Restore Qt 4 behavior in default double click handler

Revert 3bb9024952. That fix was an attempt
to handle the issue that has been fixed in 5.3 by
9063edef79 and should have been reverted
when the new approach, that restores Qt 4 behavior for widgets, was
introduced.

Task-number: QTBUG-38242
Task-number: QTBUG-36423
Change-Id: I8f8a82da22605fac90543492e9b2cd2b568544e7
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Laszlo Agocs 2014-04-15 18:14:08 +02:00 committed by The Qt Project
parent 7aac93b6ce
commit 4dbef58c3d
3 changed files with 11 additions and 5 deletions

View File

@ -8525,6 +8525,8 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
This event handler, for event \a event, can be reimplemented in a
subclass to receive mouse double click events for the widget.
The default implementation calls mousePressEvent().
\note The widget will also receive mouse press and mouse release
events in addition to the double click event. It is up to the
developer to ensure that the application interprets these events
@ -8536,7 +8538,7 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
event->ignore();
mousePressEvent(event);
}
#ifndef QT_NO_WHEELEVENT

View File

@ -679,7 +679,8 @@ void tst_QTabBar::tabBarClicked()
QCOMPARE(doubleClickSpy.count(), 0);
QTest::mouseDClick(&tabBar, button, 0, tabPos);
QCOMPARE(clickSpy.count(), 0);
QCOMPARE(clickSpy.count(), 1);
QCOMPARE(clickSpy.takeFirst().takeFirst().toInt(), 0);
QCOMPARE(doubleClickSpy.count(), 1);
QCOMPARE(doubleClickSpy.takeFirst().takeFirst().toInt(), 0);
@ -691,7 +692,8 @@ void tst_QTabBar::tabBarClicked()
QCOMPARE(doubleClickSpy.count(), 0);
QTest::mouseDClick(&tabBar, button, 0, barPos);
QCOMPARE(clickSpy.count(), 0);
QCOMPARE(clickSpy.count(), 1);
QCOMPARE(clickSpy.takeFirst().takeFirst().toInt(), -1);
QCOMPARE(doubleClickSpy.count(), 1);
QCOMPARE(doubleClickSpy.takeFirst().takeFirst().toInt(), -1);

View File

@ -690,7 +690,8 @@ void tst_QTabWidget::tabBarClicked()
QCOMPARE(doubleClickSpy.count(), 0);
QTest::mouseDClick(&tabBar, button, 0, tabPos);
QCOMPARE(clickSpy.count(), 0);
QCOMPARE(clickSpy.count(), 1);
QCOMPARE(clickSpy.takeFirst().takeFirst().toInt(), 0);
QCOMPARE(doubleClickSpy.count(), 1);
QCOMPARE(doubleClickSpy.takeFirst().takeFirst().toInt(), 0);
@ -702,7 +703,8 @@ void tst_QTabWidget::tabBarClicked()
QCOMPARE(doubleClickSpy.count(), 0);
QTest::mouseDClick(&tabBar, button, 0, barPos);
QCOMPARE(clickSpy.count(), 0);
QCOMPARE(clickSpy.count(), 1);
QCOMPARE(clickSpy.takeFirst().takeFirst().toInt(), -1);
QCOMPARE(doubleClickSpy.count(), 1);
QCOMPARE(doubleClickSpy.takeFirst().takeFirst().toInt(), -1);