This commit is contained in:
zhuzichu 2023-04-22 19:25:10 +08:00
parent da17b31be7
commit 82d1edc43c
7 changed files with 24 additions and 1 deletions

View File

@ -52,3 +52,8 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
mac: {
QMAKE_INFO_PLIST = Info.plist
}
#### 如果你正在使用静态库,请将将下面的配置注释取消掉
#DEFINES += STATICLIB
#INCLUDEPATH += $$OUT_PWD/../bin/FluentUI/
#LIBS += -L$$OUT_PWD/../bin/FluentUI/ -lFluentUI

View File

@ -8,6 +8,9 @@
#include "AppInfo.h"
#include "controller/ChatController.h"
#include "tool/IPC.h"
#if defined(STATICLIB)
#include <FluentUI.h>
#endif
int main(int argc, char *argv[])
{
@ -38,6 +41,9 @@ int main(int argc, char *argv[])
}
app.setQuitOnLastWindowClosed(false);
QQmlApplicationEngine engine;
#if defined(STATICLIB)
FluentUI::initialize(&engine);
#endif
qmlRegisterType<ChatController>("Controller",1,0,"ChatController");
QQmlContext * context = engine.rootContext();
Lang* lang = appInfo->lang();

View File

@ -11,6 +11,8 @@
#include "Def.h"
#ifdef Q_OS_WIN
#pragma comment(lib, "Dwmapi.lib")
#pragma comment(lib, "User32.lib")
#include <dwmapi.h>
#include <Windows.h>
#include <windowsx.h>

View File

@ -8,3 +8,8 @@ void FluentUI::registerTypes(const char *uri){
void FluentUI::initializeEngine(QQmlEngine *engine, const char *uri){
Fluent::getInstance()->initializeEngine(engine,uri);
}
void FluentUI::initialize(QQmlEngine *engine){
Fluent::getInstance()->registerTypes(URI_STR);
Fluent::getInstance()->initializeEngine(engine,URI_STR);
}

View File

@ -3,12 +3,13 @@
#include <QQmlEngine>
class FluentUI
class Q_DECL_EXPORT FluentUI
{
public:
static void registerTypes(const char *uri) ;
static void initializeEngine(QQmlEngine *engine, const char *uri);
static void initialize(QQmlEngine *engine);
};
#endif // FLUENTUI_H

View File

@ -2,6 +2,8 @@
#include "FluTheme.h"
#include "FluApp.h"
#ifdef Q_OS_WIN
#pragma comment(lib, "Dwmapi.lib")
#pragma comment(lib, "User32.lib")
#include <Windows.h>
#include <windowsx.h>
#endif

View File

@ -5,6 +5,8 @@
#include "FluTheme.h"
#ifdef Q_OS_WIN
#pragma comment(lib, "Dwmapi.lib")
#pragma comment(lib, "User32.lib")
#include <dwmapi.h>
#include <Windows.h>
#include <windowsx.h>