Can somebody show some examplecode about how to insert a QCheckBox into
a QListWidgetItem?
Thanks.
Can somebody show some examplecode about how to insert a QCheckBox into
a QListWidgetItem?
Thanks.
It is easy enough. Use QListWidget::setItemWidget(QListWidgetItem*, QWidget*);
Something like:
Qt Code:
To copy to clipboard, switch view to plain text mode
Note that you need a reference to the item for which you want to set the widget.
Regards
Please search the forums next time. This subject has been discussed several times.Qt Code:
item->setFlags(item->flags() | Qt::ItemIsUserCheckable); item->setCheckState(Qt::Unchecked);To copy to clipboard, switch view to plain text mode![]()
J-P Nurmi
Tnx, I didn't expect that it should be that simple![]()
Bookmarks