#include <qstyleoption.h>
Inheritance diagram for QStyleOptionHeader:


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, 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.
For an example demonstrating how style options can be used, see the {widgets/styles}{Styles} example.
Definition at line 173 of file qstyleoption.h.
Public Types | |
| enum | StyleOptionType |
| enum | StyleOptionVersion |
| enum | SectionPosition |
| enum | SelectedPosition |
| enum | SortIndicator |
Public Member Functions | |
| QStyleOptionHeader () | |
| QStyleOptionHeader (const QStyleOptionHeader &other) | |
Public Attributes | |
| int | section |
| QString | text |
| Qt::Alignment | textAlignment |
| QIcon | icon |
| Qt::Alignment | iconAlignment |
| SectionPosition | position |
| SelectedPosition | selectedPosition |
| SortIndicator | sortIndicator |
| Qt::Orientation | orientation |
Protected Member Functions | |
| QStyleOptionHeader (int version) | |
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
Type The type of style option provided ({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.
Reimplemented from QStyleOption.
Definition at line 176 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.
Version 1
The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.
Reimplemented from QStyleOption.
Definition at line 177 of file qstyleoption.h.
00177 { Version = 1 };
which section of the header is being paintedthe text of the headerthe alignment flags for the text of the headerthe icon of the headerthe alignment flags for the icon of the headerthe section's position in relation to the other sectionsthe section's position in relation to the selected sectionthe direction the sort indicator should be drawn
This enum lets you know where the section's position is in relation to the other sections.
Beginning At the beginining of the header Middle In the middle of the header End At the end of the header OnlyOneSection Only one header section
Definition at line 179 of file qstyleoption.h.
00179 { Beginning, Middle, End, OnlyOneSection };
This enum lets you know where the section's position is in relation to the selected section.
NotAdjacent Not adjacent to the selected section NextIsSelected The next section is selected PreviousIsSelected The previous section is selected NextAndPreviousAreSelected Both the next and previous section are selected
Definition at line 180 of file qstyleoption.h.
00180 { NotAdjacent, NextIsSelected, PreviousIsSelected, 00181 NextAndPreviousAreSelected };
Indicates which direction the sort indicator should be drawn
None No sort indicator is needed SortUp Draw an up indicator SortDown Draw a down indicator
Definition at line 182 of file qstyleoption.h.
| QStyleOptionHeader::QStyleOptionHeader | ( | ) |
Constructs a QStyleOptionHeader, initializing the members variables to their default values.
Definition at line 916 of file qstyleoption.cpp.
00917 : QStyleOption(QStyleOptionHeader::Version, SO_Header), 00918 section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft), 00919 position(QStyleOptionHeader::Beginning), 00920 selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None), 00921 orientation(Qt::Horizontal) 00922 { 00923 }
| QStyleOptionHeader::QStyleOptionHeader | ( | const QStyleOptionHeader & | other | ) | [inline] |
the header's orientation (horizontal or vertical)
Constructs a copy of the other style option.
Definition at line 195 of file qstyleoption.h.
00195 : QStyleOption(Version, Type) { *this = other; }
| QStyleOptionHeader::QStyleOptionHeader | ( | int | version | ) | [protected] |
Definition at line 928 of file qstyleoption.cpp.
00929 : QStyleOption(version, SO_Header), 00930 section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft), 00931 position(QStyleOptionHeader::Beginning), 00932 selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None), 00933 orientation(Qt::Horizontal) 00934 { 00935 }
Definition at line 184 of file qstyleoption.h.
Referenced by getStyleOption(), QHeaderViewPrivate::getStyleOption(), and QHeaderView::paintSection().
Definition at line 185 of file qstyleoption.h.
Referenced by getStyleOption(), QHeaderView::paintSection(), and QHeaderView::sectionSizeFromContents().
| Qt::Alignment QStyleOptionHeader::textAlignment |
Definition at line 186 of file qstyleoption.h.
Referenced by getStyleOption(), and QHeaderView::paintSection().
Definition at line 187 of file qstyleoption.h.
Referenced by getStyleOption(), QHeaderView::paintSection(), and QHeaderView::sectionSizeFromContents().
| Qt::Alignment QStyleOptionHeader::iconAlignment |
Definition at line 188 of file qstyleoption.h.
Referenced by getStyleOption(), and QHeaderView::paintSection().
Definition at line 189 of file qstyleoption.h.
Referenced by QTableCornerButton::paintEvent(), and QHeaderView::paintSection().
Definition at line 191 of file qstyleoption.h.
Referenced by Q3Header::paintSection(), QHeaderView::paintSection(), and Q3Header::paintSectionLabel().
Definition at line 192 of file qstyleoption.h.
Referenced by QHeaderViewPrivate::getStyleOption(), and QHeaderView::paintSection().
1.5.1