1// qconcatenatetablesproxymodel.sip generated by MetaSIP 2// 3// This file is part of the QtCore Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23%If (Qt_5_13_0 -) 24 25class QConcatenateTablesProxyModel : QAbstractItemModel 26{ 27%TypeHeaderCode 28#include <qconcatenatetablesproxymodel.h> 29%End 30 31public: 32 explicit QConcatenateTablesProxyModel(QObject *parent /TransferThis/ = 0); 33 virtual ~QConcatenateTablesProxyModel(); 34 void addSourceModel(QAbstractItemModel *sourceModel /GetWrapper/); 35%MethodCode 36 // We want to keep a reference to the model but this is in addition to the 37 // existing ones and does not replace them - so we can't use /KeepReference/. 38 sipCpp->addSourceModel(a0); 39 40 // Use the user object as a list of the references. 41 PyObject *user = sipGetUserObject((sipSimpleWrapper *)sipSelf); 42 43 if (!user) 44 { 45 user = PyList_New(0); 46 sipSetUserObject((sipSimpleWrapper *)sipSelf, user); 47 } 48 49 if (user) 50 PyList_Append(user, a0Wrapper); 51%End 52 53 void removeSourceModel(QAbstractItemModel *sourceModel /GetWrapper/); 54%MethodCode 55 // Discard the extra model reference that we took in addSourceModel(). 56 sipCpp->removeSourceModel(a0); 57 58 // Use the user object as a list of the references. 59 PyObject *user = sipGetUserObject((sipSimpleWrapper *)sipSelf); 60 61 if (user) 62 { 63 Py_ssize_t i = 0; 64 65 // Note that we deal with an object appearing in the list more than once. 66 while (i < PyList_Size(user)) 67 if (PyList_GetItem(user, i) == a0Wrapper) 68 PyList_SetSlice(user, i, i + 1, NULL); 69 else 70 ++i; 71 } 72%End 73 74 QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; 75 QModelIndex mapToSource(const QModelIndex &proxyIndex) const; 76 virtual QVariant data(const QModelIndex &index, int role = Qt::ItemDataRole::DisplayRole) const; 77 virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::ItemDataRole::EditRole); 78 virtual QMap<int, QVariant> itemData(const QModelIndex &proxyIndex) const; 79 virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles); 80 virtual Qt::ItemFlags flags(const QModelIndex &index) const; 81 virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; 82 virtual QModelIndex parent(const QModelIndex &index) const; 83 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 84 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::ItemDataRole::DisplayRole) const; 85 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 86 virtual QStringList mimeTypes() const; 87 virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/; 88 virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const; 89 virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); 90 virtual QSize span(const QModelIndex &index) const; 91%If (Qt_5_15_0 -) 92 QList<QAbstractItemModel *> sourceModels() const; 93%End 94}; 95 96%End 97