更新README.d

增加upx.exe文件
增加QT静态编译无依赖设定信息
补全修改全局设置功能
删除common.h的#include <winuser.h>
默认样式为style=1
This commit is contained in:
JackLee_CN 2024-10-13 21:09:14 +08:00
parent e1850ad366
commit 380b7cd512
12 changed files with 37 additions and 36 deletions

View File

@ -1,5 +1,5 @@
#cmake #cmake
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.19)
set(VCPKG_ROOT "F:/SourceCode/vcpkg") set(VCPKG_ROOT "F:/SourceCode/vcpkg")
set(CMAKE_TOOLCHAIN_FILE "F:/SourceCode/vcpkg/scripts/buildsystems/vcpkg.cmake") set(CMAKE_TOOLCHAIN_FILE "F:/SourceCode/vcpkg/scripts/buildsystems/vcpkg.cmake")
@ -42,7 +42,10 @@ endif()
MESSAGE(STATUS "----------编译模式 END---------------") MESSAGE(STATUS "----------编译模式 END---------------")
#QT .cmake #QT .cmake
SET(QT_DIR "D:/Dev/Qt/6.3.2/mingw1120_static_x64_base/lib/cmake") #QT
SET(QT_DIR "D:/Dev/Qt/6.8.0/mingw1310_static_x64/lib/cmake")
#Msys2
#SET(QT_DIR "D:/Dev/msys64/mingw64/qt6-static/lib/cmake")
SET(JSON ${PROJECT_SOURCE_DIR}/3rdparty/json) SET(JSON ${PROJECT_SOURCE_DIR}/3rdparty/json)
LIST(APPEND CMAKE_PREFIX_PATH ${QT_DIR} ${MSYS}) LIST(APPEND CMAKE_PREFIX_PATH ${QT_DIR} ${MSYS})
@ -146,11 +149,13 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -ftrapv")
# #
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -fstack-check") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -fstack-check")
#winpthreadgcc_s
SET(CMAKE_CXX_FLAGS "-static-libstdc++ -static-libgcc")
# #
target_link_options(${PROJECT_NAME} PUBLIC -Wl,--allow-multiple-definition) target_link_options(${PROJECT_NAME} PUBLIC -Wl,--allow-multiple-definition)
#
#SET(CMAKE_EXE_LINKER_FLAGS -static)
#set_property(TARGET harfbuzz::harfbuzz PROPERTY
# IMPORTED_IMPLIB "D:/Dev/msys64/mingw64/lib/libharfbuzz.dll.a" )
target_link_libraries( target_link_libraries(
${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets PkgConfig::LIBGIT2 PkgConfig::CURL ${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets PkgConfig::LIBGIT2 PkgConfig::CURL
) )

View File

@ -9,11 +9,16 @@
2-入库游戏ID这个项目的选择用于确定steam的游戏名字对应的ID,有此ID就可以在上面数据服务器中寻找游戏的文件清单.</br> 2-入库游戏ID这个项目的选择用于确定steam的游戏名字对应的ID,有此ID就可以在上面数据服务器中寻找游戏的文件清单.</br>
# Windows Mingw64 Msys2编译环境 # Windows Mingw64 Msys2编译环境
依赖库QT,libcurl,libgit2 依赖库QT,libcurl,libgit2</br>
QT编译方式可静态可动态 QT编译方式可静态可动态</br>
libcurl采用msys2静态编译,编译后安装在msys2中 libcurl采用msys2静态编译,编译后安装在msys2中</br>
libgit2采用msys2静态编译,编译后安装在msys2中 libgit2采用msys2静态编译,编译后安装在msys2中</br>
想要编译出来的exe不依赖任何dll库则需要修改QT静态库下面文件</br>
mingw73_32_static\mkspecs\common\g++-win32.conf下增加和修改</br>
在g++-win32.conf文件中新增QMAKE_LFLAGS = -static</br>
在g++-win32.conf文件中修改QMAKE_LFLAGS_DLL = -static</br>
mingw73_32_static\mkspecs\common\base.conf</br>
在base.conf文件中新增QMAKE_LFLAGS = -static</br>
# 完成进度 # 完成进度
1-数据服务器增删改减√</br> 1-数据服务器增删改减√</br>
2-一键游戏ID入库√</br> 2-一键游戏ID入库√</br>

View File

@ -51,5 +51,4 @@
#include <fstream> #include <fstream>
#include <zlib.h> #include <zlib.h>
#include <string.h> #include <string.h>
#include <winuser.h>
#endif // COMMON_H #endif // COMMON_H

View File

@ -6,6 +6,8 @@ sui::sui(QWidget *parent)
m_press(false), m_press(false),
m_border_width(5) m_border_width(5)
{ {
QFuture<void> future = QtConcurrent::run([=]()
{ xsteam_init_opts();});
init_layout(); init_layout();
} }
sui::~sui() sui::~sui()

View File

@ -1,12 +0,0 @@
#ifndef SUI_BASE_H
#define SUI_BASE_H
#include <vector>
#include <string>
typedef struct {
int set_font;
int set_style;
}sui_sets;
extern sui_sets s_sets;
#endif // SUI_BASE_H

View File

@ -59,8 +59,6 @@ sui_title::sui_title(QWidget *parent)
m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setContentsMargins(0, 0, 0, 0);
setFixedHeight(40); setFixedHeight(40);
setLayout(m_layout); setLayout(m_layout);
s_sets.set_font=0;
s_sets.set_style=1;
QDir *fontDir = new QDir(tr(":/res/font/")); QDir *fontDir = new QDir(tr(":/res/font/"));
font_table = fontDir->entryList(QDir::Files); font_table = fontDir->entryList(QDir::Files);
font_table.append(QFontDatabase::applicationFontFamilies(QFontDatabase::SimplifiedChinese)); font_table.append(QFontDatabase::applicationFontFamilies(QFontDatabase::SimplifiedChinese));
@ -92,7 +90,7 @@ void sui_title::slots_ico_menu()
QAction* s_Action=new QAction(sName,s_QGroup); QAction* s_Action=new QAction(sName,s_QGroup);
s_Action->setObjectName(QString::number(i)); s_Action->setObjectName(QString::number(i));
s_Action->setCheckable(true); s_Action->setCheckable(true);
if(i==s_sets.set_style){ if(i==_data.x_config.style){
s_Action->setChecked(true); s_Action->setChecked(true);
} }
connect(s_Action,SIGNAL(triggered (bool)),this,SLOT(slots_set_style_change())); connect(s_Action,SIGNAL(triggered (bool)),this,SLOT(slots_set_style_change()));
@ -107,7 +105,7 @@ void sui_title::slots_ico_menu()
QAction* f_Action=new QAction(font_table[i],f_QGroup); QAction* f_Action=new QAction(font_table[i],f_QGroup);
f_Action->setObjectName(QString::number(i)); f_Action->setObjectName(QString::number(i));
f_Action->setCheckable(true); f_Action->setCheckable(true);
if(i==s_sets.set_font){ if(i==_data.x_config.font){
f_Action->setChecked(true); f_Action->setChecked(true);
} }
connect(f_Action,SIGNAL(triggered (bool)),this,SLOT(slots_set_font_change())); connect(f_Action,SIGNAL(triggered (bool)),this,SLOT(slots_set_font_change()));
@ -123,16 +121,16 @@ void sui_title::slots_ico_menu()
void sui_title::slots_set_style_change() void sui_title::slots_set_style_change()
{ {
if(sender()!=nullptr){ if(sender()!=nullptr){
s_sets.set_style=sender()->objectName().toInt(); _data.x_config.style=sender()->objectName().toInt();
} }
change_style(s_sets.set_style); change_style(_data.x_config.style);
} }
void sui_title::slots_set_font_change() void sui_title::slots_set_font_change()
{ {
if(sender()!=nullptr){ if(sender()!=nullptr){
s_sets.set_font=sender()->objectName().toInt(); _data.x_config.font=sender()->objectName().toInt();
} }
QString font=tr(":/res/font/")+font_table[s_sets.set_font]; QString font=tr(":/res/font/")+font_table[_data.x_config.font];
int fontId = QFontDatabase::addApplicationFont(font); int fontId = QFontDatabase::addApplicationFont(font);
QStringList fontIDs = QFontDatabase::applicationFontFamilies(fontId); QStringList fontIDs = QFontDatabase::applicationFontFamilies(fontId);
if (!fontIDs.isEmpty()) { if (!fontIDs.isEmpty()) {
@ -143,7 +141,7 @@ void sui_title::slots_set_font_change()
else { else {
qDebug()<<"Failed to load font."; qDebug()<<"Failed to load font.";
} }
change_style(s_sets.set_style); change_style(_data.x_config.style);
} }
void sui_title::change_style(int index){ void sui_title::change_style(int index){
QString style=tr(":/res/qss/")+style_table[index]; QString style=tr(":/res/qss/")+style_table[index];

View File

@ -15,9 +15,7 @@
#include <QDir> #include <QDir>
#include <QActionGroup> #include <QActionGroup>
#include <QFontDatabase> #include <QFontDatabase>
#include "sui_base.h"
#include "xsteam_ex.h" #include "xsteam_ex.h"
sui_sets s_sets;
class sui_title: public QWidget class sui_title: public QWidget
{ {
Q_OBJECT Q_OBJECT

View File

@ -365,7 +365,7 @@ void xsteam_save_data_read()
_data.s_data.push_back(_src_data); _data.s_data.push_back(_src_data);
// 默认配置 // 默认配置
_data.x_config.font = 0; _data.x_config.font = 0;
_data.x_config.style = 0; _data.x_config.style = 1;
QSettings settings("HKEY_CURRENT_USER\\Software\\Valve\\Steam", QSettings::NativeFormat); QSettings settings("HKEY_CURRENT_USER\\Software\\Valve\\Steam", QSettings::NativeFormat);
_data.x_config.steam_dir = (settings.value("SteamPath", "").toString()).toStdString(); _data.x_config.steam_dir = (settings.value("SteamPath", "").toString()).toStdString();
_data.x_config.steam_api_url = "https://store.steampowered.com/api/appdetails/?appids="; _data.x_config.steam_api_url = "https://store.steampowered.com/api/appdetails/?appids=";

View File

@ -84,6 +84,12 @@ void xsteam_set_ui::load_data_set(){
steaminfo_head_path_edit->setText(QString::fromStdString(_data.x_config.steam_logo_url)); steaminfo_head_path_edit->setText(QString::fromStdString(_data.x_config.steam_logo_url));
} }
void xsteam_set_ui::slotsSaveDone(){ void xsteam_set_ui::slotsSaveDone(){
qInfo()<<"Done Object!"; _data.x_config.steam_dir=steam_path_edit->text().toStdString();
_data.x_config.steamtools_dir=steamtools_path_edit->text().toStdString();
_data.x_config.steamtools_st_dir=steamtools_st_path_edit->text().toStdString();
_data.x_config.steam_api_url=steaminfo_api_path_edit->text().toStdString();
_data.x_config.steam_logo_url=steaminfo_head_path_edit->text().toStdString();
xsteam_save_data_write();
xsteam_msg_tip(nullptr, "保存成功");
this->close(); this->close();
} }

View File

@ -13,6 +13,7 @@
#include <QPushButton> #include <QPushButton>
#include <QLabel> #include <QLabel>
#include "xsteam_base.h" #include "xsteam_base.h"
#include "xsteam_ex.h"
class xsteam_set_ui :public QDialog{ class xsteam_set_ui :public QDialog{
Q_OBJECT Q_OBJECT
public: public:

View File

@ -16,7 +16,6 @@ xsteam_ui::xsteam_ui(QWidget *parent) : QWidget(parent),
{ {
bool steam_ok=false; bool steam_ok=false;
bool steamtools_ok=false; bool steamtools_ok=false;
xsteam_init_opts();
emit signals_src_combobox_update(); emit signals_src_combobox_update();
slots_disable_enable_function(true); slots_disable_enable_function(true);
table_load_ui_data(); table_load_ui_data();

BIN
upx/upx.exe Normal file

Binary file not shown.