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
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
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).
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.
Bookmarks