QtBase  v6.3.1
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
QStyleOptionMenuItem Class Reference

the minimum value for the progress bar More...

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionMenuItem:
Inheritance graph
[legend]
Collaboration diagram for QStyleOptionMenuItem:
Collaboration graph
[legend]

Public Types

enum  StyleOptionType { Type = SO_MenuItem }
 
enum  StyleOptionVersion { Version = 1 }
 
enum  MenuItemType {
  Normal , DefaultItem , Separator , SubMenu ,
  Scroller , TearOff , Margin , EmptyArea
}
 
enum  CheckType { NotCheckable , Exclusive , NonExclusive }
 
- Public Types inherited from QStyleOption
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
}
 
enum  StyleOptionType { Type = SO_Default }
 
enum  StyleOptionVersion { Version = 1 }
 

Public Member Functions

 QStyleOptionMenuItem ()
 
 QStyleOptionMenuItem (const QStyleOptionMenuItem &other)
 
QStyleOptionMenuItemoperator= (const QStyleOptionMenuItem &)=default
 
- Public Member Functions inherited from QStyleOption
 QStyleOption (int version=QStyleOption::Version, int type=SO_Default)
 
 QStyleOption (const QStyleOption &other)
 
 ~QStyleOption ()
 
void initFrom (const QWidget *w)
 
QStyleOptionoperator= (const QStyleOption &other)
 

Public Attributes

MenuItemType menuItemType
 
CheckType checkType
 
bool checked
 
bool menuHasCheckableItems
 
QRect menuRect
 
QString text
 
QIcon icon
 
int maxIconWidth
 
int reservedShortcutWidth
 
QFont font
 
- Public Attributes inherited from QStyleOption
int version
 
int type
 
QStyle::State state
 
Qt::LayoutDirection direction
 
QRect rect
 
QFontMetrics fontMetrics
 
QPalette palette
 
QObjectstyleObject
 

Protected Member Functions

 QStyleOptionMenuItem (int version)
 

Additional Inherited Members

Detailed Description

the minimum value for the progress bar

\variable QStyleOptionProgressBar::minimum

This is the minimum value in the progress bar. The default value is 0.

See also
QProgressBar::minimum

\variable QStyleOptionProgressBar::maximum

the maximum value for the progress bar

This is the maximum value in the progress bar. The default value is 0.

See also
QProgressBar::maximum

\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.

See also
QProgressBar::text

\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.

See also
QProgressBar::textVisible

\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

See also
QProgressBar::value

\variable QStyleOptionProgressBar::invertedAppearance

whether the progress bar's appearance is inverted

The default value is false.

See also
QProgressBar::invertedAppearance

\variable QStyleOptionProgressBar::bottomToTop

whether the text reads from bottom to top when the progress bar is vertical

The default value is false.

See also
QProgressBar::textDirection

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.

For an example demonstrating how style options can be used, see the \l {widgets/styles}{Styles} example.

See also
QStyleOption

Definition at line 368 of file qstyleoption.h.

Member Enumeration Documentation

◆ CheckType

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).

See also
checkType, QAction::checkable, QAction::checked, QActionGroup::exclusionPolicy
Enumerator
NotCheckable 
Exclusive 
NonExclusive 

Definition at line 376 of file qstyleoption.h.

◆ MenuItemType

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.

See also
menuItemType
Enumerator
Normal 
DefaultItem 
Separator 
SubMenu 
Scroller 
TearOff 
Margin 
EmptyArea 

Definition at line 374 of file qstyleoption.h.

◆ StyleOptionType

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.

See also
StyleOptionVersion
Enumerator
Type 

Definition at line 371 of file qstyleoption.h.

◆ StyleOptionVersion

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.

See also
StyleOptionType
Enumerator
Version 

Definition at line 372 of file qstyleoption.h.

Constructor & Destructor Documentation

◆ QStyleOptionMenuItem() [1/3]

QStyleOptionMenuItem::QStyleOptionMenuItem ( )

Constructs a QStyleOptionMenuItem, initializing the members variables to their default values.

Definition at line 1686 of file qstyleoption.cpp.

◆ QStyleOptionMenuItem() [2/3]

QStyleOptionMenuItem::QStyleOptionMenuItem ( const QStyleOptionMenuItem other)
inline

Constructs a copy of the other style option.

Definition at line 390 of file qstyleoption.h.

Here is the call graph for this function:

◆ QStyleOptionMenuItem() [3/3]

QStyleOptionMenuItem::QStyleOptionMenuItem ( int  version)
protected

Definition at line 1694 of file qstyleoption.cpp.

Member Function Documentation

◆ operator=()

QStyleOptionMenuItem& QStyleOptionMenuItem::operator= ( const QStyleOptionMenuItem )
default

Member Data Documentation

◆ checked

bool QStyleOptionMenuItem::checked

Definition at line 380 of file qstyleoption.h.

◆ checkType

CheckType QStyleOptionMenuItem::checkType

Definition at line 379 of file qstyleoption.h.

◆ font

QFont QStyleOptionMenuItem::font

Definition at line 387 of file qstyleoption.h.

◆ icon

QIcon QStyleOptionMenuItem::icon

Definition at line 384 of file qstyleoption.h.

◆ maxIconWidth

int QStyleOptionMenuItem::maxIconWidth

Definition at line 385 of file qstyleoption.h.

◆ menuHasCheckableItems

bool QStyleOptionMenuItem::menuHasCheckableItems

Definition at line 381 of file qstyleoption.h.

◆ menuItemType

MenuItemType QStyleOptionMenuItem::menuItemType

Definition at line 378 of file qstyleoption.h.

◆ menuRect

QRect QStyleOptionMenuItem::menuRect

Definition at line 382 of file qstyleoption.h.

◆ reservedShortcutWidth

int QStyleOptionMenuItem::reservedShortcutWidth

Definition at line 386 of file qstyleoption.h.

◆ text

QString QStyleOptionMenuItem::text

Definition at line 383 of file qstyleoption.h.


The documentation for this class was generated from the following files: