summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicsitem_p.h
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-03 06:06:46 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-03 06:06:46 (GMT)
commit2b07e188b91d2cb92a2c41f85678415c4dbb3721 (patch)
tree445c524bf3a587a0c676b7895df76772eaaaf1bc /src/declarative/graphicsitems/qmlgraphicsitem_p.h
parent00e793e43c51f2b8b8ac230812822155aef8362b (diff)
downloadQt-2b07e188b91d2cb92a2c41f85678415c4dbb3721.zip
Qt-2b07e188b91d2cb92a2c41f85678415c4dbb3721.tar.gz
Qt-2b07e188b91d2cb92a2c41f85678415c4dbb3721.tar.bz2
A collection of small optimizations.
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicsitem_p.h')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem_p.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem_p.h b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
index 0c722ac..a76a7f7 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
@@ -109,7 +109,12 @@ public:
_componentComplete(true), _keepMouse(false),
smooth(false), keyHandler(0),
width(0), height(0), implicitWidth(0), implicitHeight(0)
- {}
+ {
+ if (widthIdx == -1) {
+ widthIdx = QmlGraphicsItem::staticMetaObject.indexOfSignal("widthChanged()");
+ heightIdx = QmlGraphicsItem::staticMetaObject.indexOfSignal("heightChanged()");
+ }
+ }
~QmlGraphicsItemPrivate()
{ delete _anchors; }
@@ -249,6 +254,19 @@ public:
}
virtual void otherSiblingOrderChange(QmlGraphicsItemPrivate* other) {Q_UNUSED(other)}
+ bool connectToWidthChanged(QObject *object, int index) {
+ return QMetaObject::connect(q_func(), widthIdx, object, index);
+ }
+ bool disconnectFromWidthChanged(QObject *object, int index) {
+ return QMetaObject::disconnect(q_func(), widthIdx, object, index);
+ }
+
+ bool connectToHeightChanged(QObject *object, int index) {
+ return QMetaObject::connect(q_func(), heightIdx, object, index);
+ }
+ bool disconnectFromHeightChanged(QObject *object, int index) {
+ return QMetaObject::disconnect(q_func(), heightIdx, object, index);
+ }
static int consistentTime;
static QTime currentTime();
@@ -256,6 +274,8 @@ public:
static void start(QTime &);
static int elapsed(QTime &);
static int restart(QTime &);
+ static int widthIdx;
+ static int heightIdx;
};
QT_END_NAMESPACE