QTablewidget with combobox and doublespinbox
Hi, i am new in Qt and i have to do a project that draw Chart of statistics dates.
I have create a qtablewidget for rappresented the dates, but i have a problem:
I want to create the rows with combobox and qdobulespinbox.
In particular i want that when index 1 of my combo is checked the item of column 2 and column 3 are disabled.
The column of my table are always the same
How can i do this connection??
Excuse me if my english is not good..
look at "qabstractitemdelegate":http://qt-project.org/doc/qt-5.0/qtwidgets/qabstractitemdelegate.html
but if i need of a combobox and 3 doublespinbox i have to create a delegate for each widget that i need in my qtablewidget??
You can find out column from QModelIndex in createEditor, setEditorData, setModelData and do different thing in different cases.
I see in the documentation of Qtablewidget that exist a method setcellwidget(...), whats's the difference between use this or delegate??
Thank you for your reply
setCellWidget sets a specific widget to be displayed to a specific cell.
The delegate provides custom display features and editor widgets. So i.e. you don't have to set a widget on every cell, the view will use the delegate to create the appropriate editor.