please consider the following code:
#include <QWidget>
#include <iostream>
#include <QApplication>
class Widget : public QWidget
{
public:
void mousePressEvent(QMouseEvent* event)
{
std::cout << "mousePressEvent" < std::endl;
}
void mouseDoubleClickEvent(QMouseEvent* event)
{
std::cout << "mouseDoubleClickEvent" << std::endl;
}
};
int main(int argc, char** argv)
{
QApplication app(argc, argv);
Widget w;
w.show();
return app.exec();
}
Every time I process double click, the output is:
mousePressEvent
mouseDoubleClickEvent
This means Qt always call mousePressEvent as soon as one press proceed without waiting the second press. Is there a way to turn off this option, so that no mousePressEvent call will perform in case of double-click.