[Qt-interest] QWizardPage::wizard() overprotected?
Andreas Pakulat
apaku at gmx.de
Thu Dec 11 21:59:05 CET 2008
On 11.12.08 20:03:32, Niels Dekker - no return address wrote:
> Andreas Pakulat wrote:
> > That depends on the implementation of QMainWindow, QWizard and
> > QDialog. In general QDialog is supposed to be a top-level window, so
> > there might be code that assumes this and you might get problems
> > when embedding it into a mainwindow.
>
> I must admit I've encountered one such problem already: when a user
> would press Escape, the embedded wizard would close, but the main window
> would still be there. I hope to fix that by overriding
> QWizard::keyPressEvent(QKeyEvent*) in my derived wizard class, to deal
> with key == Qt::Key_Escape.
It never ceases to amaze me through how many hoops people are going to jump
to make something work thats not supposed to work. No offense meant.
> > Besides a wizard with widgets, then the next/prev/finish buttons
> > and then a statusbar is pretty uncommon and might confuse
> > users.
>
> I hope not! My status messages certainly aren't meant to confuse the
> users!
Personally I'd be surprised by this thing, because its neither a dialog nor
a mainwindow, but tries to be both.
Another IMHO good place for status messages like errors in the inputs or
missing information is directly beneath the title of the page.
> >> It looks like Qt doesn't supports adding a statusbar to a dialog.
> >> At least not within the Qt4 Designer, or the VS Integration.
>
> > Well, some things you have to do manually. I don't really understand
> > why you have a .ui file for the dialog itself. After all you can't
> > really create wizard+wizardpages in Qt designer anyway.
>
> I guess you're right, I probably shouldn't have created a .ui file for
> the QWizard.
Interesting that must be a (mis?)feature of the VS integration, because
standalone designer doesn't offer to create a QWizard.
> Thanks for the eye opener! While I find the designer (VS
> Integration) very convenient when designing my wizard pages, it only
> offers very limited ways to design the wizard itself.
Well, the QWizard API also doesn't offer that much, there's support for
adjusting the order of buttons and which buttons to use, a couple of
options, a pixmap and thats about it.
> > So you're not adding the statusbar to the dialog, but to the widget
> > of the page in your QWizardPage subclass. And then each individual
> > page is a subclass of that and just calls setWidget() with a widget
> > generated from a form.
>
> I'm not sure. I'd rather have the statusbar at the bottom of the main
> window, not at the bottom of the embedded page. But I can still
> consider adding the statusbar manually, doing "new
> QStatusBar(myWizard)", as in your code example.
That won't work, then your statusbar will show up probably in the top-left
corner of the dialog. The problem is that QWizard has a layout which adds the
various buttons and puts the current page into the main area. Of course you
can try to find the layout and try to do things with that, but you'll end
up with quite some guessing and QWizard code-reading to accomplish that.
Anyway, its your time that you may spend with this, I'm just 100% sure I
won't do this myself, I'd rather consider writing my own QDialog-based
wizard class working with QWizardPage ;)
> ----------------------------------------------------------------------
> >> I mean, what does Qt protect me against?
>
> Scott Aron Bloom wrote:
It would be nice if you could stop breaking threads by this reply to
multiple people in one mail.
Andreas
--
Tomorrow, this will be part of the unchangeable past but fortunately,
it can still be changed today.
More information about the Qt-interest-old
mailing list