diff options
Diffstat (limited to 'src/kernel/qobject.cpp')
-rw-r--r-- | src/kernel/qobject.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp index 403691e..d6be971 100644 --- a/src/kernel/qobject.cpp +++ b/src/kernel/qobject.cpp @@ -49,6 +49,9 @@ #include "qucomextra_p.h" #include "qptrvector.h" +// QStyleControlElementData +#include "qstyle.h" + #ifdef QT_THREAD_SUPPORT #include "qmutex.h" #include <private/qmutexpool_p.h> @@ -58,6 +61,33 @@ #include <ctype.h> #include <stdlib.h> +// Keep in sync with duplicate definition in qcommonstyle.cpp +class QStyleControlElementDataPrivate { + public: + bool isQPushButton; + bool isQToolButton; + bool isQButton; + bool isQTabBar; + bool isQTitleBar; + bool isQToolBox; + bool isQToolBar; + bool isQProgressBar; + bool isQPopupMenu; + bool isQComboBox; + bool isQCheckBox; + bool isQRadioButton; + bool isQHeader; + bool isQScrollBar; + bool isQSlider; + bool isQDialogButtons; + bool isQSpinWidget; + bool isQListView; + bool isQDockWindow; + bool isQTabWidget; + bool isQFrame; + bool isQWidget; +}; + #ifndef QT_NO_USERDATA class QObjectPrivate : public QPtrVector<QObjectUserData> #else @@ -70,14 +100,36 @@ public: ownThread = NULL; disableThreadPostedEvents = false; setAutoDelete( TRUE ); + controlElementData = NULL; + controlElementDataPrivate = NULL; + } + ~QObjectPrivate() { + delete controlElementData; + delete controlElementDataPrivate; } #endif QThread* ownThread; QMutex* senderObjectListMutex; QMutex* childObjectListMutex; bool disableThreadPostedEvents; + QStyleControlElementData* controlElementData; + QStyleControlElementDataPrivate* controlElementDataPrivate; }; +QStyleControlElementData* QObject::controlElementDataObject() { + if (!d->controlElementData) { + d->controlElementData = new QStyleControlElementData(); + } + return d->controlElementData; +} + +QStyleControlElementDataPrivate* QObject::controlElementDataPrivateObject() { + if (!d->controlElementDataPrivate) { + d->controlElementDataPrivate = new QStyleControlElementDataPrivate(); + } + return d->controlElementDataPrivate; +} + #if defined(QT_THREAD_SUPPORT) void QObject::moveToThread_helper(QThread *targetThread) |