onamatic
7th January 2009, 16:03
I have a StandardItemModel - call it myModel.
I have several ListViews on different pages of a Wizard which all use myModel.
All items in myModel are checkable.
Everything works fine; I get my checkboxes in the ListView as desired.
The Problem: I want a new ListView, again based on myModel, but I don't want to see the checkboxes this time.
The Question:Is there a way of telling the new ListView "don't display a checkbox even if the item is checkable"?
Note 1. I have tried overriding the StandardItem::flags() function to return Qt::ItemIsUserCheckable as necessary but it never gets called before ListView is painted.
Note 2. I could clone myModel and set every item to non checkable; this would give me great problems in maintaining the state of both models though.)
I have several ListViews on different pages of a Wizard which all use myModel.
All items in myModel are checkable.
Everything works fine; I get my checkboxes in the ListView as desired.
The Problem: I want a new ListView, again based on myModel, but I don't want to see the checkboxes this time.
The Question:Is there a way of telling the new ListView "don't display a checkbox even if the item is checkable"?
Note 1. I have tried overriding the StandardItem::flags() function to return Qt::ItemIsUserCheckable as necessary but it never gets called before ListView is painted.
Note 2. I could clone myModel and set every item to non checkable; this would give me great problems in maintaining the state of both models though.)