How Do I set widgets in listView ?
General and Desktop
4
Posts
2
Posters
803
Views
2
Watching
-
Hi
Best way is via a delegate.
http://doc.qt.io/qt-5/model-view-programming.html
It will then just draw the look of a button but
when in Edit mode it will be real button.
The easy way is
http://doc.qt.io/qt-5/qabstractitemview.html#setIndexWidget
but performance will suck at some point. ( many rows)
so also depends on your requirements. -
@mit_cruze
Hi
http://doc.qt.io/qt-5/qtwidgets-itemviews-stardelegate-example.html
You would draw a button instead of start but concept is the same.The setIndexWidget should is one liner and docs should be fine?
http://stackoverflow.com/questions/5184956/using-a-qwidget-in-a-qt-view