Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquicktoolseparator.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
include
"qquicktoolseparator_p.h"
6
7
#
include
"qquickcontrol_p_p.h"
8
9
QT_BEGIN_NAMESPACE
10
11
/*!
12
\qmltype ToolSeparator
13
\inherits Control
14
//! \nativetype QQuickToolSeparator
15
\inqmlmodule QtQuick.Controls
16
\since 5.8
17
\ingroup qtquickcontrols-separators
18
\brief Separates a group of items in a toolbar from adjacent items.
19
20
ToolSeparator is used to visually distinguish between groups of items in a
21
toolbar by separating them with a line. It can be used in horizontal or
22
vertical toolbars by setting the \l orientation property to \c Qt.Vertical
23
or \c Qt.Horizontal, respectively.
24
25
\image qtquickcontrols-toolseparator.png
26
27
\snippet qtquickcontrols-toolseparator.qml 1
28
29
\sa {Customizing ToolSeparator}, {Separator Controls}
30
*/
31
32
class
QQuickToolSeparatorPrivate
:
public
QQuickControlPrivate
33
{
34
Q_DECLARE_PUBLIC(QQuickToolSeparator)
35
36
public
:
37
QPalette
defaultPalette
()
const
override
{
return
QQuickTheme
::
palette
(
QQuickTheme
::
ToolBar
); }
38
39
Qt
::
Orientation
orientation
=
Qt
::
Vertical
;
40
};
41
42
QQuickToolSeparator::QQuickToolSeparator(QQuickItem *parent)
43
: QQuickControl(*(
new
QQuickToolSeparatorPrivate), parent)
44
{
45
}
46
47
/*!
48
\qmlproperty enumeration QtQuick.Controls::ToolSeparator::orientation
49
50
This property holds the orientation of the tool separator.
51
52
Possible values:
53
\value Qt.Horizontal A horizontal separator is used in a vertical toolbar.
54
\value Qt.Vertical A vertical separator is used in a horizontal toolbar. (default)
55
*/
56
Qt::Orientation QQuickToolSeparator::orientation()
const
57
{
58
Q_D(
const
QQuickToolSeparator);
59
return
d->orientation;
60
}
61
62
void
QQuickToolSeparator::setOrientation(Qt::Orientation orientation)
63
{
64
Q_D(QQuickToolSeparator);
65
if
(d->orientation == orientation)
66
return
;
67
68
d->orientation = orientation;
69
emit orientationChanged();
70
}
71
72
/*!
73
\readonly
74
\qmlproperty bool QtQuick.Controls::ToolSeparator::horizontal
75
76
This property holds whether \l orientation is equal to \c Qt.Horizontal.
77
78
It is useful for \l {Customizing ToolSeparator}{customizing ToolSeparator}.
79
80
\sa orientation, vertical
81
*/
82
bool
QQuickToolSeparator::isHorizontal()
const
83
{
84
Q_D(
const
QQuickToolSeparator);
85
return
d->orientation == Qt::Horizontal;
86
}
87
88
/*!
89
\readonly
90
\qmlproperty bool QtQuick.Controls::ToolSeparator::vertical
91
92
This property holds whether \l orientation is equal to \c Qt.Vertical.
93
94
It is useful for \l {Customizing ToolSeparator}{customizing ToolSeparator}.
95
96
\sa orientation, horizontal
97
*/
98
bool
QQuickToolSeparator::isVertical()
const
99
{
100
Q_D(
const
QQuickToolSeparator);
101
return
d->orientation == Qt::Vertical;
102
}
103
104
QFont QQuickToolSeparator::defaultFont()
const
105
{
106
return
QQuickTheme::font(QQuickTheme::ToolBar);
107
}
108
109
#
if
QT_CONFIG
(
accessibility
)
110
QAccessible::Role QQuickToolSeparator::accessibleRole()
const
111
{
112
return
QAccessible::Separator;
113
}
114
#
endif
115
116
QT_END_NAMESPACE
117
118
#
include
"moc_qquicktoolseparator_p.cpp"
QQuickToolSeparatorPrivate
Separates a group of items in a toolbar from adjacent items.
Definition
qquicktoolseparator.cpp:33
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtdeclarative
src
quicktemplates
qquicktoolseparator.cpp
Generated on
for Qt by
1.14.0