[Development] [QML] Positioner and Qt Quick Layout

Mark markg85 at gmail.com
Sun Jul 28 18:46:42 CEST 2013


On Sun, Jul 28, 2013 at 3:05 PM,  <guillaume.belz at free.fr> wrote:
> 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
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>

I didn't know anything about a "Positioner" so that's certainly
interesting to see!
However, what you do as: "parent.Positioner.index" is what i do as
just "index" so you might have better luck trying that one.



More information about the Development mailing list