GrabBag/GrabBagApp/StyledMessageBox.h

27 lines
797 B
C
Raw Permalink Normal View History

2025-07-23 01:35:14 +08:00
#ifndef STYLEDMESSAGEBOX_H
#define STYLEDMESSAGEBOX_H
#include <QMessageBox>
#include <QWidget>
class StyledMessageBox
{
public:
// 静态方法,显示信息弹窗
static void information(QWidget* parent, const QString& title, const QString& text);
// 静态方法,显示警告弹窗
static void warning(QWidget* parent, const QString& title, const QString& text);
// 静态方法,显示错误弹窗
static void critical(QWidget* parent, const QString& title, const QString& text);
private:
// 私有方法,应用统一的样式
static void applyStyle(QMessageBox& msgBox);
// 私有方法,设置中文按钮文本
static void setChineseButtonText(QMessageBox& msgBox);
};
#endif // STYLEDMESSAGEBOX_H