1// qstandarditemmodel.sip generated by MetaSIP
2//
3// This file is part of the QtGui 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
23class QStandardItemModel : QAbstractItemModel
24{
25%TypeHeaderCode
26#include <qstandarditemmodel.h>
27%End
28
29public:
30    explicit QStandardItemModel(QObject *parent /TransferThis/ = 0);
31    QStandardItemModel(int rows, int columns, QObject *parent /TransferThis/ = 0);
32    virtual ~QStandardItemModel();
33    virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
34    virtual QModelIndex parent(const QModelIndex &child) const;
35    QObject *parent() const;
36    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
37    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
38    virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
39    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
40    virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
41    virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
42    virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
43    virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
44    virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
45    virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
46    virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
47    virtual Qt::ItemFlags flags(const QModelIndex &index) const;
48    void clear();
49    virtual Qt::DropActions supportedDropActions() const;
50    virtual QMap<int, QVariant> itemData(const QModelIndex &index) const;
51    virtual bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
52    virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
53    QStandardItem *itemFromIndex(const QModelIndex &index) const;
54    QModelIndex indexFromItem(const QStandardItem *item) const;
55    QStandardItem *item(int row, int column = 0) const;
56    void setItem(int row, int column, QStandardItem *item /Transfer/);
57    void setItem(int arow, QStandardItem *aitem /Transfer/);
58    QStandardItem *invisibleRootItem() const /Transfer/;
59    QStandardItem *horizontalHeaderItem(int column) const;
60    void setHorizontalHeaderItem(int column, QStandardItem *item /Transfer/);
61    QStandardItem *verticalHeaderItem(int row) const;
62    void setVerticalHeaderItem(int row, QStandardItem *item /Transfer/);
63    void setHorizontalHeaderLabels(const QStringList &labels);
64    void setVerticalHeaderLabels(const QStringList &labels);
65    void setRowCount(int rows);
66    void setColumnCount(int columns);
67    void appendRow(const QList<QStandardItem *> &items /Transfer/);
68    void appendColumn(const QList<QStandardItem *> &items /Transfer/);
69    void insertRow(int row, const QList<QStandardItem *> &items /Transfer/);
70    void insertColumn(int column, const QList<QStandardItem *> &items /Transfer/);
71    QStandardItem *takeItem(int row, int column = 0) /TransferBack/;
72    QList<QStandardItem *> takeRow(int row) /TransferBack/;
73    QList<QStandardItem *> takeColumn(int column) /TransferBack/;
74    QStandardItem *takeHorizontalHeaderItem(int column) /TransferBack/;
75    QStandardItem *takeVerticalHeaderItem(int row) /TransferBack/;
76    const QStandardItem *itemPrototype() const;
77    void setItemPrototype(const QStandardItem *item /Transfer/);
78    QList<QStandardItem *> findItems(const QString &text, Qt::MatchFlags flags = Qt::MatchExactly, int column = 0) const;
79    int sortRole() const;
80    void setSortRole(int role);
81    void appendRow(QStandardItem *aitem /Transfer/);
82    void insertRow(int arow, QStandardItem *aitem /Transfer/);
83    bool insertRow(int row, const QModelIndex &parent = QModelIndex());
84    bool insertColumn(int column, const QModelIndex &parent = QModelIndex());
85    virtual QStringList mimeTypes() const;
86    virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/;
87    virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
88    virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
89    void setItemRoleNames(const QHash<int, QByteArray> &roleNames);
90
91signals:
92    void itemChanged(QStandardItem *item);
93
94public:
95%If (Qt_5_12_0 -)
96    bool clearItemData(const QModelIndex &index);
97%End
98};
99
100class QStandardItem /Supertype=sip.wrapper/
101{
102%TypeHeaderCode
103#include <qstandarditemmodel.h>
104%End
105
106public:
107    QStandardItem();
108    explicit QStandardItem(const QString &text);
109    QStandardItem(const QIcon &icon, const QString &text);
110    QStandardItem(int rows, int columns = 1);
111    virtual ~QStandardItem();
112    virtual QVariant data(int role = Qt::UserRole + 1) const;
113    virtual void setData(const QVariant &value, int role = Qt::UserRole + 1);
114    QString text() const;
115    QIcon icon() const;
116    QString toolTip() const;
117    QString statusTip() const;
118    QString whatsThis() const;
119    QSize sizeHint() const;
120    QFont font() const;
121    Qt::Alignment textAlignment() const;
122    QBrush background() const;
123    QBrush foreground() const;
124    Qt::CheckState checkState() const;
125    QString accessibleText() const;
126    QString accessibleDescription() const;
127    Qt::ItemFlags flags() const;
128    void setFlags(Qt::ItemFlags flags);
129    bool isEnabled() const;
130    void setEnabled(bool enabled);
131    bool isEditable() const;
132    void setEditable(bool editable);
133    bool isSelectable() const;
134    void setSelectable(bool selectable);
135    bool isCheckable() const;
136    void setCheckable(bool checkable);
137    bool isTristate() const;
138    void setTristate(bool tristate);
139    bool isDragEnabled() const;
140    void setDragEnabled(bool dragEnabled);
141    bool isDropEnabled() const;
142    void setDropEnabled(bool dropEnabled);
143    QStandardItem *parent() const;
144    int row() const;
145    int column() const;
146    QModelIndex index() const;
147    QStandardItemModel *model() const;
148    int rowCount() const;
149    void setRowCount(int rows);
150    int columnCount() const;
151    void setColumnCount(int columns);
152    bool hasChildren() const;
153    QStandardItem *child(int row, int column = 0) const;
154    void setChild(int row, int column, QStandardItem *item /Transfer/);
155    void setChild(int arow, QStandardItem *aitem /Transfer/);
156    void insertRow(int row, const QList<QStandardItem *> &items /Transfer/);
157    void insertRow(int arow, QStandardItem *aitem /Transfer/);
158    void insertRows(int row, int count);
159    void insertColumn(int column, const QList<QStandardItem *> &items /Transfer/);
160    void insertColumns(int column, int count);
161    void removeRow(int row);
162    void removeColumn(int column);
163    void removeRows(int row, int count);
164    void removeColumns(int column, int count);
165    QStandardItem *takeChild(int row, int column = 0) /TransferBack/;
166    QList<QStandardItem *> takeRow(int row) /TransferBack/;
167    QList<QStandardItem *> takeColumn(int column) /TransferBack/;
168    void sortChildren(int column, Qt::SortOrder order = Qt::AscendingOrder);
169    virtual QStandardItem *clone() const /Factory/;
170
171    enum ItemType
172    {
173        Type,
174        UserType,
175    };
176
177    virtual int type() const;
178    virtual void read(QDataStream &in);
179    virtual void write(QDataStream &out) const;
180    virtual bool operator<(const QStandardItem &other /NoCopy/) const;
181    void setText(const QString &atext);
182    void setIcon(const QIcon &aicon);
183    void setToolTip(const QString &atoolTip);
184    void setStatusTip(const QString &astatusTip);
185    void setWhatsThis(const QString &awhatsThis);
186    void setSizeHint(const QSize &asizeHint);
187    void setFont(const QFont &afont);
188    void setTextAlignment(Qt::Alignment atextAlignment);
189    void setBackground(const QBrush &abrush);
190    void setForeground(const QBrush &abrush);
191    void setCheckState(Qt::CheckState acheckState);
192    void setAccessibleText(const QString &aaccessibleText);
193    void setAccessibleDescription(const QString &aaccessibleDescription);
194    void appendRow(const QList<QStandardItem *> &items /Transfer/);
195    void appendRow(QStandardItem *aitem /Transfer/);
196    void appendColumn(const QList<QStandardItem *> &items /Transfer/);
197    void insertRows(int row, const QList<QStandardItem *> &items /Transfer/);
198    void appendRows(const QList<QStandardItem *> &items /Transfer/);
199
200protected:
201    QStandardItem(const QStandardItem &other);
202    void emitDataChanged();
203
204public:
205%If (Qt_5_6_0 -)
206    bool isAutoTristate() const;
207%End
208%If (Qt_5_6_0 -)
209    void setAutoTristate(bool tristate);
210%End
211%If (Qt_5_6_0 -)
212    bool isUserTristate() const;
213%End
214%If (Qt_5_6_0 -)
215    void setUserTristate(bool tristate);
216%End
217%If (Qt_5_12_0 -)
218    void clearData();
219%End
220};
221
222QDataStream &operator>>(QDataStream &in, QStandardItem &item /Constrained/) /ReleaseGIL/;
223QDataStream &operator<<(QDataStream &out, const QStandardItem &item /Constrained/) /ReleaseGIL/;
224