Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, March 2007
QTreeView.setModel


Message 1 in thread

Hello

I've a question about QTreeView.setModel(..). It's deprecated now. But 
how could I connect the view to a Model (i.E. a subclass from 
QAbstractItemModel ?)

On the other side :
My subclass would not care about what kind of View was connected to it. 
So it's a little bit strange, that there is a different behavior in 
between QListView an QTreeView.

Is there anything I've overseen.

best greetings
Arne


Message 2 in thread

Arne Stocker wrote:
> Hello
> 
> I've a question about QTreeView.setModel(..). It's deprecated now. But 
> how could I connect the view to a Model (i.E. a subclass from 
> QAbstractItemModel ?)
> 
> On the other side :
> My subclass would not care about what kind of View was connected to it. 
> So it's a little bit strange, that there is a different behavior in 
> between QListView an QTreeView.
> 
> Is there anything I've overseen.
> 
> best greetings
> Arne

I think you may be mistaken. setModel in QTreeWidget is deprecated, not 
in QTreeView. QTreeWidget uses a predefined model so it makes sense that 
you shouldn't be able to set a different one.