[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Read-only relational model in Qt4?
From: Chris Gow <sniffy () rogers ! com>
Date: 2007-02-09 20:11:08
Message-ID: 200702091511.09098.sniffy () rogers ! com
[Download RAW message or body]
On Friday 09 February 2007 14:45:14 Matthias Lechner wrote:
> Hi everyone,
>
> I'm currently facing the problem of creating a read-only model for a SQLite
> database. Within the database I have one table which has a field "contact"
> which refers to a contact person defined in another table "contacts".
>
> First I tried to use the QSqlRelationalTableModel, but I'm unable to
> disable the edit mode. Furthermore there seems to be no option to define
> relations to multiple columns (e.g. I want to display a contact by "Contact
> name (phone number)").
>
> So I decided to reimplement QAbstractTableModel, but this requires a lot of
> (unnecessary) work and I feel like I'm reinventing the wheel.
>
> So the question is: is it really that hard to create a read-only relational
> model or do I miss something?
>
> Best regards
> Matthias
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
I'm not a qt expert by any means but if you override the flags() method to not
return editable, will that not do what you want it to do?
-- chris
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic