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:
38 // Constructor for SARibbonColorToolButton
39 explicit SARibbonColorToolButton(QWidget* parent = nullptr);
40 // Constructor with default action
41 explicit SARibbonColorToolButton(QAction* defaultAction, QWidget* parent = nullptr);
42 // Destructor for SARibbonColorToolButton
44 // Get the current color
45 QColor color() const;
46 // Set the color display style
47 void setColorStyle(ColorStyle s);
48 // Get the current color display style
49 ColorStyle colorStyle() const;
50 // Set up a standard color menu
51 SAColorMenu* setupStandardColorMenu();
52public Q_SLOTS:
53 // Set the color, emits colorChanged signal
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 QPixmap createIconPixmap(const QStyleOptionToolButton& opt, const QSize& iconSize) const override;
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:31
virtual QPixmap createIconPixmap(const QStyleOptionToolButton &opt, const QSize &iconSize) const
创建图标pixmap,子类可以重写此函数以自定义图标绘制
Definition SARibbonToolButton.cpp:1690