![]() |
Qt 6.x
The Qt SDK
|
\variable QStyleOptionProgressBar::minimum More...
#include <qstyleoption.h>
Public Types | |
enum | StyleOptionType { Type = SO_MenuItem } |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass. More... | |
enum | StyleOptionVersion { Version = 1 } |
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass. More... | |
enum | MenuItemType { Normal , DefaultItem , Separator , SubMenu , Scroller , TearOff , Margin , EmptyArea } |
This enum indicates the type of menu item that the structure describes. More... | |
enum | CheckType { NotCheckable , Exclusive , NonExclusive } |
This enum is used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all. More... | |
![]() | |
enum | OptionType { SO_Default , SO_FocusRect , SO_Button , SO_Tab , SO_MenuItem , SO_Frame , SO_ProgressBar , SO_ToolBox , SO_Header , SO_DockWidget , SO_ViewItem , SO_TabWidgetFrame , SO_TabBarBase , SO_RubberBand , SO_ToolBar , SO_GraphicsItem , SO_Complex = 0xf0000 , SO_Slider , SO_SpinBox , SO_ToolButton , SO_ComboBox , SO_TitleBar , SO_GroupBox , SO_SizeGrip , SO_CustomBase = 0xf00 , SO_ComplexCustomBase = 0xf000000 } |
This enum is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. More... | |
enum | StyleOptionType { Type = SO_Default } |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass. More... | |
enum | StyleOptionVersion { Version = 1 } |
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass. More... | |
Public Member Functions | |
QStyleOptionMenuItem () | |
Constructs a QStyleOptionMenuItem, initializing the members variables to their default values. | |
QStyleOptionMenuItem (const QStyleOptionMenuItem &other) | |
Constructs a copy of the other style option. | |
QStyleOptionMenuItem & | operator= (const QStyleOptionMenuItem &)=default |
![]() | |
QStyleOption (int version=QStyleOption::Version, int type=SO_Default) | |
Constructs a QStyleOption with the specified version and type. | |
QStyleOption (const QStyleOption &other) | |
Constructs a copy of other. | |
~QStyleOption () | |
Destroys this style option object. | |
void | initFrom (const QWidget *w) |
QStyleOption & | operator= (const QStyleOption &other) |
Assign other to this QStyleOption. | |
Public Attributes | |
MenuItemType | menuItemType |
CheckType | checkType |
bool | checked |
bool | menuHasCheckableItems |
QRect | menuRect |
QString | text |
QIcon | icon |
int | maxIconWidth |
int | reservedShortcutWidth |
QFont | font |
![]() | |
int | version |
int | type |
QStyle::State | state |
Qt::LayoutDirection | direction |
QRect | rect |
QFontMetrics | fontMetrics |
QPalette | palette |
QObject * | styleObject |
Protected Member Functions | |
QStyleOptionMenuItem (int version) | |
Additional Inherited Members | |
![]() | |
template< typename T > T | qstyleoption_cast (const QStyleOption *option) |
\variable QStyleOptionTitleBar::text | |
template< typename T > T | qstyleoption_cast (QStyleOption *option) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
\variable QStyleOptionProgressBar::minimum
the minimum value for the progress bar
This is the minimum value in the progress bar. The default value is 0.
\variable QStyleOptionProgressBar::maximum
the maximum value for the progress bar
This is the maximum value in the progress bar. The default value is 0.
\variable QStyleOptionProgressBar::text
the text for the progress bar
The progress bar text is usually just the progress expressed as a string. An empty string indicates that the progress bar has not started yet. The default value is an empty string.
\variable QStyleOptionProgressBar::textVisible
a flag indicating whether or not text is visible
If this flag is true then the text is visible. Otherwise, the text is not visible. The default value is false.
\variable QStyleOptionProgressBar::textAlignment
the text alignment for the text in the QProgressBar
This can be used as a guide on where the text should be in the progress bar. The default value is Qt::AlignLeft.
\variable QStyleOptionProgressBar::progress
the current progress for the progress bar
The current progress. A value of QStyleOptionProgressBar::minimum
\variable QStyleOptionProgressBar::invertedAppearance
whether the progress bar's appearance is inverted
The default value is false.
\variable QStyleOptionProgressBar::bottomToTop
whether the text reads from bottom to top when the progress bar is vertical
The default value is false.
The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item.
\inmodule QtWidgets
QStyleOptionMenuItem contains all the information that QStyle functions need to draw the menu items from \l QMenu. It is also used for drawing other menu-related widgets.
For performance reasons, there are few member functions and the access to the member variables is direct (i.e., using the . or
->
operator). This makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.
Definition at line 333 of file qstyleoption.h.
This enum is used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all.
\value NotCheckable The item is not checkable. \value Exclusive The item is an exclusive check item (like a radio button). \value NonExclusive The item is a non-exclusive check item (like a check box).
Enumerator | |
---|---|
NotCheckable | |
Exclusive | |
NonExclusive |
Definition at line 341 of file qstyleoption.h.
This enum indicates the type of menu item that the structure describes.
\value Normal A normal menu item. \value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction(). \value Separator A menu separator. \value SubMenu Indicates the menu item points to a sub-menu. \value Scroller A popup menu scroller (currently only used on \macos). \value TearOff A tear-off handle for the menu. \value Margin The margin of the menu. \value EmptyArea The empty area of the menu.
Enumerator | |
---|---|
Normal | |
DefaultItem | |
Separator | |
SubMenu | |
Scroller | |
TearOff | |
Margin | |
EmptyArea |
Definition at line 339 of file qstyleoption.h.
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
\value Type The type of style option provided (\l{SO_MenuItem} for this class).
The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.
Enumerator | |
---|---|
Type |
Definition at line 336 of file qstyleoption.h.
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.
\value Version 1
The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally do not need to check it.
Enumerator | |
---|---|
Version |
Definition at line 337 of file qstyleoption.h.
QStyleOptionMenuItem::QStyleOptionMenuItem | ( | ) |
Constructs a QStyleOptionMenuItem, initializing the members variables to their default values.
Definition at line 1621 of file qstyleoption.cpp.
|
inline |
Constructs a copy of the other style option.
Definition at line 355 of file qstyleoption.h.
References other().
|
protected |
Definition at line 1629 of file qstyleoption.cpp.
|
default |
bool QStyleOptionMenuItem::checked |
Definition at line 345 of file qstyleoption.h.
CheckType QStyleOptionMenuItem::checkType |
Definition at line 344 of file qstyleoption.h.
Referenced by QMenuPrivate::drawScroller(), QMenuPrivate::drawTearOff(), QComboBoxPrivateScroller::paintEvent(), QMenu::paintEvent(), QMenuBar::paintEvent(), and QComboBoxListView::paintEvent().
QFont QStyleOptionMenuItem::font |
Definition at line 352 of file qstyleoption.h.
QIcon QStyleOptionMenuItem::icon |
Definition at line 349 of file qstyleoption.h.
int QStyleOptionMenuItem::maxIconWidth |
Definition at line 350 of file qstyleoption.h.
Referenced by QMenuPrivate::drawScroller(), QMenuPrivate::drawTearOff(), QComboBoxPrivateScroller::paintEvent(), QMenu::paintEvent(), and QComboBoxListView::paintEvent().
bool QStyleOptionMenuItem::menuHasCheckableItems |
Definition at line 346 of file qstyleoption.h.
MenuItemType QStyleOptionMenuItem::menuItemType |
Definition at line 343 of file qstyleoption.h.
Referenced by QMenuPrivate::drawScroller(), QMenuPrivate::drawTearOff(), QComboBoxPrivateScroller::paintEvent(), QMenu::paintEvent(), and QMenuBar::paintEvent().
QRect QStyleOptionMenuItem::menuRect |
Definition at line 347 of file qstyleoption.h.
Referenced by QComboBoxPrivateScroller::paintEvent(), QMenu::paintEvent(), QMenuBar::paintEvent(), and QComboBoxListView::paintEvent().
int QStyleOptionMenuItem::reservedShortcutWidth |
Definition at line 351 of file qstyleoption.h.
Referenced by QMenuPrivate::drawScroller(), QMenuPrivate::drawTearOff(), QComboBoxPrivateScroller::paintEvent(), QMenu::paintEvent(), and QComboBoxListView::paintEvent().
QString QStyleOptionMenuItem::text |
Definition at line 348 of file qstyleoption.h.