50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
#ifndef Global_H
|
|
#define Global_H
|
|
#include "BackEnd/BackEnd.h"
|
|
#include "YSGraphic_Core/GlobalTypes.h"
|
|
#include <QApplication>
|
|
#include <QDebug>
|
|
#include <QHBoxLayout>
|
|
#include <QKeyEvent>
|
|
#include <QPainter>
|
|
#include <QVBoxLayout>
|
|
#include <QVector>
|
|
#include <QWidget>
|
|
#include <QWindow>
|
|
#include <QtWidgets>
|
|
#include <QtWidgetsDepends>
|
|
#include <functional>
|
|
#include "psc_global_include/Singleton.hpp"
|
|
class Global : public Psc::Singleton<Global> {
|
|
public:
|
|
explicit Global();
|
|
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);
|
|
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 RollObject;
|
|
}
|
|
|
|
class BaseWidgetMenu;
|
|
|
|
void initClickButton(QPushButton* button, const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::RollObject<QPushButton>*);
|
|
QPushButton *createClickButton(const QString &text, int fontSize, const std::function<void(void)> &mFunc, YSG::RollObject<QPushButton>*);
|
|
|
|
|
|
|
|
QPushButton* createNormal(const QString& text, int fontSize, const std::function<void(void)>& mFunc = nullptr);
|
|
|
|
#endif
|