PDA

View Full Version : Handling single click and double click mouse events separately in QTableWidget



vjyrakesh
16th July 2012, 12:35
Hi,

I have a QTableWidget widget in my application. I need to handle both single-click and double-click mouse events separately for this widget. Currently, I have slots for both the signals but only single-click slot is called even when I double click. How do I handle these two signals separately in my application?

Thanks,
Rakesh.

wysota
16th July 2012, 12:37
Show us some code, please.

vjyrakesh
16th July 2012, 12:40
The following is the code for signal-slot connection:
connect(ui.tableWidget, SIGNAL(cellClicked(int, int)), this, SLOT(myCellClicked(int, int)));
connect(ui.tableWidget, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(tableItemClicked(QTableWidgetItem*)));