QTableWidget - Unselect cell onClick outside of control
Hello,
What I want:
I'm trying to implement the following behavior while using a class which derives from QtTableWidget:
When the user clicks outside the control, no cell in the table should be selected or in focus.
Current behavior:
When the user clicks outside the control the selection square remains on the last edited cell, although it does not appear editable. If I type something in the cell does get edited though
Setting I am using:
setSelectionBehavior(QAbstractItemView::SelectItem s);
setEditTriggers(QAbstractItemView::AllEditTriggers );
setShowGrid(true);
Any Ideas on how I can achieve this?
Thanks,
Yoni
Re: QTableWidget - Unselect cell onClick outside of control
Try to subclass QTableWidget and override focusOutEvent method (it gets called when a widget looses focus). There you can try to clear selection (e.g. via clearSelection method).