PDA

View Full Version : Deselect text on a QTableWidgtem cell upon double clicking



EB
27th January 2010, 21:13
Everytime I double click a cell that belongs to a QTableWidget the cell's entire text is selected. I have tried to disable this so that when I double a cell the text editor opens up for editing with NO text selected, but I haven't been successful. This is apparently the default behavior. How can i change this?

I'm using Qt-4.6.0 on Linux.

Thanks!

EB
29th January 2010, 12:17
I finally figured out how to do this. I did it by capturing the Qt::FocusIn event on the delegate's eventFilter() function. There I used the pointer to the editor to call the deselect() function.