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

Qt-interest Archive, January 2008
multiple models in a single view


Message 1 in thread

Hello,

Has anyone have an idea on how to display multiple models in a single view?
I know it sounds bizare, but I would like to have a QTreeView, and have a
number of models displayed one after another.

They only other way I can think is to us separate views for each model, but
then they all end up with separate scrollbars etc which is not really what
I want.

Thanks
Ryan Winter

--
 [ signature omitted ] 

Message 2 in thread

Not sure what you mean with the tree view..

But I have had it on a tree view... 

I created a custom model derived from a proxy model.. which using hasa
relationships, owned multiple models.

Essentially, the custom model was a would return the correct
ModelIndexes that would allow the system to have each top level node
return the correct info into the correct sub model...

It wasn't easy.. but I did get it working in about 1-2 days work

Scott

> -----Original Message-----
> From: Ryan Winter [mailto:wintered@xxxxxxxxx]
> Sent: Sunday, January 27, 2008 12:29 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: multiple models in a single view
> 
> Hello,
> 
> Has anyone have an idea on how to display multiple models in a single
> view?
> I know it sounds bizare, but I would like to have a QTreeView, and
have a
> number of models displayed one after another.
> 
> They only other way I can think is to us separate views for each
model,
> but
> then they all end up with separate scrollbars etc which is not really
what
> I want.
> 
> Thanks
> Ryan Winter
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 3 in thread

Scott Aron Bloom wrote:

> Not sure what you mean with the tree view..
> 
> But I have had it on a tree view...
> 
> I created a custom model derived from a proxy model.. which using hasa
> relationships, owned multiple models.
> 
> Essentially, the custom model was a would return the correct
> ModelIndexes that would allow the system to have each top level node
> return the correct info into the correct sub model...
> 
> It wasn't easy.. but I did get it working in about 1-2 days work

I thought of this idea, creating my own model to aggregate other models
together, but it looked kinda annoying to implement so I was hoping there
was some easy way of doing it.

Ryan

--
 [ signature omitted ]