1 Attachment(s)
How to conditionaly enable cells dpeneding on other cells data?
Hi,
I'm using QTableView to dispaly data of a QStandardItemModel. The model contains 3 columns. In the QTableView I use a custom delegate to second column, where user can select values from a combo box.
To select values from the combo box user should enter value to first column's cell. How can I enable/disable second column if it first column empty?
This basically means user should not able to select any value ( no edit mode ) if left cell is empty.
Attachment 6871
Re: How to conditionaly enable cells dpeneding on other cells data?
Make your own model by deriving from QAbstractTableModel. In the flags function, for column 2 check against your datasource or model for column1 data and pass appropriate flag.