PDA

View Full Version : QTable, Removing cell focus



Kubil
25th July 2007, 13:21
Hi all,

I have QTableWidget class, it can be hold 10 rows and 3 columns before scrollbar appear,
for example it has 2 rows and 3 columns ,
is there a way to removing cell focus when clicked on the empty space below the two rows,
because focus will be move to the last row (mark by rectangle), but normal when clicked existing cell.

thanks in advance.

jpn
25th July 2007, 22:19
I'm not sure how badly this would break the mouse handling but you could try catching mouse press event and calling the base class implementation only if pressed over an item, otherwise ignoring the event and setting current item to 0.

Reference:

QMouseEvent::pos()
QTableWidget::itemAt()
QTableWidget::setCurrentItem()

Kubil
27th July 2007, 11:13
Hi, thanks, i will try this.