Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:09:19

0001 // Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 
0005 #ifndef QIDENTITYPROXYMODEL_H
0006 #define QIDENTITYPROXYMODEL_H
0007 
0008 #include <QtCore/qabstractproxymodel.h>
0009 
0010 QT_REQUIRE_CONFIG(identityproxymodel);
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 
0015 class QIdentityProxyModelPrivate;
0016 
0017 class Q_CORE_EXPORT QIdentityProxyModel : public QAbstractProxyModel
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit QIdentityProxyModel(QObject* parent = nullptr);
0022     ~QIdentityProxyModel();
0023 
0024     int columnCount(const QModelIndex& parent = QModelIndex()) const override;
0025     QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
0026     QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
0027     QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
0028     QModelIndex parent(const QModelIndex& child) const override;
0029     using QObject::parent;
0030     int rowCount(const QModelIndex& parent = QModelIndex()) const override;
0031     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0032     bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
0033     QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
0034 
0035     QItemSelection mapSelectionFromSource(const QItemSelection& selection) const override;
0036     QItemSelection mapSelectionToSource(const QItemSelection& selection) const override;
0037     QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const override;
0038     void setSourceModel(QAbstractItemModel* sourceModel) override;
0039 
0040     bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override;
0041     bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
0042     bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override;
0043     bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
0044     bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override;
0045     bool moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild) override;
0046 
0047     bool handleSourceLayoutChanges() const;
0048     bool handleSourceDataChanges() const;
0049 
0050 protected:
0051     QIdentityProxyModel(QIdentityProxyModelPrivate &dd, QObject* parent);
0052     void setHandleSourceLayoutChanges(bool);
0053     void setHandleSourceDataChanges(bool);
0054 
0055 private:
0056     Q_DECLARE_PRIVATE(QIdentityProxyModel)
0057     Q_DISABLE_COPY(QIdentityProxyModel)
0058 };
0059 
0060 QT_END_NAMESPACE
0061 
0062 #endif // QIDENTITYPROXYMODEL_H
0063