[Interest] ListView questions

Nurmi J-P jpnurmi at theqtcompany.com
Thu Dec 4 20:21:05 CET 2014


> On 04 Dec 2014, at 20:07, Jason H <jhihn at gmx.com> wrote:
> 
> So I am finding that ListView is poorly documented. It inherits Flickable, but does not otherwise have any currentIndexChanged() events, except that, it has it... somehow.
> 
> I am trying to use a ListView with a delegate that has the following behavior:
> Unselected item delegate:
> - A line of text
> - Font is a color
> 
> Selected Item delegate:
> - 2 lines of text (double height)
> - Font is a different color
> - Alternate background color (easy via highlight property)
> 
> 
> I can expand the delegate onCurrentIndexChanged, but there is no documentation if there is a previous item availible. And if I add a property, how do I alter the non-current item delegate?
> 
> Where is the complete ListView documentation?

It doesn't sound like you need onCurrentIndexChanged or the previous item at all. You could just create declarative bindings that change the delegate looks based on the attached ListView.isCurrentItem property.

http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#isCurrentItem-prop

--
J-P Nurmi




More information about the Interest mailing list