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
qquickcontainer_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QQUICKCONTAINER_P_P_H
6#define QQUICKCONTAINER_P_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#include <QtQuickTemplates2/private/qquickcontrol_p_p.h>
21#include <private/qqmlobjectmodel_p.h>
22
24
25class Q_QUICKTEMPLATES2_EXPORT QQuickContainerPrivate : public QQuickControlPrivate
26{
27public:
28 Q_DECLARE_PUBLIC(QQuickContainer)
29
30 static QQuickContainerPrivate *get(QQuickContainer *container)
31 {
32 return container->d_func();
33 }
34
35 void init();
36 void cleanup();
37
38 QQuickItem *itemAt(int index) const;
39 void insertItem(int index, QQuickItem *item);
40 void moveItem(int from, int to, QQuickItem *item);
41 void removeItem(int index, QQuickItem *item);
42 void reorderItems();
43 void maybeCullItem(QQuickItem *item);
44 void maybeCullItems();
45
46 void _q_currentIndexChanged();
47
48 void itemChildAdded(QQuickItem *item, QQuickItem *child) override;
49 void itemSiblingOrderChanged(QQuickItem *item) override;
50 void itemParentChanged(QQuickItem *item, QQuickItem *parent) override;
51 void itemDestroyed(QQuickItem *item) override;
52
53 static void contentData_append(QQmlListProperty<QObject> *prop, QObject *obj);
54 static qsizetype contentData_count(QQmlListProperty<QObject> *prop);
55 static QObject *contentData_at(QQmlListProperty<QObject> *prop, qsizetype index);
56 static void contentData_clear(QQmlListProperty<QObject> *prop);
57
58 static void contentChildren_append(QQmlListProperty<QQuickItem> *prop, QQuickItem *obj);
59 static qsizetype contentChildren_count(QQmlListProperty<QQuickItem> *prop);
60 static QQuickItem *contentChildren_at(QQmlListProperty<QQuickItem> *prop, qsizetype index);
61 static void contentChildren_clear(QQmlListProperty<QQuickItem> *prop);
62
63 void updateContentWidth();
64 void updateContentHeight();
65
66 qreal getContentWidth() const override;
67 qreal getContentHeight() const override;
68
69 bool hasContentWidth = false;
70 bool hasContentHeight = false;
71 qreal contentWidth = 0;
72 qreal contentHeight = 0;
73 QObjectList contentData;
74 QQmlObjectModel *contentModel = nullptr;
75 qsizetype currentIndex = -1;
76 bool updatingCurrent = false;
77 QQuickItemPrivate::ChangeTypes changeTypes = Destroyed | Parent | SiblingOrder;
78};
79
80QT_END_NAMESPACE
81
82#endif // QQUICKCONTAINER_P_P_H
static QT_BEGIN_NAMESPACE QQuickItem * effectiveContentItem(QQuickItem *item)
Abstract base type providing functionality common to containers.
QT_REQUIRE_CONFIG(quicktemplates2_container)