Qt 4.8
qstandarditemmodel.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QSTANDARDITEMMODEL_H
43 #define QSTANDARDITEMMODEL_H
44 
45 #include <QtCore/qabstractitemmodel.h>
46 #include <QtGui/qbrush.h>
47 #include <QtGui/qfont.h>
48 #include <QtGui/qicon.h>
49 #ifndef QT_NO_DATASTREAM
50 #include <QtCore/qdatastream.h>
51 #endif
52 
54 
56 
57 QT_MODULE(Gui)
58 
59 #ifndef QT_NO_STANDARDITEMMODEL
60 
61 template <class T> class QList;
62 
63 class QStandardItemModel;
64 
67 {
68 public:
69  QStandardItem();
70  QStandardItem(const QString &text);
71  QStandardItem(const QIcon &icon, const QString &text);
72  explicit QStandardItem(int rows, int columns = 1);
73  virtual ~QStandardItem();
74 
75  virtual QVariant data(int role = Qt::UserRole + 1) const;
76  virtual void setData(const QVariant &value, int role = Qt::UserRole + 1);
77 
78  inline QString text() const {
80  }
81  inline void setText(const QString &text);
82 
83  inline QIcon icon() const {
85  }
86  inline void setIcon(const QIcon &icon);
87 
88 #ifndef QT_NO_TOOLTIP
89  inline QString toolTip() const {
91  }
92  inline void setToolTip(const QString &toolTip);
93 #endif
94 
95 #ifndef QT_NO_STATUSTIP
96  inline QString statusTip() const {
98  }
99  inline void setStatusTip(const QString &statusTip);
100 #endif
101 
102 #ifndef QT_NO_WHATSTHIS
103  inline QString whatsThis() const {
105  }
106  inline void setWhatsThis(const QString &whatsThis);
107 #endif
108 
109  inline QSize sizeHint() const {
111  }
112  inline void setSizeHint(const QSize &sizeHint);
113 
114  inline QFont font() const {
116  }
117  inline void setFont(const QFont &font);
118 
119  inline Qt::Alignment textAlignment() const {
120  return Qt::Alignment(qvariant_cast<int>(data(Qt::TextAlignmentRole)));
121  }
122  inline void setTextAlignment(Qt::Alignment textAlignment);
123 
124  inline QBrush background() const {
126  }
127  inline void setBackground(const QBrush &brush);
128 
129  inline QBrush foreground() const {
131  }
132  inline void setForeground(const QBrush &brush);
133 
134  inline Qt::CheckState checkState() const {
135  return Qt::CheckState(qvariant_cast<int>(data(Qt::CheckStateRole)));
136  }
137  inline void setCheckState(Qt::CheckState checkState);
138 
139  inline QString accessibleText() const {
141  }
142  inline void setAccessibleText(const QString &accessibleText);
143 
146  }
147  inline void setAccessibleDescription(const QString &accessibleDescription);
148 
149  Qt::ItemFlags flags() const;
150  void setFlags(Qt::ItemFlags flags);
151 
152  inline bool isEnabled() const {
153  return (flags() & Qt::ItemIsEnabled) != 0;
154  }
155  void setEnabled(bool enabled);
156 
157  inline bool isEditable() const {
158  return (flags() & Qt::ItemIsEditable) != 0;
159  }
160  void setEditable(bool editable);
161 
162  inline bool isSelectable() const {
163  return (flags() & Qt::ItemIsSelectable) != 0;
164  }
165  void setSelectable(bool selectable);
166 
167  inline bool isCheckable() const {
168  return (flags() & Qt::ItemIsUserCheckable) != 0;
169  }
170  void setCheckable(bool checkable);
171 
172  inline bool isTristate() const {
173  return (flags() & Qt::ItemIsTristate) != 0;
174  }
175  void setTristate(bool tristate);
176 
177 #ifndef QT_NO_DRAGANDDROP
178  inline bool isDragEnabled() const {
179  return (flags() & Qt::ItemIsDragEnabled) != 0;
180  }
181  void setDragEnabled(bool dragEnabled);
182 
183  inline bool isDropEnabled() const {
184  return (flags() & Qt::ItemIsDropEnabled) != 0;
185  }
186  void setDropEnabled(bool dropEnabled);
187 #endif // QT_NO_DRAGANDDROP
188 
189  QStandardItem *parent() const;
190  int row() const;
191  int column() const;
192  QModelIndex index() const;
193  QStandardItemModel *model() const;
194 
195  int rowCount() const;
196  void setRowCount(int rows);
197  int columnCount() const;
198  void setColumnCount(int columns);
199 
200  bool hasChildren() const;
201  QStandardItem *child(int row, int column = 0) const;
202  void setChild(int row, int column, QStandardItem *item);
203  inline void setChild(int row, QStandardItem *item);
204 
205  void insertRow(int row, const QList<QStandardItem*> &items);
206  void insertColumn(int column, const QList<QStandardItem*> &items);
207  void insertRows(int row, const QList<QStandardItem*> &items);
208  void insertRows(int row, int count);
209  void insertColumns(int column, int count);
210 
211  void removeRow(int row);
212  void removeColumn(int column);
213  void removeRows(int row, int count);
214  void removeColumns(int column, int count);
215 
216  inline void appendRow(const QList<QStandardItem*> &items);
217  inline void appendRows(const QList<QStandardItem*> &items);
218  inline void appendColumn(const QList<QStandardItem*> &items);
219  inline void insertRow(int row, QStandardItem *item);
220  inline void appendRow(QStandardItem *item);
221 
222  QStandardItem *takeChild(int row, int column = 0);
223  QList<QStandardItem*> takeRow(int row);
224  QList<QStandardItem*> takeColumn(int column);
225 
226  void sortChildren(int column, Qt::SortOrder order = Qt::AscendingOrder);
227 
228  virtual QStandardItem *clone() const;
229 
230  enum ItemType { Type = 0, UserType = 1000 };
231  virtual int type() const;
232 
233 #ifndef QT_NO_DATASTREAM
234  virtual void read(QDataStream &in);
235  virtual void write(QDataStream &out) const;
236 #endif
237  virtual bool operator<(const QStandardItem &other) const;
238 
239 protected:
240  QStandardItem(const QStandardItem &other);
242  QStandardItem &operator=(const QStandardItem &other);
244 
245  void emitDataChanged();
246 
247 private:
251 };
252 
253 inline void QStandardItem::setText(const QString &atext)
254 { setData(atext, Qt::DisplayRole); }
255 
256 inline void QStandardItem::setIcon(const QIcon &aicon)
257 { setData(aicon, Qt::DecorationRole); }
258 
259 #ifndef QT_NO_TOOLTIP
260 inline void QStandardItem::setToolTip(const QString &atoolTip)
261 { setData(atoolTip, Qt::ToolTipRole); }
262 #endif
263 
264 #ifndef QT_NO_STATUSTIP
265 inline void QStandardItem::setStatusTip(const QString &astatusTip)
266 { setData(astatusTip, Qt::StatusTipRole); }
267 #endif
268 
269 #ifndef QT_NO_WHATSTHIS
270 inline void QStandardItem::setWhatsThis(const QString &awhatsThis)
271 { setData(awhatsThis, Qt::WhatsThisRole); }
272 #endif
273 
274 inline void QStandardItem::setSizeHint(const QSize &asizeHint)
275 { setData(asizeHint, Qt::SizeHintRole); }
276 
277 inline void QStandardItem::setFont(const QFont &afont)
278 { setData(afont, Qt::FontRole); }
279 
280 inline void QStandardItem::setTextAlignment(Qt::Alignment atextAlignment)
281 { setData(int(atextAlignment), Qt::TextAlignmentRole); }
282 
283 inline void QStandardItem::setBackground(const QBrush &abrush)
284 { setData(abrush, Qt::BackgroundRole); }
285 
286 inline void QStandardItem::setForeground(const QBrush &abrush)
287 { setData(abrush, Qt::ForegroundRole); }
288 
290 { setData(acheckState, Qt::CheckStateRole); }
291 
292 inline void QStandardItem::setAccessibleText(const QString &aaccessibleText)
293 { setData(aaccessibleText, Qt::AccessibleTextRole); }
294 
295 inline void QStandardItem::setAccessibleDescription(const QString &aaccessibleDescription)
296 { setData(aaccessibleDescription, Qt::AccessibleDescriptionRole); }
297 
298 inline void QStandardItem::setChild(int arow, QStandardItem *aitem)
299 { setChild(arow, 0, aitem); }
300 
302 { insertRow(rowCount(), aitems); }
303 
305 { insertRows(rowCount(), aitems); }
306 
308 { insertColumn(columnCount(), aitems); }
309 
310 inline void QStandardItem::insertRow(int arow, QStandardItem *aitem)
311 { insertRow(arow, QList<QStandardItem*>() << aitem); }
312 
314 { insertRow(rowCount(), aitem); }
315 
317 
319 {
320  Q_OBJECT
321  int sortRole;
322 
323 public:
324  explicit QStandardItemModel(QObject *parent = 0);
325  QStandardItemModel(int rows, int columns, QObject *parent = 0);
327 
328  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
329  QModelIndex parent(const QModelIndex &child) const;
330 
331  int rowCount(const QModelIndex &parent = QModelIndex()) const;
332  int columnCount(const QModelIndex &parent = QModelIndex()) const;
333  bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
334 
335  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
336  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
337 
338  QVariant headerData(int section, Qt::Orientation orientation,
339  int role = Qt::DisplayRole) const;
340  bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
341  int role = Qt::EditRole);
342 
343  bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
344  bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex());
345  bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
346  bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex());
347 
348  Qt::ItemFlags flags(const QModelIndex &index) const;
349  Qt::DropActions supportedDropActions() const;
350 
351  QMap<int, QVariant> itemData(const QModelIndex &index) const;
352  bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles);
353 
354  void clear();
355 
356 #ifdef Q_NO_USING_KEYWORD
357  inline QObject *parent() const { return QObject::parent(); }
358 #else
359  using QObject::parent;
360 #endif
361 
362  void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
363 
364  QStandardItem *itemFromIndex(const QModelIndex &index) const;
365  QModelIndex indexFromItem(const QStandardItem *item) const;
366 
367  QStandardItem *item(int row, int column = 0) const;
368  void setItem(int row, int column, QStandardItem *item);
369  inline void setItem(int row, QStandardItem *item);
370  QStandardItem *invisibleRootItem() const;
371 
372  QStandardItem *horizontalHeaderItem(int column) const;
373  void setHorizontalHeaderItem(int column, QStandardItem *item);
374  QStandardItem *verticalHeaderItem(int row) const;
375  void setVerticalHeaderItem(int row, QStandardItem *item);
376 
377  void setHorizontalHeaderLabels(const QStringList &labels);
378  void setVerticalHeaderLabels(const QStringList &labels);
379 
380  void setRowCount(int rows);
381  void setColumnCount(int columns);
382 
383  void appendRow(const QList<QStandardItem*> &items);
384  void appendColumn(const QList<QStandardItem*> &items);
385  inline void appendRow(QStandardItem *item);
386 
387  void insertRow(int row, const QList<QStandardItem*> &items);
388  void insertColumn(int column, const QList<QStandardItem*> &items);
389  inline void insertRow(int row, QStandardItem *item);
390 
391  inline bool insertRow(int row, const QModelIndex &parent = QModelIndex());
392  inline bool insertColumn(int column, const QModelIndex &parent = QModelIndex());
393 
394  QStandardItem *takeItem(int row, int column = 0);
395  QList<QStandardItem*> takeRow(int row);
396  QList<QStandardItem*> takeColumn(int column);
397 
398  QStandardItem *takeHorizontalHeaderItem(int column);
399  QStandardItem *takeVerticalHeaderItem(int row);
400 
401  const QStandardItem *itemPrototype() const;
402  void setItemPrototype(const QStandardItem *item);
403 
404  QList<QStandardItem*> findItems(const QString &text,
405  Qt::MatchFlags flags = Qt::MatchExactly,
406  int column = 0) const;
407 
408  int sortRole() const;
409  void setSortRole(int role);
410 
411  QStringList mimeTypes() const;
412  QMimeData *mimeData(const QModelIndexList &indexes) const;
413  bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
414 
415 Q_SIGNALS:
416  void itemChanged(QStandardItem *item);
417 
418 protected:
420 
421 private:
422  friend class QStandardItemPrivate;
423  friend class QStandardItem;
426 
427  Q_PRIVATE_SLOT(d_func(), void _q_emitItemChanged(const QModelIndex &topLeft,
428  const QModelIndex &bottomRight))
429 };
430 
431 inline void QStandardItemModel::setItem(int arow, QStandardItem *aitem)
432 { setItem(arow, 0, aitem); }
433 
435 { appendRow(QList<QStandardItem*>() << aitem); }
436 
437 inline void QStandardItemModel::insertRow(int arow, QStandardItem *aitem)
438 { insertRow(arow, QList<QStandardItem*>() << aitem); }
439 
440 inline bool QStandardItemModel::insertRow(int arow, const QModelIndex &aparent)
441 { return QAbstractItemModel::insertRow(arow, aparent); }
442 inline bool QStandardItemModel::insertColumn(int acolumn, const QModelIndex &aparent)
443 { return QAbstractItemModel::insertColumn(acolumn, aparent); }
444 
445 #ifndef QT_NO_DATASTREAM
448 #endif
449 
450 #endif // QT_NO_STANDARDITEMMODEL
451 
453 
455 
456 #endif //QSTANDARDITEMMODEL_H
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
bool isCheckable() const
Returns whether the item is user-checkable.
void setWhatsThis(const QString &whatsThis)
Sets the item&#39;s "What&#39;s This?" help to the string specified by whatsThis.
CheckState
Definition: qnamespace.h:1607
int type
Definition: qmetatype.cpp:239
void appendRow(const QList< QStandardItem *> &items)
Appends a row containing items.
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Handles the data supplied by a drag and drop operation that ended with the given action.
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
virtual QMap< int, QVariant > itemData(const QModelIndex &index) const
Returns a map with values for all predefined roles in the model for the item at the given index...
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
QIcon icon() const
Returns the item&#39;s icon.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
void setAccessibleDescription(const QString &accessibleDescription)
Sets the item&#39;s accessible description to the string specified by accessibleDescription.
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &in, QStandardItem &item)
static void clear(QVariant::Private *d)
Definition: qvariant.cpp:197
virtual bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles)
Sets the role data for the item at index to the associated value in roles, for every Qt::ItemDataRole...
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual QStringList mimeTypes() const
Returns a list of MIME types that can be used to describe a list of model indexes.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
#define Q_PRIVATE_SLOT(d, signature)
Definition: qobjectdefs.h:73
virtual Qt::DropActions supportedDropActions() const
Returns the drop actions supported by this model.
void setBackground(const QBrush &brush)
Sets the item&#39;s background brush to the specified brush.
The QStandardItemModel class provides a generic model for storing custom data.
void insertRow(int row, const QList< QStandardItem *> &items)
Inserts a row at row containing items.
void insertRow(int row, const QList< QStandardItem *> &items)
Inserts a row at row containing items.
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEditable() const
Returns whether the item can be edited by the user.
void setSizeHint(const QSize &sizeHint)
Sets the size hint for the item to be size.
void setChild(int row, int column, QStandardItem *item)
Sets the child item at (row, column) to item.
bool isDragEnabled() const
Returns whether the item is drag enabled.
QString toolTip() const
Returns the item&#39;s tooltip.
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
bool operator<(int priority, const QPair< QRunnable *, int > &p)
Definition: qthreadpool.cpp:50
void setIcon(const QIcon &icon)
Sets the item&#39;s icon to the icon specified.
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
QBrush background() const
Returns the brush used to render the item&#39;s background.
virtual void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
Sorts the model by column in the given order.
QBrush foreground() const
Returns the brush used to render the item&#39;s foreground (e.
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
QString statusTip() const
Returns the item&#39;s status tip.
void setItem(int row, int column, QStandardItem *item)
Sets the item for the given row and column to item.
SortOrder
Definition: qnamespace.h:189
Qt::CheckState checkState() const
Returns the checked state of the item.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
bool insertRow(int row, const QModelIndex &parent=QModelIndex())
Inserts a single row before the given row in the child items of the parent specified.
void setFont(const QFont &font)
Sets the font used to display the item&#39;s text to the given font.
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &out, const QStandardItem &item)
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
Definition: qmime_win.cpp:141
int sortRole
the item role that is used to query the model&#39;s data when sorting items
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
QString text() const
Returns the item&#39;s text.
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
On models that support this, removes count rows starting with the given row under parent parent from ...
static const char * data(const QByteArray &arr)
QFont font() const
Returns the font used to render the item&#39;s text.
QString accessibleText() const
Returns the item&#39;s accessible text.
Qt::Alignment textAlignment() const
Returns the text alignment for the item&#39;s text.
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Returns the data stored under the given role for the item referred to by the index.
DropAction
Definition: qnamespace.h:1597
The QMimeData class provides a container for data that records information about its MIME type...
Definition: qmimedata.h:57
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
On models that support this, inserts count rows into the model before the given row.
#define Q_OBJECT
Definition: qobjectdefs.h:157
The QAbstractItemModel class provides the abstract interface for item model classes.
virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
Sets the data for the given role and section in the header with the specified orientation to the valu...
void appendRow(const QList< QStandardItem *> &items)
Appends a row containing items.
bool isTristate() const
Returns whether the item is tristate; that is, if it&#39;s checkable with three separate states...
bool isDropEnabled() const
Returns whether the item is drop enabled.
void appendRows(const QList< QStandardItem *> &items)
Appends rows containing items.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
bool insertColumn(int column, const QModelIndex &parent=QModelIndex())
Inserts a single column before the given column in the child items of the parent specified.
void appendColumn(const QList< QStandardItem *> &items)
Appends a column containing items.
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
The QModelIndex class is used to locate data in a data model.
bool isSelectable() const
Returns whether the item is selectable by the user.
bool isEnabled() const
Returns whether the item is enabled.
QString accessibleDescription() const
Returns the item&#39;s accessible description.
virtual bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex())
On models that support this, inserts count new columns into the model before the given column...
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
quint16 index
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
void setAccessibleText(const QString &accessibleText)
Sets the item&#39;s accessible text to the string specified by accessibleText.
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
QString whatsThis() const
Returns the item&#39;s "What&#39;s This?" help.
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71
QSize sizeHint() const
Returns the size hint set for the item, or an invalid QSize if no size hint has been set...
The QStandardItem class provides an item for use with the QStandardItemModel class.
void setToolTip(const QString &toolTip)
Sets the item&#39;s tooltip to the string specified by toolTip.
void setCheckState(Qt::CheckState checkState)
Sets the check state of the item to be state.
#define class
void setTextAlignment(Qt::Alignment textAlignment)
Sets the text alignment for the item&#39;s text to the alignment specified.
Orientation
Definition: qnamespace.h:174
void insertColumn(int column, const QList< QStandardItem *> &items)
Inserts a column at column containing items.
#define QT_END_HEADER
Definition: qglobal.h:137
ItemType
This enum describes the types that are used to describe standard items.
QScopedPointer< QStandardItemPrivate > d_ptr
#define enabled
virtual bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex())
On models that support this, removes count columns starting with the given column under parent parent...
void setStatusTip(const QString &statusTip)
Sets the item&#39;s status tip to the string specified by statusTip.
void setForeground(const QBrush &brush)
Sets the brush used to display the item&#39;s foreground (e.
The QMap class is a template class that provides a skip-list-based dictionary.
Definition: qdatastream.h:67
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
#define text
Definition: qobjectdefs.h:80
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo, const QMetaObject *ignoreStart, const QMetaObject *ignoreEnd)
The QIcon class provides scalable icons in different modes and states.
Definition: qicon.h:60