Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qquicktumbler_p_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
4#ifndef QQUICKTUMBLER_P_P_H
5#define QQUICKTUMBLER_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
19#include <QtQuickTemplates2/private/qquicktumbler_p.h>
20
22
23class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTumblerPrivate : public QQuickControlPrivate
24{
25 Q_DECLARE_PUBLIC(QQuickTumbler)
26
27public:
32 ListViewContentItem
33 };
34
35 QQuickItem *determineViewType(QQuickItem *contentItem);
36 void resetViewData();
37 QList<QQuickItem *> viewContentItemChildItems() const;
38
39 static QQuickTumblerPrivate *get(QQuickTumbler *tumbler);
40
41 QPalette defaultPalette() const override;
42
44 QQmlComponent *delegate = nullptr;
45 int visibleItemCount = 5;
46 bool wrap = true;
47 bool explicitWrap = false;
48 bool modelBeingSet = false;
49 bool currentIndexSetDuringModelChange = false;
50 QQuickItem *view = nullptr;
51 QQuickItem *viewContentItem = nullptr;
52 ContentItemType viewContentItemType = UnsupportedContentItemType;
53 union {
54 qreal viewOffset; // PathView
55 qreal viewContentY; // ListView
56 };
57 int currentIndex = -1;
58 int pendingCurrentIndex = -1;
59 bool ignoreCurrentIndexChanges = false;
60 int count = 0;
61 bool ignoreSignals = false;
62
63 void _q_updateItemHeights();
64 void _q_updateItemWidths();
65 void _q_onViewCurrentIndexChanged();
66 void _q_onViewCountChanged();
67 void _q_onViewOffsetChanged();
68 void _q_onViewContentYChanged();
69
70 void calculateDisplacements();
71
72 void disconnectFromView();
73 void setupViewData(QQuickItem *newControlContentItem);
74 void warnAboutIncorrectContentItem();
75 void syncCurrentIndex();
76 void setPendingCurrentIndex(int index);
77
80 InternalChange
81 };
82
83 static QString propertyChangeReasonToString(PropertyChangeReason changeReason);
84
85 void setCurrentIndex(int newCurrentIndex, PropertyChangeReason changeReason = InternalChange);
86 void setCount(int newCount);
87 void setWrapBasedOnCount();
88 void setWrap(bool shouldWrap, bool isExplicit);
89 void beginSetModel();
90 void endSetModel();
91
92 void itemChildAdded(QQuickItem *, QQuickItem *) override;
93 void itemChildRemoved(QQuickItem *, QQuickItem *) override;
95};
96
98{
99 Q_DECLARE_PUBLIC(QQuickTumblerAttached)
100
101public:
103 {
104 return attached->d_func();
105 }
106
107 void init(QQuickItem *delegateItem);
108
110 void emitIfDisplacementChanged(qreal oldDisplacement, qreal newDisplacement);
111
112 // The Tumbler that contains the delegate. Required to calculated the displacement.
114 // The index of the delegate. Used to calculate the displacement.
115 int index = -1;
116 // The displacement for our delegate.
118};
119
121
122#endif // QQUICKTUMBLER_P_P_H
Definition qlist.h:74
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
\inmodule QtCore
Definition qpointer.h:18
The QQmlComponent class encapsulates a QML component definition.
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
QPalette defaultPalette() const override
static QQuickControlPrivate * get(QQuickControl *control)
virtual void itemChildAdded(QQuickItem *, QQuickItem *)
virtual void itemChildRemoved(QQuickItem *, QQuickItem *)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
static QQuickTumblerAttachedPrivate * get(QQuickTumblerAttached *attached)
void emitIfDisplacementChanged(qreal oldDisplacement, qreal newDisplacement)
void init(QQuickItem *delegateItem)
QPointer< QQuickTumbler > tumbler
\inmodule QtCore\reentrant
Definition qrect.h:483
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
Combined button and popup list for selecting options.
GLuint index
[2]
GLenum GLenum GLsizei count
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
double qreal
Definition qtypes.h:92
QQuickView * view
[0]