diff --git a/src/libs/tracing/CMakeLists.txt b/src/libs/tracing/CMakeLists.txt index c34f583810f..948067c72b9 100644 --- a/src/libs/tracing/CMakeLists.txt +++ b/src/libs/tracing/CMakeLists.txt @@ -32,94 +32,82 @@ set(TRACING_CPP_SOURCES tracing_global.h ) -if(${Qt5_VERSION} VERSION_LESS "6.2.0") - add_qtc_library(Tracing - FEATURE_INFO - DEPENDS Utils Qt5::Qml Qt5::Quick - PUBLIC_DEPENDS Qt5::Widgets - SOURCES - ${TEST_SOURCES} - ${TRACING_CPP_SOURCES} - qml/tracing.qrc - ) -else() # < Qt 6.2 - find_package(Qt6 COMPONENTS ShaderTools QUIET) +find_package(Qt6 COMPONENTS ShaderTools QUIET) - add_qtc_library(Tracing - CONDITION TARGET Qt6::ShaderTools AND TARGET Qt5::Quick - FEATURE_INFO - DEPENDS Utils Qt5::Qml Qt5::Quick - PUBLIC_DEPENDS Qt5::Widgets - SOURCES - ${TEST_SOURCES} - ) +add_qtc_library(Tracing + CONDITION TARGET Qt6::ShaderTools AND TARGET Qt5::Quick + FEATURE_INFO + DEPENDS Utils Qt5::Qml Qt5::Quick + PUBLIC_DEPENDS Qt5::Widgets + SOURCES + ${TEST_SOURCES} +) - if (NOT TARGET Tracing) - return() - endif() +if (NOT TARGET Tracing) + return() +endif() - set(TRACING_QML_FILES - qml/ButtonsBar.qml - qml/CategoryLabel.qml - qml/Detail.qml - qml/FlameGraphDelegate.qml - qml/FlameGraphView.qml - qml/ImageToolButton.qml - qml/MainView.qml - qml/Overview.qml - qml/RangeDetails.qml - qml/RangeMover.qml - qml/RowLabel.qml - qml/SelectionRange.qml - qml/SelectionRangeDetails.qml - qml/TimeDisplay.qml - qml/TimelineContent.qml - qml/TimelineLabels.qml - qml/TimelineRulers.qml - qml/TimelineText.qml - qml/TimeMarks.qml - ) +set(TRACING_QML_FILES + qml/ButtonsBar.qml + qml/CategoryLabel.qml + qml/Detail.qml + qml/FlameGraphDelegate.qml + qml/FlameGraphView.qml + qml/ImageToolButton.qml + qml/MainView.qml + qml/Overview.qml + qml/RangeDetails.qml + qml/RangeMover.qml + qml/RowLabel.qml + qml/SelectionRange.qml + qml/SelectionRangeDetails.qml + qml/TimeDisplay.qml + qml/TimelineContent.qml + qml/TimelineLabels.qml + qml/TimelineRulers.qml + qml/TimelineText.qml + qml/TimeMarks.qml +) - set(TRACING_QML_RESOURCES - qml/ico_edit.png - qml/ico_edit@2x.png - qml/ico_rangeselected.png - qml/ico_rangeselected@2x.png - qml/ico_rangeselection.png - qml/ico_rangeselection@2x.png - qml/ico_selectionmode.png - qml/ico_selectionmode@2x.png - qml/range_handle.png - qml/range_handle@2.png - ) +set(TRACING_QML_RESOURCES + qml/ico_edit.png + qml/ico_edit@2x.png + qml/ico_rangeselected.png + qml/ico_rangeselected@2x.png + qml/ico_rangeselection.png + qml/ico_rangeselection@2x.png + qml/ico_selectionmode.png + qml/ico_selectionmode@2x.png + qml/range_handle.png + qml/range_handle@2.png +) - foreach(file IN LISTS TRACING_QML_FILES TRACING_QML_RESOURCES) - get_filename_component(fileName "${file}" NAME) - set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}") - endforeach() +foreach(file IN LISTS TRACING_QML_FILES TRACING_QML_RESOURCES) + get_filename_component(fileName "${file}" NAME) + set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}") +endforeach() - qt_add_shaders(Tracing "res_tracingshaders" - BATCHABLE - PREFIX - "/QtCreator/Tracing" - BASE - "qml" - FILES - qml/notes_qt6.vert - qml/notes_qt6.frag - qml/timelineitems_qt6.vert - qml/timelineitems_qt6.frag - ) +qt_add_shaders(Tracing "res_tracingshaders" + BATCHABLE + PREFIX + "/QtCreator/Tracing" + BASE + "qml" + FILES + qml/notes_qt6.vert + qml/notes_qt6.frag + qml/timelineitems_qt6.vert + qml/timelineitems_qt6.frag +) - qt_add_qml_module(Tracing - URI "QtCreator.Tracing" - VERSION "1.0" - NO_PLUGIN - QML_FILES - ${TRACING_QML_FILES} - RESOURCES - ${TRACING_QML_RESOURCES} - SOURCES - ${TRACING_CPP_SOURCES} - ) -endif() # < Qt 6.2 +qt_add_qml_module(Tracing + URI "QtCreator.Tracing" + VERSION "1.0" + NO_PLUGIN + QML_FILES + ${TRACING_QML_FILES} + RESOURCES + ${TRACING_QML_RESOURCES} + SOURCES + ${TRACING_CPP_SOURCES} +) diff --git a/src/libs/tracing/flamegraph.h b/src/libs/tracing/flamegraph.h index 9bffa5f251f..d48a7acbe96 100644 --- a/src/libs/tracing/flamegraph.h +++ b/src/libs/tracing/flamegraph.h @@ -49,9 +49,7 @@ class TRACING_EXPORT FlameGraph : public QQuickItem Q_PROPERTY(bool zoomed READ isZoomed NOTIFY rootChanged) Q_PROPERTY(int selectedTypeId READ selectedTypeId WRITE setSelectedTypeId NOTIFY selectedTypeIdChanged) -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ELEMENT -#endif // Qt >= 6.2 public: FlameGraph(QQuickItem *parent = nullptr); diff --git a/src/libs/tracing/qml/ButtonsBar.qml b/src/libs/tracing/qml/ButtonsBar.qml index 580d12a3a9d..20b32f454fd 100644 --- a/src/libs/tracing/qml/ButtonsBar.qml +++ b/src/libs/tracing/qml/ButtonsBar.qml @@ -23,11 +23,11 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.3 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts -import QtCreator.Tracing 1.0 +import QtCreator.Tracing ToolBar { id: buttons diff --git a/src/libs/tracing/qml/CategoryLabel.qml b/src/libs/tracing/qml/CategoryLabel.qml index e70dba108c8..32c93b666b4 100644 --- a/src/libs/tracing/qml/CategoryLabel.qml +++ b/src/libs/tracing/qml/CategoryLabel.qml @@ -23,10 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Controls 2.2 +import QtQuick +import QtQuick.Controls -import QtCreator.Tracing 1.0 +import QtCreator.Tracing Item { id: labelContainer diff --git a/src/libs/tracing/qml/Detail.qml b/src/libs/tracing/qml/Detail.qml index a8ba0244c85..7bae5c58b8b 100644 --- a/src/libs/tracing/qml/Detail.qml +++ b/src/libs/tracing/qml/Detail.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick TimelineText { property bool isLabel: false diff --git a/src/libs/tracing/qml/FlameGraphDelegate.qml b/src/libs/tracing/qml/FlameGraphDelegate.qml index 09efdc53f65..431ef8b8d2f 100644 --- a/src/libs/tracing/qml/FlameGraphDelegate.qml +++ b/src/libs/tracing/qml/FlameGraphDelegate.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Item { id: flamegraphItem diff --git a/src/libs/tracing/qml/FlameGraphView.qml b/src/libs/tracing/qml/FlameGraphView.qml index 488adaa3733..a04be40a7ee 100644 --- a/src/libs/tracing/qml/FlameGraphView.qml +++ b/src/libs/tracing/qml/FlameGraphView.qml @@ -23,12 +23,12 @@ ** ****************************************************************************/ -import QtCreator.Tracing 1.0 +import QtCreator.Tracing -import QtQml 2.2 -import QtQuick 2.9 -import QtQuick.Controls 2.3 -import QtQuick.Controls.Material 2.3 +import QtQml +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.Material ScrollView { id: root diff --git a/src/libs/tracing/qml/ImageToolButton.qml b/src/libs/tracing/qml/ImageToolButton.qml index d2959d7ac1b..4c3e78c6bbe 100644 --- a/src/libs/tracing/qml/ImageToolButton.qml +++ b/src/libs/tracing/qml/ImageToolButton.qml @@ -23,10 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick +import QtQuick.Controls -import QtCreator.Tracing 1.0 +import QtCreator.Tracing ToolButton { implicitWidth: 30 diff --git a/src/libs/tracing/qml/MainView.qml b/src/libs/tracing/qml/MainView.qml index c00112dee64..62826c08f55 100644 --- a/src/libs/tracing/qml/MainView.qml +++ b/src/libs/tracing/qml/MainView.qml @@ -23,10 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick +import QtQuick.Controls -import QtCreator.Tracing 1.0 +import QtCreator.Tracing Rectangle { id: root diff --git a/src/libs/tracing/qml/Overview.qml b/src/libs/tracing/qml/Overview.qml index 5152e4bc965..ec399ca5196 100644 --- a/src/libs/tracing/qml/Overview.qml +++ b/src/libs/tracing/qml/Overview.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Rectangle { id: overview diff --git a/src/libs/tracing/qml/RangeDetails.qml b/src/libs/tracing/qml/RangeDetails.qml index c98d4d6d83b..4bc4c06ffc2 100644 --- a/src/libs/tracing/qml/RangeDetails.qml +++ b/src/libs/tracing/qml/RangeDetails.qml @@ -23,10 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.9 -import QtQuick.Controls 2.0 +import QtQuick +import QtQuick.Controls -import QtCreator.Tracing 1.0 +import QtCreator.Tracing Item { id: rangeDetails diff --git a/src/libs/tracing/qml/RangeMover.qml b/src/libs/tracing/qml/RangeMover.qml index 346d251b55e..8c660529798 100644 --- a/src/libs/tracing/qml/RangeMover.qml +++ b/src/libs/tracing/qml/RangeMover.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Item { id: rangeMover diff --git a/src/libs/tracing/qml/RowLabel.qml b/src/libs/tracing/qml/RowLabel.qml index 5ea85693e59..aa70f432526 100644 --- a/src/libs/tracing/qml/RowLabel.qml +++ b/src/libs/tracing/qml/RowLabel.qml @@ -23,9 +23,9 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Controls 2.2 -import QtCreator.Tracing 1.0 +import QtQuick +import QtQuick.Controls +import QtCreator.Tracing Button { id: button diff --git a/src/libs/tracing/qml/SelectionRange.qml b/src/libs/tracing/qml/SelectionRange.qml index 3f10ac3414f..80ad4fc18a0 100644 --- a/src/libs/tracing/qml/SelectionRange.qml +++ b/src/libs/tracing/qml/SelectionRange.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick RangeMover { id: selectionRange diff --git a/src/libs/tracing/qml/SelectionRangeDetails.qml b/src/libs/tracing/qml/SelectionRangeDetails.qml index 307bdd660f9..0715cc9dbf2 100644 --- a/src/libs/tracing/qml/SelectionRangeDetails.qml +++ b/src/libs/tracing/qml/SelectionRangeDetails.qml @@ -23,10 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Controls 2.0 +import QtQuick +import QtQuick.Controls -import QtCreator.Tracing 1.0 +import QtCreator.Tracing Item { id: selectionRangeDetails diff --git a/src/libs/tracing/qml/TimeDisplay.qml b/src/libs/tracing/qml/TimeDisplay.qml index d4876597459..48080e4656c 100644 --- a/src/libs/tracing/qml/TimeDisplay.qml +++ b/src/libs/tracing/qml/TimeDisplay.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Item { id: timeDisplay diff --git a/src/libs/tracing/qml/TimeMarks.qml b/src/libs/tracing/qml/TimeMarks.qml index 761a4a07fcc..5bf303b4df8 100644 --- a/src/libs/tracing/qml/TimeMarks.qml +++ b/src/libs/tracing/qml/TimeMarks.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Item { id: timeMarks diff --git a/src/libs/tracing/qml/TimelineContent.qml b/src/libs/tracing/qml/TimelineContent.qml index f4579007a67..cf0c4bd0fd1 100644 --- a/src/libs/tracing/qml/TimelineContent.qml +++ b/src/libs/tracing/qml/TimelineContent.qml @@ -23,10 +23,10 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Controls 2.2 -import QtCreator.Tracing 1.0 -import QtQml.Models 2.1 +import QtQuick +import QtQuick.Controls +import QtCreator.Tracing +import QtQml.Models Flickable { id: flick diff --git a/src/libs/tracing/qml/TimelineLabels.qml b/src/libs/tracing/qml/TimelineLabels.qml index 8dfd6dc7e95..62af731a322 100644 --- a/src/libs/tracing/qml/TimelineLabels.qml +++ b/src/libs/tracing/qml/TimelineLabels.qml @@ -23,9 +23,9 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQml.Models 2.1 -import QtCreator.Tracing 1.0 +import QtQuick +import QtQml.Models +import QtCreator.Tracing Flickable { id: categories diff --git a/src/libs/tracing/qml/TimelineRulers.qml b/src/libs/tracing/qml/TimelineRulers.qml index 99c9d533a37..97cd5be3cb6 100644 --- a/src/libs/tracing/qml/TimelineRulers.qml +++ b/src/libs/tracing/qml/TimelineRulers.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Item { id: rulersParent diff --git a/src/libs/tracing/qml/TimelineText.qml b/src/libs/tracing/qml/TimelineText.qml index 8354b62f3cf..eb8f7600377 100644 --- a/src/libs/tracing/qml/TimelineText.qml +++ b/src/libs/tracing/qml/TimelineText.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtCreator.Tracing 1.0 +import QtQuick +import QtCreator.Tracing Text { font.pixelSize: 12 diff --git a/src/libs/tracing/qml/notes.frag b/src/libs/tracing/qml/notes.frag deleted file mode 100644 index 0f174ca28de..00000000000 --- a/src/libs/tracing/qml/notes.frag +++ /dev/null @@ -1,32 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -varying lowp vec4 color; -varying lowp float d; - -void main() -{ - gl_FragColor = color * float(d < (2.0 / 3.0) || d > (5.0 / 6.0)); -} diff --git a/src/libs/tracing/qml/notes.vert b/src/libs/tracing/qml/notes.vert deleted file mode 100644 index be3c8700b8c..00000000000 --- a/src/libs/tracing/qml/notes.vert +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -attribute vec4 vertexCoord; -attribute float distanceFromTop; - -uniform mat4 matrix; -uniform vec4 notesColor; - -varying vec4 color; -varying float d; - -void main() -{ - gl_Position = matrix * vertexCoord; - gl_Position.z -= 0.1; - gl_Position.w = 1.0; - color = notesColor; - d = distanceFromTop; -} diff --git a/src/libs/tracing/qml/timelineitems.frag b/src/libs/tracing/qml/timelineitems.frag deleted file mode 100644 index 97d79770f64..00000000000 --- a/src/libs/tracing/qml/timelineitems.frag +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#ifdef GL_OES_standard_derivatives -#extension GL_OES_standard_derivatives : enable -// else we probably have fwidth() in core -#endif - -varying lowp vec3 edgeColor; -varying lowp vec3 color; -varying lowp vec2 barycentric; - -void main() -{ - lowp vec2 d = fwidth(barycentric) * 4.0; - lowp vec4 edge_closeness = step(vec4(d.x, d.y, d.x, d.y), - vec4(barycentric.x, barycentric.y, 1.0 - barycentric.x, 1.0 - barycentric.y)); - lowp float total = min(min(edge_closeness[0], edge_closeness[1]), - min(edge_closeness[2], edge_closeness[3])); - gl_FragColor.rgb = mix(edgeColor, color, total); - gl_FragColor.a = 1.0; -} diff --git a/src/libs/tracing/qml/timelineitems.vert b/src/libs/tracing/qml/timelineitems.vert deleted file mode 100644 index 153bf693db2..00000000000 --- a/src/libs/tracing/qml/timelineitems.vert +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -attribute vec4 vertexCoord; -attribute vec2 rectSize; -attribute float selectionId; -attribute vec4 vertexColor; - -uniform vec2 scale; -uniform mat4 matrix; -uniform vec4 selectionColor; -uniform float selectedItem; - -varying vec3 color; -varying vec3 edgeColor; -varying vec2 barycentric; - -void main() -{ - gl_Position = matrix * vertexCoord; - - // Make very narrow events somewhat wider so that they don't collapse into 0 pixels - float scaledWidth = scale.x * rectSize.x; - float shift = sign(rectSize.x) * max(0.0, 3.0 - abs(scaledWidth)) * 0.0005; - gl_Position.x += shift; - - // Ditto for events with very small height - float scaledHeight = scale.y * rectSize.y; - gl_Position.y += float(rectSize.y > 0.0) * max(0.0, 3.0 - scaledHeight) * 0.003; - - barycentric = vec2(rectSize.x > 0.0 ? 1.0 : 0.0, rectSize.y > 0.0 ? 1.0 : 0.0); - color = vertexColor.rgb; - float selected = min(1.0, abs(selectionId - selectedItem)); - edgeColor = mix(selectionColor.rgb, vertexColor.rgb, selected); - gl_Position.z += mix(0.0, (shift + 0.0015) / 10.0, selected); - gl_Position.w = 1.0; -} diff --git a/src/libs/tracing/runscenegraphtest.cpp b/src/libs/tracing/runscenegraphtest.cpp index 5b405535130..9d634345bcf 100644 --- a/src/libs/tracing/runscenegraphtest.cpp +++ b/src/libs/tracing/runscenegraphtest.cpp @@ -30,26 +30,12 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#include -#endif // < Qt 6 - namespace Timeline { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -static void renderMessageHandler(QtMsgType type, const QMessageLogContext &context, - const QString &message) -{ - if (type > QtDebugMsg) - QTest::qFail(message.toLatin1().constData(), context.file, context.line); - else - QTest::qWarn(message.toLatin1().constData(), context.file, context.line); -} -#endif // < Qt 6 - void runSceneGraphTest(QSGNode *node) { + Q_UNUSED(node) + QSurfaceFormat format; format.setStencilBufferSize(8); format.setDepthBufferSize(24); @@ -64,26 +50,6 @@ void runSceneGraphTest(QSGNode *node) QVERIFY(context.makeCurrent(&surface)); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGEngine engine; - QSGRootNode root; - root.appendChildNode(node); - engine.initialize(&context); - - QSGAbstractRenderer *renderer = engine.createRenderer(); - QVERIFY(renderer != 0); - renderer->setRootNode(&root); - QtMessageHandler originalHandler = qInstallMessageHandler(renderMessageHandler); - renderer->renderScene(); - qInstallMessageHandler(originalHandler); - delete renderer; - - // Unfortunately we cannot check the results of the rendering. But at least we know the shaders - // have not crashed here. -#else - Q_UNUSED(node) -#endif // < Qt 6 - context.doneCurrent(); } diff --git a/src/libs/tracing/timelineformattime.cpp b/src/libs/tracing/timelineformattime.cpp index a01d0e0bc8b..280046565e5 100644 --- a/src/libs/tracing/timelineformattime.cpp +++ b/src/libs/tracing/timelineformattime.cpp @@ -86,14 +86,4 @@ QString formatTime(qint64 timestamp, qint64 reference) } } -void TimeFormatter::setupTimeFormatter() -{ -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - static const int typeIndex = qmlRegisterSingletonType( - "QtCreator.Tracing", 1, 0, "TimeFormatter", - [](QQmlEngine *, QJSEngine *){ return new TimeFormatter; }); - Q_UNUSED(typeIndex) -#endif // Qt < 6.2 -} - } diff --git a/src/libs/tracing/timelineformattime.h b/src/libs/tracing/timelineformattime.h index 60f1e38d5b5..5a32cec5151 100644 --- a/src/libs/tracing/timelineformattime.h +++ b/src/libs/tracing/timelineformattime.h @@ -36,18 +36,14 @@ QString TRACING_EXPORT formatTime(qint64 timestamp, class TRACING_EXPORT TimeFormatter : public QObject { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ELEMENT QML_SINGLETON -#endif // Qt >= 6.2 public: Q_INVOKABLE QString format(qint64 timestamp, qint64 reference) { return formatTime(timestamp, reference); } - - static void setupTimeFormatter(); }; } diff --git a/src/libs/tracing/timelineitemsrenderpass.h b/src/libs/tracing/timelineitemsrenderpass.h index 9d52be9ac71..699f7e02592 100644 --- a/src/libs/tracing/timelineitemsrenderpass.h +++ b/src/libs/tracing/timelineitemsrenderpass.h @@ -45,11 +45,7 @@ public: void setSelectionColor(QColor selectionColor); QSGMaterialType *type() const override; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGMaterialShader *createShader() const override; -#else QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override; -#endif // < Qt 6 private: QVector2D m_scale; diff --git a/src/libs/tracing/timelinemodel.h b/src/libs/tracing/timelinemodel.h index e9543c16966..1778e8b768c 100644 --- a/src/libs/tracing/timelinemodel.h +++ b/src/libs/tracing/timelinemodel.h @@ -54,9 +54,7 @@ class TRACING_EXPORT TimelineModel : public QObject Q_PROPERTY(QVariantList labels READ labels NOTIFY labelsChanged) Q_PROPERTY(int count READ count NOTIFY contentChanged) Q_PROPERTY(int defaultRowHeight READ defaultRowHeight CONSTANT) -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ANONYMOUS -#endif // Qt >= 6.2 public: class TimelineModelPrivate; diff --git a/src/libs/tracing/timelinenotesmodel.h b/src/libs/tracing/timelinenotesmodel.h index 07ddde822c6..0ce6f4d51b0 100644 --- a/src/libs/tracing/timelinenotesmodel.h +++ b/src/libs/tracing/timelinenotesmodel.h @@ -36,9 +36,7 @@ class TRACING_EXPORT TimelineNotesModel : public QObject { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY changed) -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ANONYMOUS -#endif // Qt >= 6.2 public: TimelineNotesModel(QObject *parent = nullptr); diff --git a/src/libs/tracing/timelinenotesrenderpass.cpp b/src/libs/tracing/timelinenotesrenderpass.cpp index bdedb595fc4..fc800207bca 100644 --- a/src/libs/tracing/timelinenotesrenderpass.cpp +++ b/src/libs/tracing/timelinenotesrenderpass.cpp @@ -41,11 +41,7 @@ class NotesMaterial : public QSGMaterial { public: QSGMaterialType *type() const final; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGMaterialShader *createShader() const final; -#else // < Qt 6 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const final; -#endif // < Qt 6 }; struct NotesGeometry @@ -180,9 +176,9 @@ TimelineNotesRenderPassState::TimelineNotesRenderPassState(int numExpandedRows) m_material.setFlag(QSGMaterial::Blending, true); #if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) m_material.setFlag(QSGMaterial::NoBatching, true); -#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#else m_material.setFlag(QSGMaterial::CustomCompileStep, true); -#endif // >= Qt 6.3/6.0 +#endif // >= Qt 6.3 m_expandedRows.reserve(numExpandedRows); for (int i = 0; i < numExpandedRows; ++i) m_expandedRows << createNode(); @@ -234,34 +230,14 @@ class NotesMaterialShader : public QSGMaterialShader public: NotesMaterialShader(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void updateState(const RenderState &state, QSGMaterial *newEffect, - QSGMaterial *oldEffect) override; - char const *const *attributeNames() const override; -#else // < Qt 6 bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override; -#endif // < Qt 6 - -private: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void initialize() override; - - int m_matrix_id; - int m_z_range_id; - int m_color_id; -#endif // < Qt 6 }; NotesMaterialShader::NotesMaterialShader() : QSGMaterialShader() { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/QtCreator/Tracing/notes.vert")); - setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/QtCreator/Tracing/notes.frag")); -#else // < Qt 6 setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes_qt6.vert.qsb"); setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes_qt6.frag.qsb"); -#endif // < Qt 6 } static QColor notesColor() @@ -271,16 +247,6 @@ static QColor notesColor() : QColor(255, 165, 0); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -void NotesMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *) -{ - if (state.isMatrixDirty()) { - program()->setUniformValue(m_matrix_id, state.combinedMatrix()); - program()->setUniformValue(m_z_range_id, GLfloat(1.0)); - program()->setUniformValue(m_color_id, notesColor()); - } -} -#else // < Qt 6 bool NotesMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) { QByteArray *buf = state.uniformData(); @@ -298,22 +264,6 @@ bool NotesMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, Q return true; } -#endif // < Qt 6 - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -char const *const *NotesMaterialShader::attributeNames() const -{ - static const char *const attr[] = {"vertexCoord", "distanceFromTop", nullptr}; - return attr; -} - -void NotesMaterialShader::initialize() -{ - m_matrix_id = program()->uniformLocation("matrix"); - m_z_range_id = program()->uniformLocation("_qt_zRange"); - m_color_id = program()->uniformLocation("notesColor"); -} -#endif // < Qt 6 QSGMaterialType *NotesMaterial::type() const { @@ -321,11 +271,7 @@ QSGMaterialType *NotesMaterial::type() const return &type; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -QSGMaterialShader *NotesMaterial::createShader() const -#else // < Qt 6 QSGMaterialShader *NotesMaterial::createShader(QSGRendererInterface::RenderMode) const -#endif // < Qt 6 { return new NotesMaterialShader; } diff --git a/src/libs/tracing/timelineoverviewrenderer.h b/src/libs/tracing/timelineoverviewrenderer.h index 119b691e1b5..184dacc9f31 100644 --- a/src/libs/tracing/timelineoverviewrenderer.h +++ b/src/libs/tracing/timelineoverviewrenderer.h @@ -32,9 +32,7 @@ namespace Timeline { class TRACING_EXPORT TimelineOverviewRenderer : public TimelineAbstractRenderer { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ELEMENT -#endif // Qt >= 6.2 public: TimelineOverviewRenderer(QQuickItem *parent = nullptr); diff --git a/src/libs/tracing/timelinerenderer.h b/src/libs/tracing/timelinerenderer.h index bf64d1cd2e5..7a8c4812738 100644 --- a/src/libs/tracing/timelinerenderer.h +++ b/src/libs/tracing/timelinerenderer.h @@ -38,9 +38,7 @@ namespace Timeline { class TRACING_EXPORT TimelineRenderer : public TimelineAbstractRenderer { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ELEMENT -#endif // Qt >= 6.2 public: explicit TimelineRenderer(QQuickItem *parent = nullptr); diff --git a/src/libs/tracing/timelinetheme.cpp b/src/libs/tracing/timelinetheme.cpp index 13b185e6f0f..9772fd93e47 100644 --- a/src/libs/tracing/timelinetheme.cpp +++ b/src/libs/tracing/timelinetheme.cpp @@ -107,12 +107,6 @@ TimelineTheme::TimelineTheme(QObject *parent) void TimelineTheme::setupTheme(QQmlEngine *engine) { -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - static const int typeIndex = qmlRegisterSingletonType( - "QtCreator.Tracing", 1, 0, "Theme", - [](QQmlEngine *, QJSEngine *){ return Utils::proxyTheme(); }); - Q_UNUSED(typeIndex) -#endif // Qt < 6.2 engine->addImageProvider(QLatin1String("icons"), new TimelineImageIconProvider); } diff --git a/src/libs/tracing/timelinetheme.h b/src/libs/tracing/timelinetheme.h index 54155419976..a82b9f1929e 100644 --- a/src/libs/tracing/timelinetheme.h +++ b/src/libs/tracing/timelinetheme.h @@ -37,10 +37,8 @@ namespace Timeline { class TRACING_EXPORT TimelineTheme : public Utils::Theme { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_NAMED_ELEMENT(Theme) QML_SINGLETON -#endif // Qt >= 6.2 public: explicit TimelineTheme(QObject *parent = nullptr); diff --git a/src/libs/tracing/timelinezoomcontrol.h b/src/libs/tracing/timelinezoomcontrol.h index 2aab624b7af..195283e0433 100644 --- a/src/libs/tracing/timelinezoomcontrol.h +++ b/src/libs/tracing/timelinezoomcontrol.h @@ -56,9 +56,7 @@ class TRACING_EXPORT TimelineZoomControl : public QObject { Q_PROPERTY(qint64 maximumZoomFactor READ maximumZoomFactor CONSTANT) Q_PROPERTY(qint64 minimumRangeLength READ minimumRangeLength CONSTANT) -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ANONYMOUS -#endif // Qt >= 6.2 public: qint64 maximumZoomFactor() const { return 1 << 10; } diff --git a/src/libs/tracing/tracing.qbs b/src/libs/tracing/tracing.qbs index 0a3527503b3..34348b7d307 100644 --- a/src/libs/tracing/tracing.qbs +++ b/src/libs/tracing/tracing.qbs @@ -40,9 +40,10 @@ Project { } Group { - name: "QML" - prefix: "qml/" - files: ["tracing.qrc"] + name: "Qml Files" + Qt.core.resourcePrefix: "QtCreator/Tracing/" + fileTags: "qt.core.resource_data" + files: "qml/**" } Group { diff --git a/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp b/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp index f108999e595..9485c330a73 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp @@ -43,16 +43,6 @@ CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerToo : QQuickWidget(parent) { setObjectName(QLatin1String("CtfVisualizerTraceView")); - -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "TimelineRenderer"); - qmlRegisterType("QtCreator.Tracing", 1, 0, - "TimelineOverviewRenderer"); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); -#endif // Qt < 6.2 - setResizeMode(QQuickWidget::SizeRootObjectToView); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -60,7 +50,6 @@ CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerToo setMinimumHeight(170); Timeline::TimelineTheme::setupTheme(engine()); - Timeline::TimeFormatter::setupTimeFormatter(); rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"), tool->modelAggregator()); diff --git a/src/plugins/perfprofiler/CMakeLists.txt b/src/plugins/perfprofiler/CMakeLists.txt index c6e902eb592..83ee5a28d96 100644 --- a/src/plugins/perfprofiler/CMakeLists.txt +++ b/src/plugins/perfprofiler/CMakeLists.txt @@ -39,40 +39,29 @@ set(PERFPROFILER_CPP_SOURCES perftracepointdialog.cpp perftracepointdialog.h perftracepointdialog.ui ) -if(${Qt5_VERSION} VERSION_LESS "6.2.0") - add_qtc_plugin(PerfProfiler - DEPENDS Tracing Qt5::QuickWidgets - PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport - SOURCES - ${TEST_SOURCES} - ${PERFPROFILER_CPP_SOURCES} - perfprofiler.qrc - ) -else() # < Qt 6.2 - add_qtc_plugin(PerfProfiler - CONDITION TARGET Tracing - DEPENDS Tracing Qt5::QuickWidgets - PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport - SOURCES - ${TEST_SOURCES} - ) +add_qtc_plugin(PerfProfiler + CONDITION TARGET Tracing + DEPENDS Tracing Qt5::QuickWidgets + PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport + SOURCES + ${TEST_SOURCES} +) - if (NOT TARGET PerfProfiler) - return() - endif() +if (NOT TARGET PerfProfiler) + return() +endif() - qt_add_resources(PerfProfiler perfprofiler - PREFIX "/perfprofiler" - tracepoints.sh - ) +qt_add_resources(PerfProfiler perfprofiler + PREFIX "/perfprofiler" + tracepoints.sh +) - qt_add_qml_module(PerfProfiler - URI "QtCreator.PerfProfiler" - VERSION "1.0" - NO_PLUGIN - QML_FILES - PerfProfilerFlameGraphView.qml - SOURCES - ${PERFPROFILER_CPP_SOURCES} - ) -endif() # < Qt 6.2 +qt_add_qml_module(PerfProfiler + URI "QtCreator.PerfProfiler" + VERSION "1.0" + NO_PLUGIN + QML_FILES + PerfProfilerFlameGraphView.qml + SOURCES + ${PERFPROFILER_CPP_SOURCES} +) diff --git a/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml b/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml index 4a3a5ae43b1..ae21398d934 100644 --- a/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml +++ b/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtCreator.PerfProfiler 1.0 +import QtCreator.PerfProfiler import "../Tracing" // TODO: Turn into module import when possible FlameGraphView { diff --git a/src/plugins/perfprofiler/perfprofiler.qbs b/src/plugins/perfprofiler/perfprofiler.qbs index 57c1aaecb89..26781ceec20 100644 --- a/src/plugins/perfprofiler/perfprofiler.qbs +++ b/src/plugins/perfprofiler/perfprofiler.qbs @@ -70,6 +70,13 @@ QtcPlugin { "perfprofiler.qrc", ] + Group { + name: "Qml Files" + Qt.core.resourcePrefix: "QtCreator/PerfProfiler/" + fileTags: "qt.core.resource_data" + files: [ "PerfProfilerFlameGraphView.qml" ] + } + Group { name: "Unit tests" condition: qtc.testsEnabled diff --git a/src/plugins/perfprofiler/perfprofiler.qrc b/src/plugins/perfprofiler/perfprofiler.qrc index 803828dbb2d..b5516d589df 100644 --- a/src/plugins/perfprofiler/perfprofiler.qrc +++ b/src/plugins/perfprofiler/perfprofiler.qrc @@ -2,7 +2,4 @@ tracepoints.sh - - PerfProfilerFlameGraphView.qml - diff --git a/src/plugins/perfprofiler/perfprofilerflamegraphmodel.h b/src/plugins/perfprofiler/perfprofilerflamegraphmodel.h index ec5595ea252..885bea96d0a 100644 --- a/src/plugins/perfprofiler/perfprofilerflamegraphmodel.h +++ b/src/plugins/perfprofiler/perfprofilerflamegraphmodel.h @@ -39,10 +39,8 @@ class PerfProfilerFlameGraphData; class PerfProfilerFlameGraphModel : public QAbstractItemModel { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ELEMENT QML_UNCREATABLE("use the context property") -#endif // Qt >= 6.2 Q_DISABLE_COPY(PerfProfilerFlameGraphModel); public: PerfProfilerFlameGraphModel(PerfProfilerFlameGraphModel &&) = delete; diff --git a/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp b/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp index d7082bd8b0a..7302fc05e88 100644 --- a/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp +++ b/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp @@ -45,13 +45,6 @@ PerfProfilerFlameGraphView::PerfProfilerFlameGraphView(QWidget *parent, PerfProf PerfProfilerTraceManager *manager = tool->traceManager(); m_model = new PerfProfilerFlameGraphModel(manager); -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "FlameGraph"); - qmlRegisterUncreatableType( - "QtCreator.PerfProfiler", 1, 0, "PerfProfilerFlameGraphModel", - QLatin1String("use the context property")); -#endif // Qt < 6.2 - Timeline::TimelineTheme::setupTheme(engine()); rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model); diff --git a/src/plugins/perfprofiler/perfprofilertraceview.cpp b/src/plugins/perfprofiler/perfprofilertraceview.cpp index a330b6eb9a9..bbeba04ff5d 100644 --- a/src/plugins/perfprofiler/perfprofilertraceview.cpp +++ b/src/plugins/perfprofiler/perfprofilertraceview.cpp @@ -41,16 +41,6 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool * : QQuickWidget(parent) { setObjectName(QLatin1String("PerfProfilerTraceView")); - -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "TimelineRenderer"); - qmlRegisterType("QtCreator.Tracing", 1, 0, - "TimelineOverviewRenderer"); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); -#endif // Qt < 6.2 - setResizeMode(QQuickWidget::SizeRootObjectToView); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -58,7 +48,6 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool * setMinimumHeight(170); Timeline::TimelineTheme::setupTheme(engine()); - Timeline::TimeFormatter::setupTimeFormatter(); rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"), tool->modelManager()); @@ -76,11 +65,7 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool * bool PerfProfilerTraceView::isUsable() const { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - return quickWindow()->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL; -#else return QSGRendererInterface::isApiRhiBased(quickWindow()->rendererInterface()->graphicsApi()); -#endif } void PerfProfilerTraceView::selectByTypeId(int typeId) diff --git a/src/plugins/qmlprofiler/CMakeLists.txt b/src/plugins/qmlprofiler/CMakeLists.txt index f8a1b214d8a..77df814dd55 100644 --- a/src/plugins/qmlprofiler/CMakeLists.txt +++ b/src/plugins/qmlprofiler/CMakeLists.txt @@ -71,59 +71,48 @@ set(QMLPROFILER_CPP_SOURCES quick3dmodel.cpp quick3dmodel.h ) -if(${Qt5_VERSION} VERSION_LESS "6.2.0") - add_qtc_plugin(QmlProfiler - DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets Utils - PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor - SOURCES - ${TEST_SOURCES} - ${QMLPROFILER_CPP_SOURCES} - qml/qmlprofiler.qrc - ) -else() # < Qt 6.2 - find_package(Qt6 COMPONENTS ShaderTools QUIET) +find_package(Qt6 COMPONENTS ShaderTools QUIET) - add_qtc_plugin(QmlProfiler - CONDITION TARGET Tracing AND TARGET Qt6::ShaderTools - DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets - PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor - SOURCES - ${TEST_SOURCES} - ) +add_qtc_plugin(QmlProfiler + CONDITION TARGET Tracing AND TARGET Qt6::ShaderTools + DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets + PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor + SOURCES + ${TEST_SOURCES} +) - if (NOT TARGET QmlProfiler) - return() - endif() +if (NOT TARGET QmlProfiler) + return() +endif() - set(QMLPROFILER_QML_FILES - qml/QmlProfilerFlameGraphView.qml - ) +set(QMLPROFILER_QML_FILES + qml/QmlProfilerFlameGraphView.qml +) - foreach(file IN LISTS QMLPROFILER_QML_FILES) - get_filename_component(fileName "${file}" NAME) - set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}") - endforeach() +foreach(file IN LISTS QMLPROFILER_QML_FILES) + get_filename_component(fileName "${file}" NAME) + set_source_files_properties("${file}" PROPERTIES QT_RESOURCE_ALIAS "${fileName}") +endforeach() - qt_add_shaders(QmlProfiler "res_qmlprofilershaders" - BATCHABLE - PREFIX - "/QtCreator/QmlProfiler" - BASE - "qml" - FILES - qml/bindingloops_qt6.frag - qml/bindingloops_qt6.vert - ) +qt_add_shaders(QmlProfiler "res_qmlprofilershaders" + BATCHABLE + PREFIX + "/QtCreator/QmlProfiler" + BASE + "qml" + FILES + qml/bindingloops_qt6.frag + qml/bindingloops_qt6.vert +) - qt_add_qml_module(QmlProfiler - URI "QtCreator.QmlProfiler" - VERSION "1.0" - NO_PLUGIN - QML_FILES - ${QMLPROFILER_QML_FILES} - RESOURCES - ${QMLPROFILER_QML_RESOURCES} - SOURCES - ${QMLPROFILER_CPP_SOURCES} - ) -endif() # < Qt 6.2 +qt_add_qml_module(QmlProfiler + URI "QtCreator.QmlProfiler" + VERSION "1.0" + NO_PLUGIN + QML_FILES + ${QMLPROFILER_QML_FILES} + RESOURCES + ${QMLPROFILER_QML_RESOURCES} + SOURCES + ${QMLPROFILER_CPP_SOURCES} +) diff --git a/src/plugins/qmlprofiler/flamegraphmodel.h b/src/plugins/qmlprofiler/flamegraphmodel.h index 3e536bf2200..64ee3d4ffc2 100644 --- a/src/plugins/qmlprofiler/flamegraphmodel.h +++ b/src/plugins/qmlprofiler/flamegraphmodel.h @@ -55,10 +55,8 @@ struct FlameGraphData { class FlameGraphModel : public QAbstractItemModel { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_NAMED_ELEMENT(QmlProfilerFlameGraphModel) QML_UNCREATABLE("use the context property") -#endif // Qt >= 6.2 public: enum Role { TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string diff --git a/src/plugins/qmlprofiler/flamegraphview.cpp b/src/plugins/qmlprofiler/flamegraphview.cpp index 19d81c9721a..9119d987ebd 100644 --- a/src/plugins/qmlprofiler/flamegraphview.cpp +++ b/src/plugins/qmlprofiler/flamegraphview.cpp @@ -46,13 +46,6 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent setObjectName("QmlProfiler.FlameGraph.Dock"); setWindowTitle(tr("Flame Graph")); -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "FlameGraph"); - qmlRegisterUncreatableType("QtCreator.QmlProfiler", 1, 0, - "QmlProfilerFlameGraphModel", - QLatin1String("use the context property")); -#endif // Qt < 6.2 - Timeline::TimelineTheme::setupTheme(m_content->engine()); m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model); diff --git a/src/plugins/qmlprofiler/inputeventsmodel.cpp b/src/plugins/qmlprofiler/inputeventsmodel.cpp index 5e2b7cb7652..fb991db96bf 100644 --- a/src/plugins/qmlprofiler/inputeventsmodel.cpp +++ b/src/plugins/qmlprofiler/inputeventsmodel.cpp @@ -72,12 +72,7 @@ QVariantList InputEventsModel::labels() const QMetaEnum InputEventsModel::metaEnum(const char *name) { - return -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - staticQtMetaObject.enumerator(staticQtMetaObject.indexOfEnumerator(name)); -#else // < Qt 6 - Qt::staticMetaObject.enumerator(Qt::staticMetaObject.indexOfEnumerator(name)); -#endif // < Qt 6 + return Qt::staticMetaObject.enumerator(Qt::staticMetaObject.indexOfEnumerator(name)); } QVariantMap InputEventsModel::details(int index) const diff --git a/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml b/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml index 1fd1a3ca538..ab7ad9e3f99 100644 --- a/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml +++ b/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtCreator.QmlProfiler 1.0 +import QtCreator.QmlProfiler import "../Tracing" // TODO: Turn into module import when possible FlameGraphView { diff --git a/src/plugins/qmlprofiler/qml/bindingloops.frag b/src/plugins/qmlprofiler/qml/bindingloops.frag deleted file mode 100644 index 7d1e2d7f0e5..00000000000 --- a/src/plugins/qmlprofiler/qml/bindingloops.frag +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -varying lowp vec4 color; - -void main() -{ - gl_FragColor = color; -} diff --git a/src/plugins/qmlprofiler/qml/bindingloops.vert b/src/plugins/qmlprofiler/qml/bindingloops.vert deleted file mode 100644 index a985ef23d05..00000000000 --- a/src/plugins/qmlprofiler/qml/bindingloops.vert +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -attribute vec4 vertexCoord; -attribute vec2 postScaleOffset; - -uniform mat4 matrix; -uniform vec4 bindingLoopsColor; - -varying vec4 color; - -void main() -{ - gl_Position = matrix * vertexCoord; - gl_Position.x += postScaleOffset.x * 0.005; - gl_Position.y += postScaleOffset.y * 0.01; - gl_Position.z -= 0.1; - gl_Position.w = 1.0; - color = bindingLoopsColor; -} diff --git a/src/plugins/qmlprofiler/qml/qmlprofiler.qrc b/src/plugins/qmlprofiler/qml/qmlprofiler.qrc deleted file mode 100644 index e3582b44eb6..00000000000 --- a/src/plugins/qmlprofiler/qml/qmlprofiler.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - bindingloops.vert - bindingloops.frag - QmlProfilerFlameGraphView.qml - - diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 8b4b389a445..49c15fd4d6c 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -65,9 +65,10 @@ QtcPlugin { } Group { - name: "QML" - prefix: "qml/" - files: ["qmlprofiler.qrc"] + name: "Qml Files" + Qt.core.resourcePrefix: "QtCreator/QmlProfiler/" + fileTags: "qt.core.resource_data" + files: "qml/**" } Group { diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp index b713acbf47e..440b599dbae 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp @@ -34,11 +34,7 @@ namespace Internal { class BindingLoopMaterial : public QSGMaterial { public: QSGMaterialType *type() const override; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGMaterialShader *createShader() const override; -#else QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override; -#endif // < Qt 6 BindingLoopMaterial(); }; @@ -299,36 +295,14 @@ class BindingLoopMaterialShader : public QSGMaterialShader public: BindingLoopMaterialShader(); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void updateState(const RenderState &state, QSGMaterial *newEffect, - QSGMaterial *oldEffect) override; - char const *const *attributeNames() const override; -#else // < Qt 6 bool updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) override; -#endif // < Qt 6 - -private: -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void initialize() override; - - int m_matrix_id = 0; - int m_z_range_id = 0; - int m_color_id = 0; -#endif // < Qt 6 }; BindingLoopMaterialShader::BindingLoopMaterialShader() : QSGMaterialShader() { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - setShaderSourceFile(QOpenGLShader::Vertex, - QStringLiteral(":/QtCreator/QmlProfiler/bindingloops.vert")); - setShaderSourceFile(QOpenGLShader::Fragment, - QStringLiteral(":/QtCreator/QmlProfiler/bindingloops.frag")); -#else // < Qt 6 setShaderFileName(VertexStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.vert.qsb"); setShaderFileName(FragmentStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.frag.qsb"); -#endif // < Qt 6 } static QColor bindingLoopsColor() @@ -336,16 +310,6 @@ static QColor bindingLoopsColor() return Utils::creatorTheme()->color(Utils::Theme::Timeline_HighlightColor); } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -void BindingLoopMaterialShader::updateState(const RenderState &state, QSGMaterial *, QSGMaterial *) -{ - if (state.isMatrixDirty()) { - program()->setUniformValue(m_matrix_id, state.combinedMatrix()); - program()->setUniformValue(m_z_range_id, GLfloat(1.0)); - program()->setUniformValue(m_color_id, bindingLoopsColor()); - } -} -#else // < Qt 6 bool BindingLoopMaterialShader::updateUniformData(RenderState &state, QSGMaterial *, QSGMaterial *) { QByteArray *buf = state.uniformData(); @@ -363,31 +327,15 @@ bool BindingLoopMaterialShader::updateUniformData(RenderState &state, QSGMateria return true; } -#endif // < Qt 6 - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -char const *const *BindingLoopMaterialShader::attributeNames() const -{ - static const char *const attr[] = {"vertexCoord", "postScaleOffset", nullptr}; - return attr; -} - -void BindingLoopMaterialShader::initialize() -{ - m_matrix_id = program()->uniformLocation("matrix"); - m_z_range_id = program()->uniformLocation("_qt_zRange"); - m_color_id = program()->uniformLocation("bindingLoopsColor"); -} -#endif // < Qt 6 BindingLoopMaterial::BindingLoopMaterial() { setFlag(QSGMaterial::Blending, false); #if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) setFlag(QSGMaterial::NoBatching, true); -#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#else setFlag(QSGMaterial::CustomCompileStep, true); -#endif // >= Qt 6.3/6.0 +#endif // >= Qt 6.3 } QSGMaterialType *BindingLoopMaterial::type() const @@ -396,11 +344,7 @@ QSGMaterialType *BindingLoopMaterial::type() const return &type; } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -QSGMaterialShader *BindingLoopMaterial::createShader() const -#else // < Qt 6 QSGMaterialShader *BindingLoopMaterial::createShader(QSGRendererInterface::RenderMode) const -#endif // < Qt 6 { return new BindingLoopMaterialShader; } diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index 939254620ad..4a9c97da2ee 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -123,15 +123,6 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag groupLayout->setContentsMargins(0, 0, 0, 0); groupLayout->setSpacing(0); -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "TimelineRenderer"); - qmlRegisterType("QtCreator.Tracing", 1, 0, - "TimelineOverviewRenderer"); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); -#endif // Qt < 6.2 - d->m_mainView = new QQuickWidget(this); d->m_mainView->setResizeMode(QQuickWidget::SizeRootObjectToView); d->m_mainView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -169,7 +160,6 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag setMinimumHeight(170); Timeline::TimelineTheme::setupTheme(d->m_mainView->engine()); - Timeline::TimeFormatter::setupTimeFormatter(); d->m_mainView->rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"), d->m_modelProxy); @@ -298,12 +288,9 @@ void QmlProfilerTraceView::showContextMenu(QPoint position) bool QmlProfilerTraceView::isUsable() const { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - return d->m_mainView->quickWindow()->rendererInterface()->graphicsApi() - == QSGRendererInterface::OpenGL; -#else - return QSGRendererInterface::isApiRhiBased(d->m_mainView->quickWindow()->rendererInterface()->graphicsApi()); -#endif + const QSGRendererInterface::GraphicsApi api = + d->m_mainView->quickWindow()->rendererInterface()->graphicsApi(); + return QSGRendererInterface::isApiRhiBased(api); } bool QmlProfilerTraceView::isSuspended() const diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp index 642720f34b0..a6c5ae006aa 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp @@ -119,18 +119,10 @@ void QmlProfilerBindingLoopsRenderPassTest::testUpdate() QCOMPARE(node->geometry()->vertexCount(), 7 * 18); QVERIFY(material2 != nullptr); QCOMPARE(material1->type(), material2->type()); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGMaterialShader *shader1 = material1->createShader(); - QVERIFY(shader1 != nullptr); - QSGMaterialShader *shader2 = material2->createShader(); - QVERIFY(shader2 != nullptr); - QCOMPARE(shader1->attributeNames(), shader2->attributeNames()); -#else // < Qt 6 QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D); QVERIFY(shader1 != 0); QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D); QVERIFY(shader2 != 0); -#endif // < Qt 6 delete shader1; delete shader2; diff --git a/tests/auto/tracing/flamegraphview/CMakeLists.txt b/tests/auto/tracing/flamegraphview/CMakeLists.txt index e34941bd636..53f00ffa118 100644 --- a/tests/auto/tracing/flamegraphview/CMakeLists.txt +++ b/tests/auto/tracing/flamegraphview/CMakeLists.txt @@ -3,31 +3,21 @@ set(TSTFLAMEGRAPHVIEW_CPP_SOURCES tst_flamegraphview.cpp ) -if(${Qt5_VERSION} VERSION_LESS "6.2.0") - add_qtc_test(tst_tracing_flamegraphview - EXCLUDE_FROM_PRECHECK - DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils - SOURCES - ${TSTFLAMEGRAPHVIEW_CPP_SOURCES} - flamegraphview.qrc - ) -else() # < Qt 6.2 - add_qtc_test(tst_tracing_flamegraphview - EXCLUDE_FROM_PRECHECK - DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils - ) +add_qtc_test(tst_tracing_flamegraphview + EXCLUDE_FROM_PRECHECK + DEPENDS Tracing Qt5::QuickWidgets Qt5::Quick Utils +) - if (NOT TARGET tst_tracing_flamegraphview) # qt_add_qml_module has no DEPENDS check - return() - endif() +if (NOT TARGET tst_tracing_flamegraphview) # qt_add_qml_module has no DEPENDS check + return() +endif() - qt_add_qml_module(tst_tracing_flamegraphview - URI "QtCreator.TstTracingFlameGraphView" - VERSION "1.0" - NO_PLUGIN - QML_FILES - TestFlameGraphView.qml - SOURCES - ${TSTFLAMEGRAPHVIEW_CPP_SOURCES} - ) -endif() # < Qt 6.2 +qt_add_qml_module(tst_tracing_flamegraphview + URI "QtCreator.TstTracingFlameGraphView" + VERSION "1.0" + NO_PLUGIN + QML_FILES + TestFlameGraphView.qml + SOURCES + ${TSTFLAMEGRAPHVIEW_CPP_SOURCES} +) diff --git a/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml b/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml index f1f2d67ec97..c92c8768942 100644 --- a/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml +++ b/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtCreator.TstTracingFlameGraphView 1.0 +import QtCreator.TstTracingFlameGraphView import "../Tracing" // TODO: Turn into module import when possible FlameGraphView { diff --git a/tests/auto/tracing/flamegraphview/flamegraphview.qbs b/tests/auto/tracing/flamegraphview/flamegraphview.qbs index 711e955014f..97c7fb66436 100644 --- a/tests/auto/tracing/flamegraphview/flamegraphview.qbs +++ b/tests/auto/tracing/flamegraphview/flamegraphview.qbs @@ -11,7 +11,16 @@ TracingAutotest { name: "Test sources" files: [ "testflamegraphmodel.h", - "tst_flamegraphview.cpp", "flamegraphview.qrc" + "tst_flamegraphview.cpp" + ] + } + + Group { + name: "Qml Files" + Qt.core.resourcePrefix: "QtCreator/TstTracingFlameGraphView/" + fileTags: "qt.core.resource_data" + files: [ + "TestFlameGraphView.qml", ] } } diff --git a/tests/auto/tracing/flamegraphview/flamegraphview.qrc b/tests/auto/tracing/flamegraphview/flamegraphview.qrc deleted file mode 100644 index 951c294936e..00000000000 --- a/tests/auto/tracing/flamegraphview/flamegraphview.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - TestFlameGraphView.qml - - diff --git a/tests/auto/tracing/flamegraphview/testflamegraphmodel.h b/tests/auto/tracing/flamegraphview/testflamegraphmodel.h index b383b928f53..25870a94db2 100644 --- a/tests/auto/tracing/flamegraphview/testflamegraphmodel.h +++ b/tests/auto/tracing/flamegraphview/testflamegraphmodel.h @@ -31,10 +31,9 @@ class TestFlameGraphModel : public QStandardItemModel { Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) QML_ELEMENT QML_UNCREATABLE("use the context property") -#endif // Qt >= 6.2 + public: enum Role { TypeIdRole = Qt::UserRole + 1, diff --git a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp index 9e217216870..5f04f199309 100644 --- a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp +++ b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp @@ -72,22 +72,13 @@ private: void tst_FlameGraphView::initMain() { - if (Utils::HostOsInfo::isWindowsHost()) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + if (Utils::HostOsInfo::isWindowsHost()) qputenv("QSG_RHI_BACKEND", "opengl"); -#endif // Qt >= 6.2 - } } void tst_FlameGraphView::initTestCase() { model.fill(); -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "FlameGraph"); - qmlRegisterUncreatableType( - "QtCreator.TstTracingFlameGraphView", 1, 0, "TestFlameGraphModel", - QLatin1String("use the context property")); -#endif // Qt < 6.2 Timeline::TimelineTheme::setupTheme(widget.engine()); diff --git a/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp b/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp index 387e539e337..00970855b9d 100644 --- a/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp +++ b/tests/auto/tracing/timelineitemsrenderpass/tst_timelineitemsrenderpass.cpp @@ -111,18 +111,10 @@ void tst_TimelineItemsRenderPass::update() QCOMPARE(node->geometry()->vertexCount(), 30); QVERIFY(material2 != 0); QCOMPARE(material1->type(), material2->type()); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGMaterialShader *shader1 = material1->createShader(); - QVERIFY(shader1 != 0); - QSGMaterialShader *shader2 = material2->createShader(); - QVERIFY(shader2 != 0); - QCOMPARE(shader1->attributeNames(), shader2->attributeNames()); -#else // < Qt 6 QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D); QVERIFY(shader1 != 0); QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D); QVERIFY(shader2 != 0); -#endif // < Qt 6 delete shader1; delete shader2; diff --git a/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp b/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp index 8700d63dd97..d74b225c4e5 100644 --- a/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp +++ b/tests/auto/tracing/timelinenotesrenderpass/tst_timelinenotesrenderpass.cpp @@ -121,18 +121,10 @@ void tst_TimelineNotesRenderPass::update() QCOMPARE(node->geometry()->vertexCount(), 2); QVERIFY(material2 != 0); QCOMPARE(material1->type(), material2->type()); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QSGMaterialShader *shader1 = material1->createShader(); - QVERIFY(shader1 != 0); - QSGMaterialShader *shader2 = material2->createShader(); - QVERIFY(shader2 != 0); - QCOMPARE(shader1->attributeNames(), shader2->attributeNames()); -#else // < Qt 6 QSGMaterialShader *shader1 = material1->createShader(QSGRendererInterface::RenderMode2D); QVERIFY(shader1 != 0); QSGMaterialShader *shader2 = material2->createShader(QSGRendererInterface::RenderMode2D); QVERIFY(shader2 != 0); -#endif // < Qt 6 delete shader1; delete shader2; diff --git a/tests/auto/tracing/timelinerenderer/tst_timelinerenderer.cpp b/tests/auto/tracing/timelinerenderer/tst_timelinerenderer.cpp index 5fe7fe46950..b6563fbe747 100644 --- a/tests/auto/tracing/timelinerenderer/tst_timelinerenderer.cpp +++ b/tests/auto/tracing/timelinerenderer/tst_timelinerenderer.cpp @@ -94,16 +94,6 @@ void tst_TimelineRenderer::testMouseEvents(DummyRenderer *renderer, int x, int y QHoverEvent hover(QMouseEvent::HoverMove, QPointF(x, y), QPointF(x - 1, y)); renderer->hoverMoveEvent(&hover); - -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - event = QMouseEvent(QMouseEvent::MouseButtonPress, QPointF(x, y), Qt::LeftButton, - Qt::LeftButton, Qt::NoModifier); - renderer->mousePressEvent(&event); - - event = QMouseEvent(QMouseEvent::MouseButtonRelease, QPointF(x, y), Qt::LeftButton, - Qt::LeftButton, Qt::NoModifier); - renderer->mouseReleaseEvent(&event); -#endif // < Qt 6 } void tst_TimelineRenderer::mouseEvents() diff --git a/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp b/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp index ff895a7b385..208fbd48a79 100644 --- a/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp +++ b/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp @@ -125,17 +125,7 @@ public: { setResizeMode(QQuickView::SizeRootObjectToView); -#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0) - qmlRegisterType("QtCreator.Tracing", 1, 0, "TimelineRenderer"); - qmlRegisterType( - "QtCreator.Tracing", 1, 0, "TimelineOverviewRenderer"); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); - qmlRegisterAnonymousType("QtCreator.Tracing", 1); -#endif // Qt < 6.2 - TimelineTheme::setupTheme(engine()); - TimeFormatter::setupTimeFormatter(); m_modelAggregator = new TimelineModelAggregator(this); m_model = new DummyModel(m_modelAggregator); @@ -162,11 +152,6 @@ public: int main(int argc, char *argv[]) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#endif // Qt < 6 - QApplication app(argc, argv); ManualTest::ThemeSelector::setTheme(":/themes/flat.creatortheme");