CopperSpice API  1.9.2
QStyleOptionToolButton Class Reference

The QStyleOptionToolButton class is used to describe the parameters for drawing a tool button. More...

Inheritance diagram for QStyleOptionToolButton:
QStyleOptionComplex QStyleOption

Public Typedefs

using ToolButtonFeatures = QFlags< ToolButtonFeature >
 

Public Types

enum  StyleOptionType
 
enum  StyleOptionVersion
 
enum  ToolButtonFeature
 
- Public Types inherited from QStyleOptionComplex
enum  StyleOptionType
 
enum  StyleOptionVersion
 
- Public Types inherited from QStyleOption
enum  OptionType
 
enum  StyleOptionType
 
enum  StyleOptionVersion
 

Public Methods

 QStyleOptionToolButton ()
 
 QStyleOptionToolButton (const QStyleOptionToolButton &other)
 
QStyleOptionToolButton & operator= (const QStyleOptionToolButton &other) = default
 
- Public Methods inherited from QStyleOptionComplex
 QStyleOptionComplex (const QStyleOptionComplex &other)
 
 QStyleOptionComplex (int version=QStyleOptionComplex::Version, int type=SO_Complex)
 
QStyleOptionComplex & operator= (const QStyleOptionComplex &other) = default
 
- Public Methods inherited from QStyleOption
 QStyleOption (const QStyleOption &other)
 
 QStyleOption (int version=QStyleOption::Version, int type=SO_Default)
 
 ~QStyleOption ()
 
void initFrom (const QWidget *widget)
 
QStyleOption & operator= (const QStyleOption &other)
 

Public Members

Qt::ArrowType arrowType
 
ToolButtonFeatures features
 
QFont font
 
QIcon icon
 
QSize iconSize
 
QPoint pos
 
QString text
 
Qt::ToolButtonStyle toolButtonStyle
 
- Public Members inherited from QStyleOption
int type
 
int version
 

Additional Inherited Members

Detailed Description

The QStyleOptionToolButton class is used to describe the parameters for drawing a tool button. QStyleOptionToolButton contains all the information that QStyle functions need to draw QToolButton.

For performance reasons the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

See also
QStyleOption, QStyleOptionComplex, QStyleOptionButton

Member Typedef Documentation

Typedef for QFlags<ToolButtonFeature> which contains an OR combination of ToolButtonFeature values.

Refer to QStyleOptionToolButton::ToolButtonFeature for the enum documentation.

Member Enumeration Documentation

This enum is used to hold information about the type of the style option and is defined for each QStyleOption subclass.

ConstantValueDescription
QStyleOptionToolButton::TypeSO_ToolButton The type of style option provided (SO_ToolButton for this class).
See also
StyleOptionVersion, qstyleoption_cast()

This enum is used to hold information about the version of the style option and is defined for each QStyleOption subclass.

ConstantValueDescription
QStyleOptionToolButton::Version11
See also
StyleOptionType, qstyleoption_cast()

Describes the various features that a tool button can have.

ConstantValueDescription
QStyleOptionToolButton::None0x00 A normal tool button.
QStyleOptionToolButton::Arrow0x01 Tool button is an arrow.
QStyleOptionToolButton::Menu0x04 Tool button has a menu.
QStyleOptionToolButton::PopupDelay0x08 There is a delay to showing the menu.
QStyleOptionToolButton::HasMenu0x10 Button has a popup menu.
QStyleOptionToolButton::MenuButtonPopupMenu Button should display an arrow to indicate a menu is present.
See also
QToolButton::toolButtonStyle(), QToolButton::popupMode(), QStyleOptionToolButton::features

Constructor & Destructor Documentation

QStyleOptionToolButton::QStyleOptionToolButton ( )

Constructs an empty QStyleOptionToolButton.

QStyleOptionToolButton::QStyleOptionToolButton ( const QStyleOptionToolButton &  other)
inline

Copy constructs a new QStyleOptionToolButton from other.

Method Documentation

QStyleOptionToolButton & QStyleOptionToolButton::operator= ( const QStyleOptionToolButton &  other)
default

Copy assigns from other and returns a reference to this object.

Member Data Documentation

Qt::ArrowType QStyleOptionToolButton::arrowType

This variable indicates the direction of the arrow for the tool button. The value is only used if QStyleOptionToolButton::features includes the Arrow flag. The default value is Qt::DownArrow.

ToolButtonFeatures QStyleOptionToolButton::features

This variable contains a set of flags from QStyleOptionToolButton::ToolButtonFeature which indicate the behavior of the tool button. The default value is QStyleOptionToolButton::None.

QFont QStyleOptionToolButton::font

This variable holds the font used for the text on the button. This value is only used if QStyleOptionToolButton::toolButtonStyle is Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or Qt::ToolButtonTextOnly. By default the application default font is used.

QIcon QStyleOptionToolButton::icon

This variable contains the icon for the tool button. The default value is an empty icon.

See also
iconSize
QSize QStyleOptionToolButton::iconSize

This variable holds the size of the icon for the tool button. The default value is QSize(-1, -1).

See also
icon
QPoint QStyleOptionToolButton::pos

This variable contains the position of the tool button. The default value is a QPoint(0, 0).

QString QStyleOptionToolButton::text

This variable contains the text for the tool button. This value is only used if QStyleOptionToolButton::toolButtonStyle is Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or Qt::ToolButtonTextOnly. The default value is an empty string.

Qt::ToolButtonStyle QStyleOptionToolButton::toolButtonStyle

This variable holds a Qt::ToolButtonStyle value describing the appearance of the tool button. The default value is Qt::ToolButtonIconOnly.

See also
QToolButton::toolButtonStyle()