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
qquicktabbar_p.h
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#ifndef QQUICKTABBAR_P_H
6#define QQUICKTABBAR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickcontainer_p.h>
20
22
23QT_BEGIN_NAMESPACE
24
25class QQuickTabBarPrivate;
26class QQuickTabBarAttached;
28
29class Q_QUICKTEMPLATES2_EXPORT QQuickTabBar : public QQuickContainer
30{
31 Q_OBJECT
32 Q_PROPERTY(Position position READ position WRITE setPosition NOTIFY positionChanged FINAL)
33 QML_NAMED_ELEMENT(TabBar)
34 QML_ATTACHED(QQuickTabBarAttached)
35 QML_ADDED_IN_VERSION(2, 0)
36
37public:
38 explicit QQuickTabBar(QQuickItem *parent = nullptr);
39
40 enum Position {
41 Header,
42 Footer
43 };
44 Q_ENUM(Position)
45
46 Position position() const;
47 void setPosition(Position position);
48
49 static QQuickTabBarAttached *qmlAttachedProperties(QObject *object);
50
51Q_SIGNALS:
52 void positionChanged();
53
54protected:
55 void updatePolish() override;
56 void componentComplete() override;
57 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
58 bool isContent(QQuickItem *item) const override;
59 void itemAdded(int index, QQuickItem *item) override;
60 void itemMoved(int index, QQuickItem *item) override;
61 void itemRemoved(int index, QQuickItem *item) override;
62#if QT_CONFIG(wheelevent)
63 void wheelEvent(QWheelEvent *event) override;
64#endif
65
66 QFont defaultFont() const override;
67
68#if QT_CONFIG(accessibility)
69 QAccessible::Role accessibleRole() const override;
70#endif
71
72private:
73 Q_DISABLE_COPY(QQuickTabBar)
74 Q_DECLARE_PRIVATE(QQuickTabBar)
75};
76
77class Q_QUICKTEMPLATES2_EXPORT QQuickTabBarAttached : public QObject
78{
79 Q_OBJECT
80 Q_PROPERTY(int index READ index NOTIFY indexChanged FINAL)
81 Q_PROPERTY(QQuickTabBar *tabBar READ tabBar NOTIFY tabBarChanged FINAL)
82 Q_PROPERTY(QQuickTabBar::Position position READ position NOTIFY positionChanged FINAL)
83
84public:
85 explicit QQuickTabBarAttached(QObject *parent = nullptr);
86
87 int index() const;
88 QQuickTabBar *tabBar() const;
89 QQuickTabBar::Position position() const;
90
91Q_SIGNALS:
92 void indexChanged();
93 void tabBarChanged();
94 void positionChanged();
95
96private:
97 Q_DISABLE_COPY(QQuickTabBarAttached)
98 Q_DECLARE_PRIVATE(QQuickTabBarAttached)
99};
100
101QT_END_NAMESPACE
102
103#endif // QQUICKTABBAR_P_H
Allows the user to switch between different views or subtasks.
void itemImplicitHeightChanged(QQuickItem *item) override
QPalette defaultPalette() const override
qreal getContentHeight() const override
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void itemImplicitWidthChanged(QQuickItem *item) override
qreal getContentWidth() const override
QT_REQUIRE_CONFIG(quicktemplates2_container)