SARibbon 2.5.2
SARibbon wiki
载入中...
搜索中...
未找到
SARibbonColorToolButton类 参考

#include <SARibbonColorToolButton.h>

类 SARibbonColorToolButton 继承关系图:
SARibbonToolButton

class  PrivateData
 

Public 类型

enum  ColorStyle { ColorUnderIcon , ColorFillToIcon }
 
- Public 类型 继承自 SARibbonToolButton
enum  RibbonButtonType { LargeButton , SmallButton }
 Button type enumeration / 按钮样式枚举 更多...
 

Public 槽

void setColor (const QColor &c)
 Set the color, emits colorChanged signal
 

信号

void colorClicked (const QColor &color, bool checked=false)
 
void colorChanged (const QColor &color)
 

Public 成员函数

 SARibbonColorToolButton (QWidget *parent=nullptr)
 Constructor for SARibbonColorToolButton
 
 SARibbonColorToolButton (QAction *defaultAction, QWidget *parent=nullptr)
 Constructor with default action
 
 ~SARibbonColorToolButton ()
 Destructor for SARibbonColorToolButton
 
QColor color () const
 Get the current color
 
void setColorStyle (ColorStyle s)
 Set the color display style
 
ColorStyle colorStyle () const
 Get the current color display style
 
SAColorMenusetupStandardColorMenu ()
 Set up a standard color menu
 
- Public 成员函数 继承自 SARibbonToolButton
 SARibbonToolButton (QWidget *parent=nullptr)
 
 SARibbonToolButton (QAction *defaultAction, QWidget *parent=nullptr)
 
 ~SARibbonToolButton ()
 
RibbonButtonType buttonType () const
 Get the current button type (LargeButton or SmallButton)
 
void setButtonType (const RibbonButtonType &buttonType)
 Set the button type to LargeButton or SmallButton
 
bool isSmallRibbonButton () const
 Check if the button is a small ribbon button
 
bool isLargeRibbonButton () const
 Check if the button is a large ribbon button
 
int spacing () const
 Get the current spacing value
 
void setSpacing (int v)
 Set the spacing between elements and the border
 
void updateRect ()
 Force an update of the internal layout rectangles
 
void setLayoutFactor (const LayoutFactor &fac)
 Set the layout factor for fine-tuning the button's appearance
 
const LayoutFactorlayoutFactor () const
 Get the layout factor for fine-tuning the button's appearance (const version)
 
LayoutFactorlayoutFactor ()
 Get the layout factor for fine-tuning the button's appearance (non-const version)
 
void setEnableWordWrap (bool on)
 Enables or disables automatic text wrapping for large buttons / 为大按钮启用或禁用自动文字换行
 
bool isEnableWordWrap ()
 Checks if automatic text wrapping is enabled / 检查是否启用了自动文字换行
 
void setButtonMaximumAspectRatio (qreal v=1.4)
 Sets the button's maximum aspect ratio (width/height) / 设置按钮的最大宽高比
 
qreal buttonMaximumAspectRatio () const
 Gets the button's maximum aspect ratio (width/height) / 获取按钮的最大宽高比
 
void invalidateSizeHint ()
 Invalidates the cached size hint / 使缓存的size hint失效
 
void setLargeIconSize (const QSize &largeSize)
 大按钮的尺寸
 
QSize largeIconSize () const
 大按钮的尺寸
 
void setSmallIconSize (const QSize &smallSize)
 小按钮尺寸
 
QSize smallIconSize () const
 小按钮尺寸
 
virtual QSize sizeHint () const Q_DECL_OVERRIDE
 Returns the recommended size for the button / 返回按钮的推荐尺寸
 
virtual QSize minimumSizeHint () const Q_DECL_OVERRIDE
 Returns the recommended minimum size for the button / 返回按钮的推荐最小尺寸
 

Protected 成员函数

void paintIcon (QPainter &p, const QStyleOptionToolButton &opt, const QRect &iconDrawRect)
 Override paintIcon to add color under the icon
 
- Protected 成员函数 继承自 SARibbonToolButton
virtual void paintEvent (QPaintEvent *e) Q_DECL_OVERRIDE
 
virtual void resizeEvent (QResizeEvent *e) Q_DECL_OVERRIDE
 在resizeevent计算绘图所需的尺寸,避免在绘图过程中实时绘制提高效率
 
virtual void mouseMoveEvent (QMouseEvent *e) Q_DECL_OVERRIDE
 鼠标移动事件
 
virtual void mousePressEvent (QMouseEvent *e) Q_DECL_OVERRIDE
 SARibbonToolButton::mousePressEvent
 
virtual void mouseReleaseEvent (QMouseEvent *e) Q_DECL_OVERRIDE
 
virtual void focusOutEvent (QFocusEvent *e) Q_DECL_OVERRIDE
 
virtual void leaveEvent (QEvent *e) Q_DECL_OVERRIDE
 
virtual bool hitButton (const QPoint &pos) const Q_DECL_OVERRIDE
 
virtual bool event (QEvent *e) Q_DECL_OVERRIDE
 
virtual void changeEvent (QEvent *e) Q_DECL_OVERRIDE
 
virtual void actionEvent (QActionEvent *e) Q_DECL_OVERRIDE
 
virtual void paintButton (QPainter &p, const QStyleOptionToolButton &opt)
 Paints the button's background and frame / 绘制按钮的背景和边框
 
virtual void paintText (QPainter &p, const QStyleOptionToolButton &opt, const QRect &textDrawRect)
 Paints the button's text / 绘制按钮的文字
 
virtual void paintIndicator (QPainter &p, const QStyleOptionToolButton &opt, const QRect &indicatorDrawRect)
 Paints the button's indicator (e.g., dropdown arrow) / 绘制按钮的指示器(例如下拉箭头)
 

详细描述

成员枚举类型说明

◆ ColorStyle

枚举值
ColorUnderIcon 

颜色在icon下方,这个要求必须设置icon

ColorFillToIcon 

颜色作为icon,这个模式下在setColor会自动生成一个颜色icon替换掉原来的icon,因此setIcon函数没有作用

成员函数说明

◆ color()

QColor SARibbonColorToolButton::color ( ) const

Get the current color

◆ colorChanged

void SARibbonColorToolButton::colorChanged ( const QColor &  color)
signal

◆ colorClicked

void SARibbonColorToolButton::colorClicked ( const QColor &  color,
bool  checked = false 
)
signal

◆ colorStyle()

SARibbonColorToolButton::ColorStyle SARibbonColorToolButton::colorStyle ( ) const

Get the current color display style

◆ paintIcon()

void SARibbonColorToolButton::paintIcon ( QPainter &  p,
const QStyleOptionToolButton &  opt,
const QRect &  iconDrawRect 
)
protectedvirtual

Override paintIcon to add color under the icon

重载 SARibbonToolButton .

◆ setColor

void SARibbonColorToolButton::setColor ( const QColor &  c)
slot

Set the color, emits colorChanged signal

◆ setColorStyle()

void SARibbonColorToolButton::setColorStyle ( SARibbonColorToolButton::ColorStyle  s)

Set the color display style

◆ setupStandardColorMenu()

SAColorMenu * SARibbonColorToolButton::setupStandardColorMenu ( )

Set up a standard color menu


该类的文档由以下文件生成: