[Qt-interest] QTree* with custom widgets

Malyushytsky, Alex alex at wai.com
Mon Mar 16 20:02:55 CET 2009


First. Please reply to the mailing list.

Everything is trade off between the cost of development and functionality which includes efficient memory handling and usability.
You mentioned that it does not matter for you which widget to use.
As for me this means that the data you need to display is relatively small.
So from this point of view, you can safely use QTreeWidget.

You don't provide sufficient details what kind of resizing you need,
but you can probably just resize widgets yourself when it is needed,
This will minimize development cost. I would not start implementing anything else untiil it is clear that this appoach will not work for me.

Regards,
   Alex


________________________________
From: Bernhard Friedreich [mailto:friesoft at gmail.com]
Sent: Monday, March 16, 2009 3:17 AM
To: Malyushytsky, Alex
Subject: Re: [Qt-interest] QTree* with custom widgets


Because the widgets needs the ability to be resized! (dynamic content)

>From the Qt docu:

This function should only be used to display static content in the place of a tree widget item. If you want to display custom dynamic content or implement a custom editor widget, use QTreeView<qtreeview.html> and subclassQItemDelegate<qitemdelegate.html> instead.

2009/3/16 Malyushytsky, Alex <alex at wai.com<mailto:alex at wai.com>>
Why QTreeWidget::setItemWidget is not working for you?

void QTreeWidget::setItemWidget ( QTreeWidgetItem * item, int column, QWidget * widget )

Regards,
   Alex




________________________________________
From: qt-interest-bounces at trolltech.com<mailto:qt-interest-bounces at trolltech.com> [mailto:qt-interest-bounces at trolltech.com<mailto:qt-interest-bounces at trolltech.com>] On Behalf Of Bernhard Friedreich
Sent: Sunday, March 15, 2009 1:44 PM
To: qt-interest at trolltech.com<mailto:qt-interest at trolltech.com>
Subject: [Qt-interest] QTree* with custom widgets

Hey!

I've been fighting with a problem for quite some time now and I've now reached the point from which on I have now idea what is left, I could try. I really hope you guys (and girls ^^) can help me.

I want to use a QTreeView or QTreeWidget (doesn't really matter) with custom widgets.

I've got those requirements:
* Custom widgets (different rows = different widgets, 0st column: normal description text, 1st column: the widget)
* dynamic resizing (adding widgets at runtime to the custom widget)
* the widgets must be shown all the time (NOT JUST FOR EDITING!)
I've tried setIndexWidget, setItemWidget, a QGraphicsView and ItemDelegates with the paint method..

Already searched on many forums, google and mailings lists but nothing useable turned up.

Here's the thread where I asked for help (provides some more information): http://www.qtforum.org/article/27021/qtree-with-custom-qwidgets.html

I'd REALLY appreciate if you could help me... I'm totally lost atm...

Thanks for your help :-)

Best regards,
Bernhard Friedreich, Qt fan and developer :-P

---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com<mailto:Qt-interest at trolltech.com>
http://lists.trolltech.com/mailman/listinfo/qt-interest


"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090316/9968efec/attachment.html 


More information about the Qt-interest-old mailing list