QStyleOptionTab Class Reference

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionTab:

Inheritance graph
[legend]
Collaboration diagram for QStyleOptionTab:

Collaboration graph
[legend]
List of all members.

Detailed Description

The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.

The QStyleOptionTab class is used for drawing several built-in Qt widgets including QTabBar and the panel for QTabWidget. Note that to describe the parameters necessary for drawing a frame in Qt 4.1 or above, you must use the QStyleOptionFrameV2 subclass.

An instance of the QStyleOptiontabV2 class has type SO_Tab and version 1. 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. 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.

If you create your own QStyle subclass, you should handle both QStyleOptionTab and QStyleOptionTabV2.

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

See also:
QStyleOptionTabV2, QStyleOption

Definition at line 226 of file qstyleoption.h.

Public Types

enum  StyleOptionType
enum  StyleOptionVersion
enum  TabPosition
enum  SelectedPosition
enum  CornerWidget

Public Member Functions

 QStyleOptionTab ()
 QStyleOptionTab (const QStyleOptionTab &other)

Public Attributes

QTabBar::Shape shape
QString text
QIcon icon
int row
TabPosition position
SelectedPosition selectedPosition
CornerWidgets cornerWidgets

Protected Member Functions

 QStyleOptionTab (int version)


Member Enumeration Documentation

enum QStyleOptionTab::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_Tab} 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 229 of file qstyleoption.h.

00229 { Type = SO_Tab };

enum QStyleOptionTab::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 230 of file qstyleoption.h.

00230 { Version = 1 };

enum QStyleOptionTab::TabPosition

This enum describes the position of the tab.

Beginning The tab is the first tab in the tab bar. Middle The tab is neither the first nor the last tab in the tab bar. End The tab is the last tab in the tab bar. OnlyOneTab The tab is both the first and the last tab in the tab bar.

See also:
position

Definition at line 232 of file qstyleoption.h.

enum QStyleOptionTab::SelectedPosition

This enum describes the position of the selected tab. Some styles need to draw a tab differently depending on whether or not it is adjacent to the selected tab.

NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab). NextIsSelected The next tab (typically the tab on the right) is selected. PreviousIsSelected The previous tab (typically the tab on the left) is selected.

See also:
selectedPosition

Definition at line 233 of file qstyleoption.h.

enum QStyleOptionTab::CornerWidget

These flags indicate the corner widgets in a tab.

NoCornerWidgets There are no corner widgets LeftCornerWidget Left corner widget RightCornerWidget Right corner widget

See also:
cornerWidgets

Definition at line 234 of file qstyleoption.h.

00234                       { NoCornerWidgets = 0x00, LeftCornerWidget = 0x01,
00235                         RightCornerWidget = 0x02 };


Constructor & Destructor Documentation

QStyleOptionTab::QStyleOptionTab (  ) 

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

Definition at line 1417 of file qstyleoption.cpp.

QStyleOptionTab::QStyleOptionTab ( const QStyleOptionTab other  )  [inline]

Constructs a copy of the other style option.

Definition at line 247 of file qstyleoption.h.

00247 : QStyleOption(Version, Type) { *this = other; }

QStyleOptionTab::QStyleOptionTab ( int  version  )  [protected]

Definition at line 1429 of file qstyleoption.cpp.


Member Data Documentation

QTabBar::Shape QStyleOptionTab::shape

Definition at line 238 of file qstyleoption.h.

Referenced by QCommonStyle::drawControl(), QTabBarPrivate::getStyleOption(), QTabBar::paintEvent(), and QWindowsXPStyle::subElementRect().

QString QStyleOptionTab::text

Definition at line 239 of file qstyleoption.h.

Referenced by QTabBarPrivate::getStyleOption().

QIcon QStyleOptionTab::icon

Definition at line 240 of file qstyleoption.h.

Referenced by QCommonStyle::drawControl(), and QTabBarPrivate::getStyleOption().

int QStyleOptionTab::row

Definition at line 241 of file qstyleoption.h.

Referenced by QTabBarPrivate::getStyleOption().

TabPosition QStyleOptionTab::position

Definition at line 242 of file qstyleoption.h.

Referenced by QTabBarPrivate::getStyleOption().

SelectedPosition QStyleOptionTab::selectedPosition

Definition at line 243 of file qstyleoption.h.

Referenced by QTabBarPrivate::getStyleOption().

CornerWidgets QStyleOptionTab::cornerWidgets

Definition at line 244 of file qstyleoption.h.

Referenced by QTabBarPrivate::getStyleOption().


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