Qt 4.8
qstyleoption.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qstyleoption.h"
43 #include "qapplication.h"
44 #ifdef Q_WS_MAC
45 # include "private/qt_mac_p.h"
46 # include "qmacstyle_mac.h"
47 #endif
48 #include <qdebug.h>
49 #include <QtCore/qmath.h>
50 
52 
168  : version(version), type(type), state(QStyle::State_None),
169  direction(QApplication::layoutDirection()), fontMetrics(QFont())
170 {
171 }
172 
173 
178 {
179 }
180 
204 {
205  QWidget *window = widget->window();
207  if (widget->isEnabled())
209  if (widget->hasFocus())
213  if (widget->underMouse())
215  if (window->isActiveWindow())
217  if (widget->isWindow())
219 #ifdef Q_WS_MAC
220  extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
222  state &= ~QStyle::State_Enabled;
223 
224  switch (QMacStyle::widgetSizePolicy(widget)) {
227  break;
228  case QMacStyle::SizeMini:
230  break;
231  default:
232  ;
233  }
234 #endif
235 #ifdef QT_KEYPAD_NAVIGATION
236  if (widget->hasEditFocus())
237  state |= QStyle::State_HasEditFocus;
238 #endif
239 
240  direction = widget->layoutDirection();
241  rect = widget->rect();
242  palette = widget->palette();
243  fontMetrics = widget->fontMetrics();
244 }
245 
250  : version(Version), type(Type), state(other.state),
251  direction(other.direction), rect(other.rect), fontMetrics(other.fontMetrics),
252  palette(other.palette)
253 {
254 }
255 
260 {
261  state = other.state;
262  direction = other.direction;
263  rect = other.rect;
264  fontMetrics = other.fontMetrics;
265  palette = other.palette;
266  return *this;
267 }
268 
426 {
427  state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom()
428 }
429 
434  : QStyleOption(version, SO_FocusRect)
435 {
436  state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom()
437 }
438 
536  : QStyleOption(Version, SO_Frame), lineWidth(0), midLineWidth(0)
537 {
538 }
539 
544  : QStyleOption(version, SO_Frame), lineWidth(0), midLineWidth(0)
545 {
546 }
547 
665  : QStyleOptionFrame(Version), features(None)
666 {
667 }
668 
682  : QStyleOptionFrame(version), features(None)
683 {
684 }
685 
698 {
700 
701  const QStyleOptionFrameV2 *f2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(&other);
702  features = f2 ? f2->features : FrameFeatures(QStyleOptionFrameV2::None);
703  version = Version;
704 }
705 
717 {
719 
720  const QStyleOptionFrameV2 *f2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(&other);
721  features = f2 ? f2->features : FrameFeatures(QStyleOptionFrameV2::None);
722  version = Version;
723  return *this;
724 }
725 
796  : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame), unused(0)
797 {
798 }
799 
813  : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame), unused(0)
814 {
815 }
816 
830 {
831  operator=(other);
832 }
833 
845 {
847 
848  const QStyleOptionFrameV3 *f3 = qstyleoption_cast<const QStyleOptionFrameV3 *>(&other);
850  version = Version;
851  return *this;
852 }
853 
854 
944 {
945 }
946 
969 {
970  (void)QStyleOptionViewItemV2::operator=(other);
971 }
972 
977  : QStyleOptionViewItem(version)
978 {
979 
980 }
981 
993 {
996  features = v2 ? v2->features : ViewItemFeatures(QStyleOptionViewItemV2::None);
997  return *this;
998 }
999 
1067 {
1068 }
1069 
1075 {
1076  (void)QStyleOptionViewItemV3::operator=(other);
1077 }
1078 
1094 {
1097  locale = v3 ? v3->locale : QLocale();
1098  widget = v3 ? v3->widget : 0;
1099  return *this;
1100 }
1101 
1106  : QStyleOptionViewItemV2(version), widget(0)
1107 {
1108 }
1109 
1110 #ifndef QT_NO_ITEMVIEWS
1111 
1244 : QStyleOptionViewItemV3(Version), checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItemV4::Invalid)
1245 {
1246 }
1247 
1266 {
1267  (void)QStyleOptionViewItemV4::operator=(other);
1268 }
1269 
1276 {
1278  if (const QStyleOptionViewItemV4 *v4 = qstyleoption_cast<const QStyleOptionViewItemV4*>(&other)) {
1279  index = v4->index;
1280  checkState = v4->checkState;
1281  text = v4->text;
1282  viewItemPosition = v4->viewItemPosition;
1283  backgroundBrush = v4->backgroundBrush;
1284  icon = v4->icon;
1285  } else {
1288  }
1289  return *this;
1290 }
1291 
1296  : QStyleOptionViewItemV3(version)
1297 {
1298 }
1299 #endif // QT_NO_ITEMVIEWS
1300 
1444  textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0)
1445 {
1446 }
1447 
1463 {
1464 }
1465 
1496  section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft),
1497  position(QStyleOptionHeader::Beginning),
1498  selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
1499  orientation(Qt::Horizontal)
1500 {
1501 }
1502 
1507  : QStyleOption(version, SO_Header),
1512 {
1513 }
1514 
1744 {
1745 }
1746 
1751  : QStyleOption(version, SO_Button), features(None)
1752 {
1753 }
1754 
1845 #ifndef QT_NO_TOOLBAR
1846 
1889  : QStyleOption(Version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne),
1890  toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0)
1891 {
1892 }
1893 
1909 {
1910 
1911 }
1912 
2065 #endif
2066 
2067 #ifndef QT_NO_TABBAR
2068 
2108  shape(QTabBar::RoundedNorth),
2109  row(0),
2111  selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets)
2112 {
2113 }
2114 
2119  : QStyleOption(version, SO_Tab),
2120  shape(QTabBar::RoundedNorth),
2121  row(0),
2124 {
2125 }
2126 
2373 {
2374 }
2375 
2380  : QStyleOptionTab(version)
2381 {
2382 }
2383 
2404 {
2405  if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other)) {
2406  *this = *tab;
2407  } else {
2408  *((QStyleOptionTab *)this) = other;
2409  version = Version;
2410  }
2411 }
2412 
2423 {
2425 
2426  if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other))
2427  iconSize = tab->iconSize;
2428  else
2429  iconSize = QSize();
2430  return *this;
2431 }
2432 
2526  , documentMode(false)
2527 {
2528 }
2529 
2534  : QStyleOptionTabV2(version)
2535 {
2536 }
2537 
2568 {
2569  if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(&other)) {
2570  *this = *tab;
2571  } else {
2572  *((QStyleOptionTabV2 *)this) = other;
2573  version = Version;
2574  }
2575 }
2576 
2588 {
2590 
2591  if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(&other)) {
2592  leftButtonSize = tab->leftButtonSize;
2593  rightButtonSize = tab->rightButtonSize;
2594  } else {
2595  leftButtonSize = QSize();
2596  rightButtonSize = QSize();
2597  documentMode = false;
2598  }
2599  return *this;
2600 }
2601 
2602 #endif // QT_NO_TABBAR
2603 
2642  minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false)
2643 {
2644 }
2645 
2650  : QStyleOption(version, SO_ProgressBar),
2652 {
2653 }
2654 
2826  orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
2827 {
2828 }
2829 
2834  : QStyleOptionProgressBar(version),
2836 {
2837 }
2838 
2852 {
2854  if (pb2)
2855  *this = *pb2;
2856  else
2857  *((QStyleOptionProgressBar *)this) = other;
2858 }
2859 
2865 {
2866  *this = other;
2867 }
2868 
2881 {
2883 
2885  orientation = pb2 ? pb2->orientation : Qt::Horizontal;
2886  invertedAppearance = pb2 ? pb2->invertedAppearance : false;
2887  bottomToTop = pb2 ? pb2->bottomToTop : false;
2888  return *this;
2889 }
2890 
2994  : QStyleOption(QStyleOptionMenuItem::Version, SO_MenuItem), menuItemType(Normal),
2995  checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
2996 {
2997 }
2998 
3005 {
3006 }
3007 
3239  : QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None)
3240 {
3241 }
3242 
3315 #ifndef QT_NO_SLIDER
3316 
3344  : QStyleOptionComplex(Version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
3345  tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
3346  sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
3347  dialWrapping(false)
3348 {
3349 }
3350 
3356  tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
3358  dialWrapping(false)
3359 {
3360 }
3361 
3558 #endif // QT_NO_SLIDER
3559 
3560 #ifndef QT_NO_SPINBOX
3561 
3589  : QStyleOptionComplex(Version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
3590  stepEnabled(QAbstractSpinBox::StepNone), frame(false)
3591 {
3592 }
3593 
3598  : QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
3599  stepEnabled(QAbstractSpinBox::StepNone), frame(false)
3600 {
3601 }
3602 
3683 #endif // QT_NO_SPINBOX
3684 
3734  : QStyleOption(Version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
3735  itemY(0), childCount(0)
3736 {
3737 }
3738 
3744  itemY(0), childCount(0)
3745 {
3746 }
3747 
3881  : QStyleOptionComplex(Version, SO_Q3ListView), viewportBGRole(QPalette::Base),
3882  sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false)
3883 {
3884 }
3885 
3892 {
3893 }
3894 
4058  : QStyleOption(Version, SO_Q3DockWindow), docked(false), closeEnabled(false)
4059 {
4060 }
4061 
4066  : QStyleOption(version, SO_Q3DockWindow), docked(false), closeEnabled(false)
4067 {
4068 }
4069 
4164  : QStyleOption(Version, SO_DockWidget), closable(false),
4165  movable(false), floatable(false)
4166 {
4167 }
4168 
4173  : QStyleOption(version, SO_DockWidget), closable(false),
4174  movable(false), floatable(false)
4175 {
4176 }
4177 
4179  : QStyleOptionDockWidget(Version), verticalTitleBar(false)
4180 {
4181 }
4182 
4184  const QStyleOptionDockWidget &other)
4186 {
4187  (void)QStyleOptionDockWidgetV2::operator=(other);
4188 }
4189 
4191  const QStyleOptionDockWidget &other)
4192 {
4194  const QStyleOptionDockWidgetV2 *v2
4195  = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(&other);
4196  verticalTitleBar = v2 ? v2->verticalTitleBar : false;
4197  return *this;
4198 }
4199 
4201  : QStyleOptionDockWidget(version), verticalTitleBar(false)
4202 {
4203 }
4204 
4337  : QStyleOptionComplex(Version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
4338  , toolButtonStyle(Qt::ToolButtonIconOnly)
4339 {
4340 }
4341 
4348 
4349 {
4350 }
4351 
4520  : QStyleOptionComplex(Version, SO_ComboBox), editable(false), frame(true)
4521 {
4522 }
4523 
4528  : QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true)
4529 {
4530 }
4531 
4677 {
4678 }
4679 
4684  : QStyleOption(version, SO_ToolBox)
4685 {
4686 }
4687 
4787  : QStyleOptionToolBox(Version), position(Beginning), selectedPosition(NotAdjacent)
4788 {
4789 }
4790 
4805 {
4806 }
4807 
4823 {
4825 
4826  const QStyleOptionToolBoxV2 *f2 = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(&other);
4827  position = f2 ? f2->position : Beginning;
4829  version = Version;
4830 }
4831 
4844 {
4846 
4847  const QStyleOptionToolBoxV2 *f2 = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(&other);
4848  position = f2 ? f2->position : Beginning;
4850  version = Version;
4851  return *this;
4852 }
4853 
4854 
4906 #ifndef QT_NO_RUBBERBAND
4907 
4935  : QStyleOption(Version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
4936 {
4937 }
4938 
4943  : QStyleOption(version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
4944 {
4945 }
4946 
5012 #endif // QT_NO_RUBBERBAND
5013 
5042  : QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
5043 {
5044 }
5045 
5097 {
5098 }
5099 
5100 
5222  displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
5223  textElideMode(Qt::ElideMiddle), decorationPosition(Left),
5224  showDecorationSelected(false)
5225 {
5226 }
5227 
5232  : QStyleOption(version, SO_ViewItem),
5235  showDecorationSelected(false)
5236 {
5237 }
5238 
5363 #ifndef QT_NO_TABWIDGET
5364 
5391  : QStyleOption(Version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
5392  shape(QTabBar::RoundedNorth)
5393 {
5394 }
5395 
5408  shape(QTabBar::RoundedNorth)
5409 {
5410 }
5411 
5565 {
5566 }
5567 
5568 
5571  : QStyleOptionTabWidgetFrame(version)
5572 {
5573 }
5574 
5575 
5595 {
5597 
5598 }
5599 
5600 
5613 {
5615  if (const QStyleOptionTabWidgetFrameV2 *f2 = qstyleoption_cast<const QStyleOptionTabWidgetFrameV2 *>(&other)) {
5616  selectedTabRect = f2->selectedTabRect;
5617  tabBarRect = f2->tabBarRect;
5618  }
5619  return *this;
5620 }
5621 
5622 
5642 #endif // QT_NO_TABWIDGET
5643 
5644 #ifndef QT_NO_TABBAR
5645 
5676  : QStyleOption(Version, SO_TabBarBase), shape(QTabBar::RoundedNorth)
5677 {
5678 }
5679 
5682  : QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth)
5683 {
5684 }
5685 
5824  , documentMode(false)
5825 {
5826 }
5827 
5842 {
5843  (void)QStyleOptionTabBarBaseV2::operator=(other);
5844 }
5845 
5855 {
5858  documentMode = v2 ? v2->documentMode : false;
5859  return *this;
5860 }
5861 
5864  : QStyleOptionTabBarBase(version), documentMode(false)
5865 {
5866 }
5867 
5868 #endif // QT_NO_TABBAR
5869 
5870 #ifndef QT_NO_SIZEGRIP
5871 
5899 {
5900 }
5901 
5916 {
5917 }
5918 
5964 #endif // QT_NO_SIZEGRIP
5965 
6028  : QStyleOption(Version, Type), levelOfDetail(1)
6029 {
6030 }
6031 
6036  : QStyleOption(version, Type), levelOfDetail(1)
6037 {
6038 }
6039 
6055 {
6056  if (worldTransform.type() <= QTransform::TxTranslate)
6057  return 1; // Translation only? The LOD is 1.
6058 
6059  // Two unit vectors.
6060  QLineF v1(0, 0, 1, 0);
6061  QLineF v2(0, 0, 0, 1);
6062  // LOD is the transformed area of a 1x1 rectangle.
6063  return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length());
6064 }
6065 
6228  : version(version), type(type)
6229 {
6230 }
6231 
6237 {
6238 
6239 }
6240 
6268 {
6269 }
6270 
6332 {
6333 }
6334 
6395 #if !defined(QT_NO_DEBUG_STREAM)
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 }
6464 
6465 QDebug operator<<(QDebug debug, const QStyleOption &option)
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 }
6479 #endif
6480 
QStyleOptionViewItemV3 & operator=(const QStyleOptionViewItem &other)
Assigns the other style option to this style option.
int version
the version of the style option
Definition: qstyleoption.h:86
qreal notchTarget
the number of pixel between notches
Definition: qstyleoption.h:717
The QDebug class provides an output stream for debugging information.
Definition: qdebug.h:62
int height
the height of the item
Definition: qstyleoption.h:474
QStyleOptionFrame()
Constructs a QStyleOptionFrame, initializing the members variables to their default values...
QStyleOptionTabV3 & operator=(const QStyleOptionTab &other)
Assigns the other style option to this QStyleOptionTabV3.
QPalette palette
the widget&#39;s palette
Definition: qwidget.h:180
QStyleOptionTabV3()
Constructs a QStyleOptionTabV3.
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Q...
Definition: qstyleoption.h:649
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
Qt::Alignment decorationAlignment
the alignment of the decoration for the item
Definition: qstyleoption.h:548
The QStyleHintReturn class provides style hints that return more than basic data types.
Definition: qstyleoption.h:907
bool rootIsDecorated
whether root items are decorated
Definition: qstyleoption.h:759
int type
the option type of the style option
Definition: qstyleoption.h:87
QStyleHintReturnMask()
Constructs a QStyleHintReturnMask.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QStyleOptionComboBox()
Creates a QStyleOptionComboBox, initializing the members variables to their default values...
The QStyleOptionDockWidget class is used to describe the parameters for drawing a dock widget...
Definition: qstyleoption.h:504
int sliderValue
the value of the slider
Definition: qstyleoption.h:714
QPointer< QWidget > widget
int maximum
the maximum value for the progress bar
Definition: qstyleoption.h:403
QRect tabBarRect
the rectangle containing all the tabs
Definition: qstyleoption.h:201
bool frame
whether the combo box has a frame
Definition: qstyleoption.h:804
int itemMargin
the margin for items in the list view
Definition: qstyleoption.h:757
bool isActiveWindow
whether this widget&#39;s window is the active window
Definition: qwidget.h:186
The QStyleOptionTabV2 class is used to describe the parameters necessary for drawing a tabs in Qt 4...
Definition: qstyleoption.h:333
QStyleOptionProgressBarV2()
Constructs a QStyleOptionProgressBarV2, initializing he members variables to their default values...
QIcon icon
The icon (if any) to be drawn in the view item.
Definition: qstyleoption.h:617
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item...
Definition: qstyleoption.h:435
The QStyleOptionHeader class is used to describe the parameters for drawing a header.
Definition: qstyleoption.h:251
Qt::ArrowType arrowType
the direction of the arrow for the tool button
Definition: qstyleoption.h:782
QStyleOptionTabBarBase()
Construct a QStyleOptionTabBarBase, initializing the members vaiables to their default values...
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
QStyleHintReturnVariant()
Constructs a QStyleHintReturnVariant.
int lineWidth
This variable holds the line width for drawing the toolbar.
Definition: qstyleoption.h:381
QStyleOptionToolBox()
Creates a QStyleOptionToolBox, initializing the members variables to their default values...
ToolBarFeatures features
This variable holds whether the toolbar is movable or not.
Definition: qstyleoption.h:380
bool closable
whether the dock window is closable
Definition: qstyleoption.h:511
QBrush backgroundBrush
The QBrush that should be used to paint the view items background.
Definition: qstyleoption.h:620
QStyleOptionTabV2 & operator=(const QStyleOptionTab &other)
Assigns the other style option to this QStyleOptionTabV2.
QFrame::Shape frameShape
This property holds the frame shape value of the frame.
Definition: qstyleoption.h:161
Qt::Orientation orientation
the progress bar&#39;s orientation (horizontal or vertical); the default orentation is Qt::Horizontal ...
Definition: qstyleoption.h:422
QStyleOptionFrameV2::FrameFeatures features
the features of the group box frame
Definition: qstyleoption.h:840
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
Position decorationPosition
the position of the decoration for the item
Definition: qstyleoption.h:550
QStyleOptionRubberBand()
Creates a QStyleOptionRubberBand, initializing the members variables to their default values...
int tickInterval
the interval that should be drawn between tick marks
Definition: qstyleoption.h:711
ToolBarPosition positionWithinLine
This variable holds the position of the toolbar within a line.
Definition: qstyleoption.h:378
QStyleOptionTabV2()
Constructs a QStyleOptionTabV2.
int maxIconWidth
the maximum icon width for the icon in the menu item
Definition: qstyleoption.h:452
int childCount
the number of children the item has
Definition: qstyleoption.h:477
Qt::TextElideMode textElideMode
where ellipsis should be added for text that is too long to fit into an item
Definition: qstyleoption.h:549
void init(const QWidget *w)
Use initFrom(widget) instead.
bool bottomToTop
whether the text reads from bottom to top when the progress bar is vertical
Definition: qstyleoption.h:424
QAbstractSpinBox::StepEnabled stepEnabled
which buttons of the spin box that are enabled
Definition: qstyleoption.h:736
SortIndicator sortIndicator
the direction the sort indicator should be drawn
Definition: qstyleoption.h:269
QSlider::TickPosition tickPosition
the position of the slider&#39;s tick marks, if any
Definition: qstyleoption.h:710
int midLineWidth
the mid-line width for drawing the panel
Definition: qstyleoption.h:182
QStyleOptionTabWidgetFrame()
Constructs a QStyleOptionTabWidgetFrame, initializing the members variables to their default values...
TabPosition position
the position of the tab in the tab bar
Definition: qstyleoption.h:320
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
qreal levelOfDetail
Use QStyleOptionGraphicsItem::levelOfDetailFromTransform() together with QPainter::worldTransform() i...
Definition: qstyleoption.h:875
bool editable
whether or not the combobox is editable or not
Definition: qstyleoption.h:802
bool underMouse() const
Returns true if the widget is under the mouse cursor; otherwise returns false.
Definition: qwidget.h:996
QStyleOptionQ3DockWindow()
Constructs a QStyleOptionQ3DockWindow, initializing the member variables to their default values...
QFontMetrics fontMetrics
the font metrics that should be used when drawing text in the control
Definition: qstyleoption.h:91
bool hasFocus() const
Definition: qwidget.cpp:6583
QStyleOptionHeader()
Constructs a QStyleOptionHeader, initializing the members variables to their default values...
The QStyleOptionToolBox class is used to describe the parameters needed for drawing a tool box...
Definition: qstyleoption.h:633
Qt::Alignment textAlignment
the alignment of the group box title
Definition: qstyleoption.h:842
TransformationType type() const
Returns the transformation type of this matrix.
QStyleOptionViewItem()
Constructs a QStyleOptionViewItem, initializing the members variables to their default values...
Qt::Corner corner
The corner in which the size grip is located.
Definition: qstyleoption.h:859
Qt::Orientation orientation
the header&#39;s orientation (horizontal or vertical)
Definition: qstyleoption.h:270
QStyleOptionTitleBar()
Constructs a QStyleOptionTitleBar, initializing the members variables to their default values...
QTabBar::Shape shape
the tab shape used to draw the tab; by default QTabBar::RoundedNorth
Definition: qstyleoption.h:316
Qt::Alignment textAlignment
the alignment flags for the text of the header
Definition: qstyleoption.h:264
QStyleOptionTabBarBaseV2 & operator=(const QStyleOptionTabBarBase &other)
Constructs a QStyleOptionTabBarBaseV2 copy of the other style option which can be either of the QStyl...
bool frame
whether the spin box has a frame
Definition: qstyleoption.h:737
QStyleOptionTabBarBaseV2()
Construct a QStyleOptionTabBarBaseV2, initializing the members vaiables to their default values...
bool qt_mac_can_clickThrough(const QWidget *)
Definition: qwidget_mac.mm:280
T qstyleoption_cast(const QStyleOption *option)
Definition: qstyleoption.h:885
bool dialWrapping
whether the dial should wrap or not
Definition: qstyleoption.h:718
The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:562
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
QRect selectedTabRect
the rectangle containing the selected tab
Definition: qstyleoption.h:202
bool closeEnabled
whether the dock window has a close button
Definition: qstyleoption.h:495
int sortColumn
the sort column of the list view
Definition: qstyleoption.h:756
bool movable
whether the dock window is movable
Definition: qstyleoption.h:512
QStyleOptionQ3ListView()
Creates a QStyleOptionQ3ListView, initializing the members variables to their default values...
bool upsideDown
the slider control orientation
Definition: qstyleoption.h:712
int lineWidth
the line width for drawing the frame
Definition: qstyleoption.h:124
The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progre...
Definition: qstyleoption.h:417
NSWindow * window
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QStyleOption & operator=(const QStyleOption &other)
Assign other to this QStyleOption.
int totalHeight
the total height of the item, including its children
Definition: qstyleoption.h:475
The QStyleOptionViewItemV3 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:590
ViewItemFeatures features
a bitwise OR of the features that describe this view item
Definition: qstyleoption.h:577
QStyleOptionViewItemV4()
Constructs a QStyleOptionViewItemV4 object.
bool documentMode
whether the tabbar is in document mode.
Definition: qstyleoption.h:239
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
Definition: qstyleoption.h:657
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
QStyleOptionSlider()
Constructs a QStyleOptionSlider, initializing the members variables to their default values...
bool checked
whether the menu item is checked or not
Definition: qstyleoption.h:447
QStyleOptionButton()
Constructs a QStyleOptionButton, initializing the members variables to their default values...
QStyleOptionDockWidget()
Constructs a QStyleOptionDockWidget, initializing the member variables to their default values...
~QStyleOption()
Destroys this style option object.
int progress
the current progress for the progress bar
Definition: qstyleoption.h:404
QFontMetrics fontMetrics() const
Returns the font metrics for the widget&#39;s current font.
Definition: qwidget.h:984
bool menuHasCheckableItems
whether the menu as a whole has checkable items or not
Definition: qstyleoption.h:448
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
QStyleOptionToolButton()
Constructs a QStyleOptionToolButton, initializing the members variables to their default values...
Q3ListViewItemFeatures features
the features for this item
Definition: qstyleoption.h:473
bool showDecorationSelected
whether the decoration should be highlighted on selected items
Definition: qstyleoption.h:553
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
Definition: qstyleoption.h:118
Qt::CheckState checkState
If this view item is checkable, i.
Definition: qstyleoption.h:616
Qt::Alignment textAlignment
the text alignment for the text in the QProgressBar
Definition: qstyleoption.h:406
int row
which row the tab is currently in
Definition: qstyleoption.h:319
The QStyleOptionTabWidgetFrame class is used to describe the parameters for drawing the frame around ...
Definition: qstyleoption.h:175
int sliderPosition
the position of the slider handle
Definition: qstyleoption.h:713
The QSlider widget provides a vertical or horizontal slider.
Definition: qslider.h:57
QStyleOptionProgressBarV2 & operator=(const QStyleOptionProgressBar &other)
Assigns the other style option to this style option.
int minimum
the minimum value for the progress bar
Definition: qstyleoption.h:402
The QStyleOptionTabBarBase class is used to describe the base of a tab bar, i.e.
Definition: qstyleoption.h:218
QStyleOptionFrameV3 & operator=(const QStyleOptionFrame &other)
Assigns the other style option to this style option.
QStyleOptionViewItemV2()
Constructs a QStyleOptionViewItemV2 object.
QStyleOptionFrameV3()
Constructs a QStyleOptionFrameV3 object.
ButtonFeatures features
a bitwise OR of the features that describe this button
Definition: qstyleoption.h:289
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
QStyleOptionSpinBox()
Constructs a QStyleOptionSpinBox, initializing the members variables to their default values...
MenuItemType menuItemType
the type of menu item
Definition: qstyleoption.h:445
bool opaque
whether the rubber band is required to be drawn in an opaque style
Definition: qstyleoption.h:676
int lineWidth
the line width for drawing the panel
Definition: qstyleoption.h:181
int treeStepSize
the number of pixel to offset children items from their parents
Definition: qstyleoption.h:758
CornerWidgets cornerWidgets
an OR combination of CornerWidget values indicating the corner widgets of the tab bar ...
Definition: qstyleoption.h:322
FrameFeatures features
a bitwise OR of the features that describe this frame.
Definition: qstyleoption.h:143
QStyleOptionGroupBox()
Constructs a QStyleOptionGroupBox, initializing the members variables to their default values...
bool isEnabled() const
Definition: qwidget.h:948
#define None
QSize rightButtonSize
the size for the right widget on the tab.
Definition: qstyleoption.h:353
bool floatable
whether the dock window is floatable
Definition: qstyleoption.h:513
QStyleOptionGraphicsItem()
Constructs a QStyleOptionGraphicsItem.
Qt::LayoutDirection layoutDirection
the layout direction for this widget
Definition: qwidget.h:216
QStyleOptionFrameV2 & operator=(const QStyleOptionFrame &other)
Assigns the other style option to this style option.
bool documentMode
whether the tabbar is in document mode.
Definition: qstyleoption.h:351
ViewItemPosition viewItemPosition
Gives the position of this view item relative to other items.
Definition: qstyleoption.h:619
The QStyleOptionTabBarBaseV2 class is used to describe the base of a tab bar, i.e.
Definition: qstyleoption.h:235
QPalette palette
the palette that should be used when painting the control
Definition: qstyleoption.h:92
QStyleOptionDockWidgetV2 & operator=(const QStyleOptionDockWidget &other)
QStyleOptionQ3ListViewItem()
Constructs a QStyleOptionQ3ListViewItem, initializing the members variables to their default values...
SectionPosition position
the section&#39;s position in relation to the other sections
Definition: qstyleoption.h:267
QAbstractSpinBox::ButtonSymbols buttonSymbols
the type of button symbols to draw for the spin box
Definition: qstyleoption.h:735
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
Definition: qstyleoption.h:321
QStyleOptionSizeGrip()
Constructs a QStyleOptionSizeGrip.
bool textVisible
a flag indicating whether or not text is visible
Definition: qstyleoption.h:407
QStyleOption(int version=QStyleOption::Version, int type=SO_Default)
Constructs a QStyleOption with the specified version and type.
int maximum
the maximum value for the slider
Definition: qstyleoption.h:709
QStyleHintReturn(int version=QStyleOption::Version, int type=SH_Default)
Constructs a QStyleHintReturn with version version and type type.
Qt::ToolButtonStyle toolButtonStyle
a Qt::ToolButtonStyle value describing the appearance of the tool button
Definition: qstyleoption.h:783
ToolButtonFeatures features
an OR combination of the tool button&#39;s features
Definition: qstyleoption.h:778
const QWidget * widget
Definition: qstyleoption.h:596
int midLineWidth
the mid-line width for drawing the panel
Definition: qstyleoption.h:845
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
Qt::Alignment iconAlignment
the alignment flags for the icon of the header
Definition: qstyleoption.h:266
SelectedPosition selectedPosition
the section&#39;s position in relation to the selected section
Definition: qstyleoption.h:268
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
QStyleOptionTabWidgetFrameV2 & operator=(const QStyleOptionTabWidgetFrame &other)
Assigns the other style option to this style option.
int midLineWidth
the mid-line width for drawing the frame
Definition: qstyleoption.h:125
int lineWidth
the line width for drawing the panel
Definition: qstyleoption.h:844
int minimum
the minimum value for the slider
Definition: qstyleoption.h:708
int tabWidth
the tab width for the menu item
Definition: qstyleoption.h:453
The QStyleOptionFrameV3 class is used to describe the parameters necessary for drawing a frame in Qt ...
Definition: qstyleoption.h:157
QModelIndex index
The model index that is to be drawn.
Definition: qstyleoption.h:615
QStyleOptionTab()
Constructs a QStyleOptionTab object, initializing the members variables to their default values...
static WidgetSizePolicy widgetSizePolicy(const QWidget *w)
Qt::Alignment displayAlignment
the alignment of the display value for the item
Definition: qstyleoption.h:547
QStyleOptionToolBoxV2()
Contsructs a QStyleOptionToolBoxV2 object.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
Definition: qstyle.h:68
OptionType
This enum is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine th...
Definition: qstyleoption.h:70
QSize iconSize
the size for the icons
Definition: qstyleoption.h:337
The QStyleOptionTabV3 class is used to describe the parameters necessary for drawing a tabs in Qt 4...
Definition: qstyleoption.h:347
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
Definition: qstyleoption.h:89
Definition: qnamespace.h:54
QTabBar::Shape shape
the shape of the tab bar
Definition: qstyleoption.h:224
QRubberBand::Shape shape
the shape of the rubber band
Definition: qstyleoption.h:675
The QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt ...
Definition: qstyleoption.h:134
ToolBarPosition positionOfLine
This variable holds the position of the toolbar line.
Definition: qstyleoption.h:377
CheckType checkType
the type of checkmark of the menu item
Definition: qstyleoption.h:446
Qt::Orientation orientation
the slider&#39;s orientation (horizontal or vertical)
Definition: qstyleoption.h:707
QStyleOptionFrameV2()
Constructs a QStyleOptionFrameV2 object.
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.
Definition: qstyleoption.h:304
QStyleOptionViewItemV2 & operator=(const QStyleOptionViewItem &other)
Assigns the other style option to this style option.
bool docked
whether the dock window is currently docked
Definition: qstyleoption.h:494
int itemY
the Y-coordinate for the item
Definition: qstyleoption.h:476
QPalette::ColorRole viewportBGRole
the background role of Q3ListView&#39;s viewport
Definition: qstyleoption.h:755
int pageStep
the size of the page step of the slider
Definition: qstyleoption.h:716
int singleStep
the size of the single step of the slider
Definition: qstyleoption.h:715
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QStyleOptionMenuItem()
Constructs a QStyleOptionMenuItem, initializing the members variables to their default values...
QStyleOptionViewItemV3()
Constructs a QStyleOptionViewItemV3 object.
int section
which section of the header is being painted
Definition: qstyleoption.h:262
Qt::WindowFlags titleBarFlags
the widget flags for the title bar
Definition: qstyleoption.h:825
Qt::ToolBarArea toolBarArea
This variable holds the location for drawing the toolbar.
Definition: qstyleoption.h:379
QStyleOptionTabWidgetFrameV2()
Constructs a QStyleOptionTabWidgetFrameV2, initializing the members variables to their default values...
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
Definition: qstyleoption.h:687
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
Definition: qstyleoption.h:539
The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress...
Definition: qstyleoption.h:396
QSize leftButtonSize
the size for the left widget on the tab.
Definition: qstyleoption.h:352
int midLineWidth
This variable holds the mid-line width for drawing the toolbar.
Definition: qstyleoption.h:382
bool invertedAppearance
whether the progress bar&#39;s appearance is inverted
Definition: qstyleoption.h:423
int titleBarState
the state of the title bar
Definition: qstyleoption.h:824
The QRubberBand class provides a rectangle or line that can indicate a selection or a boundary...
Definition: qrubberband.h:58
The QFrame class is the base class of widgets that can have a frame.
Definition: qframe.h:55
QStyleOptionViewItemV4 & operator=(const QStyleOptionViewItem &other)
Assigns the other style option to this style option.
The QStyleOptionButton class is used to describe the parameters for drawing buttons.
Definition: qstyleoption.h:279
#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
qreal qSqrt(qreal v)
Definition: qmath.h:205
QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
The QStyleOptionTabWidgetFrameV2 class is used to describe the parameters for drawing the frame aroun...
Definition: qstyleoption.h:196
QStyleOptionProgressBar()
Constructs a QStyleOptionProgressBar, initializing the members variables to their default values...
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90
QStyleOptionFocusRect()
Constructs a QStyleOptionFocusRect, initializing the members variables to their default values...
QTabBar::Shape shape
the tab shape used to draw the tabs
Definition: qstyleoption.h:183
static qreal levelOfDetailFromTransform(const QTransform &worldTransform)
Returns the level of detail from the worldTransform.
QStyleOptionToolBoxV2 & operator=(const QStyleOptionToolBox &other)
Assigns the other style option to this style option.
QStyleOptionToolBar()
Constructs a QStyleOptionToolBar, initializing the members variables to their default values...
QString text
The text (if any) to be drawn in the view item.
Definition: qstyleoption.h:618
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
QStyleOptionComplex(int version=QStyleOptionComplex::Version, int type=SO_Complex)
Constructs a QStyleOptionComplex of the specified type and version, initializing the member variables...
Qt::LayoutDirection direction
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61