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:
void verticalCenterOffsetChanged();
void horizontalCenterOffsetChanged();
void baselineOffsetChanged();
- void mirroredChanged();
void centerAlignedChanged();
private:
anchor_d->fillChanged();
anchor_d->centerInChanged();
anchor_d->updateHorizontalAnchors();
- emit _anchors->mirroredChanged();
}
mirrorChange();
if (extra.isAllocated() && extra->layoutDirectionAttached) {
\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
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.
QQuickItem* rootItem = qobject_cast<QQuickItem*>(view->rootObject());
foreach (QObject *child, rootItem->children()) {
- bool mirrored = QQuickItemPrivate::get(qobject_cast<QQuickItem*>(child))->anchors()->property("mirrored").toBool();
+ bool mirrored = QQuickItemPrivate::get(qobject_cast<QQuickItem*>(child))->anchors()->mirrored();
QCOMPARE(mirrored, false);
}
mirrorAnchors(qobject_cast<QQuickItem*>(child));
foreach (QObject *child, rootItem->children()) {
- bool mirrored = QQuickItemPrivate::get(qobject_cast<QQuickItem*>(child))->anchors()->property("mirrored").toBool();
+ bool mirrored = QQuickItemPrivate::get(qobject_cast<QQuickItem*>(child))->anchors()->mirrored();
QCOMPARE(mirrored, true);
}