summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyleoption.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qstyleoption.cpp')
-rw-r--r--src/widgets/styles/qstyleoption.cpp639
1 files changed, 222 insertions, 417 deletions
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 97631a5841..d3a395246c 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWidgets module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "private/qstylehelper_p.h"
@@ -58,9 +22,9 @@ QT_BEGIN_NAMESPACE
For performance reasons, there are few member functions and the
access to the member variables is direct (i.e., using the \c . or
- \c -> operator). This low-level feel makes the structures
- straightforward to use and emphasizes that these are simply
- parameters used by the style functions.
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
The caller of a QStyle function usually creates QStyleOption
objects on the stack. This combined with Qt's extensive use of
@@ -86,9 +50,6 @@ QT_BEGIN_NAMESPACE
The qstyleoption_cast() function will return 0 if the object to
which \c option points is not of the correct type.
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
-
\sa QStyle, QStylePainter
*/
@@ -151,7 +112,7 @@ QT_BEGIN_NAMESPACE
QStyleOption::QStyleOption(int version, int type)
: version(version), type(type), state(QStyle::State_None),
- direction(QApplication::layoutDirection()), fontMetrics(QFont()), styleObject(0)
+ direction(QGuiApplication::layoutDirection()), fontMetrics(QFont()), styleObject(nullptr)
{
}
@@ -176,13 +137,7 @@ QStyleOption::~QStyleOption()
\sa QWidget::layoutDirection(), QWidget::rect(),
QWidget::palette(), QWidget::fontMetrics()
*/
-
-/*!
- \obsolete
-
- Use initFrom(\a widget) instead.
-*/
-void QStyleOption::init(const QWidget *widget)
+void QStyleOption::initFrom(const QWidget *widget)
{
QWidget *window = widget->window();
state = QStyle::State_None;
@@ -198,11 +153,6 @@ void QStyleOption::init(const QWidget *widget)
state |= QStyle::State_Active;
if (widget->isWindow())
state |= QStyle::State_Window;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
- if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
- state &= ~QStyle::State_Enabled;
-#endif
switch (QStyleHelper::widgetSizePolicy(widget)) {
case QStyleHelper::SizeSmall:
state |= QStyle::State_Small;
@@ -370,13 +320,11 @@ QStyleOption &QStyleOption::operator=(const QStyleOption &other)
\inmodule QtWidgets
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
@@ -387,9 +335,8 @@ QStyleOption &QStyleOption::operator=(const QStyleOption &other)
*/
QStyleOptionFocusRect::QStyleOptionFocusRect()
- : QStyleOption(Version, SO_FocusRect)
+ : QStyleOptionFocusRect(Version)
{
- state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom()
}
/*!
@@ -457,6 +404,12 @@ QStyleOptionFocusRect::QStyleOptionFocusRect(int version)
QStyleOptionFrame is used for drawing several built-in Qt widgets,
including QFrame, QGroupBox, QLineEdit, and QMenu.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
+
An instance of the QStyleOptionFrame class has
\l{QStyleOption::type} {type} SO_Frame and \l{QStyleOption::version}
{version} 3.
@@ -469,36 +422,16 @@ QStyleOptionFocusRect::QStyleOptionFocusRect(int version)
without breaking compatibility. If you use qstyleoption_cast(),
you normally do not need to check it.
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
-
\sa QStyleOption
*/
/*!
- \typedef QStyleOptionFrameV2
- \relates QStyleOptionFrame
- \obsolete
-
- Synonym for QStyleOptionFrame.
-*/
-
-/*!
- \typedef QStyleOptionFrameV3
- \relates QStyleOptionFrame
- \obsolete
-
- Synonym for QStyleOptionFrame.
-*/
-
-/*!
Constructs a QStyleOptionFrame, initializing the members
variables to their default values.
*/
QStyleOptionFrame::QStyleOptionFrame()
- : QStyleOption(Version, SO_Frame), lineWidth(0), midLineWidth(0),
- features(None), frameShape(QFrame::NoFrame)
+ : QStyleOptionFrame(Version)
{
}
@@ -607,13 +540,11 @@ QStyleOptionFrame::QStyleOptionFrame(int version)
the group box's \l {text}{title} and the title's \l
{textAlignment}{alignment} and \l {textColor}{color}.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionComplex, QGroupBox
*/
@@ -709,8 +640,7 @@ QStyleOptionFrame::QStyleOptionFrame(int version)
variables to their default values.
*/
QStyleOptionGroupBox::QStyleOptionGroupBox()
- : QStyleOptionComplex(Version, Type), features(QStyleOptionFrame::None),
- textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0)
+ : QStyleOptionGroupBox(Version)
{
}
@@ -740,13 +670,11 @@ QStyleOptionGroupBox::QStyleOptionGroupBox(int version)
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 \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
@@ -757,11 +685,7 @@ QStyleOptionGroupBox::QStyleOptionGroupBox(int version)
*/
QStyleOptionHeader::QStyleOptionHeader()
- : QStyleOption(QStyleOptionHeader::Version, SO_Header),
- section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft),
- position(QStyleOptionHeader::Beginning),
- selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
- orientation(Qt::Horizontal)
+ : QStyleOptionHeader(QStyleOptionHeader::Version)
{
}
@@ -917,6 +841,49 @@ QStyleOptionHeader::QStyleOptionHeader(int version)
*/
/*!
+ \class QStyleOptionHeaderV2
+ \brief The QStyleOptionHeaderV2 class is used to describe the
+ parameters for drawing a header.
+
+ \inmodule QtWidgets
+*/
+
+/*!
+ Constructs a QStyleOptionHeaderV2, initializing the members
+ variables to their default values.
+*/
+QStyleOptionHeaderV2::QStyleOptionHeaderV2()
+ : QStyleOptionHeaderV2(QStyleOptionHeaderV2::Version)
+{
+}
+
+/*!
+ \internal
+*/
+QStyleOptionHeaderV2::QStyleOptionHeaderV2(int version)
+: QStyleOptionHeader(version), textElideMode(Qt::ElideNone), isSectionDragTarget(false), unused(0)
+{}
+
+/*!
+ \variable QStyleOptionHeaderV2::textElideMode
+ \brief where ellipsis should be added for text that is too long to fit
+ into an item
+
+ The default value is Qt::ElideNone.
+
+ \sa Qt::TextElideMode
+*/
+
+/*!
+ \variable QStyleOptionHeaderV2::isSectionDragTarget
+
+ \brief whether the section is the location at which a dragged section
+ will be inserted
+
+ \sa QHeaderView::setSectionsMovable
+*/
+
+/*!
\class QStyleOptionButton
\brief The QStyleOptionButton class is used to describe the
parameters for drawing buttons.
@@ -927,13 +894,11 @@ QStyleOptionHeader::QStyleOptionHeader(int version)
functions need to draw graphical elements like QPushButton,
QCheckBox, and QRadioButton.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionToolButton
*/
@@ -959,7 +924,7 @@ QStyleOptionHeader::QStyleOptionHeader(int version)
*/
QStyleOptionButton::QStyleOptionButton()
- : QStyleOption(QStyleOptionButton::Version, SO_Button), features(None)
+ : QStyleOptionButton(QStyleOptionButton::Version)
{
}
@@ -1052,11 +1017,6 @@ QStyleOptionButton::QStyleOptionButton(int version)
QStyleOptionToolBar contains all the information that QStyle
functions need to draw QToolBar.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> operator). This low-level feel
- makes the structures straightforward to use and emphasizes that
- these are simply parameters used by the style functions.
-
The QStyleOptionToolBar class holds the lineWidth and the
midLineWidth for drawing the widget. It also stores information
about which \l {toolBarArea}{area} the toolbar should be located
@@ -1070,8 +1030,11 @@ QStyleOptionButton::QStyleOptionButton(int version)
the position of a toolbar line, as well as the toolbar's position
within the line.
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
@@ -1082,8 +1045,7 @@ QStyleOptionButton::QStyleOptionButton(int version)
*/
QStyleOptionToolBar::QStyleOptionToolBar()
- : QStyleOption(Version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne),
- toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0)
+ : QStyleOptionToolBar(Version)
{
}
@@ -1249,41 +1211,22 @@ QStyleOptionToolBar::QStyleOptionToolBar(int version)
compatibility. If you use qstyleoption_cast(), you normally do not
need to check it.
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
/*!
- \typedef QStyleOptionTabV2
- \relates QStyleOptionTab
- \obsolete
-
- Synonym for QStyleOptionTab.
-*/
-
-/*!
- \typedef QStyleOptionTabV3
- \relates QStyleOptionTab
- \obsolete
-
- Synonym for QStyleOptionTab.
-*/
-
-/*!
Constructs a QStyleOptionTab object, initializing the members
variables to their default values.
*/
QStyleOptionTab::QStyleOptionTab()
- : QStyleOption(QStyleOptionTab::Version, SO_Tab),
- shape(QTabBar::RoundedNorth),
- row(0),
- position(Beginning),
- selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets),
- documentMode(false),
- features(QStyleOptionTab::None)
+ : QStyleOptionTab(QStyleOptionTab::Version)
{
}
@@ -1347,6 +1290,7 @@ QStyleOptionTab::QStyleOptionTab(int version)
\value Middle The tab is neither the first nor the last tab in the tab bar.
\value End The tab is the last tab in the tab bar.
\value OnlyOneTab The tab is both the first and the last tab in the tab bar.
+ \value [since 6.6] Moving The tab is moving by mouse drag or animation.
\sa position
*/
@@ -1398,7 +1342,7 @@ QStyleOptionTab::QStyleOptionTab(int version)
/*!
\variable QStyleOptionTab::shape
\brief the tab shape used to draw the tab; by default
- QTabBar::RoundedNorth
+ QTabBar::RoundedNorth.
\sa QTabBar::Shape
*/
@@ -1458,7 +1402,7 @@ QStyleOptionTab::QStyleOptionTab(int version)
\value None A normal tab button.
\value HasFrame The tab button is positioned on a tab frame
- \sa features
+ \sa QStyleOptionToolBar::features
*/
/*!
@@ -1475,6 +1419,13 @@ QStyleOptionTab::QStyleOptionTab(int version)
The default value is QSize(-1, -1), i.e. an invalid size;
*/
+/*!
+ \variable QStyleOptionTab::tabIndex
+ \brief the index for the tab being represented.
+
+ The default value is -1, i.e. a tab not on a tabbar;
+ */
+
#endif // QT_CONFIG(tabbar)
/*!
@@ -1495,29 +1446,22 @@ QStyleOptionTab::QStyleOptionTab(int version)
without breaking compatibility. If you use qstyleoption_cast(),
you normally do not need to check it.
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
/*!
- \typedef QStyleOptionProgressBarV2
- \relates QStyleOptionProgressBar
- \obsolete
-
- Synonym for QStyleOptionProgressBar.
-*/
-
-/*!
Constructs a QStyleOptionProgressBar, initializing the members
variables to their default values.
*/
QStyleOptionProgressBar::QStyleOptionProgressBar()
- : QStyleOption(QStyleOptionProgressBar::Version, SO_ProgressBar),
- minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false),
- orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
+ : QStyleOptionProgressBar(QStyleOptionProgressBar::Version)
{
}
@@ -1527,8 +1471,9 @@ QStyleOptionProgressBar::QStyleOptionProgressBar()
QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
: QStyleOption(version, SO_ProgressBar),
minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false),
- orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
+ invertedAppearance(false), bottomToTop(false)
{
+ state |= QStyle::State_Horizontal;
}
/*!
@@ -1612,7 +1557,7 @@ QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
/*!
\variable QStyleOptionProgressBar::textAlignment
- \brief the text alignment for the text in the QProgressBar
+ \brief the text alignment for the text in the QProgressBar.
This can be used as a guide on where the text should be in the
progress bar. The default value is Qt::AlignLeft.
@@ -1630,17 +1575,6 @@ QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
*/
/*!
- \variable QStyleOptionProgressBar::orientation
- \brief the progress bar's orientation (horizontal or vertical);
- the default orentation is Qt::Horizontal
-
- \deprecated
- Use the QStyle::State_Horizontal flag instead (in the the QStyleOption::state member).
-
- \sa QProgressBar::orientation
-*/
-
-/*!
\variable QStyleOptionProgressBar::invertedAppearance
\brief whether the progress bar's appearance is inverted
@@ -1670,13 +1604,11 @@ QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
functions need to draw the menu items from \l QMenu. It is also
used for drawing other menu-related widgets.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
@@ -1687,8 +1619,7 @@ QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
*/
QStyleOptionMenuItem::QStyleOptionMenuItem()
- : QStyleOption(QStyleOptionMenuItem::Version, SO_MenuItem), menuItemType(Normal),
- checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
+ : QStyleOptionMenuItem(QStyleOptionMenuItem::Version)
{
}
@@ -1697,7 +1628,8 @@ QStyleOptionMenuItem::QStyleOptionMenuItem()
*/
QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
: QStyleOption(version, SO_MenuItem), menuItemType(Normal),
- checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
+ checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0),
+ reservedShortcutWidth(0)
{
}
@@ -1765,7 +1697,7 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
\value Exclusive The item is an exclusive check item (like a radio button).
\value NonExclusive The item is a non-exclusive check item (like a check box).
- \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusive
+ \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusionPolicy
*/
/*!
@@ -1841,7 +1773,7 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
*/
/*!
- \variable QStyleOptionMenuItem::tabWidth
+ \variable QStyleOptionMenuItem::reservedShortcutWidth
\brief the reserved width for the menu item's shortcut
QMenu sets it to the width occupied by the widest shortcut among
@@ -1872,11 +1804,11 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
other complex control options, for example QStyleOptionSlider and
QStyleOptionSpinBox.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> operator).
-
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
@@ -1962,13 +1894,11 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type)
QStyleOptionSlider contains all the information that QStyle
functions need to draw QSlider and QScrollBar.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOptionComplex, QSlider, QScrollBar
*/
@@ -1979,10 +1909,7 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type)
*/
QStyleOptionSlider::QStyleOptionSlider()
- : QStyleOptionComplex(Version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
- tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
- sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
- dialWrapping(false)
+ : QStyleOptionSlider(Version)
{
}
@@ -1993,7 +1920,7 @@ QStyleOptionSlider::QStyleOptionSlider(int version)
: QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
- dialWrapping(false)
+ dialWrapping(false), keyboardModifiers{}
{
}
@@ -2161,13 +2088,11 @@ QStyleOptionSlider::QStyleOptionSlider(int version)
QStyleOptionSpinBox contains all the information that QStyle
functions need to draw QSpinBox and QDateTimeEdit.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionComplex
*/
@@ -2178,8 +2103,7 @@ QStyleOptionSlider::QStyleOptionSlider(int version)
*/
QStyleOptionSpinBox::QStyleOptionSpinBox()
- : QStyleOptionComplex(Version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
- stepEnabled(QAbstractSpinBox::StepNone), frame(false)
+ : QStyleOptionSpinBox(Version)
{
}
@@ -2266,33 +2190,22 @@ QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
QStyleOptionDockWidget contains all the information that QStyle
functions need to draw graphical elements like QDockWidget.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption
*/
/*!
- \typedef QStyleOptionDockWidgetV2
- \relates QStyleOptionDockWidget
- \obsolete
-
- Synonym for QStyleOptionDockWidget.
-*/
-
-/*!
Constructs a QStyleOptionDockWidget, initializing the member
variables to their default values.
*/
QStyleOptionDockWidget::QStyleOptionDockWidget()
- : QStyleOption(Version, SO_DockWidget), closable(false),
- movable(false), floatable(false), verticalTitleBar(false)
+ : QStyleOptionDockWidget(Version)
{
}
@@ -2380,13 +2293,11 @@ QStyleOptionDockWidget::QStyleOptionDockWidget(int version)
QStyleOptionToolButton contains all the information that QStyle
functions need to draw QToolButton.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionComplex, QStyleOptionButton
*/
@@ -2412,8 +2323,7 @@ QStyleOptionDockWidget::QStyleOptionDockWidget(int version)
*/
QStyleOptionToolButton::QStyleOptionToolButton()
- : QStyleOptionComplex(Version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
- , toolButtonStyle(Qt::ToolButtonIconOnly)
+ : QStyleOptionToolButton(Version)
{
}
@@ -2544,13 +2454,11 @@ QStyleOptionToolButton::QStyleOptionToolButton(int version)
QStyleOptionButton contains all the information that QStyle
functions need to draw QComboBox.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionComplex, QComboBox
*/
@@ -2561,7 +2469,7 @@ QStyleOptionToolButton::QStyleOptionToolButton(int version)
*/
QStyleOptionComboBox::QStyleOptionComboBox()
- : QStyleOptionComplex(Version, SO_ComboBox), editable(false), frame(true)
+ : QStyleOptionComboBox(Version)
{
}
@@ -2601,7 +2509,7 @@ QStyleOptionComboBox::QStyleOptionComboBox(int version)
This enum is used to hold information about the version of the style option, and
is defined for each QStyleOption subclass.
- \value Version 1
+ \value Version 2
The version is used by QStyleOption subclasses to implement
extensions without breaking compatibility. If you use
@@ -2663,6 +2571,13 @@ QStyleOptionComboBox::QStyleOptionComboBox(int version)
*/
/*!
+ \variable QStyleOptionComboBox::textAlignment
+ \brief the alignment of the current text in the combo box
+
+ The default value is Qt::AlignLeft | Qt::AlignVCenter.
+*/
+
+/*!
\class QStyleOptionToolBox
\brief The QStyleOptionToolBox class is used to describe the
parameters needed for drawing a tool box.
@@ -2672,32 +2587,22 @@ QStyleOptionComboBox::QStyleOptionComboBox(int version)
QStyleOptionToolBox contains all the information that QStyle
functions need to draw QToolBox.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QToolBox
*/
/*!
- \typedef QStyleOptionToolBoxV2
- \relates QStyleOptionToolBox
- \obsolete
-
- Synonym for QStyleOptionToolBox.
-*/
-
-/*!
Creates a QStyleOptionToolBox, initializing the members variables
to their default values.
*/
QStyleOptionToolBox::QStyleOptionToolBox()
- : QStyleOption(Version, SO_ToolBox), position(Beginning), selectedPosition(NotAdjacent)
+ : QStyleOptionToolBox(Version)
{
}
@@ -2806,13 +2711,11 @@ QStyleOptionToolBox::QStyleOptionToolBox(int version)
QStyleOptionRubberBand contains all the information that
QStyle functions need to draw QRubberBand.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QRubberBand
*/
@@ -2823,7 +2726,7 @@ QStyleOptionToolBox::QStyleOptionToolBox(int version)
*/
QStyleOptionRubberBand::QStyleOptionRubberBand()
- : QStyleOption(Version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
+ : QStyleOptionRubberBand(Version)
{
}
@@ -2897,13 +2800,11 @@ QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
QStyleOptionTitleBar contains all the information that QStyle
functions need to draw the title bar of a QMdiSubWindow.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionComplex, QMdiSubWindow
*/
@@ -2914,7 +2815,7 @@ QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
*/
QStyleOptionTitleBar::QStyleOptionTitleBar()
- : QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
+ : QStyleOptionTitleBar(Version)
{
}
@@ -2959,7 +2860,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar()
\internal
*/
QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
- : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
+ : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0)
{
}
@@ -3009,43 +2910,17 @@ QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
QStyleOptionViewItem contains all the information that QStyle
functions need to draw the items for Qt's model/view classes.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, {model-view-programming.html}{Model/View
Programming}
*/
/*!
- \typedef QStyleOptionViewItemV2
- \relates QStyleOptionViewItem
- \obsolete
-
- Synonym for QStyleOptionViewItem.
-*/
-
-/*!
- \typedef QStyleOptionViewItemV3
- \relates QStyleOptionViewItem
- \obsolete
-
- Synonym for QStyleOptionViewItem.
-*/
-
-/*!
- \typedef QStyleOptionViewItemV4
- \relates QStyleOptionViewItem
- \obsolete
-
- Synonym for QStyleOptionViewItem.
-*/
-
-/*!
\enum QStyleOptionViewItem::Position
This enum describes the position of the item's decoration.
@@ -3087,11 +2962,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
*/
QStyleOptionViewItem::QStyleOptionViewItem()
- : QStyleOption(Version, SO_ViewItem),
- displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
- textElideMode(Qt::ElideMiddle), decorationPosition(Left),
- showDecorationSelected(false), features(None), widget(0),
- checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid)
+ : QStyleOptionViewItem(Version)
{
}
@@ -3102,7 +2973,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version)
: QStyleOption(version, SO_ViewItem),
displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
textElideMode(Qt::ElideMiddle), decorationPosition(Left),
- showDecorationSelected(false), features(None), widget(0),
+ showDecorationSelected(false), features(None), widget(nullptr),
checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid)
{
}
@@ -3270,7 +3141,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version)
\fn template <typename T> T qstyleoption_cast<T>(const QStyleOption *option)
\relates QStyleOption
- Returns a T or 0 depending on the \l{QStyleOption::type}{type} and
+ Returns a T or \nullptr depending on the \l{QStyleOption::type}{type} and
\l{QStyleOption::version}{version} of the given \a option.
Example:
@@ -3285,7 +3156,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version)
\overload
\relates QStyleOption
- Returns a T or 0 depending on the type of the given \a option.
+ Returns a T or \nullptr depending on the type of the given \a option.
*/
#if QT_CONFIG(tabwidget)
@@ -3299,32 +3170,21 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version)
QStyleOptionTabWidgetFrame contains all the information that
QStyle functions need to draw the frame around QTabWidget.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QTabWidget
*/
/*!
- \typedef QStyleOptionTabWidgetFrameV2
- \relates QStyleOptionTabWidgetFrame
- \obsolete
-
- Synonym for QStyleOptionTabWidgetFrame.
-*/
-
-/*!
Constructs a QStyleOptionTabWidgetFrame, initializing the members
variables to their default values.
*/
QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame()
- : QStyleOption(Version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
- shape(QTabBar::RoundedNorth)
+ : QStyleOptionTabWidgetFrame(Version)
{
}
@@ -3449,32 +3309,21 @@ QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version)
drawn for a standalone QTabBar (one that isn't part of a
QTabWidget).
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QTabBar::drawBase()
*/
/*!
- \typedef QStyleOptionTabBarBaseV2
- \relates QStyleOptionTabBarBase
- \obsolete
-
- Synonym for QStyleOptionTabBarBase.
-*/
-
-/*!
Construct a QStyleOptionTabBarBase, initializing the members
- vaiables to their default values.
+ variables to their default values.
*/
QStyleOptionTabBarBase::QStyleOptionTabBarBase()
- : QStyleOption(Version, SO_TabBarBase), shape(QTabBar::RoundedNorth),
- documentMode(false)
+ : QStyleOptionTabBarBase(Version)
{
}
@@ -3567,13 +3416,11 @@ QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
QStyleOptionButton contains all the information that QStyle
functions need to draw QSizeGrip.
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> 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 \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QStyleOptionComplex, QSizeGrip
*/
@@ -3582,7 +3429,7 @@ QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
Constructs a QStyleOptionSizeGrip.
*/
QStyleOptionSizeGrip::QStyleOptionSizeGrip()
- : QStyleOptionComplex(Version, Type), corner(Qt::BottomRightCorner)
+ : QStyleOptionSizeGrip(Version)
{
}
@@ -3646,13 +3493,11 @@ QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version)
\ingroup graphicsview-api
\inmodule QtWidgets
- For performance reasons, the access to the member variables is
- direct (i.e., using the \c . or \c -> operator). This low-level feel
- makes the structures straightforward to use and emphasizes that
- these are simply parameters.
-
- For an example demonstrating how style options can be used, see
- the \l {widgets/styles}{Styles} example.
+ For performance reasons, there are few member functions and the
+ access to the member variables is direct (i.e., using the \c . or
+ \c -> operator). This makes the structures straightforward to use
+ and emphasizes that these are simply parameters used by the style
+ functions.
\sa QStyleOption, QGraphicsItem::paint()
*/
@@ -3692,7 +3537,7 @@ QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version)
Constructs a QStyleOptionGraphicsItem.
*/
QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()
- : QStyleOption(Version, Type), levelOfDetail(1)
+ : QStyleOptionGraphicsItem(Version)
{
}
@@ -3700,7 +3545,7 @@ QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()
\internal
*/
QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version)
- : QStyleOption(version, Type), levelOfDetail(1)
+ : QStyleOption(version, Type)
{
}
@@ -3748,38 +3593,6 @@ qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &wor
*/
/*!
- \variable QStyleOptionGraphicsItem::matrix
- \brief the complete transformation matrix for the item
- \obsolete
-
- The QMatrix provided through this member does include information about
- any perspective transformations applied to the view or item. To get the
- correct transformation matrix, use QPainter::transform() on the painter
- passed into the QGraphicsItem::paint() implementation.
-
- This matrix is the combination of the item's scene matrix and the matrix
- of the painter used for drawing the item. It is provided for convenience,
- allowing anvanced level-of-detail metrics that can be used to speed up
- item drawing.
-
- To find the dimensions of an item in screen coordinates (i.e., pixels),
- you can use the mapping functions of QMatrix, such as QMatrix::map().
-
- This member is only initialized for items that have the
- QGraphicsItem::ItemUsesExtendedStyleOption flag set.
-
- \sa QStyleOptionGraphicsItem::levelOfDetailFromTransform()
-*/
-
-/*!
- \variable QStyleOptionGraphicsItem::levelOfDetail
- \obsolete
-
- Use QStyleOptionGraphicsItem::levelOfDetailFromTransform()
- together with QPainter::worldTransform() instead.
-*/
-
-/*!
\class QStyleHintReturn
\brief The QStyleHintReturn class provides style hints that return more
than basic data types.
@@ -3791,10 +3604,6 @@ qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &wor
from a style back to the querying widget. This is most useful
when the return value from QStyle::styleHint() does not provide enough
detail; for example, when a mask is to be returned.
-
- \omit
- ### --Sam
- \endomit
*/
/*!
@@ -3884,10 +3693,6 @@ QStyleHintReturn::~QStyleHintReturn()
\ingroup appearance
\inmodule QtWidgets
-
- \omit
- ### --Sam
- \endomit
*/
/*!
@@ -4006,7 +3811,7 @@ QStyleHintReturnVariant::~QStyleHintReturnVariant()
\fn template <typename T> T qstyleoption_cast<T>(const QStyleHintReturn *hint)
\relates QStyleHintReturn
- Returns a T or 0 depending on the \l{QStyleHintReturn::type}{type}
+ Returns a T or \nullptr depending on the \l{QStyleHintReturn::type}{type}
and \l{QStyleHintReturn::version}{version} of \a hint.
Example:
@@ -4021,7 +3826,7 @@ QStyleHintReturnVariant::~QStyleHintReturnVariant()
\overload
\relates QStyleHintReturn
- Returns a T or 0 depending on the type of \a hint.
+ Returns a T or \nullptr depending on the type of \a hint.
*/
#if !defined(QT_NO_DEBUG_STREAM)