summaryrefslogtreecommitdiffstats
path: root/src/kernel/qobject.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-12-22 03:17:30 -0600
committerTimothy Pearson <[email protected]>2013-12-22 03:17:30 -0600
commitd1b6b7be7d5bc7754a143b424295a267bbdafdbd (patch)
tree20ee69ce981cd5ba62c65bb35b21188cd7b83246 /src/kernel/qobject.cpp
parentf4193c940cdc34284e19cf4cb0687c1a8e81a458 (diff)
downloadqt3-d1b6b7be7d5bc7754a143b424295a267bbdafdbd.tar.gz
qt3-d1b6b7be7d5bc7754a143b424295a267bbdafdbd.zip
Repair performance regression accidentally introduced with new style API
Diffstat (limited to 'src/kernel/qobject.cpp')
-rw-r--r--src/kernel/qobject.cpp52
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)