diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-05-06 23:16:10 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-05-08 15:07:41 +0200 |
commit | a3c9fb78cb33c29d49dbe83d0525c5935e77beed (patch) | |
tree | b01c7f709c3c48326b8d11503e5da4478b3666af /src/quick/items/qquickitem.cpp | |
parent | 93563959cd9e64087599a829fc7d6afe22d3b487 (diff) | |
parent | cef5e9d385d0cf78e43e8ea41edf253b78f0ca13 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Change-Id: Ia06843de255547174efa556b1ab76be4b4be4287
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index ad3c46a8c9..bdf60e7ea0 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -164,7 +164,7 @@ void QQuickTransform::update() } QQuickContents::QQuickContents(QQuickItem *item) -: m_item(item), m_x(0), m_y(0), m_width(0), m_height(0) +: m_item(item) { } @@ -177,8 +177,8 @@ QQuickContents::~QQuickContents() bool QQuickContents::calcHeight(QQuickItem *changed) { - qreal oldy = m_y; - qreal oldheight = m_height; + qreal oldy = m_contents.y(); + qreal oldheight = m_contents.height(); if (changed) { qreal top = oldy; @@ -188,8 +188,8 @@ bool QQuickContents::calcHeight(QQuickItem *changed) bottom = y + changed->height(); if (y < top) top = y; - m_y = top; - m_height = bottom - top; + m_contents.setY(top); + m_contents.setHeight(bottom - top); } else { qreal top = std::numeric_limits<qreal>::max(); qreal bottom = -std::numeric_limits<qreal>::max(); @@ -202,17 +202,17 @@ bool QQuickContents::calcHeight(QQuickItem *changed) top = y; } if (!children.isEmpty()) - m_y = top; - m_height = qMax(bottom - top, qreal(0.0)); + m_contents.setY(top); + m_contents.setHeight(qMax(bottom - top, qreal(0.0))); } - return (m_height != oldheight || m_y != oldy); + return (m_contents.height() != oldheight || m_contents.y() != oldy); } bool QQuickContents::calcWidth(QQuickItem *changed) { - qreal oldx = m_x; - qreal oldwidth = m_width; + qreal oldx = m_contents.x(); + qreal oldwidth = m_contents.width(); if (changed) { qreal left = oldx; @@ -222,8 +222,8 @@ bool QQuickContents::calcWidth(QQuickItem *changed) right = x + changed->width(); if (x < left) left = x; - m_x = left; - m_width = right - left; + m_contents.setX(left); + m_contents.setWidth(right - left); } else { qreal left = std::numeric_limits<qreal>::max(); qreal right = -std::numeric_limits<qreal>::max(); @@ -236,11 +236,11 @@ bool QQuickContents::calcWidth(QQuickItem *changed) left = x; } if (!children.isEmpty()) - m_x = left; - m_width = qMax(right - left, qreal(0.0)); + m_contents.setX(left); + m_contents.setWidth(qMax(right - left, qreal(0.0))); } - return (m_width != oldwidth || m_x != oldx); + return (m_contents.width() != oldwidth || m_contents.x() != oldx); } void QQuickContents::complete() @@ -7237,6 +7237,8 @@ void QQuickItemPrivate::setHasCursorInChild(bool hasCursor) QQuickItemPrivate *parentPrivate = QQuickItemPrivate::get(parent); parentPrivate->setHasCursorInChild(hasCursor); } +#else + Q_UNUSED(hasCursor); #endif } @@ -8522,3 +8524,5 @@ quint64 QQuickItemPrivate::_q_createJSWrapper(QV4::ExecutionEngine *engine) QT_END_NAMESPACE #include <moc_qquickitem.cpp> + +#include "moc_qquickitem_p.cpp" |