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 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY
34 orientationChanged FINAL REVISION(6, 13))
35 Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(6, 13))
36 Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(6, 13))
37 QML_NAMED_ELEMENT(TabBar)
38 QML_ATTACHED(QQuickTabBarAttached)
39 QML_ADDED_IN_VERSION(2, 0)
40
41public:
42 explicit QQuickTabBar(QQuickItem *parent = nullptr);
44 enum Position {
45 Header,
46 Footer
47 };
48 Q_ENUM(Position)
49
50 Position position() const;
51 void setPosition(Position position);
52
53 Qt::Orientation orientation() const;
54 void setOrientation(Qt::Orientation orientation);
55
56 bool isHorizontal() const;
57 bool isVertical() const;
58
59 static QQuickTabBarAttached *qmlAttachedProperties(QObject *object);
60
61Q_SIGNALS:
62 void positionChanged();
63 Q_REVISION(6, 13) void orientationChanged();
64
65protected:
66 void updatePolish() override;
67 void componentComplete() override;
68 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
69 bool isContent(QQuickItem *item) const override;
70 void itemAdded(int index, QQuickItem *item) override;
71 void itemMoved(int index, QQuickItem *item) override;
72 void itemRemoved(int index, QQuickItem *item) override;
73#if QT_CONFIG(wheelevent)
74 void wheelEvent(QWheelEvent *event) override;
75#endif
76
77 QFont defaultFont() const override;
78
79#if QT_CONFIG(accessibility)
80 QAccessible::Role accessibleRole() const override;
81#endif
82
83private:
84 Q_DISABLE_COPY(QQuickTabBar)
85 Q_DECLARE_PRIVATE(QQuickTabBar)
86};
87
88class Q_QUICKTEMPLATES2_EXPORT QQuickTabBarAttached : public QObject
89{
90 Q_OBJECT
91 Q_PROPERTY(int index READ index NOTIFY indexChanged FINAL)
92 Q_PROPERTY(QQuickTabBar *tabBar READ tabBar NOTIFY tabBarChanged FINAL)
93 Q_PROPERTY(QQuickTabBar::Position position READ position NOTIFY positionChanged FINAL)
94
95public:
96 explicit QQuickTabBarAttached(QObject *parent = nullptr);
97
98 int index() const;
99 QQuickTabBar *tabBar() const;
100 QQuickTabBar::Position position() const;
101
102Q_SIGNALS:
103 void indexChanged();
104 void tabBarChanged();
105 void positionChanged();
106
107private:
108 Q_DISABLE_COPY(QQuickTabBarAttached)
109 Q_DECLARE_PRIVATE(QQuickTabBarAttached)
110};
111
112QT_END_NAMESPACE
113
114#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
Qt::Orientation orientation
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void itemImplicitWidthChanged(QQuickItem *item) override
qreal getContentWidth() const override
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(quicktemplates2_container)