This commit is contained in:
zhuzichu
2023-08-10 16:08:27 +08:00
parent 3c349da98f
commit 312aebae73
16 changed files with 484 additions and 102 deletions

View File

@ -26,9 +26,6 @@ endif()
#获取文件路径分隔符(解决执行命令的时候有些平台会报错)
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
#设置版本号
add_definitions(-DVERSION=1,5,0,0)
find_package(Qt6 REQUIRED COMPONENTS Quick Svg Network)
if(QT_VERSION VERSION_GREATER_EQUAL "6.3")
@ -39,6 +36,13 @@ else()
set(CMAKE_AUTOUIC ON)
endif()
##生成版本信息头文件
set(HEADER_FILE_VERSION_PATH ${CMAKE_SOURCE_DIR}/example/Version.h)
configure_file(
${CMAKE_SOURCE_DIR}/.cmake/Version.h.in
${HEADER_FILE_VERSION_PATH}
)
#遍历所有Cpp文件
file(GLOB_RECURSE CPP_FILES *.cpp *.h)
foreach(filepath ${CPP_FILES})
@ -60,11 +64,21 @@ foreach(filepath ${RES_PATHS})
list(APPEND resource_files ${filename})
endforeach(filepath)
#如果是Windows平台则生成rc文件
set(EXAMPLE_VERSION_RC_PATH "")
if(WIN32)
set(EXAMPLE_VERSION_RC_PATH ${CMAKE_BINARY_DIR}/version_${PROJECT_NAME}.rc)
configure_file(
${CMAKE_SOURCE_DIR}/.cmake/version_exe.rc.in
${EXAMPLE_VERSION_RC_PATH}
)
endif()
#添加可执行文件
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (WIN32)
qt_add_executable(example
${sources_files}
example.rc
${EXAMPLE_VERSION_RC_PATH}
)
else ()
qt_add_executable(example

View File

@ -1,42 +0,0 @@
#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

View File

@ -38,7 +38,7 @@ FluExpander{
topMargin: 5
}
onClicked:{
FluTools.clipText(content.text)
FluTools.clipText(FluTools.html2PlantText(content.text))
showSuccess("复制成功")
}
}

View File

@ -102,7 +102,7 @@ FluContentPage{
param.custname = "朱子楚"
param.custtel = "1234567890"
param.custemail = "zhuzichu520@gmail.com"
// http.postJson("https://httpbingo.org/post",callable,param)
http.postJson("https://httpbingo.org/post",callable,param)
}
}
FluButton{
@ -125,7 +125,7 @@ FluContentPage{
console.debug(status+";"+errorString)
}
var param = "我命由我不由天"
// http.postString("https://httpbingo.org/post",callable,param)
http.postString("https://httpbingo.org/post",callable,param)
}
}
FluButton{

View File

@ -4,16 +4,12 @@
#include <QDebug>
#include "lang/En.h"
#include "lang/Zh.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))
#include "Version.h"
AppInfo::AppInfo(QObject *parent)
: QObject{parent}
{
version(VER_STR);
version(APPLICATION_VERSION);
lang(new En());
}