[Qt-interest] Widgets in your own Table?
André Somers
andre at familiesomers.nl
Fri Mar 12 00:02:09 CET 2010
Google for the terms "KWidgetItemDelegate" and "Goya". It's a little set of
classes inside the KDE source tree that allow you to use widgets as your
(display) items. It's not without its problems (don't use it with large
models...), but it does work.
André
-----Oorspronkelijk bericht-----
Van: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] Namens B.W.H. van Beest
Verzonden: donderdag 11 maart 2010 22:37
Aan: qt-interest at trolltech.com
Onderwerp: [Qt-interest] Widgets in your own Table?
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
More information about the Qt-interest-old
mailing list