Anchors.mirrored is returned as invalid property in C++ side!

  • I have tried to find if a Rectangle has LayoutMirroring enabled. As per the "documentation":, this value should return mirroring (LayoutMirroring) status. But when I tried to read it from the C++ side, it is always returned as an invalid property type.

    I used the following code to test this case.
    @import QtQuick 1.1

    Rectangle {
    id: parentRect
    LayoutMirroring.enabled: true
    LayoutMirroring.childrenInherit: true
    width: 300; height: 50
    color: "yellow"
    border.width: 1

    Row {
        anchors { left: parent.left; margins: 5 }
        y: 5; spacing: 5
        Repeater {
            model: 5
            Rectangle {
                color: "red"
                opacity: (5 - index) / 5
                width: 40; height: 40
                Text {
                    text: index + 1
                    anchors.centerIn: parent


    @#include <QtGui/QApplication>
    #include <QDeclarativeProperty>
    #include <QGraphicsObject>
    #include <QDebug>
    #include "qmlapplicationviewer.h"

    Q_DECL_EXPORT int main(int argc, char *argv[])
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());

    QDeclarativeProperty propLayout(viewer->rootObject(),"anchors.mirrored");
    QDeclarativeProperty propLayoutMargin(viewer->rootObject(),"anchors.leftMargin");
    qDebug() << "Layout Property :" <<;
    qDebug() << "Layout Margin :" <<;
    if(propLayout.type() == QDeclarativeProperty::Invalid)
        qDebug() << "Invalid property";
    return app->exec&#40;&#41;;


    I have also tried to access other properties like anchors.leftMargin, but I cannot get anchors.mirrored as a valid property.

  • Hi,

    I think this is likely a bug, related to the fact that anchors.mirrored is a revisioned property (was introduced in 1.1) on a group object. I'd suggest adding a bug report via so it can be looked into further.


  • @mbrasser Thanks. I'll report it shortly.

  • I have reported this bug. "Bug Link":

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.