SARibbon 2.5.2
SARibbon wiki
载入中...
搜索中...
未找到
SARibbonColorToolButton.h
1#ifndef SARIBBONCOLORTOOLBUTTON_H
2#define SARIBBONCOLORTOOLBUTTON_H
3#include "SARibbonToolButton.h"
4#include "SARibbonGlobal.h"
5class SAColorMenu;
17class SA_RIBBON_EXPORT SARibbonColorToolButton : public SARibbonToolButton
18{
19 Q_OBJECT
20 SA_RIBBON_DECLARE_PRIVATE(SARibbonColorToolButton)
21public:
32 {
34 ColorFillToIcon
35 };
36
37public:
39 explicit SARibbonColorToolButton(QWidget* parent = nullptr);
41 explicit SARibbonColorToolButton(QAction* defaultAction, QWidget* parent = nullptr);
45 QColor color() const;
47 void setColorStyle(ColorStyle s);
49 ColorStyle colorStyle() const;
51 SAColorMenu* setupStandardColorMenu();
52public Q_SLOTS:
54 void setColor(const QColor& c);
55private Q_SLOTS:
56 void onButtonClicked(bool checked = false);
57Q_SIGNALS:
71 void colorClicked(const QColor& color, bool checked = false);
83 void colorChanged(const QColor& color);
84
85protected:
87 void paintIcon(QPainter& p, const QStyleOptionToolButton& opt, const QRect& iconDrawRect);
88};
89
90#endif // SARIBBONCOLORTOOLBUTTON_H
Definition SAColorMenu.h:19
Definition SARibbonColorToolButton.h:18
void colorClicked(const QColor &color, bool checked=false)
void colorChanged(const QColor &color)
ColorStyle
Definition SARibbonColorToolButton.h:32
@ ColorUnderIcon
颜色在icon下方,这个要求必须设置icon
Definition SARibbonColorToolButton.h:33
Definition SARibbonToolButton.h:27
virtual void paintIcon(QPainter &p, const QStyleOptionToolButton &opt, const QRect &iconDrawRect)
Paints the button's icon / 绘制按钮的图标
Definition SARibbonToolButton.cpp:1426