How to know that QTableView is in editing state
-
Hi, all
The different columns of QTableView have set delegates, the table model is QSqlTableModel, and everything is working normally. According to the needs of the project, when QTableView is idle, its background color will change randomly. When double-clicking any cell to enter the editing state, its background color will stop refreshing.
I tried the “hasFocus” property, “entered” signal, and “viewportentered” signal, but the Editing State cannot be obtained correctly.
How do I know if a cell in QTableView is being edited, please?
Best regards! -
@tovax said in How to know that QTableView is in editing state:
If no delegation is used, how can this problem be solved?
Overwrite QTableView::edit()
-
@Christian-Ehrlicher said in How to know that QTableView is in editing state:
Overwrite QTableView::edit()
@tovax
Plus see https://doc.qt.io/qt-5/qabstractitemview.html#closeEditor and https://doc.qt.io/qt-5/qabstractitemview.html#state. -
@Christian-Ehrlicher
@JonB
Thank you very much.