PDA

View Full Version : How to disable one combo box when another combo box changes its value using Delegate



alfaalfa
11th June 2013, 13:45
Hi Every one ,

I am new to QT and trying to use QTableView. My table's two columns are having combo box.

I am using a class derived from QItemDelegate to add combo box to particular column.

Now my requirement is, when I change combo box of column 3 (from "read only" to "No access"), combo box of column 4 must be disabled.

Please see the attached image for table layout.

9140

Can somebody help me how can I achieve this?

anda_skoa
11th June 2013, 16:56
One option is to have an item role for column 4 that can retrieve the enabled/disabled state.
When you model receives new data for column 3 it checks if that changes the enabled/disabled data for column4 and if yes emits data changed for that column as well.

Cheers,
_