Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QStyleOptionHeader Class Reference

The QStyleOptionHeader class is used to describe the parameters for drawing a header. More...

#include <qstyleoption.h>

+ Inheritance diagram for QStyleOptionHeader:
+ Collaboration diagram for QStyleOptionHeader:

Public Types

enum  StyleOptionType { Type = SO_Header }
 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  SectionPosition { Beginning , Middle , End , OnlyOneSection }
 \variable QStyleOptionHeader::section More...
 
enum  SelectedPosition { NotAdjacent , NextIsSelected , PreviousIsSelected , NextAndPreviousAreSelected }
 This enum lets you know where the section's position is in relation to the selected section. More...
 
enum  SortIndicator { None , SortUp , SortDown }
 Indicates which direction the sort indicator should be drawn. More...
 
- 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
}
 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

 QStyleOptionHeader ()
 Constructs a QStyleOptionHeader, initializing the members variables to their default values.
 
 QStyleOptionHeader (const QStyleOptionHeader &other)
 \variable QStyleOptionHeader::orientation
 
QStyleOptionHeaderoperator= (const QStyleOptionHeader &)=default
 
- Public Member Functions inherited from QStyleOption
 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)
 
QStyleOptionoperator= (const QStyleOption &other)
 Assign other to this QStyleOption.
 

Public Attributes

int section
 
QString text
 
Qt::Alignment textAlignment
 
QIcon icon
 
Qt::Alignment iconAlignment
 
SectionPosition position
 
SelectedPosition selectedPosition
 
SortIndicator sortIndicator
 
Qt::Orientation orientation
 
- 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

 QStyleOptionHeader (int version)
 

Additional Inherited Members

Detailed Description

The QStyleOptionHeader class is used to describe the parameters for drawing a header.

\inmodule QtWidgets

QStyleOptionHeader contains all the information that QStyle functions need to draw the item views' header pane, header sort arrow, and header label.

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.

See also
QStyleOption

Definition at line 167 of file qstyleoption.h.

Member Enumeration Documentation

◆ SectionPosition

\variable QStyleOptionHeader::section

which section of the header is being painted

The default value is 0.

\variable QStyleOptionHeader::text

the text of the header

The default value is an empty string.

\variable QStyleOptionHeader::textAlignment

the alignment flags for the text of the header

The default value is Qt::AlignLeft.

\variable QStyleOptionHeader::icon

the icon of the header

The default value is an empty icon, i.e. an icon with neither a pixmap nor a filename.

\variable QStyleOptionHeader::iconAlignment

the alignment flags for the icon of the header

The default value is Qt::AlignLeft.

\variable QStyleOptionHeader::position

the section's position in relation to the other sections

The default value is QStyleOptionHeader::Beginning.

\variable QStyleOptionHeader::selectedPosition

the section's position in relation to the selected section

The default value is QStyleOptionHeader::NotAdjacent

\variable QStyleOptionHeader::sortIndicator

the direction the sort indicator should be drawn

The default value is QStyleOptionHeader::None.

This enum lets you know where the section's position is in relation to the other sections.

\value Beginning At the beginining of the header \value Middle In the middle of the header \value End At the end of the header \value OnlyOneSection Only one header section

See also
position
Enumerator
Beginning 
Middle 
End 
OnlyOneSection 

Definition at line 173 of file qstyleoption.h.

◆ SelectedPosition

This enum lets you know where the section's position is in relation to the selected section.

\value NotAdjacent Not adjacent to the selected section \value NextIsSelected The next section is selected \value PreviousIsSelected The previous section is selected \value NextAndPreviousAreSelected Both the next and previous section are selected

See also
selectedPosition
Enumerator
NotAdjacent 
NextIsSelected 
PreviousIsSelected 
NextAndPreviousAreSelected 

Definition at line 174 of file qstyleoption.h.

◆ SortIndicator

Indicates which direction the sort indicator should be drawn.

\value None No sort indicator is needed \value SortUp Draw an up indicator \value SortDown Draw a down indicator

See also
sortIndicator
Enumerator
None 
SortUp 
SortDown 

Definition at line 176 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_Header} 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 170 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 171 of file qstyleoption.h.

Constructor & Destructor Documentation

◆ QStyleOptionHeader() [1/3]

QStyleOptionHeader::QStyleOptionHeader ( )

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

Definition at line 687 of file qstyleoption.cpp.

◆ QStyleOptionHeader() [2/3]

QStyleOptionHeader::QStyleOptionHeader ( const QStyleOptionHeader & other)
inline

\variable QStyleOptionHeader::orientation

the header's orientation (horizontal or vertical)

The default orientation is Qt::Horizontal

Constructs a copy of the other style option.

Definition at line 189 of file qstyleoption.h.

References other().

+ Here is the call graph for this function:

◆ QStyleOptionHeader() [3/3]

QStyleOptionHeader::QStyleOptionHeader ( int version)
protected

Definition at line 695 of file qstyleoption.cpp.

Member Function Documentation

◆ operator=()

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

Member Data Documentation

◆ icon

QIcon QStyleOptionHeader::icon

Definition at line 181 of file qstyleoption.h.

◆ iconAlignment

Qt::Alignment QStyleOptionHeader::iconAlignment

Definition at line 182 of file qstyleoption.h.

◆ orientation

Qt::Orientation QStyleOptionHeader::orientation

Definition at line 186 of file qstyleoption.h.

◆ position

SectionPosition QStyleOptionHeader::position

Definition at line 183 of file qstyleoption.h.

◆ section

int QStyleOptionHeader::section

Definition at line 178 of file qstyleoption.h.

◆ selectedPosition

SelectedPosition QStyleOptionHeader::selectedPosition

Definition at line 184 of file qstyleoption.h.

◆ sortIndicator

SortIndicator QStyleOptionHeader::sortIndicator

Definition at line 185 of file qstyleoption.h.

◆ text

QString QStyleOptionHeader::text

Definition at line 179 of file qstyleoption.h.

◆ textAlignment

Qt::Alignment QStyleOptionHeader::textAlignment

Definition at line 180 of file qstyleoption.h.


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