Quote Originally Posted by marcel View Post
Yeah, no support for that.
If the difference is smaller than 800ms or even 500ms(the user would have to be very fast) then you have a double click and you can emit a custom doubleClick() signal or whatever.
Hardcoding a double click time is not ideal. Use QApplication::doubleClickInterval() to get the correct number of milliseconds.

Also this doesn't really solve the problem of how to ignore the mouse press if there is a double click coming. Basically it's impossible to determine on mouse press if another click is coming, since it obviously hasn't happened yet. However, if a small delay is acceptable, you can do the following:

In your mousePressEvent, start a timer with a timeout of QApplication::doubleClickInterval() + a little bit, where a little bit is some small number of milliseconds as a buffer.

If the user clicks just once, then you can execute whatever action you want when the timer finishes. If you get a mouseDoubleClick before your timer finishes, you can cancel the timer and execute the double click action.

Like I said, the only downside is that there will be about a 400 ms delay when responding to single clicks.