[Qtce-preview-feedback] Modal dialogs
Mateusz Loskot
mateusz at loskot.net
Fri Feb 22 23:52:47 CET 2008
Hi,
I'm not sure but probably modal dialogs do not work correctly.
I'd like to present a few simple tests I've made to learn how Qt dialogs
work in modal mode, using Visual C++ 2005 and Windows Mobile 5.0.
I'm also posting a few screenshots to present my observations better.
1. exec()
The manual says:
"The most common way to display a modal dialog is to call
its exec() function"
I have a simple dialog box based on .ui form and I show it
on menu action:
about_dialog dlg(this);
dlg.exec();
This code displays dialog as a floating window (not maximized nor full
screen). So, everything works well and just as it's said in the manual.
Screenshot: dialog-exec.png
2. exec() + custom state
Here, I'm trying to open modal dialog as fullscreen,
not floating window:
about_dialog dlg(this);
dlg.setWindowState(dlg.windowState() ^ Qt::WindowFullScreen);
dlg.exec();
Unfortunately, the dialog is not fullscreen but semi-fullscreen,
with empty menubar at the bottom. Applying Qt::WindowMaximized
has the same effect.
Screenshot: dialog-state-fullscreen-exec.png
Is it correct behavior? Shouldn't the window be displayed as fullscreen?
3. show() + setModal()
The manual says:
"An alternative is to call setModal(true) or setWindowModality(),
then show()"
Here is test code that IMO is supposed to display modal dialog
using the alternative:
about_dialog dlg(this);
dlg.setModal(true);
dlg.show(); // here dialog is displayed
// after this line dialog disappears
The dialog is displayed by show() - as floating window. Next, after
execution moves forward the dialog disappears immediately. I have to
confess that I'm confused by this behavior because it is different than
what I understand from the manual. At least, the dialog should not
disappear.
Screenshot: dialog-modal-show.png
4. showFullScreen() + setModal()
The only way to display real fullscreen modal dialog is:
about_dialog dlg(this);
dlg.setModal(true);
dlg.showFullScreen(); // here dialog is displayed as fullscreen
// after this line dialog disappears
Unfortunately, here the dialog also disappears, ideantically as in the
case 3. Is this correct?
Screenshot: dialog-modal-showfullscreen.png
Perhaps, I've misunderstood the manual, but simply I'm trying to find
how to display maximized or fullscreen modal dialog box.
I'd be thankful for any review of my tests.
p.s. I'm going to try to send all 4 screenshots attached to my post,
perhaps the list will accept it. However, in case they won't
reach the list, I uploaded them here:
http://mateusz.loskot.net/tmp/qt/
Greetings
--
Mateusz Loskot
http://mateusz.loskot.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialog-exec.png
Type: image/png
Size: 11985 bytes
Desc: not available
Url : http://lists.trolltech.com/pipermail/qtce-preview-feedback/attachments/20080222/022dd614/attachment-0004.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialog-state-fullscreen-exec.png
Type: image/png
Size: 6800 bytes
Desc: not available
Url : http://lists.trolltech.com/pipermail/qtce-preview-feedback/attachments/20080222/022dd614/attachment-0005.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialog-modal-show.png
Type: image/png
Size: 200429 bytes
Desc: not available
Url : http://lists.trolltech.com/pipermail/qtce-preview-feedback/attachments/20080222/022dd614/attachment-0006.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialog-modal-showfullscreen.png
Type: image/png
Size: 188239 bytes
Desc: not available
Url : http://lists.trolltech.com/pipermail/qtce-preview-feedback/attachments/20080222/022dd614/attachment-0007.png
More information about the Qtce-preview-feedback
mailing list