aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/qqmldelegatemodel_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmlmodels/qqmldelegatemodel_p.h')
-rw-r--r--src/qmlmodels/qqmldelegatemodel_p.h92
1 files changed, 36 insertions, 56 deletions
diff --git a/src/qmlmodels/qqmldelegatemodel_p.h b/src/qmlmodels/qqmldelegatemodel_p.h
index f4578e130e..2eeffb9e0c 100644
--- a/src/qmlmodels/qqmldelegatemodel_p.h
+++ b/src/qmlmodels/qqmldelegatemodel_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QQMLDATAMODEL_P_H
#define QQMLDATAMODEL_P_H
@@ -65,13 +29,12 @@ QT_BEGIN_NAMESPACE
class QQmlChangeSet;
class QQuickPackage;
-class QQmlV4Function;
class QQmlDelegateModelGroup;
class QQmlDelegateModelAttached;
class QQmlDelegateModelPrivate;
-class Q_QMLMODELS_PRIVATE_EXPORT QQmlDelegateModel : public QQmlInstanceModel, public QQmlParserStatus
+class Q_QMLMODELS_EXPORT QQmlDelegateModel : public QQmlInstanceModel, public QQmlParserStatus
{
Q_OBJECT
Q_DECLARE_PRIVATE(QQmlDelegateModel)
@@ -150,8 +113,11 @@ private Q_SLOTS:
void _q_itemsInserted(int index, int count);
void _q_itemsRemoved(int index, int count);
void _q_itemsMoved(int from, int to, int count);
- void _q_modelReset();
+ void _q_modelAboutToBeReset();
void _q_rowsInserted(const QModelIndex &,int,int);
+ void _q_columnsInserted(const QModelIndex &, int, int);
+ void _q_columnsRemoved(const QModelIndex &, int, int);
+ void _q_columnsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
void _q_rowsAboutToBeRemoved(const QModelIndex &parent, int begin, int end);
void _q_rowsRemoved(const QModelIndex &,int,int);
void _q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
@@ -159,13 +125,14 @@ private Q_SLOTS:
void _q_layoutChanged(const QList<QPersistentModelIndex>&, QAbstractItemModel::LayoutChangeHint);
private:
+ void handleModelReset();
bool isDescendantOf(const QPersistentModelIndex &desc, const QList<QPersistentModelIndex> &parents) const;
Q_DISABLE_COPY(QQmlDelegateModel)
};
class QQmlDelegateModelGroupPrivate;
-class Q_QMLMODELS_PRIVATE_EXPORT QQmlDelegateModelGroup : public QObject
+class Q_QMLMODELS_EXPORT QQmlDelegateModelGroup : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
@@ -189,14 +156,14 @@ public:
Q_INVOKABLE QJSValue get(int index);
public Q_SLOTS:
- void insert(QQmlV4Function *);
- void create(QQmlV4Function *);
- void resolve(QQmlV4Function *);
- void remove(QQmlV4Function *);
- void addGroups(QQmlV4Function *);
- void removeGroups(QQmlV4Function *);
- void setGroups(QQmlV4Function *);
- void move(QQmlV4Function *);
+ void insert(QQmlV4FunctionPtr);
+ void create(QQmlV4FunctionPtr);
+ void resolve(QQmlV4FunctionPtr);
+ void remove(QQmlV4FunctionPtr);
+ void addGroups(QQmlV4FunctionPtr);
+ void removeGroups(QQmlV4FunctionPtr);
+ void setGroups(QQmlV4FunctionPtr);
+ void move(QQmlV4FunctionPtr);
Q_SIGNALS:
void countChanged();
@@ -212,9 +179,14 @@ class QQmlDelegateModelAttachedMetaObject;
class QQmlDelegateModelAttached : public QObject
{
Q_OBJECT
- Q_PROPERTY(QQmlDelegateModel *model READ model CONSTANT)
- Q_PROPERTY(QStringList groups READ groups WRITE setGroups NOTIFY groupsChanged)
- Q_PROPERTY(bool isUnresolved READ isUnresolved NOTIFY unresolvedChanged)
+ Q_PROPERTY(QQmlDelegateModel *model READ model CONSTANT FINAL)
+ Q_PROPERTY(QStringList groups READ groups WRITE setGroups NOTIFY groupsChanged FINAL)
+ Q_PROPERTY(bool isUnresolved READ isUnresolved NOTIFY unresolvedChanged FINAL)
+ Q_PROPERTY(bool inPersistedItems READ inPersistedItems WRITE setInPersistedItems NOTIFY groupsChanged FINAL)
+ Q_PROPERTY(bool inItems READ inItems WRITE setInItems NOTIFY groupsChanged FINAL)
+ Q_PROPERTY(int persistedItemsIndex READ persistedItemsIndex NOTIFY groupsChanged FINAL)
+ Q_PROPERTY(int itemsIndex READ itemsIndex NOTIFY groupsChanged FINAL)
+
public:
QQmlDelegateModelAttached(QObject *parent);
QQmlDelegateModelAttached(QQmlDelegateModelItem *cacheItem, QObject *parent);
@@ -223,6 +195,14 @@ public:
void resetCurrentIndex();
void setCacheItem(QQmlDelegateModelItem *item);
+ void setInPersistedItems(bool inPersisted);
+ bool inPersistedItems() const;
+ int persistedItemsIndex() const;
+
+ void setInItems(bool inItems);
+ bool inItems() const;
+ int itemsIndex() const;
+
QQmlDelegateModel *model() const;
QStringList groups() const;
@@ -238,6 +218,9 @@ Q_SIGNALS:
void groupsChanged();
void unresolvedChanged();
+private:
+ void setInGroup(QQmlListCompositor::Group group, bool inGroup);
+
public:
QQmlDelegateModelItem *m_cacheItem;
int m_previousGroups;
@@ -249,7 +232,4 @@ public:
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQmlDelegateModel)
-QML_DECLARE_TYPE(QQmlDelegateModelGroup)
-
#endif // QQMLDATAMODEL_P_H