QStyleOptionHeader Class Reference

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionHeader:

Inheritance graph
[legend]
Collaboration diagram for QStyleOptionHeader:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

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.

See also:
QStyleOption

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)


Member Enumeration Documentation

enum QStyleOptionHeader::StyleOptionType

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.

See also:
StyleOptionVersion

Reimplemented from QStyleOption.

Definition at line 176 of file qstyleoption.h.

00176 { Type = SO_Header };

enum QStyleOptionHeader::StyleOptionVersion

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.

See also:
StyleOptionType

Reimplemented from QStyleOption.

Definition at line 177 of file qstyleoption.h.

00177 { Version = 1 };

enum QStyleOptionHeader::SectionPosition

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

See also:
position

Definition at line 179 of file qstyleoption.h.

enum QStyleOptionHeader::SelectedPosition

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

See also:
selectedPosition

Definition at line 180 of file qstyleoption.h.

enum QStyleOptionHeader::SortIndicator

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

See also:
sortIndicator

Definition at line 182 of file qstyleoption.h.

00182 { None, SortUp, SortDown };


Constructor & Destructor Documentation

QStyleOptionHeader::QStyleOptionHeader (  ) 

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

Definition at line 916 of file qstyleoption.cpp.

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.


Member Data Documentation

int QStyleOptionHeader::section

Definition at line 184 of file qstyleoption.h.

Referenced by getStyleOption(), QHeaderViewPrivate::getStyleOption(), and QHeaderView::paintSection().

QString QStyleOptionHeader::text

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

QIcon QStyleOptionHeader::icon

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

SectionPosition QStyleOptionHeader::position

Definition at line 189 of file qstyleoption.h.

Referenced by QTableCornerButton::paintEvent(), and QHeaderView::paintSection().

SelectedPosition QStyleOptionHeader::selectedPosition

Definition at line 190 of file qstyleoption.h.

Referenced by QHeaderView::paintSection().

SortIndicator QStyleOptionHeader::sortIndicator

Definition at line 191 of file qstyleoption.h.

Referenced by Q3Header::paintSection(), QHeaderView::paintSection(), and Q3Header::paintSectionLabel().

Qt::Orientation QStyleOptionHeader::orientation

Definition at line 192 of file qstyleoption.h.

Referenced by QHeaderViewPrivate::getStyleOption(), and QHeaderView::paintSection().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 19:10:30 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1