[Qt-qml] Getting the index of a ListView delegate

Cornelius Hald hald at icandy.de
Fri Mar 18 11:52:15 CET 2011


Mark, thanks a lot!

I knew there had to be something like this, but I was looking in the
wrong corner :)

Now it's working fine. Thanks again!
Conny

On Fri, 2011-03-18 at 06:45 -0400, Mark Tucker wrote:
> The attached property you are after can be accessed withing the delegate
> simply as "index".
> 
> see here:
> http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html#delegate-prop
> 
> Mark T
> 
> -----Original Message-----
> From: qt-qml-bounces+mark.tucker=airborne.aero at qt.nokia.com
> [mailto:qt-qml-bounces+mark.tucker=airborne.aero at qt.nokia.com] On Behalf
> Of Cornelius Hald
> Sent: 18 March 2011 10:26
> To: qt-qml at qt.nokia.com
> Subject: [Qt-qml] Getting the index of a ListView delegate
> 
> Hi,
> 
> on clicking a ListView delegate, I'd like to know the index of that
> delegate. ListView.currentIndex does not help because I'm displaying
> several items at the same time. Is there something else? I thought there
> would be an attached property 'ListView.index' but there isn't.
> 
> I'm trying to link a ListView with a PathView. They are displaying
> different aspects of the same model. If the user clicks on an entry in
> the ListView, I want the PathView to show the item with the index
> selected by the ListView.
> 
> I'd be happy to hear your ideas!
> Conny
> 
> 
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml




More information about the Qt-qml mailing list