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
qquicktabbutton.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
"qquicktabbutton_p.h"
6
#
include
"qquickcontrol_p_p.h"
7
#
include
"qquickabstractbutton_p_p.h"
8
9
#
include
<
QtGui
/
qpa
/
qplatformtheme
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
/*!
14
\qmltype TabButton
15
\inherits AbstractButton
16
//! \nativetype QQuickTabButton
17
\inqmlmodule QtQuick.Controls
18
\since 5.7
19
\ingroup qtquickcontrols-navigation
20
\brief Button with a look suitable for a TabBar.
21
22
\image qtquickcontrols-tabbutton.png
23
{Tab button in tab bar}
24
25
TabButton is used in conjunction with a \l TabBar.
26
27
\snippet qtquickcontrols-tabbutton.qml 1
28
29
TabButton inherits its API from AbstractButton. For instance, you can set
30
\l {AbstractButton::text}{text}, and react to \l {AbstractButton::clicked}{clicks}
31
using the AbstractButton API.
32
33
\sa TabBar, {Customizing TabButton}, {Button Controls}, {Navigation Controls}
34
*/
35
36
class
Q_QUICKTEMPLATES2_EXPORT
QQuickTabButtonPrivate
:
public
QQuickAbstractButtonPrivate
37
{
38
Q_DECLARE_PUBLIC(QQuickTabButton)
39
40
public
:
41
QPalette defaultPalette()
const
override {
return
QQuickTheme::palette(QQuickTheme::TabBar); }
42
};
43
44
QQuickTabButton::QQuickTabButton(QQuickItem *parent)
45
: QQuickAbstractButton(*(
new
QQuickTabButtonPrivate), parent)
46
{
47
setCheckable(
true
);
48
setAutoExclusive(
true
);
49
}
50
51
QFont QQuickTabButton::defaultFont()
const
52
{
53
return
QQuickTheme::font(QQuickTheme::TabBar);
54
}
55
56
#
if
QT_CONFIG
(
accessibility
)
57
QAccessible::Role QQuickTabButton::accessibleRole()
const
58
{
59
return
QAccessible::PageTab;
60
}
61
#
endif
62
63
QT_END_NAMESPACE
64
65
#
include
"moc_qquicktabbutton_p.cpp"
QQuickTabButtonPrivate
Button with a look suitable for a TabBar.
Definition
qquicktabbutton.cpp:37
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
qtdeclarative
src
quicktemplates
qquicktabbutton.cpp
Generated on
for Qt by
1.16.1