Handling single click and double click separately in QTableWidget

Viewed 12908

I have a QTableWidget widget in my application. I have to handle both single-click and double click mouse events separately in my application. Right now, only single-click slot is being called even when I double click on a cell. How do I handle them separately?

The following is the code for the 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*)));

Am I missing any other configuration here?

1 Answers
Related