From 09dd381bbc577a0319fbf61bcf770bb41f8646eb Mon Sep 17 00:00:00 2001 From: zhuzihcu Date: Wed, 17 May 2023 11:42:03 +0800 Subject: [PATCH] update --- example/qml/page/T_Acrylic.qml | 2 +- example/qml/page/T_Rectangle.qml | 2 +- example/src/main.cpp | 2 ++ src/CMakeLists.txt | 4 +++- src/FluApp.h | 3 --- src/FluTheme.cpp | 2 +- src/FluentUI.cpp | 5 +++++ src/FluentUI.h | 15 +++++++++++++++ 8 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/FluentUI.cpp create mode 100644 src/FluentUI.h diff --git a/example/qml/page/T_Acrylic.qml b/example/qml/page/T_Acrylic.qml index 521f853..c634868 100644 --- a/example/qml/page/T_Acrylic.qml +++ b/example/qml/page/T_Acrylic.qml @@ -24,7 +24,7 @@ FluScrollablePage{ asynchronous: true source: "qrc:/example/res/image/banner_3.jpg" anchors.fill: parent - sourceSize: Qt.size(width,height) + sourceSize: Qt.size(2*width,2*height) } FluAcrylic { sourceItem:image diff --git a/example/qml/page/T_Rectangle.qml b/example/qml/page/T_Rectangle.qml index be0fc56..5c6eb3f 100644 --- a/example/qml/page/T_Rectangle.qml +++ b/example/qml/page/T_Rectangle.qml @@ -121,7 +121,7 @@ FluScrollablePage{ asynchronous: true source: "qrc:/example/res/image/banner_1.jpg" anchors.fill: parent - sourceSize: Qt.size(width,height) + sourceSize: Qt.size(2*width,2*height) } Layout.topMargin: 20 } diff --git a/example/src/main.cpp b/example/src/main.cpp index e7bf88f..40dce66 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "lang/Lang.h" #include "AppInfo.h" #include "tool/IPC.h" @@ -11,6 +12,7 @@ int main(int argc, char *argv[]) { //将样式设置为Basic,不然会导致组件显示异常 + FluentUI::init(); qputenv("QT_QUICK_CONTROLS_STYLE","Basic"); //6.4及以下监听系统深色模式变化 #ifdef Q_OS_WIN diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 45a4064..a7f8efe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,6 +44,8 @@ foreach(filepath IN LISTS qml_files resource_files) set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename}) endforeach() +set_source_files_properties(FluentUI.h PROPERTIES QT_RESOURCE_ALIAS "../../include/FluentUI/FluentUI.h") + #添加qml模块 qt_add_library(fluentuiplugin SHARED) qt_add_qml_module(fluentuiplugin @@ -54,7 +56,7 @@ qt_add_qml_module(fluentuiplugin URI "FluentUI" SOURCES ${sources_files} fluentui.rc QML_FILES ${qml_files} - RESOURCES ${resource_files} + RESOURCES ${resource_files} FluentUI.h #支持designer DESIGNER_SUPPORTED ) diff --git a/src/FluApp.h b/src/FluApp.h index dab8e00..b03961a 100644 --- a/src/FluApp.h +++ b/src/FluApp.h @@ -8,9 +8,6 @@ #include #include #include -#include "FluTheme.h" -#include "FluTools.h" -#include "FluColors.h" #include "FluRegister.h" #include "stdafx.h" diff --git a/src/FluTheme.cpp b/src/FluTheme.cpp index d4c1ab4..41b4d92 100644 --- a/src/FluTheme.cpp +++ b/src/FluTheme.cpp @@ -1,8 +1,8 @@ #include "FluTheme.h" #include "Def.h" +#include "FluColors.h" #include -#include "FluApp.h" #include FluTheme* FluTheme::m_instance = nullptr; diff --git a/src/FluentUI.cpp b/src/FluentUI.cpp new file mode 100644 index 0000000..cf7bfc7 --- /dev/null +++ b/src/FluentUI.cpp @@ -0,0 +1,5 @@ +#include "FluentUI.h" + +void FluentUI::init(){ + qDebug()<<"FluentUI init"; +} diff --git a/src/FluentUI.h b/src/FluentUI.h new file mode 100644 index 0000000..cba1e73 --- /dev/null +++ b/src/FluentUI.h @@ -0,0 +1,15 @@ +#ifndef FLUENTUI_H +#define FLUENTUI_H + +#include +#include + +class Q_DECL_EXPORT FluentUI +{ + +public: + static void init(); + +}; + +#endif // FLUENTUI_H