0
votes

I'm using a QStyledItemDelegate in QTableView. I followed tutorial http://doc.qt.io/qt-5/qtwidgets-itemviews-spinboxdelegate-example.html . No problem for this.

I just changed QSpinBox to a custom widget I designed (let's call it MyWidget). It's also working, but now, whenever I trigger a cell of QTableView, editor MyWidget is poping up as a parentless widget would do. I've been trying to understand what makes the editor appear at cell's location but without any success.

In short : I'd like MyWidget to appear at cell's location and be part of QTableView. As QSpinBox does in tutorial example. Is it possible ? If so, how can I achieve this ? Thanks

Edit

Solved : parent argument routing from MyWidget to QWidget was wrong.

1
I'd like MyWidget to appear at cell's location and be part of QTableView. As QSpinBox does in tutorial example. Is it possible ? Yes. I have done this recently. - drescherjm
If so, how can I achieve this ? Hard to tell you what you are doing wrong without your minimal example code. - drescherjm
Maybe you forgot to set the parent in your createEditor override - drescherjm
Indeed, parent's routing from MyWidget to QWidget was flawed.. Feeling tired (and stupid). Thanks @drescherjm - brahmin

1 Answers

0
votes

Solved : parent argument routing from MyWidget to QWidget was wrong.