Qt 4.8
Classes | Functions
qstyleoption.h File Reference
#include <QtCore/qvariant.h>
#include <QtGui/qabstractspinbox.h>
#include <QtGui/qicon.h>
#include <QtGui/qmatrix.h>
#include <QtGui/qslider.h>
#include <QtGui/qstyle.h>
#include <QtGui/qtabbar.h>
#include <QtGui/qtabwidget.h>
#include <QtGui/qrubberband.h>
#include <QtGui/qframe.h>
#include <QtCore/qabstractitemmodel.h>

Go to the source code of this file.

Classes

class  QStyleHintReturn
 The QStyleHintReturn class provides style hints that return more than basic data types. More...
 
class  QStyleHintReturnMask
 The QStyleHintReturnMask class provides style hints that return a QRegion. More...
 
class  QStyleHintReturnVariant
 The QStyleHintReturnVariant class provides style hints that return a QVariant. More...
 
class  QStyleOption
 The QStyleOption class stores the parameters used by QStyle functions. More...
 
class  QStyleOptionButton
 The QStyleOptionButton class is used to describe the parameters for drawing buttons. More...
 
class  QStyleOptionComboBox
 The QStyleOptionComboBox class is used to describe the parameter for drawing a combobox. More...
 
class  QStyleOptionComplex
 The QStyleOptionComplex class is used to hold parameters that are common to all complex controls. More...
 
class  QStyleOptionDockWidget
 The QStyleOptionDockWidget class is used to describe the parameters for drawing a dock widget. More...
 
class  QStyleOptionDockWidgetV2
 
class  QStyleOptionFocusRect
 The QStyleOptionFocusRect class is used to describe the parameters for drawing a focus rectangle with QStyle. More...
 
class  QStyleOptionFrame
 The QStyleOptionFrame class is used to describe the parameters for drawing a frame. More...
 
class  QStyleOptionFrameV2
 The QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.1 or above. More...
 
class  QStyleOptionFrameV3
 The QStyleOptionFrameV3 class is used to describe the parameters necessary for drawing a frame in Qt 4.1 or above. More...
 
class  QStyleOptionGraphicsItem
 The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem. More...
 
class  QStyleOptionGroupBox
 The QStyleOptionGroupBox class describes the parameters for drawing a group box. More...
 
class  QStyleOptionHeader
 The QStyleOptionHeader class is used to describe the parameters for drawing a header. More...
 
class  QStyleOptionMenuItem
 The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. More...
 
class  QStyleOptionProgressBar
 The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress bar. More...
 
class  QStyleOptionProgressBarV2
 The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progress bar in Qt 4.1 or above. More...
 
class  QStyleOptionQ3DockWindow
 The QStyleOptionQ3DockWindow class is used to describe the parameters for drawing various parts of a Q3DockWindow. More...
 
class  QStyleOptionQ3ListView
 The QStyleOptionQ3ListView class is used to describe the parameters for drawing a Q3ListView. More...
 
class  QStyleOptionQ3ListViewItem
 The QStyleOptionQ3ListViewItem class is used to describe an item drawn in a Q3ListView. More...
 
class  QStyleOptionRubberBand
 The QStyleOptionRubberBand class is used to describe the parameters needed for drawing a rubber band. More...
 
class  QStyleOptionSizeGrip
 The QStyleOptionSizeGrip class is used to describe the parameter for drawing a size grip. More...
 
class  QStyleOptionSlider
 The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider. More...
 
class  QStyleOptionSpinBox
 The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box. More...
 
class  QStyleOptionTab
 The QStyleOptionTab class is used to describe the parameters for drawing a tab bar. More...
 
class  QStyleOptionTabBarBase
 The QStyleOptionTabBarBase class is used to describe the base of a tab bar, i.e. More...
 
class  QStyleOptionTabBarBaseV2
 The QStyleOptionTabBarBaseV2 class is used to describe the base of a tab bar, i.e. More...
 
class  QStyleOptionTabV2
 The QStyleOptionTabV2 class is used to describe the parameters necessary for drawing a tabs in Qt 4.1 or above. More...
 
class  QStyleOptionTabV3
 The QStyleOptionTabV3 class is used to describe the parameters necessary for drawing a tabs in Qt 4.5 or above. More...
 
class  QStyleOptionTabWidgetFrame
 The QStyleOptionTabWidgetFrame class is used to describe the parameters for drawing the frame around a tab widget. More...
 
class  QStyleOptionTabWidgetFrameV2
 The QStyleOptionTabWidgetFrameV2 class is used to describe the parameters for drawing the frame around a tab widget. More...
 
class  QStyleOptionTitleBar
 The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar. More...
 
class  QStyleOptionToolBar
 The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar. More...
 
class  QStyleOptionToolBox
 The QStyleOptionToolBox class is used to describe the parameters needed for drawing a tool box. More...
 
class  QStyleOptionToolBoxV2
 The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.3 or above. More...
 
class  QStyleOptionToolButton
 The QStyleOptionToolButton class is used to describe the parameters for drawing a tool button. More...
 
class  QStyleOptionViewItem
 The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widget. More...
 
class  QStyleOptionViewItemV2
 The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.2 or above. More...
 
class  QStyleOptionViewItemV3
 The QStyleOptionViewItemV3 class is used to describe the parameters necessary for drawing a frame in Qt 4.3 or above. More...
 
class  QStyleOptionViewItemV4
 The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in Qt 4.4 or above. More...
 

Functions

Q_GUI_EXPORT QDebug operator<< (QDebug debug, const QStyleOption::OptionType &optionType)
 
Q_GUI_EXPORT QDebug operator<< (QDebug debug, const QStyleOption &option)
 
template<typename T >
qstyleoption_cast (const QStyleOption *opt)
 
template<typename T >
qstyleoption_cast (QStyleOption *opt)
 
template<typename T >
qstyleoption_cast (const QStyleHintReturn *hint)
 
template<typename T >
qstyleoption_cast (QStyleHintReturn *hint)
 

Function Documentation

◆ operator<<() [1/2]

Q_GUI_EXPORT QDebug operator<< ( QDebug  debug,
const QStyleOption::OptionType optionType 
)

Definition at line 6396 of file qstyleoption.cpp.

Referenced by qstyleoption_cast().

6397 {
6398 #if !defined(QT_NO_DEBUG)
6399  switch (optionType) {
6401  debug << "SO_Default"; break;
6403  debug << "SO_FocusRect"; break;
6405  debug << "SO_Button"; break;
6406  case QStyleOption::SO_Tab:
6407  debug << "SO_Tab"; break;
6409  debug << "SO_MenuItem"; break;
6411  debug << "SO_Frame"; break;
6413  debug << "SO_ProgressBar"; break;
6415  debug << "SO_ToolBox"; break;
6417  debug << "SO_Header"; break;
6419  debug << "SO_Q3DockWindow"; break;
6421  debug << "SO_DockWidget"; break;
6423  debug << "SO_Q3ListViewItem"; break;
6425  debug << "SO_ViewItem"; break;
6427  debug << "SO_TabWidgetFrame"; break;
6429  debug << "SO_TabBarBase"; break;
6431  debug << "SO_RubberBand"; break;
6433  debug << "SO_Complex"; break;
6435  debug << "SO_Slider"; break;
6437  debug << "SO_SpinBox"; break;
6439  debug << "SO_ToolButton"; break;
6441  debug << "SO_ComboBox"; break;
6443  debug << "SO_Q3ListView"; break;
6445  debug << "SO_TitleBar"; break;
6447  debug << "SO_CustomBase"; break;
6449  debug << "SO_GroupBox"; break;
6451  debug << "SO_ToolBar"; break;
6453  debug << "SO_ComplexCustomBase"; break;
6455  debug << "SO_SizeGrip"; break;
6457  debug << "SO_GraphicsItem"; break;
6458  }
6459 #else
6460  Q_UNUSED(optionType);
6461 #endif
6462  return debug;
6463 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ operator<<() [2/2]

Q_GUI_EXPORT QDebug operator<< ( QDebug  debug,
const QStyleOption option 
)

Definition at line 6465 of file qstyleoption.cpp.

6466 {
6467 #if !defined(QT_NO_DEBUG)
6468  debug << "QStyleOption(";
6469  debug << QStyleOption::OptionType(option.type);
6470  debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
6471  debug << ',' << option.state;
6472  debug << ',' << option.rect;
6473  debug << ')';
6474 #else
6475  Q_UNUSED(option);
6476 #endif
6477  return debug;
6478 }
int type
the option type of the style option
Definition: qstyleoption.h:87
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
OptionType
This enum is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine th...
Definition: qstyleoption.h:70
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
Definition: qstyleoption.h:89
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90

◆ qstyleoption_cast() [1/4]

template<typename T >
T qstyleoption_cast ( const QStyleOption opt)
related

Definition at line 885 of file qstyleoption.h.

Referenced by QMacStylePrivate::drawColorlessButton(), QCommonStyle::drawControl(), QWindowsVistaStyle::drawControl(), QWindowsMobileStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsXPStyle::drawControl(), QWindowsStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QMacStyle::drawControl(), QCommonStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QDockWidget::initStyleOption(), QItemDelegate::paint(), QCommonStyle::pixelMetric(), QMacStyle::sizeFromContents(), QPlastiqueStyle::styleHint(), QWindowsXPStyle::styleHint(), QCommonStyle::subElementRect(), QCleanlooksStyle::subElementRect(), QWindowsXPStyle::subElementRect(), QWindowsStyle::subElementRect(), QMacStyle::subElementRect(), and QStyleHelper::uniqueName().

886 {
887  if (opt && opt->version >= static_cast<T>(0)->Version && (opt->type == static_cast<T>(0)->Type
888  || int(static_cast<T>(0)->Type) == QStyleOption::SO_Default
889  || (int(static_cast<T>(0)->Type) == QStyleOption::SO_Complex
890  && opt->type > QStyleOption::SO_Complex)))
891  return static_cast<T>(opt);
892  return 0;
893 }
int version
the version of the style option
Definition: qstyleoption.h:86
int type
the option type of the style option
Definition: qstyleoption.h:87

◆ qstyleoption_cast() [2/4]

template<typename T >
T qstyleoption_cast ( QStyleOption opt)
related

Definition at line 896 of file qstyleoption.h.

897 {
898  if (opt && opt->version >= static_cast<T>(0)->Version && (opt->type == static_cast<T>(0)->Type
899  || int(static_cast<T>(0)->Type) == QStyleOption::SO_Default
900  || (int(static_cast<T>(0)->Type) == QStyleOption::SO_Complex
901  && opt->type > QStyleOption::SO_Complex)))
902  return static_cast<T>(opt);
903  return 0;
904 }
int version
the version of the style option
Definition: qstyleoption.h:86
int type
the option type of the style option
Definition: qstyleoption.h:87

◆ qstyleoption_cast() [3/4]

template<typename T >
T qstyleoption_cast ( const QStyleHintReturn hint)
related

Definition at line 944 of file qstyleoption.h.

945 {
946  if (hint && hint->version <= static_cast<T>(0)->Version &&
947  (hint->type == static_cast<T>(0)->Type || int(static_cast<T>(0)->Type) == QStyleHintReturn::SH_Default))
948  return static_cast<T>(hint);
949  return 0;
950 }
int type
the type of the style hint container
Definition: qstyleoption.h:920
int version
the version of the style hint return container
Definition: qstyleoption.h:919

◆ qstyleoption_cast() [4/4]

template<typename T >
T qstyleoption_cast ( QStyleHintReturn hint)
related

Definition at line 953 of file qstyleoption.h.

954 {
955  if (hint && hint->version <= static_cast<T>(0)->Version &&
956  (hint->type == static_cast<T>(0)->Type || int(static_cast<T>(0)->Type) == QStyleHintReturn::SH_Default))
957  return static_cast<T>(hint);
958  return 0;
959 }
int type
the type of the style hint container
Definition: qstyleoption.h:920
int version
the version of the style hint return container
Definition: qstyleoption.h:919