summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-19 03:17:51 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-19 03:17:51 (GMT)
commita8188c22ad67b339c1c68b39da0064473fec8171 (patch)
treee5b8141e2ad28e6abe0f45ae168bd6f0fd089bd6 /src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
parent9b4dad87830200f7a2d33c51c2e0488a632b57b5 (diff)
downloadQt-a8188c22ad67b339c1c68b39da0064473fec8171.zip
Qt-a8188c22ad67b339c1c68b39da0064473fec8171.tar.gz
Qt-a8188c22ad67b339c1c68b39da0064473fec8171.tar.bz2
Speed up Rectangle creation with pen or gradient slightly
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativerectangle_p_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle_p_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
index 84418bc..001b018 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativerectangle_p_p.h
@@ -81,12 +81,18 @@ public:
qreal radius;
qreal paintmargin;
QPixmap rectImage;
+ static int doUpdateSlotIdx;
QDeclarativePen *getPen() {
if (!pen) {
Q_Q(QDeclarativeRectangle);
pen = new QDeclarativePen;
- QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate()));
+ static int penChangedSignalIdx = -1;
+ if (penChangedSignalIdx < 0)
+ penChangedSignalIdx = QDeclarativePen::staticMetaObject.indexOfSignal("penChanged()");
+ if (doUpdateSlotIdx < 0)
+ doUpdateSlotIdx = QDeclarativeRectangle::staticMetaObject.indexOfSlot("doUpdate()");
+ QMetaObject::connect(pen, penChangedSignalIdx, q, doUpdateSlotIdx);
}
return pen;
}