main
zhuzihcu 2023-05-17 11:42:03 +08:00
parent 09fa471a10
commit 09dd381bbc
8 changed files with 28 additions and 7 deletions

View File

@ -24,7 +24,7 @@ FluScrollablePage{
asynchronous: true asynchronous: true
source: "qrc:/example/res/image/banner_3.jpg" source: "qrc:/example/res/image/banner_3.jpg"
anchors.fill: parent anchors.fill: parent
sourceSize: Qt.size(width,height) sourceSize: Qt.size(2*width,2*height)
} }
FluAcrylic { FluAcrylic {
sourceItem:image sourceItem:image

View File

@ -121,7 +121,7 @@ FluScrollablePage{
asynchronous: true asynchronous: true
source: "qrc:/example/res/image/banner_1.jpg" source: "qrc:/example/res/image/banner_1.jpg"
anchors.fill: parent anchors.fill: parent
sourceSize: Qt.size(width,height) sourceSize: Qt.size(2*width,2*height)
} }
Layout.topMargin: 20 Layout.topMargin: 20
} }

View File

@ -4,6 +4,7 @@
#include <QDir> #include <QDir>
#include <QQuickWindow> #include <QQuickWindow>
#include <QProcess> #include <QProcess>
#include <FluentUI/FluentUI.h>
#include "lang/Lang.h" #include "lang/Lang.h"
#include "AppInfo.h" #include "AppInfo.h"
#include "tool/IPC.h" #include "tool/IPC.h"
@ -11,6 +12,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
//将样式设置为Basic不然会导致组件显示异常 //将样式设置为Basic不然会导致组件显示异常
FluentUI::init();
qputenv("QT_QUICK_CONTROLS_STYLE","Basic"); qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
//6.4及以下监听系统深色模式变化 //6.4及以下监听系统深色模式变化
#ifdef Q_OS_WIN #ifdef Q_OS_WIN

View File

@ -44,6 +44,8 @@ foreach(filepath IN LISTS qml_files resource_files)
set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename}) set_source_files_properties(${filepath} PROPERTIES QT_RESOURCE_ALIAS ${filename})
endforeach() endforeach()
set_source_files_properties(FluentUI.h PROPERTIES QT_RESOURCE_ALIAS "../../include/FluentUI/FluentUI.h")
#qml #qml
qt_add_library(fluentuiplugin SHARED) qt_add_library(fluentuiplugin SHARED)
qt_add_qml_module(fluentuiplugin qt_add_qml_module(fluentuiplugin
@ -54,7 +56,7 @@ qt_add_qml_module(fluentuiplugin
URI "FluentUI" URI "FluentUI"
SOURCES ${sources_files} fluentui.rc SOURCES ${sources_files} fluentui.rc
QML_FILES ${qml_files} QML_FILES ${qml_files}
RESOURCES ${resource_files} RESOURCES ${resource_files} FluentUI.h
#designer #designer
DESIGNER_SUPPORTED DESIGNER_SUPPORTED
) )

View File

@ -8,9 +8,6 @@
#include <QQmlContext> #include <QQmlContext>
#include <QJsonObject> #include <QJsonObject>
#include <QQmlEngine> #include <QQmlEngine>
#include "FluTheme.h"
#include "FluTools.h"
#include "FluColors.h"
#include "FluRegister.h" #include "FluRegister.h"
#include "stdafx.h" #include "stdafx.h"

View File

@ -1,8 +1,8 @@
#include "FluTheme.h" #include "FluTheme.h"
#include "Def.h" #include "Def.h"
#include "FluColors.h"
#include <QPalette> #include <QPalette>
#include "FluApp.h"
#include <QGuiApplication> #include <QGuiApplication>
FluTheme* FluTheme::m_instance = nullptr; FluTheme* FluTheme::m_instance = nullptr;

5
src/FluentUI.cpp Normal file
View File

@ -0,0 +1,5 @@
#include "FluentUI.h"
void FluentUI::init(){
qDebug()<<"FluentUI init";
}

15
src/FluentUI.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef FLUENTUI_H
#define FLUENTUI_H
#include <QObject>
#include <QDebug>
class Q_DECL_EXPORT FluentUI
{
public:
static void init();
};
#endif // FLUENTUI_H