From 2d635f3fa48c924e7a25f26228c7a7373c70ed3e Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Fri, 14 Nov 2025 03:00:34 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkdeclarative Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: https://github.com/linuxdeepin/dtkdeclarative/pull/549 --- examples/CMakeLists.txt | 2 -- examples/exhibition/main.cpp | 7 ++++--- examples/qml-inspect/main.cpp | 7 ++++--- qt6/src/CMakeLists.txt | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cfbef0d1..38fbb7ea 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,4 @@ -set(CHAMELEON_PATH "${PROJECT_BINARY_DIR}/plugins") add_definitions( - -DCHAMELEON_PATH="${CHAMELEON_PATH}" -DQT_DEPRECATED_WARNINGS ) add_subdirectory(exhibition) diff --git a/examples/exhibition/main.cpp b/examples/exhibition/main.cpp index 37288b32..52a0cd5d 100644 --- a/examples/exhibition/main.cpp +++ b/examples/exhibition/main.cpp @@ -71,16 +71,17 @@ int main(int argc, char **argv) QQmlApplicationEngine engine; - engine.addImportPath(CHAMELEON_PATH); + const QString chameleonPath = QStringLiteral("%1/../../../plugins").arg(QGuiApplication::applicationDirPath()); + engine.addImportPath(chameleonPath); #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QQuickStyle::addStylePath(CHAMELEON_PATH); + QQuickStyle::addStylePath(chameleonPath); // QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); #else // QQuickWindow::setGraphicsApi(QSGRendererInterface::Software); #endif #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG) - QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); + QQuickStyle::setStyle(chameleonPath"/Chameleon"); #else QQuickStyle::setStyle("Chameleon"); #endif diff --git a/examples/qml-inspect/main.cpp b/examples/qml-inspect/main.cpp index b4eff902..2c6fb5c1 100644 --- a/examples/qml-inspect/main.cpp +++ b/examples/qml-inspect/main.cpp @@ -20,16 +20,17 @@ int main(int argc, char *argv[]) QQmlApplicationEngine engine; - engine.addImportPath(CHAMELEON_PATH); + const QString chameleonPath = QStringLiteral("%1/../../../plugins").arg(QGuiApplication::applicationDirPath()); + engine.addImportPath(chameleonPath); #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QQuickStyle::addStylePath(CHAMELEON_PATH); + QQuickStyle::addStylePath(chameleonPath); // QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); #else // QQuickWindow::setGraphicsApi(QSGRendererInterface::Software); #endif #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) && defined(QT_NO_DEBUG) - QQuickStyle::setStyle(CHAMELEON_PATH"/Chameleon"); + QQuickStyle::setStyle(chameleonPath"/Chameleon"); #else QQuickStyle::setStyle("Chameleon"); #endif diff --git a/qt6/src/CMakeLists.txt b/qt6/src/CMakeLists.txt index 4f593e1f..63b82ca3 100644 --- a/qt6/src/CMakeLists.txt +++ b/qt6/src/CMakeLists.txt @@ -87,4 +87,4 @@ install(EXPORT Dtk${DTK_VERSION_MAJOR}DeclarativeTargets NAMESPACE Dtk${DTK_VERS install(FILES ${QM_FILES} DESTINATION "${TRANSLATIONS_INSTALL_PATH}") # Install plugin install(TARGETS ${PLUGIN_NAME} DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}") -install(DIRECTORY "${PLUGIN_OUTPUT_DIR}/${URI_PATH}/" DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}") +install(FILES "${PLUGIN_OUTPUT_DIR}/${URI_PATH}/qmldir" DESTINATION "${QML_INSTALL_DIR}/${URI_PATH}")