[Qt-interest] Widgets in your own Table?
B.W.H. van Beest
bwvb at xs4all.nl
Thu Mar 11 22:36:47 CET 2010
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
More information about the Qt-interest-old
mailing list