SARibbon 2.5.1
SARibbon wiki
载入中...
搜索中...
未找到
SARibbonColorToolButton.h
1#ifndef SARIBBONCOLORTOOLBUTTON_H
2#define SARIBBONCOLORTOOLBUTTON_H
3#include "SARibbonToolButton.h"
4#include "SARibbonGlobal.h"
5class SAColorMenu;
9class SA_RIBBON_EXPORT SARibbonColorToolButton : public SARibbonToolButton
10{
11 Q_OBJECT
12 SA_RIBBON_DECLARE_PRIVATE(SARibbonColorToolButton)
13public:
18 {
20 ColorFillToIcon
21 };
22
23public:
24 explicit SARibbonColorToolButton(QWidget* parent = nullptr);
25 explicit SARibbonColorToolButton(QAction* defaultAction, QWidget* parent = nullptr);
27 // 获取颜色
28 QColor color() const;
29 // 设置颜色显示方案
30 void setColorStyle(ColorStyle s);
31 ColorStyle colorStyle() const;
32 // 建立标准的颜色菜单
33 SAColorMenu* setupStandardColorMenu();
34public Q_SLOTS:
35 // 设置颜色,会发射colorChanged信号
36 void setColor(const QColor& c);
37private Q_SLOTS:
38 void onButtonClicked(bool checked = false);
39Q_SIGNALS:
44 void colorClicked(const QColor& color, bool checked = false);
49 void colorChanged(const QColor& color);
50
51protected:
52 void paintIcon(QPainter& p, const QStyleOptionToolButton& opt, const QRect& iconDrawRect);
53};
54
55#endif // SARIBBONCOLORTOOLBUTTON_H
标准颜色菜单
Definition SAColorMenu.h:13
Refer to the color setting button in the office, which can display the color below the icon(参考office的...
Definition SARibbonColorToolButton.h:10
void colorClicked(const QColor &color, bool checked=false)
颜色被点击的响应
void colorChanged(const QColor &color)
颜色改变信号
ColorStyle
颜色样式
Definition SARibbonColorToolButton.h:18
@ ColorUnderIcon
颜色在icon下方,这个要求必须设置icon
Definition SARibbonColorToolButton.h:19
Ribbon interface adapted tool button / Ribbon界面适用的toolButton
Definition SARibbonToolButton.h:20
virtual void paintIcon(QPainter &p, const QStyleOptionToolButton &opt, const QRect &iconDrawRect)
Paints the button's icon / 绘制按钮的图标
Definition SARibbonToolButton.cpp:1358