Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
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
21#include <QtCore/qpointer.h>
22
24
25class Q_QUICKTEMPLATES2_EXPORT QQuickTumblerPrivate : public QQuickControlPrivate
26{
27 Q_DECLARE_PUBLIC(QQuickTumbler)
28
29public:
36
37 QQuickItem *determineViewType(QQuickItem *contentItem);
38 void resetViewData();
39 QList<QQuickItem *> viewContentItemChildItems() const;
40
41 static QQuickTumblerPrivate *get(QQuickTumbler *tumbler);
42
43 QPalette defaultPalette() const override;
44
46 QQmlComponent *delegate = nullptr;
47 int visibleItemCount = 5;
48 bool wrap = true;
49 bool explicitWrap = false;
50 bool modelBeingSet = false;
51 bool currentIndexSetDuringModelChange = false;
52 QQuickItem *view = nullptr;
53 QQuickItem *viewContentItem = nullptr;
54 ContentItemType viewContentItemType = UnsupportedContentItemType;
55 union {
56 qreal viewOffset; // PathView
57 qreal viewContentY; // ListView
58 };
59 int currentIndex = -1;
60 int pendingCurrentIndex = -1;
61 bool ignoreCurrentIndexChanges = false;
62 int count = 0;
63 bool ignoreSignals = false;
64
65 void _q_updateItemHeights();
66 void _q_updateItemWidths();
67 void _q_onViewCurrentIndexChanged();
68 void _q_onViewCountChanged();
69 void _q_onViewOffsetChanged();
70 void _q_onViewContentYChanged();
71
72 void calculateDisplacements();
73
74 void disconnectFromView();
75 void setupViewData(QQuickItem *newControlContentItem);
76 void warnAboutIncorrectContentItem();
77 void syncCurrentIndex();
78 void setPendingCurrentIndex(int index);
79
82 InternalChange
83 };
84
85 static QString propertyChangeReasonToString(PropertyChangeReason changeReason);
86
87 void setCurrentIndex(int newCurrentIndex, PropertyChangeReason changeReason = InternalChange);
88 void setCount(int newCount);
89 void setWrapBasedOnCount();
90 void setWrap(bool shouldWrap, bool isExplicit);
91 void beginSetModel();
92 void endSetModel();
93
94 void itemChildAdded(QQuickItem *, QQuickItem *) override;
95 void itemChildRemoved(QQuickItem *, QQuickItem *) override;
96 void itemGeometryChanged(QQuickItem *, QQuickGeometryChange , const QRectF &) override;
97};
98
100{
101 Q_DECLARE_PUBLIC(QQuickTumblerAttached)
102
103public:
105 {
106 return attached->d_func();
107 }
108
109 void init(QQuickItem *delegateItem);
110
112 void emitIfDisplacementChanged(qreal oldDisplacement, qreal newDisplacement);
113
114 // The Tumbler that contains the delegate. Required to calculated the displacement.
115 QPointer<QQuickTumbler> tumbler;
116 // The index of the delegate. Used to calculate the displacement.
117 int index = -1;
118 // The displacement for our delegate.
120};
121
123
124#endif // QQUICKTUMBLER_P_P_H
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
The QQmlComponent class encapsulates a QML component definition.
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
static QQuickTumblerAttachedPrivate * get(QQuickTumblerAttached *attached)
void emitIfDisplacementChanged(qreal oldDisplacement, qreal newDisplacement)
void init(QQuickItem *delegateItem)
QPointer< QQuickTumbler > tumbler
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
GLuint index
[2]
GLenum GLenum GLsizei count
static QT_BEGIN_NAMESPACE QAsn1Element wrap(quint8 type, const QAsn1Element &child)
double qreal
Definition qtypes.h:187
QQuickView * view
[0]