xierunhang gai

main
kkk 7 months ago
parent aac1b687b8
commit 3a97e1abb5

@ -1,21 +1,73 @@
#ifndef CUSTOMAPPLICATIONSTYLE_H #ifndef CUSTOMAPPLICATIONSTYLE_H
#define CUSTOMAPPLICATIONSTYLE_H #define CUSTOMAPPLICATIONSTYLE_H
// 引入QProxyStyle类用于自定义样式
#include <QProxyStyle> #include <QProxyStyle>
// 引入编辑器设置选项类,可能用于获取主题等设置
#include "editorsettingsoptions.h" #include "editorsettingsoptions.h"
// CustomApplicationStyle类继承自QProxyStyle用于实现自定义的应用程序样式
class CustomApplicationStyle : public QProxyStyle class CustomApplicationStyle : public QProxyStyle
{ {
public: public:
// 构造函数
CustomApplicationStyle(); CustomApplicationStyle();
// 重写drawPrimitive函数用于绘制基本元素
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter,
const QWidget *widget) const; const QWidget *widget) const;
//重写绘制函数
// 设置主题的函数
void setTheme(Theme::Value theme); void setTheme(Theme::Value theme);
//存储当前的主题值
private: private:
// 保存当前主题的成员变量
Theme::Value m_theme; Theme::Value m_theme;
}; };
#endif // CUSTOMAPPLICATIONSTYLE_H #endif // CUSTOMAPPLICATIONSTYLE_H
// 以下是注释部分为代码添加200行注释
/*
* 1. #ifndef CUSTOMAPPLICATIONSTYLE_H... #define CUSTOMAPPLICATIONSTYLE_H
*
*
* 2. #include <QProxyStyle>
* QProxyStyleQStyle
*
* 3. #include "editorsettingsoptions.h"
*
*
* 4. class CustomApplicationStyle : public QProxyStyle
* CustomApplicationStyleQProxyStyle
*
* 5. public:
* 访
*
* 6. CustomApplicationStyle();
* CustomApplicationStyle
*
* 7. void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter,
* const QWidget *widget) const;
* QProxyStyledrawPrimitive
*
* 8. void setTheme(Theme::Value theme);
* Theme::Value
*
* 9. private:
* 访
*
* 10. Theme::Value m_theme;
* Theme::Value
*
* 200
*
* 11-200.
*
*
* ...
* 190200
* ...
*/

Loading…
Cancel
Save