aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-03-30 14:43:48 +0200
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2016-04-05 13:52:38 +0000
commiteb9fa2d407a712ae72f7fdf80c4833bd301f1de5 (patch)
treea5f5f1e04e278570cd4d5284d6d8d86fbf1e298f
parentf63f86f7d38a182b41a85af27bf0baba3db03941 (diff)
QML: directly access private data instead of calling accessors.
According to valgrind, these accessors were not inlined. So, instead of placing ~8 calls for creating the QRectF's of geometryChanged, do a direct read of the data. Change-Id: I9ba60e90c87fcecf1c1985f038195e2dd657dd20 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
-rw-r--r--src/quick/items/qquickitem.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 0750dc94b1..a9ec40f73a 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -6253,8 +6253,8 @@ void QQuickItem::setX(qreal v)
d->dirty(QQuickItemPrivate::Position);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(oldx, y(), width(), height()));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(oldx, d->y, d->width, d->height));
}
void QQuickItem::setY(qreal v)
@@ -6268,8 +6268,8 @@ void QQuickItem::setY(qreal v)
d->dirty(QQuickItemPrivate::Position);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), oldy, width(), height()));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, oldy, d->width, d->height));
}
/*!
@@ -6289,8 +6289,8 @@ void QQuickItem::setPosition(const QPointF &pos)
d->dirty(QQuickItemPrivate::Position);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(oldx, oldy, width(), height()));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(oldx, oldy, d->width, d->height));
}
/*!
@@ -6319,8 +6319,8 @@ void QQuickItem::setWidth(qreal w)
d->dirty(QQuickItemPrivate::Size);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), y(), oldWidth, height()));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, d->y, oldWidth, d->height));
}
void QQuickItem::resetWidth()
@@ -6441,8 +6441,8 @@ void QQuickItem::setImplicitWidth(qreal w)
d->dirty(QQuickItemPrivate::Size);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), y(), oldWidth, height()));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, d->y, oldWidth, d->height));
if (changed)
d->implicitWidthChanged();
@@ -6483,8 +6483,8 @@ void QQuickItem::setHeight(qreal h)
d->dirty(QQuickItemPrivate::Size);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), y(), width(), oldHeight));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, d->y, d->width, oldHeight));
}
void QQuickItem::resetHeight()
@@ -6535,8 +6535,8 @@ void QQuickItem::setImplicitHeight(qreal h)
d->dirty(QQuickItemPrivate::Size);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), y(), width(), oldHeight));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, d->y, d->width, oldHeight));
if (changed)
d->implicitHeightChanged();
@@ -6580,8 +6580,8 @@ void QQuickItem::setImplicitSize(qreal w, qreal h)
d->dirty(QQuickItemPrivate::Size);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), y(), oldWidth, oldHeight));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, d->y, oldWidth, oldHeight));
if (!wDone && wChanged)
d->implicitWidthChanged();
@@ -6617,8 +6617,8 @@ void QQuickItem::setSize(const QSizeF &size)
d->dirty(QQuickItemPrivate::Size);
- geometryChanged(QRectF(x(), y(), width(), height()),
- QRectF(x(), y(), oldWidth, oldHeight));
+ geometryChanged(QRectF(d->x, d->y, d->width, d->height),
+ QRectF(d->x, d->y, oldWidth, oldHeight));
}
/*!