[Qt-interest] How to make a dialog that remains on top and allows for clicking on other windows.
Nikos Chantziaras
realnc at arcor.de
Sun Mar 7 14:01:46 CET 2010
On 03/07/2010 02:39 PM, wim.delvaux at adaptiveplanet.com wrote:
> Hi all,
>
> I want to make a dialog like Office has. It is a dialog (with all
> decorations) movable closable etc. It stays on top of all windows of the
> application but allows for selection of values in the windows it covers.
> The selection would allow the dialog to update its values according to the new
> selection.
>
> This should work on all OS.
>
> I tried a few things and could create a kind of popup window but it had no
> decoractions and was not movable.
Create a modeless dialog (setModal(false), but actually this should be
the default already) with the main window as its parent. Don't use
exec() to show the dialog, use show() instead. exec() will always make
the dialog modal (= blocking its parent.)
Also, you pass appropriate Qt::WindowFlags flags to its constructor.
For example:
QDialog(parent, Qt::Tool)
You can also use Qt::WindowStaysOnTopHint. For a list, see:
http://doc.trolltech.com/4.6/qt.html#WindowType-enum
More information about the Qt-interest-old
mailing list