Now I can process all key presses in my QTableWidget
in a function eventFilter()
(after calling of myTable->viewport()->installEventFilter(this);
in the constructor).
The only place where this doesn't work is editable cell while editing (because it grabs all key presses). To fix it I can't call installEventFilter()
for each item in the table, because these items are not QObject
s (and also I can't use connect
for putting of my processing of key presses).
The only solution I have is to put QLineEdit
s in these cells and to use event filter to catch key presses while editing. But is it possible to solve it using only standard items? (i.e. only QTableWidgetItem
with a flag Qt::ItemIsEditable
)
Also I can call grabKeyboard()
for my QTableWidget
. In this case I'll have all key presses (even while editing of cells by user), but it blocks edit box (i.e. user can't input anything). May be it is possible to fix broken edit boxes after calling of grabKeyboard()
for the table?