From 5d3e56b3b48a58414e94e09dbaa87bb36a14fdac Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 24 Feb 2020 14:33:20 +0100 Subject: [PATCH] QmlDesigner: Fix compile with Qt5.11 and building tests Change-Id: I96dea7de0d185c67ea3a26a42de0805bd60dc1d1 Reviewed-by: Miikka Heikkinen --- .../instances/qt5informationnodeinstanceserver.cpp | 10 +++++++++- tests/auto/qml/qmldesigner/coretests/coretests.pro | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index a82859a36c4..3b8cb04a909 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -1185,9 +1185,17 @@ void Qt5InformationNodeInstanceServer::inputEvent(const InputEventCommand &comma { if (m_editView3D) { if (command.type() == QEvent::Wheel) { - auto we = new QWheelEvent(command.pos(), command.pos(), {0, 0}, {0, command.angleDelta()}, + QWheelEvent *we +#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) + = new QWheelEvent(command.pos(), command.pos(), {0, 0}, {0, command.angleDelta()}, command.buttons(), command.modifiers(), Qt::NoScrollPhase, false); +#else + = new QWheelEvent(command.pos(), command.pos(), {0, 0}, {0, command.angleDelta()}, + 0, Qt::Horizontal, command.buttons(), command.modifiers(), + Qt::NoScrollPhase, Qt::MouseEventNotSynthesized); +#endif + QGuiApplication::postEvent(m_editView3D, we); } else { auto me = new QMouseEvent(command.type(), command.pos(), command.button(), diff --git a/tests/auto/qml/qmldesigner/coretests/coretests.pro b/tests/auto/qml/qmldesigner/coretests/coretests.pro index fbc7f4f0e2e..8a86681e62c 100644 --- a/tests/auto/qml/qmldesigner/coretests/coretests.pro +++ b/tests/auto/qml/qmldesigner/coretests/coretests.pro @@ -49,6 +49,7 @@ INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins/qmldesigner/components/stateseditor INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins/qmldesigner/components/formeditor INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins/qmldesigner/components/propertyeditor INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins/qmldesigner/components/debugview +INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins/qmldesigner/components/edit3d INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/3rdparty include($$IDE_SOURCE_TREE/src/plugins/qmldesigner/designercore/designercore-lib.pri)