aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-18 10:07:56 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-01-18 10:22:10 +0000
commit9e61e6ac9cf782eddb428fb72aaeab1413f824b6 (patch)
tree5c50681ad219ba3a3e09ed20dc64353376685298
parent0c2b18778a5c7f38bcddda0ee5ceb04da540e6d8 (diff)
parent12e45d7670161164676a9799ea77f56ae7939e29 (diff)
Merge "Merge remote-tracking branch 'origin/5.9.4' into 5.9" into refs/staging/5.9
-rw-r--r--dist/changes-5.9.477
-rw-r--r--src/quickwidgets/qquickwidget.cpp20
-rw-r--r--tests/auto/particles/qquickcustomaffector/BLACKLIST2
-rw-r--r--tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp15
-rw-r--r--tests/auto/quickwidgets/qquickwidget/data/mouse.qml18
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp29
6 files changed, 144 insertions, 17 deletions
diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4
new file mode 100644
index 0000000000..c0e861a706
--- /dev/null
+++ b/dist/changes-5.9.4
@@ -0,0 +1,77 @@
+Qt 5.9.4 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.9.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.9 series is binary compatible with the 5.8.x series.
+Applications compiled for 5.8 will continue to run with 5.9.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt 5.9.4 Changes *
+****************************************************************************
+
+QtQml
+-----
+
+ - Added qt.qml.gc.statistics and qt.qml.gc.allocatorStats logging
+ categories for garbage collection statistics
+ - [QTBUG-56521][QTBUG-56532] Added private qmlUnregisterType(int) for
+ advanced use cases such as re-registering an enum, or cleaning up
+ when a plugin is unloaded
+ - [QTBUG-61209] Fixed handling of QML cache files during URL interception
+ - [QTBUG-63844] Fixed a crash in QMetaObject::activate() when using
+ a Loader to load items with animations
+
+QtQuick
+-------
+
+ - QQuickWindow:
+ * Added logging category qt.quick.window.transient to check detection of
+ transient windows declared inside other Items and Windows
+
+ - QQuickWidget:
+ * [QTBUG-64241] Synthesized mouse events delivered via QQuickWidget
+ have QMouseEvent::source() set so they can be identified as synthesized
+ * [QTBUG-64548] Shortcut now works in QQuickWidget
+ * Fixed coordinate transformation in QInputMethodQueryEvent as delivered
+ to QQuickWidget
+
+ - Input Handling:
+ * [QTBUG-53036] When an application is deactivated (applicationState() is
+ no longer ApplicationActive), it's treated the same as window deactivation.
+ Thus on mobile devices MouseAreas no longer get stuck in pressed state, etc.
+ * [QTBUG-61144] Fixed the regression that when a mouse-handling Item
+ or Control is used in a Flickable with a pressDelay, the delegate item
+ did not receive touchscreen taps (in the form of mouse clicks)
+ * [QTBUG-63026] Flickable no longer jumps when reversing the direction of
+ scrolling on a pixel-delta-capable trackpad
+ * [QTBUG-64249] When pressing one MouseArea via mouse, then tapping another
+ via touch, then releasing, the first MouseArea correctly gets released
+
+ - Item Views:
+ * [QTBUG-46488] Refilling is restarted when necessary due to changing
+ the model in a delegate's Component.onCompleted()
+ * [QTBUG-50992] Fixed a bug which caused Qt Quick Controls to often be
+ "destroyed during incubation" during asynchronous creation
+ * [QTBUG-54859] Fixed a crash when items in a Repeater are moved around
+ during asynchronous creation
+ * [QTBUG-61537] Fixed incorrect delegate geometry due to model changes
+ during delegate creation
+ * [QTBUG-62864] Fixed incorrect ListView and GridView highlight position
+ while scrolling through delegates backed by a lazy-loading model
+ * [QTBUG-63743] Fixed a bug with clipping of items in a ScrollView
+
+ - Other:
+ * [QTBUG-62913] AnimatedImage.frameCount now has a NOTIFY signal
+ * [QTBUG-65156] Fixed a memory leak by releasing textures during resizing
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index df28ff964a..b15df88112 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -934,7 +934,7 @@ void QQuickWidget::createFramebufferObject()
}
QOpenGLContext *shareWindowContext = QWidgetPrivate::get(window())->shareContext();
- if (shareWindowContext && context->shareContext() != shareWindowContext) {
+ if (shareWindowContext && context->shareContext() != shareWindowContext && !qGuiApp->testAttribute(Qt::AA_ShareOpenGLContexts)) {
context->setShareContext(shareWindowContext);
context->setScreen(shareWindowContext->screen());
if (!context->create())
@@ -1246,11 +1246,11 @@ void QQuickWidget::mouseMoveEvent(QMouseEvent *e)
Q_QUICK_INPUT_PROFILE(QQuickProfiler::Mouse, QQuickProfiler::InputMouseMove, e->localPos().x(),
e->localPos().y());
- // Use the constructor taking localPos and screenPos. That puts localPos into the
- // event's localPos and windowPos, and screenPos into the event's screenPos. This way
- // the windowPos in e is ignored and is replaced by localPos. This is necessary
- // because QQuickWindow thinks of itself as a top-level window always.
- QMouseEvent mappedEvent(e->type(), e->localPos(), e->windowPos(), e->screenPos(),
+ // Put localPos into the event's localPos and windowPos, and screenPos into the
+ // event's screenPos. This way the windowPos in e is ignored and is replaced by
+ // localPos. This is necessary because QQuickWindow thinks of itself as a
+ // top-level window always.
+ QMouseEvent mappedEvent(e->type(), e->localPos(), e->localPos(), e->screenPos(),
e->button(), e->buttons(), e->modifiers(), e->source());
QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent);
e->setAccepted(mappedEvent.isAccepted());
@@ -1265,11 +1265,11 @@ void QQuickWidget::mouseDoubleClickEvent(QMouseEvent *e)
// As the second mouse press is suppressed in widget windows we emulate it here for QML.
// See QTBUG-25831
- QMouseEvent pressEvent(QEvent::MouseButtonPress, e->localPos(), e->windowPos(), e->screenPos(),
+ QMouseEvent pressEvent(QEvent::MouseButtonPress, e->localPos(), e->localPos(), e->screenPos(),
e->button(), e->buttons(), e->modifiers(), e->source());
QCoreApplication::sendEvent(d->offscreenWindow, &pressEvent);
e->setAccepted(pressEvent.isAccepted());
- QMouseEvent mappedEvent(e->type(), e->localPos(), e->windowPos(), e->screenPos(),
+ QMouseEvent mappedEvent(e->type(), e->localPos(), e->localPos(), e->screenPos(),
e->button(), e->buttons(), e->modifiers(), e->source());
QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent);
}
@@ -1330,7 +1330,7 @@ void QQuickWidget::mousePressEvent(QMouseEvent *e)
Q_QUICK_INPUT_PROFILE(QQuickProfiler::Mouse, QQuickProfiler::InputMousePress, e->button(),
e->buttons());
- QMouseEvent mappedEvent(e->type(), e->localPos(), e->windowPos(), e->screenPos(),
+ QMouseEvent mappedEvent(e->type(), e->localPos(), e->localPos(), e->screenPos(),
e->button(), e->buttons(), e->modifiers(), e->source());
QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent);
e->setAccepted(mappedEvent.isAccepted());
@@ -1343,7 +1343,7 @@ void QQuickWidget::mouseReleaseEvent(QMouseEvent *e)
Q_QUICK_INPUT_PROFILE(QQuickProfiler::Mouse, QQuickProfiler::InputMouseRelease, e->button(),
e->buttons());
- QMouseEvent mappedEvent(e->type(), e->localPos(), e->windowPos(), e->screenPos(),
+ QMouseEvent mappedEvent(e->type(), e->localPos(), e->localPos(), e->screenPos(),
e->button(), e->buttons(), e->modifiers(), e->source());
QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent);
e->setAccepted(mappedEvent.isAccepted());
diff --git a/tests/auto/particles/qquickcustomaffector/BLACKLIST b/tests/auto/particles/qquickcustomaffector/BLACKLIST
new file mode 100644
index 0000000000..0757641bcc
--- /dev/null
+++ b/tests/auto/particles/qquickcustomaffector/BLACKLIST
@@ -0,0 +1,2 @@
+[test_move]
+windows gcc developer-build
diff --git a/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp b/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp
index ee05fb29c9..cad3813e92 100644
--- a/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp
+++ b/tests/auto/particles/qquickcustomaffector/tst_qquickcustomaffector.cpp
@@ -98,16 +98,17 @@ void tst_qquickcustomaffector::test_move()
if (!d->stillAlive(system))
continue; //parameters no longer get set once you die
- QVERIFY(myFuzzyCompare(d->curX(system), 50.0));
- QVERIFY(myFuzzyCompare(d->curY(system), 50.0));
- QVERIFY(myFuzzyCompare(d->curVX(system), 50.0));
- QVERIFY(myFuzzyCompare(d->curVY(system), 50.0));
- QVERIFY(myFuzzyCompare(d->curAX(), 50.0));
- QVERIFY(myFuzzyCompare(d->curAY(), 50.0));
+ QVERIFY2(myFuzzyCompare(d->curX(system), 50.0), QByteArray::number(d->curX(system)));
+ QVERIFY2(myFuzzyCompare(d->curY(system), 50.0), QByteArray::number(d->curY(system)));
+ QVERIFY2(myFuzzyCompare(d->curVX(system), 50.0), QByteArray::number(d->curVX(system)));
+ QVERIFY2(myFuzzyCompare(d->curVY(system), 50.0), QByteArray::number(d->curVY(system)));
+ QVERIFY2(myFuzzyCompare(d->curAX(), 50.0), QByteArray::number(d->curAX()));
+ QVERIFY2(myFuzzyCompare(d->curAY(), 50.0), QByteArray::number(d->curAY()));
QCOMPARE(d->lifeSpan, 0.5f);
QCOMPARE(d->size, 32.f);
QCOMPARE(d->endSize, 32.f);
- QVERIFY(myFuzzyLEQ(d->t, ((qreal)system->timeInt/1000.0)));
+ QVERIFY2(myFuzzyLEQ(d->t, ((qreal)system->timeInt/1000.0)),
+ QString::fromLatin1("%1 <= %2 / 1000").arg(d->t).arg(system->timeInt).toUtf8());
}
delete view;
}
diff --git a/tests/auto/quickwidgets/qquickwidget/data/mouse.qml b/tests/auto/quickwidgets/qquickwidget/data/mouse.qml
new file mode 100644
index 0000000000..5d1c6e8443
--- /dev/null
+++ b/tests/auto/quickwidgets/qquickwidget/data/mouse.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 50
+ height: 50
+
+ property bool wasClicked: false
+ property bool wasDoubleClicked: false
+ property bool wasMoved: false
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: wasClicked = true
+ onDoubleClicked: wasDoubleClicked = true
+ onMouseXChanged: wasMoved = true
+ }
+}
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index e4991a5f26..6c8d8191a5 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -62,6 +62,7 @@ private slots:
void keyEvents();
void shortcuts();
void enterLeave();
+ void mouseEventWindowPos();
};
@@ -433,6 +434,34 @@ void tst_qquickwidget::enterLeave()
QTRY_VERIFY(!rootItem->property("hasMouse").toBool());
}
+void tst_qquickwidget::mouseEventWindowPos()
+{
+ QWidget widget;
+ widget.resize(100, 100);
+ QQuickWidget *quick = new QQuickWidget(&widget);
+ quick->setSource(testFileUrl("mouse.qml"));
+ quick->move(50, 50);
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&widget, 5000));
+ QQuickItem *rootItem = quick->rootObject();
+ QVERIFY(rootItem);
+
+ QVERIFY(!rootItem->property("wasClicked").toBool());
+ QVERIFY(!rootItem->property("wasDoubleClicked").toBool());
+ QVERIFY(!rootItem->property("wasMoved").toBool());
+
+ QWindow *window = widget.windowHandle();
+ QVERIFY(window);
+
+ QTest::mouseMove(window, QPoint(60, 60));
+ QTest::mouseClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(60, 60));
+ QTRY_VERIFY(rootItem->property("wasClicked").toBool());
+ QTest::mouseDClick(window, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(60, 60));
+ QTRY_VERIFY(rootItem->property("wasDoubleClicked").toBool());
+ QTest::mouseMove(window, QPoint(70, 70));
+ QTRY_VERIFY(rootItem->property("wasMoved").toBool());
+}
+
QTEST_MAIN(tst_qquickwidget)
#include "tst_qquickwidget.moc"