diff --git a/.gitmodules b/.gitmodules index e69de29b..39e0ed0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "3rdparty/Qt5QMLPlugin"] + path = 3rdparty/Qt5QMLPlugin + url = https://github.com/mentalfl0w/Qt5QMLPlugin.git diff --git a/3rdparty/Qt5QMLPlugin b/3rdparty/Qt5QMLPlugin new file mode 160000 index 00000000..f056abc4 --- /dev/null +++ b/3rdparty/Qt5QMLPlugin @@ -0,0 +1 @@ +Subproject commit f056abc43282cb7b652aa04e3ee3b0a60f2b85f6 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9863d2ca..9193fb2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ if (MSVC) endif () list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake/) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/3rdparty/Qt5QMLPlugin) include(GetGitRevisionDescription) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 24592b5e..8ac0ba7e 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -83,16 +83,13 @@ list(APPEND sources_files ${QRC_RESOURCES}) if (WIN32) list(APPEND sources_files ${EXAMPLE_VERSION_RC_PATH}) endif () -if (${QT_VERSION_MAJOR} GREATER_EQUAL 6) - qt_add_executable(${PROJECT_NAME} - MANUAL_FINALIZATION - ${sources_files} - ) -else () - add_executable(${PROJECT_NAME} - ${sources_files} - ) -endif () + +if (${QT_VERSION_MAJOR} LESS 6) + include(Qt5QMLPlugin) +endif() +qt_add_executable(${PROJECT_NAME} + ${sources_files} +) add_dependencies(${PROJECT_NAME} Script-UpdateTranslations) #复制程序运行所需要的动态库 @@ -147,7 +144,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network fluentuiplugin ) - #添加部署脚本 if (CMAKE_BUILD_TYPE MATCHES "Release") if (APPLE) diff --git a/example/src/helper/TranslateHelper.h b/example/src/helper/TranslateHelper.h index 1476871a..d70f2d85 100644 --- a/example/src/helper/TranslateHelper.h +++ b/example/src/helper/TranslateHelper.h @@ -23,4 +23,4 @@ SINGLETON(TranslateHelper) private: QQmlEngine *_engine = nullptr; QTranslator *_translator = nullptr; -}; \ No newline at end of file +}; diff --git a/example/src/main.cpp b/example/src/main.cpp index bd80267c..72a7d140 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -19,18 +19,51 @@ #include "src/helper/InitializrHelper.h" #include "src/helper/TranslateHelper.h" #include "src/helper/Network.h" - +#include #ifdef FLUENTUI_BUILD_STATIC_LIB -#if (QT_VERSION > QT_VERSION_CHECK(6, 2, 0)) -Q_IMPORT_QML_PLUGIN(FluentUIPlugin) +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +#define Q_IMPORT_QML_PLUGIN(PLUGIN) \ +Q_IMPORT_PLUGIN(PLUGIN) +extern void qml_static_register_types_FluentUI(); #endif -#include +Q_IMPORT_QML_PLUGIN(FluentUIPlugin) #endif #ifdef WIN32 #include "app_dmp.h" #endif +void listFiles(const QString &path) { + QDir dir(path); + // 设置过滤器以包括目录和文件,排除符号链接 + dir.setFilter(QDir::Files | QDir::Dirs); + // 获取目录和文件信息列表 + QFileInfoList list = dir.entryInfoList(); + + for (const QFileInfo &fileInfo : list) { + if (fileInfo.isDir()) { + // 如果是目录,则递归调用listFiles + listFiles(fileInfo.absoluteFilePath()); + } else { + // 输出文件名称 + qDebug() << "文件名: " << fileInfo.fileName(); + QFile file(fileInfo.absoluteFilePath()); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + continue; + + QTextStream in(&file); + // 输出文件内容 + qDebug() << "文件内容: "; + while (!in.atEnd()) { + QString line = in.readLine(); + qDebug() << line; + } + file.close(); + } + } +} + + int main(int argc, char *argv[]) { const char *uri = "example"; @@ -78,17 +111,16 @@ int main(int argc, char *argv[]) qmlRegisterType(uri,major,minor,"NetworkParams"); qmlRegisterType(uri,major,minor,"OpenGLItem"); qmlRegisterUncreatableMetaObject(NetworkType::staticMetaObject, uri, major, minor, "NetworkType", "Access to enums & flags only"); - QQmlApplicationEngine engine; +#ifdef FLUENTUI_BUILD_STATIC_LIB + qml_static_register_types_FluentUI(); +#endif TranslateHelper::getInstance()->init(&engine); engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance()); engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance()); engine.rootContext()->setContextProperty("InitializrHelper",InitializrHelper::getInstance()); engine.rootContext()->setContextProperty("TranslateHelper",TranslateHelper::getInstance()); engine.rootContext()->setContextProperty("Network",Network::getInstance()); -#ifdef FLUENTUI_BUILD_STATIC_LIB - FluentUI::getInstance()->registerTypes(&engine); -#endif const QUrl url(QStringLiteral("qrc:/example/qml/App.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { diff --git a/src/.cmake/QmlPlugin.cmake b/src/.cmake/QmlPlugin.cmake deleted file mode 100644 index b7193718..00000000 --- a/src/.cmake/QmlPlugin.cmake +++ /dev/null @@ -1,128 +0,0 @@ -include(CMakeParseArguments) -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) -find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core) -function(FindQmlPluginDump) - get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) - execute_process( - COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_BINS - OUTPUT_VARIABLE QT_BIN_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) -endfunction() -function(FindQtInstallQml) - execute_process( - COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_QML - OUTPUT_VARIABLE PROC_RESULT - OUTPUT_STRIP_TRAILING_WHITESPACE - ) -set(QT_INSTALL_QML ${PROC_RESULT} PARENT_SCOPE) -endfunction() -function(add_qmlplugin TARGET) - set(options NO_AUTORCC NO_AUTOMOC) - set(oneValueArgs URI VERSION BINARY_DIR QMLDIR LIBTYPE) - set(multiValueArgs SOURCES QMLFILES QMLFILESALIAS) - cmake_parse_arguments(QMLPLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - if(NOT QMLPLUGIN_URI OR NOT QMLPLUGIN_VERSION OR NOT QMLPLUGIN_QMLDIR OR NOT QMLPLUGIN_LIBTYPE) - message(WARNING "TARGET,URI,VERSION,qmldir and LIBTYPE must be set, no files generated") - return() - endif() - if(NOT QMLPLUGIN_BINARY_DIR) - set(QMLPLUGIN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${QMLPLUGIN_URI}) - endif() - add_library(${TARGET} ${QMLPLUGIN_LIBTYPE} - ${QMLPLUGIN_SOURCES} - ) -set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) -if(QMLPLUGIN_NO_AUTORCC) - set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF) -else() - set_target_properties(${TARGET} PROPERTIES AUTOMOC ON) -endif() -if(QMLPLUGIN_NO_AUTOMOC) - set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF) -else() - set_target_properties(${TARGET} PROPERTIES AUTOMOC ON) -endif() -if (${QMLPLUGIN_LIBTYPE} MATCHES "SHARED") - FindQmlPluginDump() - FindQtInstallQml() - if(QMLPLUGIN_BINARY_DIR) - set(MAKE_QMLPLUGINDIR_COMMAND ${CMAKE_COMMAND} -E make_directory ${QMLPLUGIN_BINARY_DIR}) - endif() - set(COPY_QMLDIR_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/qmldir $/${QMLPLUGIN_URI}/qmldir) - set(INSTALL_QMLDIR_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/qmldir ${QMLPLUGIN_BINARY_DIR}/qmldir) - set(COPY_QMLTYPES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/plugins.qmltypes $/${QMLPLUGIN_URI}/plugins.qmltypes) - set(INSTALL_QMLTYPES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR}/plugins.qmltypes ${QMLPLUGIN_BINARY_DIR}/plugins.qmltypes) - set(COPY_LIBRARY_COMMAND ${CMAKE_COMMAND} -E copy $/$ $/${QMLPLUGIN_URI}) - set(INSTALL_LIBRARY_COMMAND ${CMAKE_COMMAND} -E copy $/$ ${QMLPLUGIN_BINARY_DIR}) - if(QMLPLUGIN_QMLDIR) - set(COPY_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR} $/${QMLPLUGIN_URI}) - else() - set(COPY_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${QMLPLUGIN_QMLFILES} $/${QMLPLUGIN_URI}) - endif() - set(INSTALL_QMLFILES_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/${QMLPLUGIN_QMLDIR} ${QMLPLUGIN_BINARY_DIR}) - if(QMLPLUGIN_BINARY_DIR) - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${MAKE_QMLPLUGINDIR_COMMAND} - COMMAND ${COPY_QMLDIR_COMMAND} - COMMENT "Copying qmldir to binary directory" - ) -else() - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${COPY_QMLDIR_COMMAND} - COMMENT "Copying qmldir to binary directory" - ) -endif() -if(QMLPLUGIN_BINARY_DIR) - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${MAKE_QMLPLUGINDIR_COMMAND} - COMMAND ${COPY_QMLTYPES_COMMAND} - COMMENT "Copying qmltypes to binary directory" - ) -else() - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${COPY_QMLTYPES_COMMAND} - COMMENT "Copying qmltypes to binary directory" - ) -endif() -add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${COPY_LIBRARY_COMMAND} - COMMENT "Copying Lib to binary plugin directory" -) -if(QMLPLUGIN_QMLFILES) - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${COPY_QMLFILES_COMMAND} - COMMENT "Copying QML files to binary directory" - ) -endif() -add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${GENERATE_QMLTYPES_COMMAND} - COMMENT "Generating plugin.qmltypes" -) -string(REPLACE "." "/" QMLPLUGIN_INSTALL_URI ${QMLPLUGIN_URI}) -add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${INSTALL_QMLTYPES_COMMAND} - COMMAND ${INSTALL_QMLDIR_COMMAND} - COMMAND ${INSTALL_LIBRARY_COMMAND} - COMMAND ${INSTALL_QMLFILES_COMMAND} - COMMAND ${INSTALL_QMLTYPES_COMMAND} - COMMENT "Install library and aditional files" -) -endif() -endfunction() diff --git a/src/.cmake/version_dll.rc.in b/src/.cmake/version_dll.rc.in index a84e0db0..3a380c40 100644 --- a/src/.cmake/version_dll.rc.in +++ b/src/.cmake/version_dll.rc.in @@ -1,13 +1,8 @@ #include -#define STR(x) #x -#define VER_JOIN(a,b,c,d) STR(a.b.c.d) -#define VER_JOIN_(x) VER_JOIN x -#define VER_STR VER_JOIN_((FLUENTUI_VERSION)) - -VS_VERSION_INFO VERSIONINFO - FILEVERSION FLUENTUI_VERSION - PRODUCTVERSION FLUENTUI_VERSION + VS_VERSION_INFO VERSIONINFO + FILEVERSION ${FLUENTUI_VERSION} + PRODUCTVERSION ${FLUENTUI_VERSION} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -24,12 +19,12 @@ BEGIN BEGIN VALUE "CompanyName", "ZhuZiChu" VALUE "FileDescription", "https://github.com/zhuzichu520/FluentUI" - VALUE "FileVersion", VER_STR + VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}" VALUE "InternalName", "${PROJECT_NAME}.dll" VALUE "LegalCopyright", "Copyright (C) 2023 ZhuZiChu. All rights reserved." VALUE "OriginalFilename", "${PROJECT_NAME}.dll" VALUE "ProductName", "${PROJECT_NAME}" - VALUE "ProductVersion", VER_STR + VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}" END END BLOCK "VarFileInfo" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 591a0eb9..16f88659 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.20) if (FLUENTUI_BUILD_STATIC_LIB AND (QT_VERSION VERSION_GREATER_EQUAL "6.2")) - project(fluentui VERSION 1.0) + project(fluentui VERSION 1.7.5.0) else () - project(fluentuiplugin VERSION 1.0) + project(fluentuiplugin VERSION 1.7.5.0) endif () list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.cmake/) @@ -20,10 +20,12 @@ else () endif () #设置版本号 -add_definitions(-DFLUENTUI_VERSION=1,7,5,0) +set(FLUENTUI_VERSION "${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJECT_VERSION_PATCH},${PROJECT_VERSION_TWEAK}") -if (FLUENTUI_BUILD_STATIC_LIB) - add_definitions(-DFLUENTUI_BUILD_STATIC_LIB) +if (FLUENTUI_BUILD_STATIC_LIB AND ${QT_VERSION_MAJOR} GREATER_EQUAL 6) + target_compile_definitions(${PROJECT_NAME} + PUBLIC + FLUENTUI_BUILD_STATIC_LIB) endif () #编译参数设置 @@ -83,41 +85,34 @@ if (WIN32) ) endif () -if (QT_VERSION VERSION_GREATER_EQUAL "6.2") - #删除fluentuiplugin.cpp与fluentuiplugin.h,这些只要Qt5使用,Qt6不需要 - list(REMOVE_ITEM sources_files fluentuiplugin.h fluentuiplugin.cpp) - if (NOT FLUENTUI_BUILD_STATIC_LIB) - list(REMOVE_ITEM sources_files FluentUI.h FluentUI.cpp) +#遍历所有qml文件 +set(SINGLETON_QML "FluRouter.qml" "FluEventBus.qml") +file(GLOB_RECURSE QML_PATHS *.qml) +foreach (filepath ${QML_PATHS}) + if (${filepath} MATCHES "Qt${QT_VERSION_MAJOR}/") + string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) + list(APPEND qml_files ${filename}) endif () +endforeach (filepath) - #遍历所有qml文件 - file(GLOB_RECURSE QML_PATHS *.qml qmldir) - foreach (filepath ${QML_PATHS}) - if (${filepath} MATCHES "Qt${QT_VERSION_MAJOR}/") - string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) - if (${filename} MATCHES "qmldir") - list(APPEND resource_files ${filename}) - else () - list(APPEND qml_files ${filename}) - endif () - endif () - endforeach (filepath) - - #遍历所有资源文件 - file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp *.js *.qm) - foreach (filepath ${RES_PATHS}) - if (${filepath} MATCHES "Qt${QT_VERSION_MAJOR}/") - string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) - list(APPEND resource_files ${filename}) - endif () - endforeach (filepath) - - #修改资源文件导出路径 - foreach (filepath IN LISTS qml_files resource_files) - string(REPLACE "Qt${QT_VERSION_MAJOR}/imports/FluentUI/" "" filename ${filepath}) - set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename}) - endforeach () -endif () +#遍历所有资源文件 +file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp *.js *.qm *.qmltypes) +foreach (filepath ${RES_PATHS}) + if (${filepath} MATCHES "Qt${QT_VERSION_MAJOR}/") + string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) + list(APPEND resource_files ${filename}) + endif () +endforeach (filepath) +#修改资源文件导出路径和QML单例 +foreach (filepath IN LISTS qml_files resource_files) + string(REPLACE "Qt${QT_VERSION_MAJOR}/imports/FluentUI/" "" filename ${filepath}) + set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename}) + foreach(singleton_qml ${SINGLETON_QML}) + if (${filepath} MATCHES ${singleton_qml}) + set_source_files_properties(${filepath} PROPERTIES QT_QML_SINGLETON_TYPE TRUE) + endif() + endforeach() +endforeach () if (FLUENTUI_BUILD_STATIC_LIB) set(LIB_TYPE "STATIC") @@ -142,38 +137,27 @@ if (WIN32) ) endif () -if (QT_VERSION VERSION_GREATER_EQUAL "6.2") - #如果是Qt6.2版本以上,则使用qt_add_library,qt_add_qml_module函数添加资源文件 - if (FLUENTUI_BUILD_STATIC_LIB) - set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FluentUI) - endif () - qt_add_library(${PROJECT_NAME} ${LIB_TYPE}) - qt_add_qml_module(${PROJECT_NAME} - PLUGIN_TARGET ${PLUGIN_TARGET_NAME} - OUTPUT_DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY} - VERSION 1.0 - URI "FluentUI" - #修改qmltypes文件名称。默认fluentuiplugin.qmltypes,使用默认名称有时候import FluentUI 1.0会爆红,所以修改成plugins.qmltypes - TYPEINFO "plugins.qmltypes" - SOURCES ${sources_files} ${FLUENTUI_VERSION_RC_PATH} - QML_FILES ${qml_files} - RESOURCES ${resource_files} - RESOURCE_PREFIX "/qt/qml" - ) -else () - qt_add_resources(QRC_RESOURCES Qt5/imports/fluentui.qrc) - #如果是Qt6.2版本以下,则使用add_qmlplugin函数添加资源文件,这是个自定义的函数,详情见.cmake/QmlPlugin.cmake - include(QmlPlugin) - add_qmlplugin(${PROJECT_NAME} - URI "FluentUI" - VERSION 1.0 - SOURCES ${sources_files} ${FLUENTUI_VERSION_RC_PATH} ${QRC_RESOURCES} - QMLFILES ${qml_files} - QMLDIR imports/FluentUI - BINARY_DIR ${FLUENTUI_QML_PLUGIN_DIRECTORY} - LIBTYPE ${LIB_TYPE} - ) +if (${QT_VERSION_MAJOR} LESS 6) + set(__qml_plugin_no_generate_typeinfo ON) + set(__qml_plugin_no_public_sources ON) + include(Qt5QMLPlugin) +endif() +if (FLUENTUI_BUILD_STATIC_LIB) + set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FluentUI) endif () +qt_add_library(${PROJECT_NAME} ${LIB_TYPE}) +qt_add_qml_module(${PROJECT_NAME} + PLUGIN_TARGET ${PLUGIN_TARGET_NAME} + OUTPUT_DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY} + VERSION 1.0 + URI "FluentUI" + #修改qmltypes文件名称。默认fluentuiplugin.qmltypes,使用默认名称有时候import FluentUI 1.0会爆红,所以修改成plugins.qmltypes + TYPEINFO "plugins.qmltypes" + SOURCES ${sources_files} ${FLUENTUI_VERSION_RC_PATH} + QML_FILES ${qml_files} + RESOURCES ${resource_files} + RESOURCE_PREFIX "/qt-project.org/imports/" +) target_compile_definitions(${PROJECT_NAME} PRIVATE @@ -201,7 +185,7 @@ if(APPLE) find_library(CARBON_LIBRARY Carbon) target_link_libraries(${PROJECT_NAME} PRIVATE ${CARBON_LIBRARY}) elseif(WIN32) - target_link_libraries(${PROJECT_NAME} PRIVATE user32) + target_link_libraries(${PROJECT_NAME} PUBLIC user32) elseif(UNIX) if(QT_VERSION_MAJOR STREQUAL "6") if(QT_VERSION VERSION_LESS "6.2.0") @@ -216,15 +200,5 @@ elseif(UNIX) target_link_libraries(${PROJECT_NAME} PRIVATE X11) endif() -if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release")) - find_program(QML_PLUGIN_DUMP NAMES qmlplugindump) - add_custom_target(Script-Generate-QmlTypes - COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes - COMMENT "Generate qmltypes........." - SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) -endif() - #安装 install(DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports) diff --git a/src/FluApp.h b/src/FluApp.h index f3d47ab7..d3ca7faf 100644 --- a/src/FluApp.h +++ b/src/FluApp.h @@ -16,25 +16,29 @@ * @brief The FluApp class */ class FluApp : public QObject { -Q_OBJECT + Q_OBJECT -Q_PROPERTY_AUTO(bool, useSystemAppBar) -Q_PROPERTY_AUTO(QString, windowIcon) -Q_PROPERTY_AUTO(QLocale, locale) -Q_PROPERTY_AUTO_P(QObject*,launcher) + Q_PROPERTY_AUTO(bool, useSystemAppBar) + Q_PROPERTY_AUTO(QString, windowIcon) + Q_PROPERTY_AUTO(QLocale, locale) + Q_PROPERTY_AUTO_P(QObject*,launcher) QML_NAMED_ELEMENT(FluApp) QML_SINGLETON +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +public: +#else private: +#endif explicit FluApp(QObject *parent = nullptr); ~FluApp() override; public: -SINGLETON(FluApp) - + SINGLETON(FluApp) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) static FluApp *create(QQmlEngine *, QJSEngine *) { return getInstance(); } - +#endif Q_INVOKABLE void init(QObject *launcher, QLocale locale = QLocale::system()); [[maybe_unused]] Q_INVOKABLE static QJsonArray iconData(const QString &keyword = ""); diff --git a/src/FluColors.h b/src/FluColors.h index 55efac31..856ab0b1 100644 --- a/src/FluColors.h +++ b/src/FluColors.h @@ -11,51 +11,55 @@ * @brief The FluColors class */ class FluColors : public QObject { -Q_OBJECT + Q_OBJECT -Q_PROPERTY_AUTO(QColor, Transparent); -Q_PROPERTY_AUTO(QColor, Black); -Q_PROPERTY_AUTO(QColor, White); -Q_PROPERTY_AUTO(QColor, Grey10); -Q_PROPERTY_AUTO(QColor, Grey20); -Q_PROPERTY_AUTO(QColor, Grey30); -Q_PROPERTY_AUTO(QColor, Grey40); -Q_PROPERTY_AUTO(QColor, Grey50); -Q_PROPERTY_AUTO(QColor, Grey60); -Q_PROPERTY_AUTO(QColor, Grey70); -Q_PROPERTY_AUTO(QColor, Grey80); -Q_PROPERTY_AUTO(QColor, Grey90); -Q_PROPERTY_AUTO(QColor, Grey100); -Q_PROPERTY_AUTO(QColor, Grey110); -Q_PROPERTY_AUTO(QColor, Grey120); -Q_PROPERTY_AUTO(QColor, Grey130); -Q_PROPERTY_AUTO(QColor, Grey140); -Q_PROPERTY_AUTO(QColor, Grey150); -Q_PROPERTY_AUTO(QColor, Grey160); -Q_PROPERTY_AUTO(QColor, Grey170); -Q_PROPERTY_AUTO(QColor, Grey180); -Q_PROPERTY_AUTO(QColor, Grey190); -Q_PROPERTY_AUTO(QColor, Grey200); -Q_PROPERTY_AUTO(QColor, Grey210); -Q_PROPERTY_AUTO(QColor, Grey220); -Q_PROPERTY_AUTO_P(FluAccentColor*, Yellow); -Q_PROPERTY_AUTO_P(FluAccentColor*, Orange); -Q_PROPERTY_AUTO_P(FluAccentColor*, Red); -Q_PROPERTY_AUTO_P(FluAccentColor*, Magenta); -Q_PROPERTY_AUTO_P(FluAccentColor*, Purple); -Q_PROPERTY_AUTO_P(FluAccentColor*, Blue); -Q_PROPERTY_AUTO_P(FluAccentColor*, Teal); -Q_PROPERTY_AUTO_P(FluAccentColor*, Green); + Q_PROPERTY_AUTO(QColor, Transparent); + Q_PROPERTY_AUTO(QColor, Black); + Q_PROPERTY_AUTO(QColor, White); + Q_PROPERTY_AUTO(QColor, Grey10); + Q_PROPERTY_AUTO(QColor, Grey20); + Q_PROPERTY_AUTO(QColor, Grey30); + Q_PROPERTY_AUTO(QColor, Grey40); + Q_PROPERTY_AUTO(QColor, Grey50); + Q_PROPERTY_AUTO(QColor, Grey60); + Q_PROPERTY_AUTO(QColor, Grey70); + Q_PROPERTY_AUTO(QColor, Grey80); + Q_PROPERTY_AUTO(QColor, Grey90); + Q_PROPERTY_AUTO(QColor, Grey100); + Q_PROPERTY_AUTO(QColor, Grey110); + Q_PROPERTY_AUTO(QColor, Grey120); + Q_PROPERTY_AUTO(QColor, Grey130); + Q_PROPERTY_AUTO(QColor, Grey140); + Q_PROPERTY_AUTO(QColor, Grey150); + Q_PROPERTY_AUTO(QColor, Grey160); + Q_PROPERTY_AUTO(QColor, Grey170); + Q_PROPERTY_AUTO(QColor, Grey180); + Q_PROPERTY_AUTO(QColor, Grey190); + Q_PROPERTY_AUTO(QColor, Grey200); + Q_PROPERTY_AUTO(QColor, Grey210); + Q_PROPERTY_AUTO(QColor, Grey220); + Q_PROPERTY_AUTO_P(FluAccentColor*, Yellow); + Q_PROPERTY_AUTO_P(FluAccentColor*, Orange); + Q_PROPERTY_AUTO_P(FluAccentColor*, Red); + Q_PROPERTY_AUTO_P(FluAccentColor*, Magenta); + Q_PROPERTY_AUTO_P(FluAccentColor*, Purple); + Q_PROPERTY_AUTO_P(FluAccentColor*, Blue); + Q_PROPERTY_AUTO_P(FluAccentColor*, Teal); + Q_PROPERTY_AUTO_P(FluAccentColor*, Green); QML_NAMED_ELEMENT(FluColors) QML_SINGLETON +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +public: +#else private: +#endif explicit FluColors(QObject *parent = nullptr); public: -SINGLETON(FluColors) - - [[maybe_unused]] Q_INVOKABLE FluAccentColor *createAccentColor(const QColor &primaryColor); - + SINGLETON(FluColors) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) static FluColors *create(QQmlEngine *, QJSEngine *) { return getInstance(); } +#endif + [[maybe_unused]] Q_INVOKABLE FluAccentColor *createAccentColor(const QColor &primaryColor); }; diff --git a/src/FluTextStyle.h b/src/FluTextStyle.h index 8143ce1e..92dabadc 100644 --- a/src/FluTextStyle.h +++ b/src/FluTextStyle.h @@ -10,24 +10,28 @@ * @brief The FluTextStyle class */ class FluTextStyle : public QObject { -Q_OBJECT + Q_OBJECT public: -Q_PROPERTY_AUTO(QString, family) -Q_PROPERTY_AUTO(QFont, Caption); -Q_PROPERTY_AUTO(QFont, Body); -Q_PROPERTY_AUTO(QFont, BodyStrong); -Q_PROPERTY_AUTO(QFont, Subtitle); -Q_PROPERTY_AUTO(QFont, Title); -Q_PROPERTY_AUTO(QFont, TitleLarge); -Q_PROPERTY_AUTO(QFont, Display); + Q_PROPERTY_AUTO(QString, family) + Q_PROPERTY_AUTO(QFont, Caption); + Q_PROPERTY_AUTO(QFont, Body); + Q_PROPERTY_AUTO(QFont, BodyStrong); + Q_PROPERTY_AUTO(QFont, Subtitle); + Q_PROPERTY_AUTO(QFont, Title); + Q_PROPERTY_AUTO(QFont, TitleLarge); + Q_PROPERTY_AUTO(QFont, Display); QML_NAMED_ELEMENT(FluTextStyle) QML_SINGLETON -private: - explicit FluTextStyle(QObject *parent = nullptr); - +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +public: +#else +private: +#endif + explicit FluTextStyle(QObject *parent = nullptr); + SINGLETON(FluTextStyle) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) public: -SINGLETON(FluTextStyle) - static FluTextStyle *create(QQmlEngine *, QJSEngine *) { return getInstance(); } +#endif }; diff --git a/src/FluTheme.h b/src/FluTheme.h index 3fa1c52e..ed44a385 100644 --- a/src/FluTheme.h +++ b/src/FluTheme.h @@ -16,34 +16,40 @@ * @brief The FluTheme class */ class FluTheme : public QObject { -Q_OBJECT + Q_OBJECT Q_PROPERTY(bool dark READ dark NOTIFY darkChanged) -Q_PROPERTY_AUTO_P(FluAccentColor*, accentColor); -Q_PROPERTY_AUTO(QColor, primaryColor); -Q_PROPERTY_AUTO(QColor, backgroundColor); -Q_PROPERTY_AUTO(QColor, dividerColor); -Q_PROPERTY_AUTO(QColor, windowBackgroundColor); -Q_PROPERTY_AUTO(QColor, windowActiveBackgroundColor); -Q_PROPERTY_AUTO(QColor, fontPrimaryColor); -Q_PROPERTY_AUTO(QColor, fontSecondaryColor); -Q_PROPERTY_AUTO(QColor, fontTertiaryColor); -Q_PROPERTY_AUTO(QColor, itemNormalColor); -Q_PROPERTY_AUTO(QColor, frameColor); -Q_PROPERTY_AUTO(QColor, frameActiveColor); -Q_PROPERTY_AUTO(QColor, itemHoverColor); -Q_PROPERTY_AUTO(QColor, itemPressColor); -Q_PROPERTY_AUTO(QColor, itemCheckColor); -Q_PROPERTY_AUTO(QString, desktopImagePath); -Q_PROPERTY_AUTO(int, darkMode); -Q_PROPERTY_AUTO(bool, nativeText); -Q_PROPERTY_AUTO(bool, animationEnabled); -Q_PROPERTY_AUTO(bool, blurBehindWindowEnabled); + Q_PROPERTY_AUTO_P(FluAccentColor*, accentColor); + Q_PROPERTY_AUTO(QColor, primaryColor); + Q_PROPERTY_AUTO(QColor, backgroundColor); + Q_PROPERTY_AUTO(QColor, dividerColor); + Q_PROPERTY_AUTO(QColor, windowBackgroundColor); + Q_PROPERTY_AUTO(QColor, windowActiveBackgroundColor); + Q_PROPERTY_AUTO(QColor, fontPrimaryColor); + Q_PROPERTY_AUTO(QColor, fontSecondaryColor); + Q_PROPERTY_AUTO(QColor, fontTertiaryColor); + Q_PROPERTY_AUTO(QColor, itemNormalColor); + Q_PROPERTY_AUTO(QColor, frameColor); + Q_PROPERTY_AUTO(QColor, frameActiveColor); + Q_PROPERTY_AUTO(QColor, itemHoverColor); + Q_PROPERTY_AUTO(QColor, itemPressColor); + Q_PROPERTY_AUTO(QColor, itemCheckColor); + Q_PROPERTY_AUTO(QString, desktopImagePath); + Q_PROPERTY_AUTO(int, darkMode); + Q_PROPERTY_AUTO(bool, nativeText); + Q_PROPERTY_AUTO(bool, animationEnabled); + Q_PROPERTY_AUTO(bool, blurBehindWindowEnabled); QML_NAMED_ELEMENT(FluTheme) QML_SINGLETON +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +public: +#else private: +#endif explicit FluTheme(QObject *parent = nullptr); - +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +private: +#endif bool eventFilter(QObject *obj, QEvent *event) override; void refreshColors(); @@ -55,11 +61,11 @@ protected: void checkUpdateDesktopImage(); public: -SINGLETON(FluTheme) - - Q_SIGNAL void darkChanged(); - + SINGLETON(FluTheme) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) static FluTheme *create(QQmlEngine *, QJSEngine *) { return getInstance(); } +#endif + Q_SIGNAL void darkChanged(); bool dark() const; @@ -67,4 +73,4 @@ private: bool _systemDark; QFileSystemWatcher _watcher; QMutex _mutex; -}; \ No newline at end of file +}; diff --git a/src/FluTools.h b/src/FluTools.h index a044c5d5..d5b779ce 100644 --- a/src/FluTools.h +++ b/src/FluTools.h @@ -11,18 +11,22 @@ * @brief The FluTools class */ class FluTools : public QObject { -Q_OBJECT + Q_OBJECT QML_NAMED_ELEMENT(FluTools) QML_SINGLETON +#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) +public: +#else private: +#endif explicit FluTools(QObject *parent = nullptr); public: -SINGLETON(FluTools) - + SINGLETON(FluTools) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) static FluTools *create(QQmlEngine *, QJSEngine *) { return getInstance(); } - +#endif Q_INVOKABLE int qtMajor(); Q_INVOKABLE int qtMinor(); diff --git a/src/FluentUI.cpp b/src/FluentUI.cpp deleted file mode 100644 index 28a97aca..00000000 --- a/src/FluentUI.cpp +++ /dev/null @@ -1,184 +0,0 @@ -#include "FluentUI.h" - -#include -#include "Def.h" -#include "FluentIconDef.h" -#include "FluApp.h" -#include "FluColors.h" -#include "FluTheme.h" -#include "FluTools.h" -#include "FluTextStyle.h" -#include "FluWatermark.h" -#include "FluCaptcha.h" -#include "FluTreeModel.h" -#include "FluRectangle.h" -#include "FluQrCodeItem.h" -#include "FluTableSortProxyModel.h" -#include "FluFrameless.h" -#include "FluTableModel.h" -#include "FluHotkey.h" - -void FluentUI::registerTypes(QQmlEngine *engine) { - initializeEngine(engine, _uri); - registerTypes(_uri); -} - -void FluentUI::registerTypes(const char *uri) const { -#if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) - Q_INIT_RESOURCE(fluentui); - int major = _major; - int minor = _minor; - //@uri FluentUI - qmlRegisterType(uri, major, minor, "FluQrCodeItem"); - qmlRegisterType(uri, major, minor, "FluCaptcha"); - qmlRegisterType(uri, major, minor, "FluWatermark"); - qmlRegisterType(uri, major, minor, "FluAccentColor"); - qmlRegisterType(uri, major, minor, "FluTreeModel"); - qmlRegisterType(uri, major, minor, "FluTableModel"); - qmlRegisterType(uri, major, minor, "FluRectangle"); - qmlRegisterType(uri, major, minor, "FluFrameless"); - qmlRegisterType(uri, major, minor, "FluHotkey"); - qmlRegisterType(uri, major, minor, "FluTableSortProxyModel"); - - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAcrylic.qml"), uri, major, minor, "FluAcrylic"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAppBar.qml"), uri, major, minor, "FluAppBar"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluFrame.qml"), uri, major, minor, "FluFrame"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluAutoSuggestBox.qml"), uri, major, minor, "FluAutoSuggestBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluBadge.qml"), uri, major, minor, "FluBadge"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluBreadcrumbBar.qml"), uri, major, minor, "FluBreadcrumbBar"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluButton.qml"), uri, major, minor, "FluButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluCalendarPicker.qml"), uri, major, minor, "FluCalendarPicker"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluCarousel.qml"), uri, major, minor, "FluCarousel"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluChart.qml"), uri, major, minor, "FluChart"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluCheckBox.qml"), uri, major, minor, "FluCheckBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluColorPicker.qml"), uri, major, minor, "FluColorPicker"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluComboBox.qml"), uri, major, minor, "FluComboBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluContentDialog.qml"), uri, major, minor, "FluContentDialog"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluContentPage.qml"), uri, major, minor, "FluContentPage"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluControl.qml"), uri, major, minor, "FluControl"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluCopyableText.qml"), uri, major, minor, "FluCopyableText"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluDatePicker.qml"), uri, major, minor, "FluDatePicker"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluDivider.qml"), uri, major, minor, "FluDivider"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluDropDownButton.qml"), uri, major, minor, "FluDropDownButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluExpander.qml"), uri, major, minor, "FluExpander"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluFilledButton.qml"), uri, major, minor, "FluFilledButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluFlipView.qml"), uri, major, minor, "FluFlipView"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluFocusRectangle.qml"), uri, major, minor, "FluFocusRectangle"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluIcon.qml"), uri, major, minor, "FluIcon"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluIconButton.qml"), uri, major, minor, "FluIconButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluImage.qml"), uri, major, minor, "FluImage"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluImageButton.qml"), uri, major, minor, "FluImageButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluInfoBar.qml"), uri, major, minor, "FluInfoBar"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluItemDelegate.qml"), uri, major, minor, "FluItemDelegate"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluMenu.qml"), uri, major, minor, "FluMenu"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluMenuBar.qml"), uri, major, minor, "FluMenuBar"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluMenuBarItem.qml"), uri, major, minor, "FluMenuBarItem"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluMenuItem.qml"), uri, major, minor, "FluMenuItem"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluMenuSeparator.qml"), uri, major, minor, "FluMenuSeparator"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluMultilineTextBox.qml"), uri, major, minor, "FluMultilineTextBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluNavigationView.qml"), uri, major, minor, "FluNavigationView"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluObject.qml"), uri, major, minor, "FluObject"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPage.qml"), uri, major, minor, "FluPage"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPagination.qml"), uri, major, minor, "FluPagination"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPaneItem.qml"), uri, major, minor, "FluPaneItem"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPaneItemEmpty.qml"), uri, major, minor, "FluPaneItemEmpty"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPaneItemExpander.qml"), uri, major, minor, "FluPaneItemExpander"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPaneItemHeader.qml"), uri, major, minor, "FluPaneItemHeader"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPaneItemSeparator.qml"), uri, major, minor, "FluPaneItemSeparator"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPasswordBox.qml"), uri, major, minor, "FluPasswordBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPivot.qml"), uri, major, minor, "FluPivot"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPivotItem.qml"), uri, major, minor, "FluPivotItem"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluPopup.qml"), uri, major, minor, "FluPopup"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluProgressBar.qml"), uri, major, minor, "FluProgressBar"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluProgressRing.qml"), uri, major, minor, "FluProgressRing"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluQRCode.qml"), uri, major, minor, "FluQRCode"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRadioButton.qml"), uri, major, minor, "FluRadioButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRadioButtons.qml"), uri, major, minor, "FluRadioButtons"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRatingControl.qml"), uri, major, minor, "FluRatingControl"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRemoteLoader.qml"), uri, major, minor, "FluRemoteLoader"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluScrollBar.qml"), uri, major, minor, "FluScrollBar"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluScrollIndicator.qml"), uri, major, minor, "FluScrollIndicator"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluScrollablePage.qml"), uri, major, minor, "FluScrollablePage"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluShadow.qml"), uri, major, minor, "FluShadow"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSlider.qml"), uri, major, minor, "FluSlider"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSpinBox.qml"), uri, major, minor, "FluSpinBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStatusLayout.qml"), uri, major, minor, "FluStatusLayout"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTabView.qml"), uri, major, minor, "FluTabView"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTableView.qml"), uri, major, minor, "FluTableView"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluText.qml"), uri, major, minor, "FluText"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTextBox.qml"), uri, major, minor, "FluTextBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTextBoxBackground.qml"), uri, major, minor, "FluTextBoxBackground"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTextBoxMenu.qml"), uri, major, minor, "FluTextBoxMenu"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTextButton.qml"), uri, major, minor, "FluTextButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTimePicker.qml"), uri, major, minor, "FluTimePicker"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTimeline.qml"), uri, major, minor, "FluTimeline"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluToggleButton.qml"), uri, major, minor, "FluToggleButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluToggleSwitch.qml"), uri, major, minor, "FluToggleSwitch"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTooltip.qml"), uri, major, minor, "FluTooltip"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTour.qml"), uri, major, minor, "FluTour"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTreeView.qml"), uri, major, minor, "FluTreeView"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluWindow.qml"), uri, major, minor, "FluWindow"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluWindowDialog.qml"), uri, major, minor, "FluWindowDialog"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRangeSlider.qml"), uri, major, minor, "FluRangeSlider"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStaggeredLayout.qml"), uri, major, minor, "FluStaggeredLayout"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluProgressButton.qml"), uri, major, minor, "FluProgressButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoadingButton.qml"), uri, major, minor, "FluLoadingButton"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluClip.qml"), uri, major, minor, "FluClip"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLoader.qml"), uri, major, minor, "FluLoader"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluShortcutPicker.qml"), uri, major, minor, "FluShortcutPicker"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSplitLayout.qml"), uri, major, minor, "FluSplitLayout"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluWindowResultLauncher.qml"), uri, major, minor, "FluWindowResultLauncher"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluLauncher.qml"), uri, major, minor, "FluLauncher"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEvent.qml"), uri, major, minor, "FluEvent"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSheet.qml"), uri, major, minor, "FluSheet"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluGroupBox.qml"), uri, major, minor, "FluGroupBox"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluControlBackground.qml"), uri, major, minor, "FluControlBackground"); - qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRouter.qml"), uri, major, minor, "FluRouter"); - qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEventBus.qml"), uri, major, minor, "FluEventBus"); - - qmlRegisterUncreatableMetaObject(FluentIcons::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri, major, minor, "FluThemeType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri, major, minor, "FluPageType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri, major, minor, "FluWindowType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluTreeViewType::staticMetaObject, uri, major, minor, "FluTreeViewType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluStatusLayoutType::staticMetaObject, uri, major, minor, "FluStatusLayoutType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluContentDialogType::staticMetaObject, uri, major, minor, "FluContentDialogType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluTimePickerType::staticMetaObject, uri, major, minor, "FluTimePickerType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluCalendarViewType::staticMetaObject, uri, major, minor, "FluCalendarViewType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluTabViewType::staticMetaObject, uri, major, minor, "FluTabViewType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluNavigationViewType::staticMetaObject, uri, major, minor, "FluNavigationViewType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only"); - qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only"); - - qmlRegisterSingletonType(uri, major, minor, "FluApp", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue { - Q_UNUSED(engine) - return scriptEngine->newQObject(FluApp::getInstance()); - }); - qmlRegisterSingletonType(uri, major, minor, "FluColors", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue { - Q_UNUSED(engine) - return scriptEngine->newQObject(FluColors::getInstance()); - }); - qmlRegisterSingletonType(uri, major, minor, "FluTheme", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue { - Q_UNUSED(engine) - return scriptEngine->newQObject(FluTheme::getInstance()); - }); - qmlRegisterSingletonType(uri, major, minor, "FluTools", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue { - Q_UNUSED(engine) - return scriptEngine->newQObject(FluTools::getInstance()); - }); - qmlRegisterSingletonType(uri, major, minor, "FluTextStyle", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue { - Q_UNUSED(engine) - return scriptEngine->newQObject(FluTextStyle::getInstance()); - }); -// qmlRegisterSingletonInstance(uri, major, minor, "FluApp", FluApp::getInstance()); -// qmlRegisterSingletonInstance(uri, major, minor, "FluColors", FluColors::getInstance()); -// qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance()); -// qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance()); -// qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance()); - qmlRegisterModule(uri, major, minor); -#endif -} - -void FluentUI::initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri) { - Q_UNUSED(engine) -} diff --git a/src/FluentUI.h b/src/FluentUI.h deleted file mode 100644 index eb454741..00000000 --- a/src/FluentUI.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include -#include "singleton.h" - -/** - * @brief The FluentUI class - */ -class FluentUI : public QObject { -Q_OBJECT - -public: -SINGLETON(FluentUI) - - Q_DECL_EXPORT void registerTypes(QQmlEngine *engine); - - void registerTypes(const char *uri) const; - - void initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri); - -private: - const int _major = 1; - const int _minor = 0; - const char *_uri = "FluentUI"; -}; \ No newline at end of file diff --git a/src/Qt5/imports/FluentUI/Controls/FluAcrylic.qml b/src/Qt5/imports/FluentUI/Controls/FluAcrylic.qml index a432c32c..7c2a8494 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluAcrylic.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluAcrylic.qml @@ -33,7 +33,7 @@ Item { } Image { anchors.fill: parent - source: "qrc:/qt/qml/FluentUI/Image/noise.png" + source: "qrc:/qt-project.org/imports/FluentUI/Image/noise.png" fillMode: Image.Tile opacity: control.noiseOpacity } diff --git a/src/Qt5/imports/FluentUI/Controls/FluIcon.qml b/src/Qt5/imports/FluentUI/Controls/FluIcon.qml index 7b1f6098..705fae6b 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluIcon.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluIcon.qml @@ -16,6 +16,6 @@ Text { opacity: iconSource>0 FontLoader{ id: font_loader - source: "qrc:/qt/qml/FluentUI/Font/FluentIcons.ttf" + source: "qrc:/qt-project.org/imports/FluentUI/Font/FluentIcons.ttf" } } diff --git a/src/Qt5/imports/FluentUI/Controls/qmldir b/src/Qt5/imports/FluentUI/Controls/qmldir deleted file mode 100644 index a4b6cc13..00000000 --- a/src/Qt5/imports/FluentUI/Controls/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -singleton FluRouter 1.0 FluRouter.qml -singleton FluEventBus 1.0 FluEventBus.qml diff --git a/src/Qt5/imports/FluentUI/qmldir b/src/Qt5/imports/FluentUI/qmldir deleted file mode 100644 index fc12b266..00000000 --- a/src/Qt5/imports/FluentUI/qmldir +++ /dev/null @@ -1,102 +0,0 @@ -module FluentUI -classname FluentUIPlugin -designersupported -typeinfo plugins.qmltypes - -FluAcrylic 1.0 Controls/FluAcrylic.qml -FluAppBar 1.0 Controls/FluAppBar.qml -FluAutoSuggestBox 1.0 Controls/FluAutoSuggestBox.qml -FluBadge 1.0 Controls/FluBadge.qml -FluBreadcrumbBar 1.0 Controls/FluBreadcrumbBar.qml -FluButton 1.0 Controls/FluButton.qml -FluCalendarPicker 1.0 Controls/FluCalendarPicker.qml -FluCarousel 1.0 Controls/FluCarousel.qml -FluChart 1.0 Controls/FluChart.qml -FluCheckBox 1.0 Controls/FluCheckBox.qml -FluClip 1.0 Controls/FluClip.qml -FluColorPicker 1.0 Controls/FluColorPicker.qml -FluComboBox 1.0 Controls/FluComboBox.qml -FluContentDialog 1.0 Controls/FluContentDialog.qml -FluContentPage 1.0 Controls/FluContentPage.qml -FluControl 1.0 Controls/FluControl.qml -FluControlBackground 1.0 Controls/FluControlBackground.qml -FluCopyableText 1.0 Controls/FluCopyableText.qml -FluDatePicker 1.0 Controls/FluDatePicker.qml -FluDivider 1.0 Controls/FluDivider.qml -FluDropDownButton 1.0 Controls/FluDropDownButton.qml -FluEvent 1.0 Controls/FluEvent.qml -FluEventBus 1.0 Controls/FluEventBus.qml -FluExpander 1.0 Controls/FluExpander.qml -FluFilledButton 1.0 Controls/FluFilledButton.qml -FluFlipView 1.0 Controls/FluFlipView.qml -FluFocusRectangle 1.0 Controls/FluFocusRectangle.qml -FluFrame 1.0 Controls/FluFrame.qml -FluGroupBox 1.0 Controls/FluGroupBox.qml -FluIcon 1.0 Controls/FluIcon.qml -FluIconButton 1.0 Controls/FluIconButton.qml -FluImage 1.0 Controls/FluImage.qml -FluImageButton 1.0 Controls/FluImageButton.qml -FluInfoBar 1.0 Controls/FluInfoBar.qml -FluItemDelegate 1.0 Controls/FluItemDelegate.qml -FluLauncher 1.0 Controls/FluLauncher.qml -FluLoader 1.0 Controls/FluLoader.qml -FluLoadingButton 1.0 Controls/FluLoadingButton.qml -FluMenu 1.0 Controls/FluMenu.qml -FluMenuBar 1.0 Controls/FluMenuBar.qml -FluMenuBarItem 1.0 Controls/FluMenuBarItem.qml -FluMenuItem 1.0 Controls/FluMenuItem.qml -FluMenuSeparator 1.0 Controls/FluMenuSeparator.qml -FluMultilineTextBox 1.0 Controls/FluMultilineTextBox.qml -FluNavigationView 1.0 Controls/FluNavigationView.qml -FluObject 1.0 Controls/FluObject.qml -FluPage 1.0 Controls/FluPage.qml -FluPagination 1.0 Controls/FluPagination.qml -FluPaneItem 1.0 Controls/FluPaneItem.qml -FluPaneItemEmpty 1.0 Controls/FluPaneItemEmpty.qml -FluPaneItemExpander 1.0 Controls/FluPaneItemExpander.qml -FluPaneItemHeader 1.0 Controls/FluPaneItemHeader.qml -FluPaneItemSeparator 1.0 Controls/FluPaneItemSeparator.qml -FluPasswordBox 1.0 Controls/FluPasswordBox.qml -FluPivot 1.0 Controls/FluPivot.qml -FluPivotItem 1.0 Controls/FluPivotItem.qml -FluPopup 1.0 Controls/FluPopup.qml -FluProgressBar 1.0 Controls/FluProgressBar.qml -FluProgressButton 1.0 Controls/FluProgressButton.qml -FluProgressRing 1.0 Controls/FluProgressRing.qml -FluQRCode 1.0 Controls/FluQRCode.qml -FluRadioButton 1.0 Controls/FluRadioButton.qml -FluRadioButtons 1.0 Controls/FluRadioButtons.qml -FluRangeSlider 1.0 Controls/FluRangeSlider.qml -FluRatingControl 1.0 Controls/FluRatingControl.qml -FluRemoteLoader 1.0 Controls/FluRemoteLoader.qml -FluRouter 1.0 Controls/FluRouter.qml -FluScrollBar 1.0 Controls/FluScrollBar.qml -FluScrollIndicator 1.0 Controls/FluScrollIndicator.qml -FluScrollablePage 1.0 Controls/FluScrollablePage.qml -FluShadow 1.0 Controls/FluShadow.qml -FluSheet 1.0 Controls/FluSheet.qml -FluShortcutPicker 1.0 Controls/FluShortcutPicker.qml -FluSlider 1.0 Controls/FluSlider.qml -FluSpinBox 1.0 Controls/FluSpinBox.qml -FluSplitLayout 1.0 Controls/FluSplitLayout.qml -FluStaggeredLayout 1.0 Controls/FluStaggeredLayout.qml -FluStatusLayout 1.0 Controls/FluStatusLayout.qml -FluTabView 1.0 Controls/FluTabView.qml -FluTableView 1.0 Controls/FluTableView.qml -FluText 1.0 Controls/FluText.qml -FluTextBox 1.0 Controls/FluTextBox.qml -FluTextBoxBackground 1.0 Controls/FluTextBoxBackground.qml -FluTextBoxMenu 1.0 Controls/FluTextBoxMenu.qml -FluTextButton 1.0 Controls/FluTextButton.qml -FluTimePicker 1.0 Controls/FluTimePicker.qml -FluTimeline 1.0 Controls/FluTimeline.qml -FluToggleButton 1.0 Controls/FluToggleButton.qml -FluToggleSwitch 1.0 Controls/FluToggleSwitch.qml -FluTooltip 1.0 Controls/FluTooltip.qml -FluTour 1.0 Controls/FluTour.qml -FluTreeView 1.0 Controls/FluTreeView.qml -FluWindow 1.0 Controls/FluWindow.qml -FluWindowDialog 1.0 Controls/FluWindowDialog.qml -FluWindowResultLauncher 1.0 Controls/FluWindowResultLauncher.qml - -plugin fluentuiplugin diff --git a/src/Qt5/imports/fluentui.qrc b/src/Qt5/imports/fluentui.qrc deleted file mode 100644 index e27840cc..00000000 --- a/src/Qt5/imports/fluentui.qrc +++ /dev/null @@ -1,114 +0,0 @@ - - - FluentUI/JS/Chart.js - FluentUI/Image/noise.png - FluentUI/Controls/FluAcrylic.qml - FluentUI/Controls/FluAppBar.qml - FluentUI/Controls/FluAutoSuggestBox.qml - FluentUI/Controls/FluBadge.qml - FluentUI/Controls/FluBreadcrumbBar.qml - FluentUI/Controls/FluButton.qml - FluentUI/Controls/FluCalendarPicker.qml - FluentUI/Controls/FluCarousel.qml - FluentUI/Controls/FluChart.qml - FluentUI/Controls/FluCheckBox.qml - FluentUI/Controls/FluColorPicker.qml - FluentUI/Controls/FluComboBox.qml - FluentUI/Controls/FluContentDialog.qml - FluentUI/Controls/FluContentPage.qml - FluentUI/Controls/FluControl.qml - FluentUI/Controls/FluCopyableText.qml - FluentUI/Controls/FluDatePicker.qml - FluentUI/Controls/FluDivider.qml - FluentUI/Controls/FluDropDownButton.qml - FluentUI/Controls/FluExpander.qml - FluentUI/Controls/FluFilledButton.qml - FluentUI/Controls/FluFlipView.qml - FluentUI/Controls/FluFocusRectangle.qml - FluentUI/Controls/FluIcon.qml - FluentUI/Controls/FluIconButton.qml - FluentUI/Controls/FluImage.qml - FluentUI/Controls/FluInfoBar.qml - FluentUI/Controls/FluItemDelegate.qml - FluentUI/Controls/FluMenu.qml - FluentUI/Controls/FluMenuBar.qml - FluentUI/Controls/FluMenuBarItem.qml - FluentUI/Controls/FluMenuItem.qml - FluentUI/Controls/FluMenuSeparator.qml - FluentUI/Controls/FluMultilineTextBox.qml - FluentUI/Controls/FluNavigationView.qml - FluentUI/Controls/FluObject.qml - FluentUI/Controls/FluPage.qml - FluentUI/Controls/FluPagination.qml - FluentUI/Controls/FluPaneItem.qml - FluentUI/Controls/FluPaneItemEmpty.qml - FluentUI/Controls/FluPaneItemExpander.qml - FluentUI/Controls/FluPaneItemHeader.qml - FluentUI/Controls/FluPaneItemSeparator.qml - FluentUI/Controls/FluPasswordBox.qml - FluentUI/Controls/FluPivot.qml - FluentUI/Controls/FluPivotItem.qml - FluentUI/Controls/FluPopup.qml - FluentUI/Controls/FluProgressBar.qml - FluentUI/Controls/FluProgressButton.qml - FluentUI/Controls/FluProgressRing.qml - FluentUI/Controls/FluQRCode.qml - FluentUI/Controls/FluRadioButton.qml - FluentUI/Controls/FluRadioButtons.qml - FluentUI/Controls/FluRangeSlider.qml - FluentUI/Controls/FluRatingControl.qml - FluentUI/Controls/FluRemoteLoader.qml - FluentUI/Controls/FluScrollablePage.qml - FluentUI/Controls/FluScrollBar.qml - FluentUI/Controls/FluScrollIndicator.qml - FluentUI/Controls/FluShadow.qml - FluentUI/Controls/FluSlider.qml - FluentUI/Controls/FluSpinBox.qml - FluentUI/Controls/FluStaggeredLayout.qml - FluentUI/Controls/FluStatusLayout.qml - FluentUI/Controls/FluTableView.qml - FluentUI/Controls/FluTabView.qml - FluentUI/Controls/FluText.qml - FluentUI/Controls/FluTextBox.qml - FluentUI/Controls/FluTextBoxBackground.qml - FluentUI/Controls/FluTextBoxMenu.qml - FluentUI/Controls/FluTextButton.qml - FluentUI/Controls/FluTimeline.qml - FluentUI/Controls/FluTimePicker.qml - FluentUI/Controls/FluToggleButton.qml - FluentUI/Controls/FluToggleSwitch.qml - FluentUI/Controls/FluTooltip.qml - FluentUI/Controls/FluTour.qml - FluentUI/Controls/FluTreeView.qml - FluentUI/Controls/FluWindow.qml - FluentUI/Controls/FluLoadingButton.qml - FluentUI/Controls/FluClip.qml - FluentUI/Controls/FluLoader.qml - FluentUI/Controls/FluShortcutPicker.qml - FluentUI/Image/btn_close_hovered.png - FluentUI/Image/btn_close_normal.png - FluentUI/Image/btn_close_pushed.png - FluentUI/Image/btn_max_hovered.png - FluentUI/Image/btn_max_normal.png - FluentUI/Image/btn_max_pushed.png - FluentUI/Image/btn_min_hovered.png - FluentUI/Image/btn_min_normal.png - FluentUI/Image/btn_min_pushed.png - FluentUI/Controls/FluImageButton.qml - FluentUI/Controls/FluSplitLayout.qml - FluentUI/Controls/FluWindowDialog.qml - FluentUI/i18n/fluentui_en_US.qm - FluentUI/i18n/fluentui_zh_CN.qm - FluentUI/Controls/FluLauncher.qml - FluentUI/Controls/FluRouter.qml - FluentUI/Controls/FluWindowResultLauncher.qml - FluentUI/Controls/qmldir - FluentUI/Controls/FluEvent.qml - FluentUI/Controls/FluEventBus.qml - FluentUI/Controls/FluFrame.qml - FluentUI/Controls/FluSheet.qml - FluentUI/Controls/FluGroupBox.qml - FluentUI/Controls/FluControlBackground.qml - FluentUI/Font/FluentIcons.ttf - - diff --git a/src/Qt6/imports/FluentUI/Controls/FluAcrylic.qml b/src/Qt6/imports/FluentUI/Controls/FluAcrylic.qml index 9dd417e7..8d5f512c 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluAcrylic.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluAcrylic.qml @@ -34,7 +34,7 @@ Item { } Image { anchors.fill: parent - source: "qrc:/qt/qml/FluentUI/Image/noise.png" + source: "qrc:/qt-project.org/imports/FluentUI/Image/noise.png" fillMode: Image.Tile opacity: control.noiseOpacity } diff --git a/src/Qt6/imports/FluentUI/Controls/FluIcon.qml b/src/Qt6/imports/FluentUI/Controls/FluIcon.qml index a8bb3b2a..d7659131 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluIcon.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluIcon.qml @@ -16,6 +16,6 @@ Text { opacity: iconSource>0 FontLoader{ id: font_loader - source: "qrc:/qt/qml/FluentUI/Font/FluentIcons.ttf" + source: "qrc:/qt-project.org/imports/FluentUI/Font/FluentIcons.ttf" } } diff --git a/src/Qt6/imports/FluentUI/Controls/qmldir b/src/Qt6/imports/FluentUI/Controls/qmldir deleted file mode 100644 index 24e4704e..00000000 --- a/src/Qt6/imports/FluentUI/Controls/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -singleton FluRouter FluRouter.qml -singleton FluEventBus FluEventBus.qml diff --git a/src/fluentuiplugin.cpp b/src/fluentuiplugin.cpp deleted file mode 100644 index 55d865c5..00000000 --- a/src/fluentuiplugin.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "fluentuiplugin.h" - -#include "FluentUI.h" - -FluentUIPlugin::FluentUIPlugin() = default; - -void FluentUIPlugin::registerTypes(const char *uri) { - FluentUI::getInstance()->registerTypes(uri); -} - -void FluentUIPlugin::initializeEngine(QQmlEngine *engine, const char *uri) { - FluentUI::getInstance()->initializeEngine(engine, uri); -} diff --git a/src/fluentuiplugin.h b/src/fluentuiplugin.h deleted file mode 100644 index bc609baa..00000000 --- a/src/fluentuiplugin.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include - -/** - * @brief The FluentUIPlugin class - */ -class FluentUIPlugin : public QQmlExtensionPlugin { -Q_OBJECT - - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) -public: - FluentUIPlugin(); - - void registerTypes(const char *uri) Q_DECL_OVERRIDE; - - void initializeEngine(QQmlEngine *engine, const char *uri) Q_DECL_OVERRIDE; -}; \ No newline at end of file