Qt 4.8
Public Types | Public Functions | Public Variables | Protected Functions | List of all members
QStyleOptionToolBoxV2 Class Reference

The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.3 or above. More...

#include <qstyleoption.h>

Inheritance diagram for QStyleOptionToolBoxV2:
QStyleOptionToolBox QStyleOption

Public Types

enum  SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected }
 This enum describes the position of the selected tab. More...
 
enum  StyleOptionVersion { Version = 2 }
 This enum holds the version of this style option. More...
 
enum  TabPosition { Beginning, Middle, End, OnlyOneTab }
 This enum describes tab positions relative to other tabs. More...
 
- Public Types inherited from QStyleOptionToolBox
enum  StyleOptionType { Type = SO_ToolBox }
 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 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_Q3DockWindow, SO_DockWidget, SO_Q3ListViewItem,
  SO_ViewItem, SO_TabWidgetFrame, SO_TabBarBase, SO_RubberBand,
  SO_ToolBar, SO_GraphicsItem, SO_Complex = 0xf0000, SO_Slider,
  SO_SpinBox, SO_ToolButton, SO_ComboBox, SO_Q3ListView,
  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 Functions

QStyleOptionToolBoxV2operator= (const QStyleOptionToolBox &other)
 Assigns the other style option to this style option. More...
 
 QStyleOptionToolBoxV2 ()
 Contsructs a QStyleOptionToolBoxV2 object. More...
 
 QStyleOptionToolBoxV2 (const QStyleOptionToolBoxV2 &other)
 Constructs a QStyleOptionToolBoxV2 copy of the other style option. More...
 
 QStyleOptionToolBoxV2 (const QStyleOptionToolBox &other)
 Constructs a QStyleOptionToolBoxV2 copy of the other style option which can be either of the QStyleOptionToolBoxV2 or QStyleOptionToolBox types. More...
 
- Public Functions inherited from QStyleOptionToolBox
 QStyleOptionToolBox ()
 Creates a QStyleOptionToolBox, initializing the members variables to their default values. More...
 
 QStyleOptionToolBox (const QStyleOptionToolBox &other)
 Constructs a copy of the other style option. More...
 
- Public Functions inherited from QStyleOption
void init (const QWidget *w)
 Use initFrom(widget) instead. More...
 
void initFrom (const QWidget *w)
 
QStyleOptionoperator= (const QStyleOption &other)
 Assign other to this QStyleOption. More...
 
 QStyleOption (int version=QStyleOption::Version, int type=SO_Default)
 Constructs a QStyleOption with the specified version and type. More...
 
 QStyleOption (const QStyleOption &other)
 Constructs a copy of other. More...
 
 ~QStyleOption ()
 Destroys this style option object. More...
 

Public Variables

TabPosition position
 
SelectedPosition selectedPosition
 the position of the selected tab in relation to this tab More...
 
- Public Variables inherited from QStyleOptionToolBox
QIcon icon
 the icon for the tool box tab More...
 
QString text
 the text for the tool box tab More...
 
- Public Variables inherited from QStyleOption
Qt::LayoutDirection direction
 the text layout direction that should be used when drawing text in the control More...
 
QFontMetrics fontMetrics
 the font metrics that should be used when drawing text in the control More...
 
QPalette palette
 the palette that should be used when painting the control More...
 
QRect rect
 the area that should be used for various calculations and painting More...
 
QStyle::State state
 the style flags that are used when drawing the control More...
 
int type
 the option type of the style option More...
 
int version
 the version of the style option More...
 

Protected Functions

 QStyleOptionToolBoxV2 (int version)
 
- Protected Functions inherited from QStyleOptionToolBox
 QStyleOptionToolBox (int version)
 

Additional Inherited Members

Detailed Description

The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.3 or above.

Since
4.3 QStyleOptionToolBoxV2 inherits QStyleOptionToolBox which is used for drawing the tabs in a QToolBox.

An instance of the QStyleOptionToolBoxV2 class has type SO_ToolBox and version 2. 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 do not need to check it.

If you create your own QStyle subclass, you should handle both QStyleOptionToolBox and QStyleOptionToolBoxV2.

See also
QStyleOptionToolBox, QStyleOption

Definition at line 649 of file qstyleoption.h.

Enumerations

◆ 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
Enumerator
NotAdjacent 
NextIsSelected 
PreviousIsSelected 

Definition at line 654 of file qstyleoption.h.

◆ StyleOptionVersion

This enum holds the version of this style option.

  • Version 2
Enumerator
Version 

Definition at line 652 of file qstyleoption.h.

◆ TabPosition

This enum describes tab positions relative to other tabs.

  • Beginning The tab is the first (i.e., top-most) tab in the toolbox.
  • Middle The tab is placed in the middle of the toolbox.
  • End The tab is placed at the bottom of the toolbox.
  • OnlyOneTab There is only one tab in the toolbox.
Enumerator
Beginning 
Middle 
End 
OnlyOneTab 

Definition at line 653 of file qstyleoption.h.

Constructors and Destructors

◆ QStyleOptionToolBoxV2() [1/4]

QStyleOptionToolBoxV2::QStyleOptionToolBoxV2 ( )

Contsructs a QStyleOptionToolBoxV2 object.

Definition at line 4786 of file qstyleoption.cpp.

4788 {
4789 }
QStyleOptionToolBox()
Creates a QStyleOptionToolBox, initializing the members variables to their default values...
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
Definition: qstyleoption.h:657

◆ QStyleOptionToolBoxV2() [2/4]

QStyleOptionToolBoxV2::QStyleOptionToolBoxV2 ( const QStyleOptionToolBoxV2 other)
inline

Constructs a QStyleOptionToolBoxV2 copy of the other style option.

Definition at line 660 of file qstyleoption.h.

660 : QStyleOptionToolBox(Version) { *this = other; }
QStyleOptionToolBox()
Creates a QStyleOptionToolBox, initializing the members variables to their default values...

◆ QStyleOptionToolBoxV2() [3/4]

QStyleOptionToolBoxV2::QStyleOptionToolBoxV2 ( const QStyleOptionToolBox other)

Constructs a QStyleOptionToolBoxV2 copy of the other style option which can be either of the QStyleOptionToolBoxV2 or QStyleOptionToolBox types.

If the other style option's version is 1, the new style option's position value is set to QStyleOptionToolBoxV2::Beginning and selectedPosition is set to QStyleOptionToolBoxV2::NotAdjacent . If its version is 2, the position selectedPosition values are simply copied to the new style option.

See also
version

Definition at line 4822 of file qstyleoption.cpp.

4823 {
4825 
4826  const QStyleOptionToolBoxV2 *f2 = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(&other);
4827  position = f2 ? f2->position : Beginning;
4829  version = Version;
4830 }
int version
the version of the style option
Definition: qstyleoption.h:86
The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Q...
Definition: qstyleoption.h:649
T qstyleoption_cast(const QStyleOption *option)
Definition: qstyleoption.h:885
QStyleOption & operator=(const QStyleOption &other)
Assign other to this QStyleOption.
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
Definition: qstyleoption.h:657

◆ QStyleOptionToolBoxV2() [4/4]

QStyleOptionToolBoxV2::QStyleOptionToolBoxV2 ( int  version)
protected
Warning
This function is not part of the public interface.

Definition at line 4803 of file qstyleoption.cpp.

4805 {
4806 }
int version
the version of the style option
Definition: qstyleoption.h:86
QStyleOptionToolBox()
Creates a QStyleOptionToolBox, initializing the members variables to their default values...
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
Definition: qstyleoption.h:657

Functions

◆ operator=()

QStyleOptionToolBoxV2 & QStyleOptionToolBoxV2::operator= ( const QStyleOptionToolBox other)

Assigns the other style option to this style option.

The other style option can be either of the QStyleOptionToolBoxV2 or QStyleOptionToolBox types.

If the {other} style option's version is 1, this style option's position and selectedPosition values are set to QStyleOptionToolBoxV2::Beginning and QStyleOptionToolBoxV2::NotAdjacent respectively. If its version is 2, these values are simply copied to this style option.

Definition at line 4843 of file qstyleoption.cpp.

4844 {
4846 
4847  const QStyleOptionToolBoxV2 *f2 = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(&other);
4848  position = f2 ? f2->position : Beginning;
4850  version = Version;
4851  return *this;
4852 }
int version
the version of the style option
Definition: qstyleoption.h:86
The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Q...
Definition: qstyleoption.h:649
T qstyleoption_cast(const QStyleOption *option)
Definition: qstyleoption.h:885
QStyleOption & operator=(const QStyleOption &other)
Assign other to this QStyleOption.
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
Definition: qstyleoption.h:657

Properties

◆ position

TabPosition QStyleOptionToolBoxV2::position

Definition at line 656 of file qstyleoption.h.

Referenced by operator=(), and QStyleOptionToolBoxV2().

◆ selectedPosition

QStyleOptionToolBoxV2::selectedPosition

the position of the selected tab in relation to this tab

The default value is NotAdjacent, i.e. the tab is not adjacent to a selected tab nor is it the selected tab.

Definition at line 657 of file qstyleoption.h.

Referenced by operator=(), and QStyleOptionToolBoxV2().


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