diff --git a/cmake/taoQuick.cmake b/cmake/taoQuick.cmake index c40691c5..40e235f1 100644 --- a/cmake/taoQuick.cmake +++ b/cmake/taoQuick.cmake @@ -3,18 +3,14 @@ set(TaoQuickPath ${CMAKE_SOURCE_DIR}/src) if (CMAKE_BUILD_TYPE MATCHES "Release") set(TaoQuickRes ${TaoQuickPath}/TaoQuick/TaoQuick.qrc CACHE STRING "tao quick res path") set(TaoQuickImport "qrc:///" CACHE STRING "tao quick import path") - set(TaoQuickImage "qrc:/TaoQuick/Images/" CACHE STRING "tao quick image path") - else() set(TaoQuickImport "file:///${TaoQuickPath}/" CACHE STRING "tao quick import path") - set(TaoQuickImage "file:///${TaoQuickPath}/TaoQuick/Images/" CACHE STRING "tao quick image path") endif() add_compile_definitions(TaoQuickImport="${TaoQuickImport}") add_compile_definitions(TaoQuickImage="${TaoQuickImage}") add_compile_definitions(TaoQuickImportPath="${TaoQuickImport}") -add_compile_definitions(TaoQuickImagePath="${TaoQuickImage}") add_compile_definitions(QML_IMPORT_PATH="${TaoQuickPath}") add_compile_definitions(QML2_IMPORT_PATH="${TaoQuickPath}") diff --git a/examples/HelloTaoQuick1/main.cpp b/examples/HelloTaoQuick1/main.cpp index c0acbdb2..d0abec41 100644 --- a/examples/HelloTaoQuick1/main.cpp +++ b/examples/HelloTaoQuick1/main.cpp @@ -7,7 +7,7 @@ int main(int argc, char** argv) QGuiApplication app(argc, argv); QQuickView view; view.engine()->addImportPath(TaoQuickImportPath); - view.rootContext()->setContextProperty("taoQuickImagePath", TaoQuickImagePath); + view.rootContext()->setContextProperty("taoQuickImportPath", TaoQuickImportPath); view.setSource(QUrl("qrc:/main.qml")); view.show(); diff --git a/examples/HelloTaoQuick2/main.cpp b/examples/HelloTaoQuick2/main.cpp index 43e18bdd..33dfb24e 100644 --- a/examples/HelloTaoQuick2/main.cpp +++ b/examples/HelloTaoQuick2/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char* argv[]) QQmlApplicationEngine engine; engine.addImportPath(TaoQuickImportPath); - engine.rootContext()->setContextProperty("taoQuickImagePath", TaoQuickImagePath); + engine.rootContext()->setContextProperty("taoQuickImportPath", TaoQuickImportPath); const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect( &engine, diff --git a/examples/HelloTaoQuick2/taoQuick.cmake b/examples/HelloTaoQuick2/taoQuick.cmake index 14e19489..e5c3178a 100644 --- a/examples/HelloTaoQuick2/taoQuick.cmake +++ b/examples/HelloTaoQuick2/taoQuick.cmake @@ -3,14 +3,10 @@ set(TaoQuickPath ${CMAKE_SOURCE_DIR}/../../src/TaoQuick/imports) if (CMAKE_BUILD_TYPE MATCHES "Release") set(TaoQuickRes ${TaoQuickPath}/TaoQuick/TaoQuick.qrc CACHE STRING "tao quick res path") set(TaoQuickImportPath "qrc:///" CACHE STRING "tao quick import path") - set(TaoQuickImagePath "qrc:/TaoQuick/Images/" CACHE STRING "tao quick image path") - else() set(TaoQuickImportPath "file:///${TaoQuickPath}" CACHE STRING "tao quick import path") - set(TaoQuickImagePath "file:///${TaoQuickPath}/TaoQuick/Images/" CACHE STRING "tao quick image path") endif() add_compile_definitions(TaoQuickImportPath="${TaoQuickImportPath}") -add_compile_definitions(TaoQuickImagePath="${TaoQuickImagePath}") add_compile_definitions(QML_IMPORT_PATH="${TaoQuickPath}") add_compile_definitions(QML2_IMPORT_PATH="${TaoQuickPath}") diff --git a/examples/TaoQuickShow/Src/main.cpp b/examples/TaoQuickShow/Src/main.cpp index 9d78e113..aec2b158 100644 --- a/examples/TaoQuickShow/Src/main.cpp +++ b/examples/TaoQuickShow/Src/main.cpp @@ -59,10 +59,6 @@ int main(int argc, char** argv) qWarning() << "TaoQuickImportPath " << TaoQuickImport; #endif -#ifdef TaoQuickImage - view.rootContext()->setContextProperty("taoQuickImagePath", TaoQuickImage); -#endif - #ifdef TAODEBUG view.rootContext()->setContextProperty("isDebug", true); #else diff --git a/examples/TaoQuickShow/TaoQuickShow.pro b/examples/TaoQuickShow/TaoQuickShow.pro index 3532fac7..35075f7b 100644 --- a/examples/TaoQuickShow/TaoQuickShow.pro +++ b/examples/TaoQuickShow/TaoQuickShow.pro @@ -34,7 +34,6 @@ DEFINES += QMAKE_GEN_TAOMACRO headerContents = \ "$${LITERAL_HASH}pragma once" \ "$${LITERAL_HASH}define TaoQuickImport $${TaoQuickImport}" \ - "$${LITERAL_HASH}define TaoQuickImage $${TaoQuickImage}" \ "$${LITERAL_HASH}define qmlPath $${qmlPath}" \ "$${LITERAL_HASH}define contentsPath $${contentsPath}" \ "$${LITERAL_HASH}define imgPath $${imgPath}" \ diff --git a/src/TaoQuick.pri b/src/TaoQuick.pri index ee9a7c44..9cc120ac 100644 --- a/src/TaoQuick.pri +++ b/src/TaoQuick.pri @@ -9,7 +9,6 @@ CONFIG(debug,debug|release){ TaoQuickImport=\"file:///$$path/\" TaoQuickImage=\"file:///$$path/TaoQuick/Images/\" DEFINES += TaoQuickImportPath=\\\"file:///$${path}/\\\" - DEFINES += TaoQuickImagePath=\\\"file:///$${path}/TaoQuick/Images/\\\" OTHER_FILES += $$files($$path/TaoQuick/Qml/*.qml, true) @@ -20,7 +19,6 @@ CONFIG(debug,debug|release){ TaoQuickImport=\"qrc:/\" TaoQuickImage=\"qrc:/TaoQuick/Images/\" DEFINES += TaoQuickImportPath=\\\"qrc:///\\\" - DEFINES += TaoQuickImagePath=\\\"qrc:/TaoQuick/Images/\\\" } # Additional import path used to resolve QML modules in Qt Creator's code model diff --git a/src/TaoQuick/Qml/CusConfig.qml b/src/TaoQuick/Qml/CusConfig.qml index 271604ca..96fa2ddb 100644 --- a/src/TaoQuick/Qml/CusConfig.qml +++ b/src/TaoQuick/Qml/CusConfig.qml @@ -22,8 +22,8 @@ QtObject { property string imagePathPrefix: "file:///./../Images/" Component.onCompleted: { - if (typeof (taoQuickImagePath) != "undefined" && taoQuickImagePath !== null && taoQuickImagePath.length > 0) { - imagePathPrefix = taoQuickImagePath + if (typeof (taoQuickImportPath) != "undefined" && taoQuickImportPath !== null && taoQuickImportPath.length > 0) { + imagePathPrefix = taoQuickImportPath + "TaoQuick/Images/" } currentTheme = 0 }