[Qt-interest] Widgets in your own Table?
B.W.H. van Beest
bwvb at xs4all.nl
Thu Mar 11 23:48:14 CET 2010
Hi Peter,
I can't see how! Qt::DecorationRole is about painting an icon or pixmap.
But I need to display a widget.
What am I overlooking?
Peter wrote:
> Hello Bertwim,
> have a look at Qt::DecorationRole within the model. This should do the
> job...
>
> regards,
> Peter
>
> Am 11.03.2010 22:36, schrieb B.W.H. van Beest:
>
>> Hi,
>>
>> This is actually a repost - as a previous attempt did not give me much
>> help that I could use. Yet there must be many readers of this list who
>> have done precisely what I'm trying to achieve.
>>
>> In short: I don't know how to display a table with at each (row,column)
>> entry a QWidget. I would be *very* pleased if somebody could give me the
>> code essentials how to achieve this. Please read on.
>>
>> Indeed very much like a QTableWidget, but not quit!
>> I need to set my own (table) model, but as
>> QTableWidget::setModel() is unaccessible (private), I cannot use the
>> QTableWidget class.
>> So I need to create my own version of a TableView (subclassed from
>> QTableView), that is capable to display the entry at each [row,column].
>>
>> I have tried many things, but all to no avail. I want to follow the
>> model/view approach. Reading the source code of QTableWidget did not
>> help me. Reading the documentation of what QItemDelegates are, suggested
>> that this might be the way to go, by implementing the "paint" method.
>> But that can't be true: that is much too low level (with painters etc.)
>> I just want to display a widget!
>>
>> Obviously, I'm missing the clue of this model/view approach.
>> Is there somebody who could give help me out of this?
>>
>> Thanks in advance.
>> Bertwim
>>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100311/cdcf6bfc/attachment.html
More information about the Qt-interest-old
mailing list