结构更新

This commit is contained in:
2026-07-24 09:17:13 +08:00
parent a13a0e15f2
commit 7091ff5d79
6 changed files with 244 additions and 364 deletions
+8 -19
View File
@@ -1,7 +1,7 @@
#ifndef Global_H
#define Global_H
#include "BackEnd/BackEnd.h"
#include "YSGraphic_Core/GlobalTypes.h"
#include "YSGraphic_Core/architecture/export.h"
#include <QApplication>
#include <QDebug>
#include <QHBoxLayout>
@@ -21,29 +21,18 @@ public:
int adaptHeight(int fullScreenHeight);
int adaptWidth(int fullScreenWidth);
};
QVBoxLayout* createVBoxLayout(const QVector<QWidget*>& children = {}, QWidget *parent = nullptr);
QHBoxLayout* createHBoxLayout(const QVector<QWidget*>& children = {}, QWidget *parent = nullptr);
QVBoxLayout* createVBoxLayout(const QVector<QWidget*>& children = {}, QWidget* parent = nullptr);
QHBoxLayout* createHBoxLayout(const QVector<QWidget*>& children = {}, QWidget* parent = nullptr);
QRect getMaxRect(const QRect& rect, double WHRate);
int calculateOptimalFontSize(const QString& text, const QSize& spaceSize, const QFont& font);
int calculateOptimalFontSize(const QVector<QString>& textList, const QSize& spaceSize, const QFont& font);
QPushButton* createButton(const QString& text, int fontSize, const std::function<void(void)>& mFunc = nullptr);
namespace YSG{
template <typename T>
class Roll_Object;
namespace YSG {
template <typename T>
class Roll_Object;
}
class BaseWidgetMenu;
void initClickButton(QPushButton* button, const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::Roll_Object<QPushButton>*);
QPushButton *createClickButton(const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::Roll_Object<QPushButton>*);
void initClickButton(QPushButton* button, const QString& text, int fontSize, const std::function<void(void)>& mFunc, YSG::Roll_Object<QPushButton>*);
QPushButton* createClickButton(const QString& text, int fontSize, const std::function<void(void)>& mFunc, YSG::Roll_Object<QPushButton>*);
QPushButton* createNormal(const QString& text, int fontSize, const std::function<void(void)>& mFunc = nullptr);
#endif