Hi everyone !
I'm using QtEmbedded 4.6.3 on an ARM processor, and I compile Qt as a static library to save some start time and memory.
Recently I tried to start a QPropertyAnimation on a QColor, which works with the "classic" version of Qt (X11/shared), but doesn't with my static library.
I found out that the QColor interpolation function for animations is declared in qguivariantanimation.cpp:70 in the "qRegisterGuiGetInterpolator" function. This function is declared with the Q_CONSTRUCTOR_FUNCTION macro, so when the application is started with the shared library, the function gets called even before the main function starts, which is OK. However, with the static version, the function never gets called, and then my QColor is not interpolated.
I found out a similar behavior with QVariant : the QColor helper methods are declared in the qRegisterGuiVariant function, which is also declared with the Q_CONSTRUCTOR_FUNCTION macro. However, this function is also explicitely called in the QApplication constructor, so it works with both the shared and static library.
Shouldn't the qRegisterGuiGetInterpolator function in the QApplication constructor too ? I didn't report this as a bug yet as I don't know if it is one, or if there is something I'm doing wrong. But the qRegisterGuiGetInterpolator function has no explicit call anywhere in the Qt code, so I believe it is assumed to be done by the library loading. Maybe there is an option I have to give to my compiler, in order to have the static library properly initialized at start ?
Thanks for help !
Bookmarks