QWidgets QPA - remove wrong setting of mouse timestamp

The comment to the code said it was to avoid double click.
However it actually breaks wanted double clicks.

The reason for it must be that the replayed event in earlier
code versions could be changed into a double click (together
with the first event).

However (now) we only test qt_replay_popup_mouse_event in
void QWidgetWindow::handleMouseEvent(QMouseEvent *event);

Regardless what kind of event we receive as input it will send
QEvent::MouseButtonPress when it sends replay mouse event.

I.e. it will then call QCoreApplication::sendSpontaneousEvent(r,e)
=> QCoreApplication::notifyInternal(receiver, event)
=> QCoreApplication::notify(receiver, event)
=> QApplicationPrivate::notify_helper(receiver, event) (+filters)
=> (probably) QWidgeWindow::event(receiver, event)
=> further handling in widget classes.

That especially means that it will *not* get into the function
QGuiApplicationPrivate::processMouseEvent where doubleclicks are
created. Therefore no doubleclick can be made from the extra event.
That makes the statement have no good effect - just side effects.

Change-Id: I190baff3c060548775201695e324059560bb7106
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Thorbjørn Martsum 2013-05-08 20:34:54 +02:00 committed by The Qt Project
parent fff9119028
commit 00b4bd0a42

View File

@ -196,7 +196,6 @@ void QApplicationPrivate::closePopup(QWidget *popup)
// mouse release event or inside
qt_replay_popup_mouse_event = false;
} else { // mouse press event
QGuiApplicationPrivate::mousePressTime -= 10000; // avoid double click
qt_replay_popup_mouse_event = true;
}