Qt 6.11 is out! See what's new in the release
blog
How to make Widget always show in QTableView
-
There is a very strange request....
In most time ,QTableView + Model + QItemDelegate ,when need to DoubleClick a item in tableview,and then this item will "produce" a MyWidget ( or anyother widget inherit QWidget),it will be implement by QItemDelegate ,like
QWidget* MyDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index){ MyWidget* w = new MyWidget(parent); return w; }When user DoubleClicke any item in QTableView,the item will replaced by MyWidget.
Now there is a request, one column int QTableView,every item of this column must be replaced by MyWidget, when the GUI(QTabelView) show.
it don't depend on user DoubleClick item, and show MyWidget int item
So how to do this?
-
Q qazaq408 has marked this topic as solved on