This commit is contained in:
zhuzihcu 2023-04-27 15:43:45 +08:00
parent a258d429c2
commit afeb6daea5
7 changed files with 106 additions and 6 deletions

View File

@ -5,6 +5,9 @@ project(example VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
add_definitions(-DVERSION=1,2,9,0)
#
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
@ -39,9 +42,16 @@ foreach(filepath ${RES_PATHS})
endforeach(filepath)
#
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
qt_add_executable(example
${sources_files}
example.rc
)
else ()
qt_add_executable(example
${sources_files}
)
endif ()
#
if(WIN32)

42
example/example.rc Normal file
View File

@ -0,0 +1,42 @@
#include <windows.h>
IDI_ICON1 ICON "favicon.ico"
#define STR(x) #x
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
#define VER_JOIN_(x) VER_JOIN x
#define VER_STR VER_JOIN_((VERSION))
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION
PRODUCTVERSION VERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Built by the FluentUI."
VALUE "CompanyName", "zhuzichu"
VALUE "FileDescription", "example"
VALUE "FileVersion", VER_STR
VALUE "InternalName", ""
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", ""
VALUE "ProductName", "example"
VALUE "ProductVersion", VER_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

BIN
example/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

View File

@ -1,11 +1,17 @@
#include "AppInfo.h"
#include "lang/En.h"
#include "lang/Zh.h"
#include <QDebug>
#define STR(x) #x
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
#define VER_JOIN_(x) VER_JOIN x
#define VER_STR VER_JOIN_((VERSION))
AppInfo::AppInfo(QObject *parent)
: QObject{parent}
{
version("1.2.8");
version(VER_STR);
lang(new En());
}

View File

@ -4,6 +4,9 @@ project(fluentui LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
add_definitions(-DVERSION=1,2,9,0)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)
else()
@ -39,7 +42,7 @@ qt_add_qml_module(fluentui
OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FluentUI
VERSION 1.0
URI "FluentUI"
SOURCES ${sources_files}
SOURCES ${sources_files} fluentui.rc
QML_FILES ${qml_files}
RESOURCES ${resource_files}
)

View File

@ -40,7 +40,6 @@ public:
Q_INVOKABLE void setFluApp(FluApp* val);
Q_INVOKABLE void setFluTheme(FluTheme* val);
Q_INVOKABLE void setFluColors(FluColors* val);
public:
QMap<quint64, QQuickWindow*> wnds;
static FluApp* fluApp;

40
src/fluentui.rc Normal file
View File

@ -0,0 +1,40 @@
#include <windows.h>
#define STR(x) #x
#define VER_JOIN(a,b,c,d) STR(a.b.c.d)
#define VER_JOIN_(x) VER_JOIN x
#define VER_STR VER_JOIN_((VERSION))
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION
PRODUCTVERSION VERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "FluentUI for QML."
VALUE "CompanyName", "zhuzichu"
VALUE "FileDescription", "fluentui"
VALUE "FileVersion", VER_STR
VALUE "InternalName", ""
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", ""
VALUE "ProductName", "fluentui"
VALUE "ProductVersion", VER_STR
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END