[Qt-interest] QDialog on Vista hides buttons

Mike Davis mike at miketdavis.blogsite.org
Thu Jan 7 01:58:24 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I had many issues with button visibility in QWizard on Vista 64. For
aesthetic reasons, and also so I don't pull my hair out, I set the
wizard style to classic style. That solved all of my issues, as well as
giving me a much nicer looking wizard. I haven't tested my current
application on XP yet, but I'm confident this will give my application a
consistent appearance across platforms as well.

Mike Davis

On 1/6/2010 5:09 PM, Dominic Stalder wrote:
> Yes sorry, it's a QWizard!
> 
> The buttons should be there, because on Mac OS X and Windows XP it
> works. Here we go:
> 
> GameWizard::GameWizard(QWidget *parent)
> : QWizard(parent, Qt::CustomizeWindowHint | Qt::WindowTitleHint |
> Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint)
> {
>     // sets the window title
>     setWindowTitle(tr("New Game Wizard"));
> 
>     // sets the dialog size (not resizable)
> #ifdef WIN32
>     setFixedSize(QSize(600, 500));
> #else
>     setFixedSize(QSize(640, 480));
> #endif
> 
>     // sets the wizard background (dialog's background in OS X, dialog's
> page header background in Windows)
>     setPixmap(QWizard::BackgroundPixmap,
> QPixmap(":/res/images/wizardbackground.png"));
> 
>     // sets the text of the buttons
>     setButtonText(QWizard::CancelButton, tr("Cancel"));
>     setButtonText(QWizard::CustomButton1, tr("S&kip >>"));
>     setButtonText(QWizard::BackButton, tr("< &Back"));
>     setButtonText(QWizard::NextButton, tr("&Next >"));
> 
>     // defines the default button layout
>     lytButtonsDefault << QWizard::Stretch
> << QWizard::CancelButton
> << QWizard::NextButton
> << QWizard::FinishButton;
> 
>     // defines the button layout with the back and the skip layout
>     lytButtonsBackSkip << QWizard::CustomButton1
> << QWizard::Stretch
> << QWizard::CancelButton
> << QWizard::BackButton
> << QWizard::FinishButton;
> 
>     // defines the button layout for the quick start game
>     lytButtonsQuickStart << QWizard::Stretch
> << QWizard::CancelButton
> << QWizard::BackButton
> << QWizard::FinishButton;
> 
>     // sets the default button layout
>     setButtonLayout(lytButtonsDefault);
> 
>     // creates all the pages for the game wizard
>     gameIntroPage = new GameIntroPage(this);
>     balanceBoardPage = new BalanceBoardPage(this);
>     controllerPage = new ControllerPage(this);
>     playerPage = new PlayerPage(this);
>     trainingLevelPage = new TrainingLevelPage(this);
>     quickStartPage = new QuickStartPage(this);
> 
>     // sets the wizard pages to the wizard, the order is based on the
> PAGEID struct
>     setPage(GameWizard::ID_INTRO, gameIntroPage);
>     setPage(GameWizard::ID_BALANCEBOARD, balanceBoardPage);
>     setPage(GameWizard::ID_CONTROLLER, controllerPage);
>     setPage(GameWizard::ID_PLAYER, playerPage);
>     setPage(GameWizard::ID_TRAININGLEVEL, trainingLevelPage);
>     setPage(GameWizard::ID_QUICKSTART, quickStartPage);
> 
>     // connects the signal of the training level page to the slot here
>     connect(trainingLevelPage, SIGNAL(trainingLevelSkipped(void)), this,
> SLOT(skipTrainingLevel(void)));
> }
> 
> Thanks
> Dominic
> 
> Am 06.01.10 20:29, schrieb Irfan Omair:
>> is this QDialog or are you using some QWizard?
>> are you sure that you have put buttons in layout?
>> can you give me code snipet.
>>
>> Regards,
>> Irfan Omair
>>
>> On Wed, Jan 6, 2010 at 9:58 AM, Dominic Stalder
>> <dominic.stalder at bluewin.ch <mailto:dominic.stalder at bluewin.ch>> wrote:
>>
>>     Hi there
>>
>>     I attached a screenshot of a QDialog on Windows Vista, where the
>>     buttons are some how hidden. Has someone ever had this problem?
>>
>>     Thanks and Regards
>>     Dominic
>>
>>     _______________________________________________
>>     Qt-interest mailing list
>>     Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>>     http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
> 
> 
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)

iEYEARECAAYFAktFMbAACgkQyv8e+QfNYNtfnACgldDa9xlxcr9NEycAKeMGG9kP
prUAn0bjvm6cJMnqBo14hEuyakSiEga5
=7zx+
-----END PGP SIGNATURE-----



More information about the Qt-interest-old mailing list