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
qabstractproxymodel_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QABSTRACTPROXYMODEL_P_H
6#define QABSTRACTPROXYMODEL_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 for the convenience
13// of QAbstractItemModel*. This header file may change from version
14// to version without notice, or even be removed.
15//
16// We mean it.
17//
18//
19
21#include "private/qabstractitemmodel_p.h"
22#include "private/qproperty_p.h"
23
25
27
28class Q_CORE_EXPORT QAbstractProxyModelPrivate : public QAbstractItemModelPrivate
29{
30 Q_DECLARE_PUBLIC(QAbstractProxyModel)
31public:
32 QAbstractProxyModelPrivate()
33 : QAbstractItemModelPrivate(),
34 sourceHadZeroRows(false),
35 sourceHadZeroColumns(false),
36 updateVerticalHeader(false),
37 updateHorizontalHeader(false)
38 {}
39 void setModelForwarder(QAbstractItemModel *sourceModel)
40 {
41 q_func()->setSourceModel(sourceModel);
42 }
43 void modelChangedForwarder()
44 {
45 Q_EMIT q_func()->sourceModelChanged(QAbstractProxyModel::QPrivateSignal());
46 }
47 QAbstractItemModel *getModelForwarder() const { return q_func()->sourceModel(); }
48
49 Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QAbstractProxyModelPrivate, QAbstractItemModel *, model,
50 &QAbstractProxyModelPrivate::setModelForwarder,
51 &QAbstractProxyModelPrivate::modelChangedForwarder,
52 &QAbstractProxyModelPrivate::getModelForwarder, nullptr)
53 virtual void _q_sourceModelDestroyed();
54 void _q_sourceModelRowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
55 void _q_sourceModelRowsInserted(const QModelIndex &parent, int first, int last);
56 void _q_sourceModelRowsRemoved(const QModelIndex &parent, int first, int last);
57 void _q_sourceModelColumnsAboutToBeInserted(const QModelIndex &parent, int first, int last);
58 void _q_sourceModelColumnsInserted(const QModelIndex &parent, int first, int last);
59 void _q_sourceModelColumnsRemoved(const QModelIndex &parent, int first, int last);
60
61 void mapDropCoordinatesToSource(int row, int column, const QModelIndex &parent,
62 int *source_row, int *source_column, QModelIndex *source_parent) const;
63
64 void scheduleHeaderUpdate(Qt::Orientation orientation);
65 void emitHeaderDataChanged();
66
67 unsigned int sourceHadZeroRows : 1;
68 unsigned int sourceHadZeroColumns : 1;
69 unsigned int updateVerticalHeader : 1;
70 unsigned int updateHorizontalHeader : 1;
71};
72
73QT_END_NAMESPACE
74
75#endif // QABSTRACTPROXYMODEL_P_H
QT_REQUIRE_CONFIG(proxymodel)
QT_REQUIRE_CONFIG(animation)