QProgressbar in ein TreeWidget integrieren

Alles rund um die Programmierung mit Qt
Antworten
thereapman
Beiträge: 36
Registriert: 6. Juni 2007 15:39

QProgressbar in ein TreeWidget integrieren

Beitrag von thereapman »

Hi Leute!

Ich will in einem TreeWidget in einer Spalte statt Text ne Progressbar einfügen. Wie mach ich sowas?

EDIT: Achja es handelt sich um QT4
@udisello
Beiträge: 50
Registriert: 19. März 2007 14:58
Wohnort: Sachsen

Beitrag von @udisello »

void QTreeWidget::setItemWidget ( QTreeWidgetItem * item, int column, QWidget * widget )
Sets the given widget to be displayed in the cell specified by the given item and column.

Note that the given widget's autoFillBackground property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the tree widget item.

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 and subclass QItemDelegate instead.

This function was introduced in Qt 4.1.

See also itemWidget() and Delegate Classes.
MfG @udisello

Qt Version 4.3.0, MS VS 2005
thereapman
Beiträge: 36
Registriert: 6. Juni 2007 15:39

Beitrag von thereapman »

Danke für den Fingerzeig. Funktioniert prima!!
Antworten