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.. -
Hi!
look at "qabstractitemdelegate":http://qt-project.org/doc/qt-5.0/qtwidgets/qabstractitemdelegate.html
and examples
"spinboxdelegate":http://qt-project.org/doc/qt-5/qtwidgets-itemviews-spinboxdelegate-example.html
"spreadsheet":http://qt-project.org/doc/qt-5.0/qtwidgets/itemviews-spreadsheet.html
"stardelegate":http://qt-project.org/doc/qt-5.0/qtwidgets/itemviews-stardelegate.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??
-
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 -
Hi,
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.