-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.0
-
None
-
Ubuntu Linux
Qt 4.6.0
kernel : 2.6.31-16-generic
GNOME : 2.28.1
GCC version : 4.4.1 (x86_64-linux-gnu)
-
7727a4355876607a1a022ff54e2570dae883f79c
A problem exists when an attempt is made to call the fromTheme() method of the QIcon class as a static invocation of a singleton.
E.g.
//header: staticicontest.h class StaticIconTest : public QMainWindow { Q_OBJECT public: StaticIconTest(QWidget *parent = 0); ~StaticIconTest(); private: static const QIcon staticIcon; }; //source: staticicontest.cpp #include "staticicontest.h" const QIcon StaticIconTest::staticIcon = QIcon::fromTheme("filenew");
My debugger reports the problem at line 89 of qguiplatformplugin.cpp at a switch statement:
switch(X11->desktopEnvironment)
Perhaps at startup time the X11 object is not yet initialized and is not ready for the call to "fromTheme".
If I made the QIcon non-static, it is able to be initialized as a const in the constructor's initialization list, so I do believe it is the timing of the call, however, I am certainly no expert of the Qt backend.