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

#include <SAColorToolButton.h>

类 SAColorToolButton 继承关系图:

class  PrivateData
 

Public 类型

enum  ColorToolButtonStyle { WithColorMenu , NoColorMenu }
 Color button built-in styles 更多...
 

Public 槽

void setColor (const QColor &c)
 Set color, will emit colorChanged signal
 

信号

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

Public 成员函数

 SAColorToolButton (QWidget *parent=nullptr)
 Constructor for SAColorToolButton
 
 SAColorToolButton (ColorToolButtonStyle style, QWidget *parent=nullptr)
 Constructor for SAColorToolButton with style
 
 ~SAColorToolButton ()
 Destructor for SAColorToolButton
 
QColor color () const
 Get color
 
void setMargins (const QMargins &mg)
 Set margins
 
QMargins margins () const
 Get margins
 
void setColorToolButtonStyle (ColorToolButtonStyle s)
 Set color tool button style
 
ColorToolButtonStyle colorToolButtonStyle () const
 Get color tool button style
 
SAColorMenucolorMenu () const
 Get colorMenu, note that this function may return nullptr if ColorToolButtonStyle is set to NoColorMenu or if a custom menu is set
 
SAColorMenucreateColorMenu ()
 Create standard color menu
 

静态 Public 成员函数

static void paintNoneColor (QPainter *p, const QRect &colorRect)
 Paint none color
 

Protected 成员函数

virtual void calcRect (const QStyleOptionToolButton &opt, QRect &iconRect, QRect &textRect, QRect &colorRect)
 Calculate positions of basic components
 
virtual void paintButton (QStylePainter *p, const QStyleOptionToolButton &opt)
 Paint button
 
virtual void paintIcon (QStylePainter *p, const QRect &iconRect, const QStyleOptionToolButton &opt)
 Paint icon
 
virtual void paintText (QStylePainter *p, const QRect &textRect, const QStyleOptionToolButton &opt)
 Paint text
 
virtual void paintColor (QStylePainter *p, const QRect &colorRect, const QColor &color, const QStyleOptionToolButton &opt)
 Paint color
 
virtual void paintEvent (QPaintEvent *e) Q_DECL_OVERRIDE
 Handle paint event
 
virtual void resizeEvent (QResizeEvent *e) Q_DECL_OVERRIDE
 Handle resize event
 
virtual QSize sizeHint () const Q_DECL_OVERRIDE
 Override sizeHint
 

详细描述

成员枚举类型说明

◆ ColorToolButtonStyle

Color button built-in styles

枚举值
WithColorMenu 

Default will build a SAColorMenu

NoColorMenu 

No ColorMenu

构造及析构函数说明

◆ SAColorToolButton() [1/2]

SAColorToolButton::SAColorToolButton ( QWidget *  parent = nullptr)
explicit

Constructor for SAColorToolButton

◆ SAColorToolButton() [2/2]

SAColorToolButton::SAColorToolButton ( ColorToolButtonStyle  style,
QWidget *  parent = nullptr 
)
explicit

Constructor for SAColorToolButton with style

◆ ~SAColorToolButton()

SAColorToolButton::~SAColorToolButton ( )

Destructor for SAColorToolButton

成员函数说明

◆ calcRect()

void SAColorToolButton::calcRect ( const QStyleOptionToolButton &  opt,
QRect &  iconRect,
QRect &  textRect,
QRect &  colorRect 
)
protectedvirtual

Calculate positions of basic components

◆ color()

QColor SAColorToolButton::color ( ) const

Get color

◆ colorChanged

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

◆ colorClicked

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

◆ colorMenu()

SAColorMenu * SAColorToolButton::colorMenu ( ) const

Get colorMenu, note that this function may return nullptr if ColorToolButtonStyle is set to NoColorMenu or if a custom menu is set

◆ colorToolButtonStyle()

SAColorToolButton::ColorToolButtonStyle SAColorToolButton::colorToolButtonStyle ( ) const

Get color tool button style

◆ createColorMenu()

SAColorMenu * SAColorToolButton::createColorMenu ( )

Create standard color menu

◆ margins()

QMargins SAColorToolButton::margins ( ) const

Get margins

◆ paintButton()

void SAColorToolButton::paintButton ( QStylePainter *  p,
const QStyleOptionToolButton &  opt 
)
protectedvirtual

Paint button

◆ paintColor()

void SAColorToolButton::paintColor ( QStylePainter *  p,
const QRect &  colorRect,
const QColor &  color,
const QStyleOptionToolButton &  opt 
)
protectedvirtual

Paint color

◆ paintEvent()

void SAColorToolButton::paintEvent ( QPaintEvent *  e)
protectedvirtual

Handle paint event

◆ paintIcon()

void SAColorToolButton::paintIcon ( QStylePainter *  p,
const QRect &  iconRect,
const QStyleOptionToolButton &  opt 
)
protectedvirtual

Paint icon

◆ paintNoneColor()

void SAColorToolButton::paintNoneColor ( QPainter *  p,
const QRect &  colorRect 
)
static

Paint none color

◆ paintText()

void SAColorToolButton::paintText ( QStylePainter *  p,
const QRect &  textRect,
const QStyleOptionToolButton &  opt 
)
protectedvirtual

Paint text

◆ resizeEvent()

void SAColorToolButton::resizeEvent ( QResizeEvent *  e)
protectedvirtual

Handle resize event

◆ setColor

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

Set color, will emit colorChanged signal

◆ setColorToolButtonStyle()

void SAColorToolButton::setColorToolButtonStyle ( ColorToolButtonStyle  s)

Set color tool button style

◆ setMargins()

void SAColorToolButton::setMargins ( const QMargins &  mg)

Set margins

◆ sizeHint()

QSize SAColorToolButton::sizeHint ( ) const
protectedvirtual

Override sizeHint

Qt6.4 取消了QApplication::globalStrut


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