[Qt-interest] display one database column as two in QTableView
Andre Somers
andre at familiesomers.nl
Tue Mar 9 15:56:14 CET 2010
Israel Brewster wrote:
> On Mar 8, 2010, at 11:28 AM, André Somers wrote:
>
>
>> Alternatively, you could create a proxy model that splits the date column
>> into two separate columns. This would also work on databases that don't
>> support editable queries.
>>
>
> I was thinking about something like that, but hadn't quite figured it out yet. If I'm thinking right, I would then need to override the data() and setData() functions to translate between the real model and proxy, and the columnCount function to return one additional column. Am I missing anything there? I'll give it a try here in a bit to see what happens. Thanks.
>
I think that should work, but I am not sure on how to implement the
mapping functions that are also in the QAbstractProxyModel class in this
case. Not sure you need them either in your application.
André
More information about the Qt-interest-old
mailing list