first commit

This commit is contained in:
zhuzihcu
2023-02-24 18:44:29 +08:00
commit 312418aded
21 changed files with 457 additions and 0 deletions

46
example/example.pro Normal file
View File

@ -0,0 +1,46 @@
QT += quick
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS QT_NO_WARNING_OUTPUT
SOURCES += \
main.cpp
RESOURCES += qml.qrc
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
#### 如果你正在使用静态库.a 那么你还需要将下面的配置注释取消掉
#### 其它项目使用方法也是如此
# DEFINES += STATICLIB
# LIBNAME = FluentUI
# CONFIG(debug, debug|release) {
# contains(QMAKE_HOST.os,Windows) {
# LIBNAME = FluentUI
# }else{
# LIBNAME = FluentUI_debug
# }
# }
# # Additional import path used to resolve QML modules in Qt Creator's code model
# QML_IMPORT_PATH = $$OUT_PWD/../bin/
# # Additional import path used to resolve QML modules just for Qt Quick Designer
# QML_DESIGNER_IMPORT_PATH = $$OUT_PWD/../bin/
# INCLUDEPATH += $$OUT_PWD/../bin/FluentUI/
# DEPENDPATH += $$OUT_PWD/../bin/FluentUI/
# LIBS += -L$$OUT_PWD/../bin/FluentUI/ -l$${LIBNAME}
# PRE_TARGETDEPS += $$OUT_PWD/../bin/FluentUI/lib$${LIBNAME}.a
### 注意:静态库 .so .dylib .dll 是自动安装的Qt qml plugin目录中不需要此步配置

22
example/main.cpp Normal file
View File

@ -0,0 +1,22 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <time.h>
#include <QDebug>
int main(int argc, char *argv[])
{
clock_t start,finish;
double totaltime;
start=clock();
qputenv("QSG_RENDER_LOOP","basic");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
finish=clock();
totaltime=(double)(finish-start)/CLOCKS_PER_SEC;
qDebug() << "startup time :" << totaltime << "s";
return app.exec();
}

31
example/main.qml Normal file
View File

@ -0,0 +1,31 @@
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Layouts 1.15
import FluentUI 1.0
Window {
id:rootwindow
visible: true
width: 480
height: 700
ColumnLayout{
spacing: 5
FluentUI{
width: 20
height: 20
}
StandardButton{
}
FilledButton{
}
}
}

5
example/qml.qrc Normal file
View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
</qresource>
</RCC>