PDA

View Full Version : QWizard with QWizardPages gives blank pages?



Tiansen
3rd March 2008, 13:43
As title states I use QWizard and add some QWizardPages with addPage. However when I run the program all pages are blank. I can click Next in the wizard but there is just a blank white space inside the wizard. What am I doing wrong? I have some buttons and test widgets inside QWizardPage instances that were built with Designer.

jpn
3rd March 2008, 13:58
Did you install a top level layout for the pages? Do child widgets get resized if you resize the page in designer?

Tiansen
3rd March 2008, 14:41
Sorry, I don't understand what exactly you mean. I use this code to create a wizard:



QWizard* carovnik=new QWizard();
QCarovnikStran2* page2=new QCarovnikStran2();
QCarovnikStran2* page3=new QCarovnikStran2();
page2->setTitle("Page 2!");
carovnik->addPage(page2);
carovnik->addPage(page3);
carovnik->exec();


QCarovnikStran2 is a GUI class, created with Designer. When I open a wizard, I see a title ("Page 2!"), but no buttons and other widgets that are defined in QCarovnikStran2.

jpn
3rd March 2008, 15:26
The form you have created in Qt Designer, does it have a top level layout installed? See this screenshot (http://www.qtcentre.org/forum/p-layouts-to-ease-resizing-solved-post53017/postcount5.html).

Tiansen
4th March 2008, 06:45
Thank you very much for a hint. I had some layout present, but obviously it was not top-level and I did not know that it is needed for wizard to work. Thank you again!