// qabstractitemmodel.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtCore Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class QModelIndex { %TypeHeaderCode #include %End public: QModelIndex(); QModelIndex(const QModelIndex &other); ~QModelIndex(); QModelIndex child(int arow, int acolumn) const; int row() const; int column() const; QVariant data(int arole = Qt::DisplayRole) const; %If (Qt_4_2_0 -) Qt::ItemFlags flags() const; %End SIP_PYOBJECT internalPointer() const; %MethodCode sipRes = reinterpret_cast(sipCpp->internalPointer()); if (!sipRes) sipRes = Py_None; Py_INCREF(sipRes); %End qint64 internalId() const; const QAbstractItemModel *model() const; bool isValid() const; QModelIndex parent() const; QModelIndex sibling(int arow, int acolumn) const; bool operator==(const QModelIndex &other) const; bool operator<(const QModelIndex &other) const; bool operator!=(const QModelIndex &other) const; }; class QPersistentModelIndex { %TypeHeaderCode #include %End public: QPersistentModelIndex(); QPersistentModelIndex(const QModelIndex &index); QPersistentModelIndex(const QPersistentModelIndex &other); ~QPersistentModelIndex(); int row() const; int column() const; QVariant data(int role = Qt::DisplayRole) const; %If (Qt_4_2_0 -) Qt::ItemFlags flags() const; %End QModelIndex parent() const; QModelIndex sibling(int row, int column) const; QModelIndex child(int row, int column) const; const QAbstractItemModel *model() const; bool isValid() const; operator const QModelIndex &() const; bool operator<(const QPersistentModelIndex &other) const; bool operator==(const QPersistentModelIndex &other) const; bool operator==(const QModelIndex &other) const; %If (Qt_4_2_0 -) bool operator!=(const QPersistentModelIndex &other) const; %End bool operator!=(const QModelIndex &other) const; }; typedef QList QModelIndexList; class QAbstractItemModel : QObject { %TypeHeaderCode #include %End public: explicit QAbstractItemModel(QObject *parent /TransferThis/ = 0); virtual ~QAbstractItemModel(); bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const = 0; virtual QModelIndex parent(const QModelIndex &child) const = 0; QObject *parent() const; QModelIndex sibling(int row, int column, const QModelIndex &idx) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const = 0; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const = 0; virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const = 0; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole); virtual QMap itemData(const QModelIndex &index) const; virtual bool setItemData(const QModelIndex &index, const QMap &roles); virtual QStringList mimeTypes() const; virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/; virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); virtual Qt::DropActions supportedDropActions() const; virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()); virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()); virtual void fetchMore(const QModelIndex &parent); virtual bool canFetchMore(const QModelIndex &parent) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); virtual QModelIndex buddy(const QModelIndex &index) const; virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchStartsWith|Qt::MatchWrap) const; virtual QSize span(const QModelIndex &index) const; signals: void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); void headerDataChanged(Qt::Orientation orientation, int first, int last); %If (Qt_4_2_0 -) void layoutAboutToBeChanged(); %End void layoutChanged(); public slots: virtual bool submit(); virtual void revert(); protected: void encodeData(const QModelIndexList &indexes, QDataStream &stream) const; bool decodeData(int row, int column, const QModelIndex &parent, QDataStream &stream); void beginInsertRows(const QModelIndex &parent, int first, int last); void endInsertRows(); void beginRemoveRows(const QModelIndex &parent, int first, int last); void endRemoveRows(); void beginInsertColumns(const QModelIndex &parent, int first, int last); void endInsertColumns(); void beginRemoveColumns(const QModelIndex &parent, int first, int last); void endRemoveColumns(); %If (Qt_4_2_0 -) QModelIndexList persistentIndexList() const; %End void reset(); void changePersistentIndex(const QModelIndex &from, const QModelIndex &to); void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to); public: bool insertRow(int arow, const QModelIndex &aparent = QModelIndex()); bool insertColumn(int acolumn, const QModelIndex &aparent = QModelIndex()); bool removeRow(int arow, const QModelIndex &aparent = QModelIndex()); bool removeColumn(int acolumn, const QModelIndex &aparent = QModelIndex()); %If (Qt_4_2_0 -) void setSupportedDragActions(Qt::DropActions); %End %If (Qt_4_2_0 -) Qt::DropActions supportedDragActions() const; %End protected: QModelIndex createIndex(int arow, int acolumn, int aid) const; QModelIndex createIndex(int arow, int acolumn, SIP_PYOBJECT adata = 0) const [QModelIndex (int arow, int acolumn, void *adata = 0)]; private: QAbstractItemModel(const QAbstractItemModel &); }; class QAbstractTableModel : QAbstractItemModel { %TypeHeaderCode #include %End public: explicit QAbstractTableModel(QObject *parent /TransferThis/ = 0); virtual ~QAbstractTableModel(); virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); private: QAbstractTableModel(const QAbstractTableModel &); virtual QModelIndex parent(const QModelIndex &child) const; virtual bool hasChildren(const QModelIndex &parent) const; }; class QAbstractListModel : QAbstractItemModel { %TypeHeaderCode #include %End public: explicit QAbstractListModel(QObject *parent /TransferThis/ = 0); virtual ~QAbstractListModel(); virtual QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const; virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); private: QAbstractListModel(const QAbstractListModel &); virtual QModelIndex parent(const QModelIndex &child) const; virtual int columnCount(const QModelIndex &parent) const; virtual bool hasChildren(const QModelIndex &parent) const; };