Unsolved Dynamic ComboBox Delagate?
-
Hi,
Finally I got to use ComboBox delagate in tableview. But this combobox is static. I mean, I got table and I read the rows.
But I need Dynamic content now. The content of the combobox need to change depens on the value of column 1 in the tableview.
So everytime the content must re-fill depends on user input on column 1 of the tableview.Is there any good idea to get this?...
Regards,Mucip:)
-
Hi
You can do it in
http://doc.qt.io/qt-5/qabstractitemdelegate.html#setEditorData
The index you get contains
http://doc.qt.io/qt-5/qmodelindex.html#model
so you can query the model data. -
Hi,
I do not want to set content of the delagate. I already do it.
I want to re-fill content of the combobox in each row depends on first cell value of the tableview...Regardgs,
Mucip:) -
@Mucip
Yep and that is exactly what setEditorData is for.
setting the items in the combobox before its shown. -
Hi,
I see... Ok.
I'll try. Thanks...Regards,
Mucip:)