Qt-interest Archive, March 2007
QTreeWidgetItem
Message 1 in thread
I use QTreeWidgetItems and I would like to add a QDoubleSpinBox in each of
them. I have to create a new class inheriting from QTreeWidgetItem? Is there
any example similar to what I wanna achieve you could point me to?
Regards, lisandro
--
[ signature omitted ]
Message 2 in thread
Lisandro Damián Nicanor Pérez Meyer wrote:
> I use QTreeWidgetItems and I would like to add a QDoubleSpinBox in each of
> them. I have to create a new class inheriting from QTreeWidgetItem? Is there
> any example similar to what I wanna achieve you could point me to?
>
> Regards, lisandro
>
>
In Qt4 drawing and editing are now done in descendants of
QAbstractItemDelegate rather than in the data items. The QTreeWidget
version of the view class trys to hide the Model-View-Delegate Pattern,
but this is once case where you have to setItemDelegate or in 4.2 you
can also do setColumnDelegate on a QTreeWidget class. This is inherited
from the QTreeView class which QTreeWidget descends from.
At this point you might want to consider the benefits of the full blown
model-view system...
There is a whitepaper on ICS's website (my employer) which describes the
process of creating custom delegates and comes with example code.
http://www.ics.com/developers/papers/
Good Luck,
--Justin
begin:vcard
begin:vcard
fn:Justin Noel
n:Noel;Justin
org:ICS;Engineering
adr:;;54B Middlesex Trpk;Bedford;MA;01730;USA
email;internet:justin@xxxxxxx
title:Sr. Consulting Engineer / Certified Qt Instructor
tel;work:(617) 621-0060
url:http://www.ics.com
version:2.1
end:vcard
Message 3 in thread
El Domingo 04 Marzo 2007 14:15, Justin Noel escribió:
> Lisandro Damián Nicanor Pérez Meyer wrote:
> > I use QTreeWidgetItems and I would like to add a QDoubleSpinBox in each
> > of them. I have to create a new class inheriting from QTreeWidgetItem? Is
> > there any example similar to what I wanna achieve you could point me to?
> >
> > Regards, lisandro
>
> In Qt4 drawing and editing are now done in descendants of
> QAbstractItemDelegate rather than in the data items. The QTreeWidget
> version of the view class trys to hide the Model-View-Delegate Pattern,
> but this is once case where you have to setItemDelegate or in 4.2 you
> can also do setColumnDelegate on a QTreeWidget class. This is inherited
> from the QTreeView class which QTreeWidget descends from.
>
> At this point you might want to consider the benefits of the full blown
> model-view system...
>
> There is a whitepaper on ICS's website (my employer) which describes the
> process of creating custom delegates and comes with example code.
>
> http://www.ics.com/developers/papers/
I'll take a look at it. Thanks!!
--
[ signature omitted ]