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

Qt-interest Archive, May 2007
Question about sharing same model between multiple views


Message 1 in thread

Hi Everyone,
I would like to share same item model between multiple views in
my QT 4.2.3 GUI env.

More of this, I would like to "only" allow one view among these
multiple views can modify this model. Others are view only.

Currently, I could only think of set the selection model and selection
behavior to all others view to "forbid" user to click/select/edit on
the view.

Is there other way to do this ?

I'm checked QT documentation online and it seems didn't mention this.

Regards,
Pagan


--
 [ signature omitted ] 

Message 2 in thread

Hi Pagan,

The QSortFilterProxyModel is something you could consider. I have used 
it before with QTableView. What I did was use nine QTableViews to get 
nine different versions of my data (a custom TableModel), based on a 
QRegExp filter.

Each QTableView object can be set to allow select/edit and so on with 
the setSelectionMode() function.

Hope this answers your question,
K.

Pagan Chou wrote:
> Hi Everyone,
> I would like to share same item model between multiple views in
> my QT 4.2.3 GUI env.
>
> More of this, I would like to "only" allow one view among these
> multiple views can modify this model. Others are view only.
>
> Currently, I could only think of set the selection model and selection
> behavior to all others view to "forbid" user to click/select/edit on
> the view.
>
> Is there other way to do this ?
>
> I'm checked QT documentation online and it seems didn't mention this.
>
> Regards,
> Pagan
>
>
> --
> 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/
>
>   
begin:vcard
begin:vcard
fn:Kavindra Palaraja
n:Palaraja;Kavindra
org:Trolltech ASA;Documentation
email;internet:kdpalara@xxxxxxxxxxxxx
title:Junior Technical Writer
x-mozilla-html:FALSE
version:2.1
end:vcard