Hi Nils, Thanks! Using listModel.index === listView.currentIndex worked for me, given that listModel and listView are the id's of the instances.
I am fairly new to QML programming and still learning the API, and hadn't thought of using the model.index concept in the delegate. I don't have a lot of Javascript experience either. I'm just getting used to how to take advantage of the way scoping works in QML. - Steve Pavao aka VStevenP --- On Fri, 3/8/13, Nils Jeisecke <njeise...@saltation.de> wrote: > From: Nils Jeisecke <njeise...@saltation.de> > Subject: Re: [Interest] ListView text item delegate property setting issue > To: interest@qt-project.org > Date: Friday, March 8, 2013, 3:43 AM > Hi, > > On Fri, Mar 8, 2013 at 1:41 AM, Steve Pavao <vstevenpa...@yahoo.com> > wrote: > > The problem I am having is that I haven't found a > reliable way to be able to set the > > associated text delegate's font.bold and font.pixelSize > properties once I set the > > ListView's currentIndex to that desired value > > programatically. (I want the text for the item at > the currentIndex to show in bold > > and at a larger pixelSize). > > Doesn't this pattern work for you? > > import QtQuick 1.1 > > Rectangle { > width: 360 > height: 360 > ListView { > anchors.fill: parent > model: 10 > delegate: Text { > id: delegate > font.bold: model.index === > delegate.ListView.view.currentIndex > font.pixelSize: model.index === > delegate.ListView.view.currentIndex ? 20 : 16 > text: modelData > MouseArea { > anchors.fill: parent > onClicked: > delegate.ListView.view.currentIndex = model.index > } > } > } > } > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest