[Qt-qml] QSqlQueryModel + highlight

bea.lam at nokia.com bea.lam at nokia.com
Mon Dec 5 07:48:01 CET 2011


On 04/12/2011, at 5:40 AM, ext Tibo W wrote:

> Hi,
> 
> I have a sqlModel that I export in the QML's context in order to be used in a ListView.
> But it seems that adding a highlight is not working. It's working with a basic model (like the one provide in the Qt's build).
> Also, there's no myListView.currentItem. Should I implement it in the sqlModel ? How can I do that ?


Hello,

Can you explain further? The currentItem and highlight concepts are part of the views, not the models. Use the model to feed the data to the ListView, then set the ListView's highlight and currentIndex properties accordingly.

Bea



More information about the Qt-qml mailing list