[Development] [QML] Positioner and Qt Quick Layout

Saether Jan-Arve Jan-Arve.Saether at digia.com
Mon Jul 29 08:19:25 CEST 2013


It's not a bug.
GridLayout is not a Positioner, so it does not provide such functionality (however, it could). In this specific case you might be able to use the index from the Repeater in your case.

If that's not sufficient, feel free to file a suggestion at bugreports.qt-project.org.
Jan Arve

From: development-bounces+jan-arve.saether=digia.com at qt-project.org [mailto:development-bounces+jan-arve.saether=digia.com at qt-project.org] On Behalf Of guillaume.belz at free.fr
Sent: 28. juli 2013 15:06
To: development at qt-project.org
Subject: [Development] [QML] Positioner and Qt Quick Layout

Hi,
When testing Qt Quick Layout, I see it's not possible to get index from Positioner in layouts.
This code works:


import QtQuick 2.0



Grid {

    rows: 3; columns: 3

    spacing: 4

    Repeater {

        model: 9

        Rectangle {

            width: 50; height: 50

            color: "lightgreen"

            Text {

                anchors.centerIn: parent

                font.pointSize: 14

                text: parent.Positioner.index

            }

        }

    }

}



But not this code:



import QtQuick 2.0

import QtQuick.Layouts 1.0



GridLayout {

    rows: 3; columns: 3

    Repeater {

        model: 9

        Rectangle {

            width: 50; height: 50

            color: "lightgreen"

            Text {

                anchors.centerIn: parent

                font.pointSize: 14

                text: parent.Positioner.index

            }

        }

    }

}



Bug ou feature ? (I did not find any entry in bugreport)

Thanks

Guillaume Belz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130729/1d0c173b/attachment.html>


More information about the Development mailing list