From f8c455e0335b4b0418dd6dba08bbbc78c7b8eea4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 29 Jun 2012 13:08:41 +1000 Subject: [PATCH] anchors.mirrored should not exist in QtQuick 2 anchors.mirrored was removed from QtQuick 1.1 before release, however QtQuick 2 was branched before it was removed, so it currently exists in QtQuick 2. Task-number: QTBUG-26369 Change-Id: Iab85f66f6c5f0ebadc5962cc6962cec15203d55d Reviewed-by: Bea Lam --- src/quick/items/qquickanchors_p.h | 2 -- src/quick/items/qquickitem.cpp | 4 ---- tests/auto/quick/qquickanchors/tst_qquickanchors.cpp | 4 ++-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/quick/items/qquickanchors_p.h b/src/quick/items/qquickanchors_p.h index 7167857..3fb3a7b 100644 --- a/src/quick/items/qquickanchors_p.h +++ b/src/quick/items/qquickanchors_p.h @@ -76,7 +76,6 @@ class Q_QUICK_PRIVATE_EXPORT QQuickAnchors : public QObject Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) Q_PROPERTY(QQuickItem *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged) Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged) - Q_PROPERTY(bool mirrored READ mirrored NOTIFY mirroredChanged) Q_PROPERTY(bool alignWhenCentered READ alignWhenCentered WRITE setAlignWhenCentered NOTIFY centerAlignedChanged) public: @@ -184,7 +183,6 @@ Q_SIGNALS: void verticalCenterOffsetChanged(); void horizontalCenterOffsetChanged(); void baselineOffsetChanged(); - void mirroredChanged(); void centerAlignedChanged(); private: diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 2357c5f..b83328a 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -1619,7 +1619,6 @@ void QQuickItemPrivate::setLayoutMirror(bool mirror) anchor_d->fillChanged(); anchor_d->centerInChanged(); anchor_d->updateHorizontalAnchors(); - emit _anchors->mirroredChanged(); } mirrorChange(); if (extra.isAllocated() && extra->layoutDirectionAttached) { @@ -2851,7 +2850,6 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty *prop) \qmlproperty real QtQuick2::Item::anchors.verticalCenterOffset \qmlproperty real QtQuick2::Item::anchors.baselineOffset - \qmlproperty bool QtQuick2::Item::anchors.mirrored \qmlproperty bool QtQuick2::Item::anchors.alignWhenCentered Anchors provide a way to position an item by specifying its @@ -2911,8 +2909,6 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty *prop) To clear an anchor value, set it to \c undefined. - \c anchors.mirrored returns true it the layout has been \l {LayoutMirroring}{mirrored}. - \c anchors.alignWhenCentered (default true) forces centered anchors to align to a whole pixel, i.e. if the item being centered has an odd width/height the item will be positioned on a whole pixel rather than being placed on a half-pixel. diff --git a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp index b91f8f1..45c00e0 100644 --- a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp +++ b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp @@ -181,7 +181,7 @@ void tst_qquickanchors::basicAnchorsRTL() QQuickItem* rootItem = qobject_cast(view->rootObject()); foreach (QObject *child, rootItem->children()) { - bool mirrored = QQuickItemPrivate::get(qobject_cast(child))->anchors()->property("mirrored").toBool(); + bool mirrored = QQuickItemPrivate::get(qobject_cast(child))->anchors()->mirrored(); QCOMPARE(mirrored, false); } @@ -189,7 +189,7 @@ void tst_qquickanchors::basicAnchorsRTL() mirrorAnchors(qobject_cast(child)); foreach (QObject *child, rootItem->children()) { - bool mirrored = QQuickItemPrivate::get(qobject_cast(child))->anchors()->property("mirrored").toBool(); + bool mirrored = QQuickItemPrivate::get(qobject_cast(child))->anchors()->mirrored(); QCOMPARE(mirrored, true); } -- 2.7.4