diff --git a/src/libs/tracing/CMakeLists.txt b/src/libs/tracing/CMakeLists.txt index e109f16bbc3..92e416aa280 100644 --- a/src/libs/tracing/CMakeLists.txt +++ b/src/libs/tracing/CMakeLists.txt @@ -90,7 +90,7 @@ endforeach() qt_add_shaders(Tracing "res_tracingshaders" BATCHABLE PREFIX - "/QtCreator/Tracing" + "/qt/qml/QtCreator/Tracing" BASE "qml" FILES @@ -104,6 +104,7 @@ qt_add_qml_module(Tracing URI "QtCreator.Tracing" VERSION "1.0" NO_PLUGIN + RESOURCE_PREFIX "/qt/qml" DEPENDENCIES QtQuick QML_FILES diff --git a/src/libs/tracing/qml/tracing.qrc b/src/libs/tracing/qml/tracing.qrc index 45d36b933e8..2be3c238edd 100644 --- a/src/libs/tracing/qml/tracing.qrc +++ b/src/libs/tracing/qml/tracing.qrc @@ -1,5 +1,5 @@ - + ButtonsBar.qml CategoryLabel.qml Detail.qml diff --git a/src/libs/tracing/timelineitemsrenderpass.cpp b/src/libs/tracing/timelineitemsrenderpass.cpp index 1a68a8453ea..c17e4458faf 100644 --- a/src/libs/tracing/timelineitemsrenderpass.cpp +++ b/src/libs/tracing/timelineitemsrenderpass.cpp @@ -451,8 +451,8 @@ public: TimelineItemsMaterialShader::TimelineItemsMaterialShader() : QSGMaterialShader() { - setShaderFileName(VertexStage, ":/QtCreator/Tracing/timelineitems_qt6.vert.qsb"); - setShaderFileName(FragmentStage, ":/QtCreator/Tracing/timelineitems_qt6.frag.qsb"); + setShaderFileName(VertexStage, ":/qt/qml/QtCreator/Tracing/timelineitems_qt6.vert.qsb"); + setShaderFileName(FragmentStage, ":/qt/qml/QtCreator/Tracing/timelineitems_qt6.frag.qsb"); } bool TimelineItemsMaterialShader::updateUniformData(RenderState &state, diff --git a/src/libs/tracing/timelinenotesrenderpass.cpp b/src/libs/tracing/timelinenotesrenderpass.cpp index fc800207bca..840473ae8ff 100644 --- a/src/libs/tracing/timelinenotesrenderpass.cpp +++ b/src/libs/tracing/timelinenotesrenderpass.cpp @@ -236,8 +236,8 @@ public: NotesMaterialShader::NotesMaterialShader() : QSGMaterialShader() { - setShaderFileName(VertexStage, ":/QtCreator/Tracing/notes_qt6.vert.qsb"); - setShaderFileName(FragmentStage, ":/QtCreator/Tracing/notes_qt6.frag.qsb"); + setShaderFileName(VertexStage, ":/qt/qml/QtCreator/Tracing/notes_qt6.vert.qsb"); + setShaderFileName(FragmentStage, ":/qt/qml/QtCreator/Tracing/notes_qt6.frag.qsb"); } static QColor notesColor() diff --git a/src/libs/tracing/timelinetheme.cpp b/src/libs/tracing/timelinetheme.cpp index 9772fd93e47..816e53a89c8 100644 --- a/src/libs/tracing/timelinetheme.cpp +++ b/src/libs/tracing/timelinetheme.cpp @@ -69,19 +69,19 @@ public: else if (iconName == "zoom") icon = Icons::ZOOM_TOOLBAR; else if (iconName == "rangeselection") - icon = Icon({{":/QtCreator/Tracing/ico_rangeselection.png", Theme::IconsBaseColor}}); + icon = Icon({{":/qt/qml/QtCreator/Tracing/ico_rangeselection.png", Theme::IconsBaseColor}}); else if (iconName == "rangeselected") - icon = Icon({{":/QtCreator/Tracing/ico_rangeselected.png", Theme::IconsBaseColor}}); + icon = Icon({{":/qt/qml/QtCreator/Tracing/ico_rangeselected.png", Theme::IconsBaseColor}}); else if (iconName == "selectionmode") - icon = Icon({{":/QtCreator/Tracing/ico_selectionmode.png", Theme::IconsBaseColor}}); + icon = Icon({{":/qt/qml/QtCreator/Tracing/ico_selectionmode.png", Theme::IconsBaseColor}}); else if (iconName == "edit") - icon = Icon({{":/QtCreator/Tracing/ico_edit.png", Theme::IconsBaseColor}}); + icon = Icon({{":/qt/qml/QtCreator/Tracing/ico_edit.png", Theme::IconsBaseColor}}); else if (iconName == "lock_open") icon = Icons::UNLOCKED_TOOLBAR; else if (iconName == "lock_closed") icon = Icons::LOCKED_TOOLBAR; else if (iconName == "range_handle") - icon = Icon({{":/QtCreator/Tracing/range_handle.png", Theme::IconsBaseColor}}); + icon = Icon({{":/qt/qml/QtCreator/Tracing/range_handle.png", Theme::IconsBaseColor}}); else if (iconName == "note") icon = Icons::INFO_TOOLBAR; else if (iconName == "split") diff --git a/src/libs/tracing/tracing.qbs b/src/libs/tracing/tracing.qbs index 34348b7d307..50bdb58c01e 100644 --- a/src/libs/tracing/tracing.qbs +++ b/src/libs/tracing/tracing.qbs @@ -41,7 +41,7 @@ Project { Group { name: "Qml Files" - Qt.core.resourcePrefix: "QtCreator/Tracing/" + Qt.core.resourcePrefix: "qt/qml/QtCreator/Tracing/" fileTags: "qt.core.resource_data" files: "qml/**" } diff --git a/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp b/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp index 9485c330a73..feddca4a376 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertraceview.cpp @@ -34,7 +34,7 @@ #include #include - +#include namespace CtfVisualizer { namespace Internal { @@ -49,13 +49,14 @@ CtfVisualizerTraceView::CtfVisualizerTraceView(QWidget *parent, CtfVisualizerToo // Minimum height: 5 rows of 20 pixels + scrollbar of 50 pixels + 20 pixels margin setMinimumHeight(170); + engine()->addImportPath(":/qt/qml/"); Timeline::TimelineTheme::setupTheme(engine()); rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"), tool->modelAggregator()); rootContext()->setContextProperty(QLatin1String("zoomControl"), tool->zoomControl()); - setSource(QUrl(QLatin1String("qrc:/QtCreator/Tracing/MainView.qml"))); + setSource(QUrl(QLatin1String("qrc:/qt/qml/QtCreator/Tracing/MainView.qml"))); // Avoid ugly warnings when reading from null properties in QML. connect(tool->modelAggregator(), &QObject::destroyed, this, [this]{ setSource(QUrl()); }); diff --git a/src/plugins/perfprofiler/CMakeLists.txt b/src/plugins/perfprofiler/CMakeLists.txt index 83ee5a28d96..3fd28374b48 100644 --- a/src/plugins/perfprofiler/CMakeLists.txt +++ b/src/plugins/perfprofiler/CMakeLists.txt @@ -60,6 +60,7 @@ qt_add_qml_module(PerfProfiler URI "QtCreator.PerfProfiler" VERSION "1.0" NO_PLUGIN + RESOURCE_PREFIX "/qt/qml" QML_FILES PerfProfilerFlameGraphView.qml SOURCES diff --git a/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml b/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml index ae21398d934..ec1847e9d04 100644 --- a/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml +++ b/src/plugins/perfprofiler/PerfProfilerFlameGraphView.qml @@ -24,7 +24,7 @@ ****************************************************************************/ import QtCreator.PerfProfiler -import "../Tracing" // TODO: Turn into module import when possible +import QtCreator.Tracing FlameGraphView { id: root diff --git a/src/plugins/perfprofiler/perfprofiler.qbs b/src/plugins/perfprofiler/perfprofiler.qbs index 26781ceec20..a136cdbadd8 100644 --- a/src/plugins/perfprofiler/perfprofiler.qbs +++ b/src/plugins/perfprofiler/perfprofiler.qbs @@ -72,7 +72,7 @@ QtcPlugin { Group { name: "Qml Files" - Qt.core.resourcePrefix: "QtCreator/PerfProfiler/" + Qt.core.resourcePrefix: "qt/qml/QtCreator/PerfProfiler/" fileTags: "qt.core.resource_data" files: [ "PerfProfilerFlameGraphView.qml" ] } diff --git a/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp b/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp index 7302fc05e88..32213d27d30 100644 --- a/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp +++ b/src/plugins/perfprofiler/perfprofilerflamegraphview.cpp @@ -33,6 +33,7 @@ #include #include +#include namespace PerfProfiler { namespace Internal { @@ -45,10 +46,12 @@ PerfProfilerFlameGraphView::PerfProfilerFlameGraphView(QWidget *parent, PerfProf PerfProfilerTraceManager *manager = tool->traceManager(); m_model = new PerfProfilerFlameGraphModel(manager); + engine()->addImportPath(":/qt/qml/"); Timeline::TimelineTheme::setupTheme(engine()); rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model); - setSource(QUrl(QStringLiteral("qrc:/QtCreator/PerfProfiler/PerfProfilerFlameGraphView.qml"))); + setSource(QUrl(QStringLiteral( + "qrc:/qt/qml/QtCreator/PerfProfiler/PerfProfilerFlameGraphView.qml"))); setClearColor(Utils::creatorTheme()->color(Utils::Theme::Timeline_BackgroundColor1)); setResizeMode(QQuickWidget::SizeRootObjectToView); diff --git a/src/plugins/perfprofiler/perfprofilertraceview.cpp b/src/plugins/perfprofiler/perfprofilertraceview.cpp index bbeba04ff5d..701c7c2bcea 100644 --- a/src/plugins/perfprofiler/perfprofilertraceview.cpp +++ b/src/plugins/perfprofiler/perfprofilertraceview.cpp @@ -33,6 +33,7 @@ #include #include +#include namespace PerfProfiler { namespace Internal { @@ -47,13 +48,14 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool * // Minimum height: 5 rows of 20 pixels + scrollbar of 50 pixels + 20 pixels margin setMinimumHeight(170); + engine()->addImportPath(":/qt/qml/"); Timeline::TimelineTheme::setupTheme(engine()); rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"), tool->modelManager()); rootContext()->setContextProperty(QLatin1String("zoomControl"), tool->zoomControl()); - setSource(QUrl(QLatin1String("qrc:/QtCreator/Tracing/MainView.qml"))); + setSource(QUrl(QLatin1String("qrc:/qt/qml/QtCreator/Tracing/MainView.qml"))); // Avoid ugly warnings when reading from null properties in QML. connect(tool->modelManager(), &QObject::destroyed, this, [this]{ setSource(QUrl()); }); diff --git a/src/plugins/qmlprofiler/CMakeLists.txt b/src/plugins/qmlprofiler/CMakeLists.txt index 77df814dd55..f0a13b63f0a 100644 --- a/src/plugins/qmlprofiler/CMakeLists.txt +++ b/src/plugins/qmlprofiler/CMakeLists.txt @@ -97,7 +97,7 @@ endforeach() qt_add_shaders(QmlProfiler "res_qmlprofilershaders" BATCHABLE PREFIX - "/QtCreator/QmlProfiler" + "/qt/qml/QtCreator/QmlProfiler" BASE "qml" FILES @@ -109,6 +109,7 @@ qt_add_qml_module(QmlProfiler URI "QtCreator.QmlProfiler" VERSION "1.0" NO_PLUGIN + RESOURCE_PREFIX "/qt/qml" QML_FILES ${QMLPROFILER_QML_FILES} RESOURCES diff --git a/src/plugins/qmlprofiler/flamegraphview.cpp b/src/plugins/qmlprofiler/flamegraphview.cpp index 9119d987ebd..cae14822cba 100644 --- a/src/plugins/qmlprofiler/flamegraphview.cpp +++ b/src/plugins/qmlprofiler/flamegraphview.cpp @@ -46,11 +46,12 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent setObjectName("QmlProfiler.FlameGraph.Dock"); setWindowTitle(tr("Flame Graph")); + m_content->engine()->addImportPath(":/qt/qml/"); Timeline::TimelineTheme::setupTheme(m_content->engine()); m_content->rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), m_model); - m_content->setSource( - QUrl(QStringLiteral("qrc:/QtCreator/QmlProfiler/QmlProfilerFlameGraphView.qml"))); + m_content->setSource(QUrl(QStringLiteral( + "qrc:/qt/qml/QtCreator/QmlProfiler/QmlProfilerFlameGraphView.qml"))); m_content->setClearColor(Utils::creatorTheme()->color(Utils::Theme::Timeline_BackgroundColor1)); m_content->setResizeMode(QQuickWidget::SizeRootObjectToView); diff --git a/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml b/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml index ab7ad9e3f99..8c2b9ce6027 100644 --- a/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml +++ b/src/plugins/qmlprofiler/qml/QmlProfilerFlameGraphView.qml @@ -24,7 +24,7 @@ ****************************************************************************/ import QtCreator.QmlProfiler -import "../Tracing" // TODO: Turn into module import when possible +import QtCreator.Tracing FlameGraphView { id: root diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 49c15fd4d6c..8183b15e678 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -66,7 +66,7 @@ QtcPlugin { Group { name: "Qml Files" - Qt.core.resourcePrefix: "QtCreator/QmlProfiler/" + Qt.core.resourcePrefix: "qt/qml/QtCreator/QmlProfiler/" fileTags: "qt.core.resource_data" files: "qml/**" } diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp index 440b599dbae..d692c35e97b 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp @@ -301,8 +301,8 @@ public: BindingLoopMaterialShader::BindingLoopMaterialShader() : QSGMaterialShader() { - setShaderFileName(VertexStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.vert.qsb"); - setShaderFileName(FragmentStage, ":/QtCreator/QmlProfiler/bindingloops_qt6.frag.qsb"); + setShaderFileName(VertexStage, ":/qt/qml/QtCreator/QmlProfiler/bindingloops_qt6.vert.qsb"); + setShaderFileName(FragmentStage, ":/qt/qml/QtCreator/QmlProfiler/bindingloops_qt6.frag.qsb"); } static QColor bindingLoopsColor() diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index 4a9c97da2ee..be80ff670d8 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -159,13 +160,14 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag // Minimum height: 5 rows of 20 pixels + scrollbar of 50 pixels + 20 pixels margin setMinimumHeight(170); + d->m_mainView->engine()->addImportPath(":/qt/qml/"); Timeline::TimelineTheme::setupTheme(d->m_mainView->engine()); d->m_mainView->rootContext()->setContextProperty(QLatin1String("timelineModelAggregator"), d->m_modelProxy); d->m_mainView->rootContext()->setContextProperty(QLatin1String("zoomControl"), d->m_zoomControl); - d->m_mainView->setSource(QUrl(QLatin1String("qrc:/QtCreator/Tracing/MainView.qml"))); + d->m_mainView->setSource(QUrl(QLatin1String("qrc:/qt/qml/QtCreator/Tracing/MainView.qml"))); connect(d->m_modelProxy, &Timeline::TimelineModelAggregator::updateCursorPosition, this, &QmlProfilerTraceView::updateCursorPosition); diff --git a/tests/auto/tracing/flamegraphview/CMakeLists.txt b/tests/auto/tracing/flamegraphview/CMakeLists.txt index 53f00ffa118..c873e54fa27 100644 --- a/tests/auto/tracing/flamegraphview/CMakeLists.txt +++ b/tests/auto/tracing/flamegraphview/CMakeLists.txt @@ -16,6 +16,7 @@ qt_add_qml_module(tst_tracing_flamegraphview URI "QtCreator.TstTracingFlameGraphView" VERSION "1.0" NO_PLUGIN + RESOURCE_PREFIX "/qt/qml" QML_FILES TestFlameGraphView.qml SOURCES diff --git a/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml b/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml index c92c8768942..2d03af84e07 100644 --- a/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml +++ b/tests/auto/tracing/flamegraphview/TestFlameGraphView.qml @@ -24,7 +24,7 @@ ****************************************************************************/ import QtCreator.TstTracingFlameGraphView -import "../Tracing" // TODO: Turn into module import when possible +import QtCreator.Tracing FlameGraphView { id: root diff --git a/tests/auto/tracing/flamegraphview/flamegraphview.qbs b/tests/auto/tracing/flamegraphview/flamegraphview.qbs index 97c7fb66436..526d518ffae 100644 --- a/tests/auto/tracing/flamegraphview/flamegraphview.qbs +++ b/tests/auto/tracing/flamegraphview/flamegraphview.qbs @@ -17,7 +17,7 @@ TracingAutotest { Group { name: "Qml Files" - Qt.core.resourcePrefix: "QtCreator/TstTracingFlameGraphView/" + Qt.core.resourcePrefix: "qt/qml/QtCreator/TstTracingFlameGraphView/" fileTags: "qt.core.resource_data" files: [ "TestFlameGraphView.qml", diff --git a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp index 5f04f199309..4ceaa48380c 100644 --- a/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp +++ b/tests/auto/tracing/flamegraphview/tst_flamegraphview.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -80,11 +81,12 @@ void tst_FlameGraphView::initTestCase() { model.fill(); + widget.engine()->addImportPath(":/qt/qml/"); Timeline::TimelineTheme::setupTheme(widget.engine()); widget.rootContext()->setContextProperty(QStringLiteral("flameGraphModel"), &model); widget.setSource(QUrl(QStringLiteral( - "qrc:/QtCreator/TstTracingFlameGraphView/TestFlameGraphView.qml"))); + "qrc:/qt/qml/QtCreator/TstTracingFlameGraphView/TestFlameGraphView.qml"))); widget.setResizeMode(QQuickWidget::SizeRootObjectToView); widget.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); diff --git a/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp b/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp index 208fbd48a79..b5c8c510f23 100644 --- a/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp +++ b/tests/manual/widgets/tracing/tst_manual_widgets_tracing.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -125,6 +126,7 @@ public: { setResizeMode(QQuickView::SizeRootObjectToView); + engine()->addImportPath(":/qt/qml/"); TimelineTheme::setupTheme(engine()); m_modelAggregator = new TimelineModelAggregator(this); @@ -137,7 +139,7 @@ public: m_zoomControl = new TimelineZoomControl(this); m_zoomControl->setTrace(0, oneMs * 1000); // Total timeline length rootContext()->setContextProperty("zoomControl", m_zoomControl); - setSource(QUrl(QLatin1String("qrc:/QtCreator/Tracing/MainView.qml"))); + setSource(QUrl(QLatin1String("qrc:/qt/qml/QtCreator/Tracing/MainView.qml"))); // Zoom onto first timeline third. Needs to be done after loading setSource. m_zoomControl->setRange(0, oneMs * 1000 / 3.0);