Why QT doesn't see all clicks?
-
Hello,
I have a QWidget ( myClass ) and when I click on it I would like to exec qDialog. Everything works, but when I click two times in a row fast, I go only once to mousePressEvent. My code:
void myClass::mousePressEvent(QMouseEvent *event) // I click on this widget { qInfo()<<"CLICK!"; QPoint global = mapToGlobal( QPoint(0,0) ); // this and next line only set position dialog->setGeometry( global.x(), global.y()+height(), 500, 500 ); dialog->exec(); }
When I click fast two Times I get:
"CLICK!"When I click two times in a normal speed ( 1 per second ) I get:
"CLICK!"
"CLICK!"When I delete line:
dialog->exec();
I can clicked very fast and everything works perfect. So exec() is very expensive.
Is there a way to use exec() and can clicked fast and get all "CLICK!"?
EDIT:
When I change exec() to show() result is the same: I don't see all clicks when click fast -
@TomNow99 Then I think the second click does not arrive the widget anymore as the dialog is being shown.
What happens if you use show() wait until dialog is shown move it away from that widget and then click the widget to times fast? -
@TomNow99 said in Why QT doesn't see all clicks?:
but when I click two times in a row fast,
Have you tried using mouseDoubleClickEvent() event handler?