PDA

View Full Version : Setting style in QApplication



Doug Broadwell
28th October 2006, 20:59
I'm confused about the Qt Assistant documentation on setting the applications style in QApplication, it talks about setting it before the QApplication constructor is called (?!?). Can someone enlighten me?

Thanks

jacek
28th October 2006, 21:09
it talks about setting it before the QApplication constructor is called (?!?)
Yes, it says that best time to set the style is before the QApplication instance is created (note that QApplication::setStyle() is a static method).

wysota
28th October 2006, 21:56
And to further explain - it is because QApplication may want to override the style, because it might get a "-style stylename" commandline parameter. If you modify the style after QApplication is constructed, you'll loose that functionality. Apart from that, nothing wrong will happen.