[Interest] QWizardPage does not get repainted

Andrei Korostelev andrei at korostelev.net
Wed Mar 21 20:17:45 CET 2012


Adding this code at the end of initializePage()

Qtimer::singleShot(10, this, SLOT(repaint()));

does the job.
I wonder if there a more decent way to do this?

Regards,
Andrei
> I have QWizard with 2 pages.
> I simply want to display a message "leaving page 1" when leaving the 
> first page and "entering page 2" when entering the second page.
> This is how I implemented it  (Page1 and Page2 are derived from 
> QWizardPage):
>
> bool Page1::validatePage()
> {
>     QMessageBox::information(this, "", "leaving page1");
>     return true;
> }
>
> void Page2::initializePage()
> {
>     QMessageBox::information(this, "", "entering page2");
> }
>
> The problem is that afer I close the second message box Page2 does not 
> get repainted i.e. I still see the contents of Page1 !
> I can force the page2 to be repainted e.g. by dragging the dialog with 
> a mouse outside Windows desktop window and back.
>
> The problem is reproducible on Windows 7 (both 32 and 64-bit).
> I did not manage to reproduce it on Windows XP.
> I tested it with Qt-4.6.2 and 4.7.0.
>
> Any help is appreciated.
>
> Regards,
> Andrei
>




More information about the Interest mailing list