mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 03:10:10 +08:00
update
This commit is contained in:
parent
ab68770d63
commit
56681cb5a3
@ -90,12 +90,21 @@ set_target_properties(example PROPERTIES
|
||||
WIN32_EXECUTABLE TRUE
|
||||
)
|
||||
|
||||
#获取FluentUI插件库目录
|
||||
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
|
||||
find_library(FluentUI fluentuiplugin ${QML_PLUGIN_DIRECTORY})
|
||||
|
||||
#链接库
|
||||
target_link_libraries(example PRIVATE
|
||||
Qt6::Quick
|
||||
fluentuiplugin
|
||||
FramelessHelper::Core
|
||||
FramelessHelper::Quick
|
||||
${FluentUI}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
example PRIVATE
|
||||
${QML_PLUGIN_DIRECTORY}
|
||||
)
|
||||
|
||||
#安装
|
||||
|
@ -6,14 +6,16 @@
|
||||
#include <QProcess>
|
||||
#include <FramelessHelper/Quick/framelessquickmodule.h>
|
||||
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
||||
#include <FluGlobal.h>
|
||||
#include "lang/Lang.h"
|
||||
#include "AppInfo.h"
|
||||
#include "tool/IPC.h"
|
||||
|
||||
FRAMELESSHELPER_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FluentUI::preInit();
|
||||
FramelessHelper::Quick::initialize();
|
||||
//将样式设置为Basic,不然会导致组件显示异常
|
||||
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
||||
@ -22,9 +24,10 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication::setApplicationName("FluentUI");
|
||||
// QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
|
||||
QGuiApplication app(argc, argv);
|
||||
// FramelessHelper::Core::setApplicationOSThemeAware();
|
||||
// FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
// FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
FluentUI::postInit();
|
||||
// FramelessHelper::Core::setApplicationOSThemeAware();
|
||||
// FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
// FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
AppInfo* appInfo = new AppInfo();
|
||||
IPC ipc(0);
|
||||
QString activeWindowEvent = "activeWindow";
|
||||
@ -41,6 +44,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
QQmlApplicationEngine engine;
|
||||
FluentUI::initEngine(&engine);
|
||||
FramelessHelper::Quick::registerTypes(&engine);
|
||||
QQmlContext * context = engine.rootContext();
|
||||
Lang* lang = appInfo->lang();
|
||||
|
@ -54,7 +54,7 @@ qt_add_qml_module(fluentuiplugin
|
||||
URI "FluentUI"
|
||||
SOURCES ${sources_files} fluentui.rc
|
||||
QML_FILES ${qml_files}
|
||||
RESOURCES ${resource_files}
|
||||
RESOURCES ${resource_files} FluGlobal.h
|
||||
#支持designer
|
||||
DESIGNER_SUPPORTED
|
||||
)
|
||||
|
17
src/FluGlobal.cpp
Normal file
17
src/FluGlobal.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "FluGlobal.h"
|
||||
|
||||
#include<QDebug>
|
||||
|
||||
namespace FluentUI {
|
||||
|
||||
void preInit(){
|
||||
qDebug()<<"preInit";
|
||||
}
|
||||
void postInit(){
|
||||
qDebug()<<"postInit";
|
||||
}
|
||||
void initEngine(QQmlApplicationEngine* engine){
|
||||
qDebug()<<"initEngine";
|
||||
}
|
||||
|
||||
}
|
13
src/FluGlobal.h
Normal file
13
src/FluGlobal.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef FLUGLOBAL_H
|
||||
#define FLUGLOBAL_H
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
namespace FluentUI {
|
||||
Q_DECL_EXPORT void preInit();
|
||||
Q_DECL_EXPORT void postInit();
|
||||
Q_DECL_EXPORT void initEngine(QQmlApplicationEngine* engine);
|
||||
}
|
||||
|
||||
#endif // FLUGLOBAL_H
|
Loading…
Reference in New Issue
Block a user