- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

# QStandardItem Class Reference

Search for all occurrences

## Detailed Description

Definition at line 66 of file qstandarditemmodel.h.

`#include <qstandarditemmodel.h>`

List of all members.

## Public Types
enum | ItemType { Type = 0, UserType = 1000 }
## Public Member Functions
| QStandardItem ()
| QStandardItem (const QString &text)
| QStandardItem (const QIcon &icon, const QString &text)
| QStandardItem (int rows, int columns=1)
virtual | ~QStandardItem ()
virtual QVariant | data (int role=Qt::UserRole+1) const
virtual void | setData (const QVariant &value, int role=Qt::UserRole+1)
QString | text () const
void | setText (const QString &text)
QIcon | icon () const
void | setIcon (const QIcon &icon)
QString | toolTip () const
void | setToolTip (const QString &toolTip)
QString | statusTip () const
void | setStatusTip (const QString &statusTip)
QString | whatsThis () const
void | setWhatsThis (const QString &whatsThis)
QSize | sizeHint () const
void | setSizeHint (const QSize &sizeHint)
QFont | font () const
void | setFont (const QFont &font)
Qt::Alignment | textAlignment () const
void | setTextAlignment (Qt::Alignment textAlignment)
QBrush | background () const
void | setBackground (const QBrush &brush)
QBrush | foreground () const
void | setForeground (const QBrush &brush)
Qt::CheckState | checkState () const
void | setCheckState (Qt::CheckState checkState)
QString | accessibleText () const
void | setAccessibleText (const QString &accessibleText)
QString | accessibleDescription () const
void | setAccessibleDescription (const QString &accessibleDescription)
Qt::ItemFlags | flags () const
void | setFlags (Qt::ItemFlags flags)
bool | isEnabled () const
void | setEnabled (bool enabled)
bool | isEditable () const
void | setEditable (bool editable)
bool | isSelectable () const
void | setSelectable (bool selectable)
bool | isCheckable () const
void | setCheckable (bool checkable)
bool | isTristate () const
void | setTristate (bool tristate)
bool | isDragEnabled () const
void | setDragEnabled (bool dragEnabled)
bool | isDropEnabled () const
void | setDropEnabled (bool dropEnabled)
QStandardItem * | parent () const
int | row () const
int | column () const
QModelIndex | index () const
QStandardItemModel * | model () const
int | rowCount () const
void | setRowCount (int rows)
int | columnCount () const
void | setColumnCount (int columns)
bool | hasChildren () const
QStandardItem * | child (int row, int column=0) const
void | setChild (int row, int column, QStandardItem *item)
void | setChild (int row, QStandardItem *item)
void | insertRow (int row, const QList< QStandardItem * > &items)
void | insertColumn (int column, const QList< QStandardItem * > &items)
void | insertRows (int row, const QList< QStandardItem * > &items)
void | insertRows (int row, int count)
void | insertColumns (int column, int count)
void | removeRow (int row)
void | removeColumn (int column)
void | removeRows (int row, int count)
void | removeColumns (int column, int count)
void | appendRow (const QList< QStandardItem * > &items)
void | appendRows (const QList< QStandardItem * > &items)
void | appendColumn (const QList< QStandardItem * > &items)
void | insertRow (int row, QStandardItem *item)
void | appendRow (QStandardItem *item)
QStandardItem * | takeChild (int row, int column=0)
QList< QStandardItem * > | takeRow (int row)
QList< QStandardItem * > | takeColumn (int column)
void | sortChildren (int column, Qt::SortOrder order=Qt::AscendingOrder)
virtual QStandardItem * | clone () const
virtual int | type () const
virtual void | read (QDataStream &in)
virtual void | write (QDataStream &out) const
virtual bool | operator< (const QStandardItem &other) const
## Protected Member Functions
| QStandardItem (const QStandardItem &other)
| QStandardItem (QStandardItemPrivate &dd)
QStandardItem & | operator= (const QStandardItem &other)
void | emitDataChanged ()
## Protected Attributes
QScopedPointer < QStandardItemPrivate > | d_ptr
## Friends
class | QStandardItemModelPrivate
class | QStandardItemModel

## Member Enumeration Documentation

enum ItemType

Search for all occurrences

Enumerator:

  Type | Search for all occurrences
  UserType | Search for all occurrences

Definition at line 230 of file qstandarditemmodel.h.

    { Type = 0, UserType = 1000 };

## Constructor & Destructor Documentation

QStandardItem | ( |  | ) |

QStandardItem | ( | const QString & | text | ) |

QStandardItem | ( | const QIcon & | icon,
|  | const QString & | text
| ) |  |

QStandardItem | ( | int | rows,
|  | int | columns = `1`
| ) |  | `[explicit]`

virtual ~QStandardItem | ( |  | ) | `[virtual]`

QStandardItem | ( | const QStandardItem & | other | ) | `[protected]`

QStandardItem | ( | QStandardItemPrivate & | dd | ) | `[protected]`

## Member Function Documentation

virtual QVariant data | ( | int | role = `Qt::UserRole+1` | ) | const `[virtual]`

Search for all occurrences

virtual void setData | ( | const QVariant & | value,
|  | int | role = `Qt::UserRole+1`
| ) |  | `[virtual]`

Search for all occurrences

QString text | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 78 of file qstandarditemmodel.h.

                                    {
            return qvariant_cast<QString>(data(Qt::DisplayRole));
        }

void setText | ( | const QString & | text | ) | `[inline]`

Search for all occurrences

Definition at line 253 of file qstandarditemmodel.h.

    { setData(atext, Qt::DisplayRole); }

QIcon icon | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 83 of file qstandarditemmodel.h.

                                  {
            return qvariant_cast<QIcon>(data(Qt::DecorationRole));
        }

void setIcon | ( | const QIcon & | icon | ) | `[inline]`

Search for all occurrences

Definition at line 256 of file qstandarditemmodel.h.

    { setData(aicon, Qt::DecorationRole); }

QString toolTip | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 89 of file qstandarditemmodel.h.

                                       {
            return qvariant_cast<QString>(data(Qt::ToolTipRole));
        }

void setToolTip | ( | const QString & | toolTip | ) | `[inline]`

Search for all occurrences

Definition at line 260 of file qstandarditemmodel.h.

    { setData(atoolTip, Qt::ToolTipRole); }

QString statusTip | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 96 of file qstandarditemmodel.h.

                                         {
            return qvariant_cast<QString>(data(Qt::StatusTipRole));
        }

void setStatusTip | ( | const QString & | statusTip | ) | `[inline]`

Search for all occurrences

Definition at line 265 of file qstandarditemmodel.h.

    { setData(astatusTip, Qt::StatusTipRole); }

QString whatsThis | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 103 of file qstandarditemmodel.h.

                                         {
            return qvariant_cast<QString>(data(Qt::WhatsThisRole));
        }

void setWhatsThis | ( | const QString & | whatsThis | ) | `[inline]`

Search for all occurrences

Definition at line 270 of file qstandarditemmodel.h.

    { setData(awhatsThis, Qt::WhatsThisRole); }

QSize sizeHint | ( | void |  | ) | const `[inline]`

Search for all occurrences

Definition at line 109 of file qstandarditemmodel.h.

                                      {
            return qvariant_cast<QSize>(data(Qt::SizeHintRole));
        }

void setSizeHint | ( | const QSize & | sizeHint | ) | `[inline]`

Search for all occurrences

Definition at line 274 of file qstandarditemmodel.h.

    { setData(asizeHint, Qt::SizeHintRole); }

QFont font | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 114 of file qstandarditemmodel.h.

                                  {
            return qvariant_cast<QFont>(data(Qt::FontRole));
        }

void setFont | ( | const QFont & | font | ) | `[inline]`

Search for all occurrences

Definition at line 277 of file qstandarditemmodel.h.

    { setData(afont, Qt::FontRole); }

Qt::Alignment textAlignment | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 119 of file qstandarditemmodel.h.

                                                 {
            return Qt::Alignment(qvariant_cast<int>(data(Qt::TextAlignmentRole)));
        }

void setTextAlignment | ( | Qt::Alignment | textAlignment | ) | `[inline]`

Search for all occurrences

Definition at line 280 of file qstandarditemmodel.h.

    { setData(int(atextAlignment), Qt::TextAlignmentRole); }

QBrush background | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 124 of file qstandarditemmodel.h.

                                         {
            return qvariant_cast<QBrush>(data(Qt::BackgroundRole));
        }

void setBackground | ( | const QBrush & | brush | ) | `[inline]`

Search for all occurrences

Definition at line 283 of file qstandarditemmodel.h.

    { setData(abrush, Qt::BackgroundRole); }

QBrush foreground | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 129 of file qstandarditemmodel.h.

                                         {
            return qvariant_cast<QBrush>(data(Qt::ForegroundRole));
        }

void setForeground | ( | const QBrush & | brush | ) | `[inline]`

Search for all occurrences

Definition at line 286 of file qstandarditemmodel.h.

    { setData(abrush, Qt::ForegroundRole); }

Qt::CheckState checkState | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 134 of file qstandarditemmodel.h.

                                               {
            return Qt::CheckState(qvariant_cast<int>(data(Qt::CheckStateRole)));
        }

void setCheckState | ( | Qt::CheckState | checkState | ) | `[inline]`

Search for all occurrences

Definition at line 289 of file qstandarditemmodel.h.

    { setData(acheckState, Qt::CheckStateRole); }

QString accessibleText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 139 of file qstandarditemmodel.h.

                                              {
            return qvariant_cast<QString>(data(Qt::AccessibleTextRole));
        }

void setAccessibleText | ( | const QString & | accessibleText | ) | `[inline]`

Search for all occurrences

Definition at line 292 of file qstandarditemmodel.h.

    { setData(aaccessibleText, Qt::AccessibleTextRole); }

QString accessibleDescription | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 144 of file qstandarditemmodel.h.

                                                     {
            return qvariant_cast<QString>(data(Qt::AccessibleDescriptionRole));
        }

void setAccessibleDescription | ( | const QString & | accessibleDescription | ) | `[inline]`

Search for all occurrences

Definition at line 295 of file qstandarditemmodel.h.

    { setData(aaccessibleDescription, Qt::AccessibleDescriptionRole); }

Qt::ItemFlags flags | ( |  | ) | const

Search for all occurrences

void setFlags | ( | Qt::ItemFlags | flags | ) |

Search for all occurrences

bool isEnabled | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 152 of file qstandarditemmodel.h.

                                      {
            return (flags() & Qt::ItemIsEnabled) != 0;
        }

void setEnabled | ( | bool | enabled | ) |

Search for all occurrences

bool isEditable | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 157 of file qstandarditemmodel.h.

                                       {
            return (flags() & Qt::ItemIsEditable) != 0;
        }

void setEditable | ( | bool | editable | ) |

Search for all occurrences

bool isSelectable | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 162 of file qstandarditemmodel.h.

                                         {
            return (flags() & Qt::ItemIsSelectable) != 0;
        }

void setSelectable | ( | bool | selectable | ) |

Search for all occurrences

bool isCheckable | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 167 of file qstandarditemmodel.h.

                                        {
            return (flags() & Qt::ItemIsUserCheckable) != 0;
        }

void setCheckable | ( | bool | checkable | ) |

Search for all occurrences

bool isTristate | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 172 of file qstandarditemmodel.h.

                                       {
            return (flags() & Qt::ItemIsTristate) != 0;
        }

void setTristate | ( | bool | tristate | ) |

Search for all occurrences

bool isDragEnabled | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 178 of file qstandarditemmodel.h.

                                          {
            return (flags() & Qt::ItemIsDragEnabled) != 0;
        }

void setDragEnabled | ( | bool | dragEnabled | ) |

Search for all occurrences

bool isDropEnabled | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 183 of file qstandarditemmodel.h.

                                          {
            return (flags() & Qt::ItemIsDropEnabled) != 0;
        }

void setDropEnabled | ( | bool | dropEnabled | ) |

Search for all occurrences

QStandardItem* parent | ( |  | ) | const

Search for all occurrences

int row | ( |  | ) | const

Search for all occurrences

int column | ( |  | ) | const

Search for all occurrences

QModelIndex index | ( |  | ) | const

Search for all occurrences

QStandardItemModel* model | ( |  | ) | const

Search for all occurrences

int rowCount | ( |  | ) | const

Search for all occurrences

void setRowCount | ( | int | rows | ) |

Search for all occurrences

int columnCount | ( |  | ) | const

Search for all occurrences

void setColumnCount | ( | int | columns | ) |

Search for all occurrences

bool hasChildren | ( |  | ) | const

Search for all occurrences

QStandardItem* child | ( | int | row,
|  | int | column = `0`
| ) |  | const

Search for all occurrences

void setChild | ( | int | row,
|  | int | column,
|  | QStandardItem * | item
| ) |  |

Search for all occurrences

void setChild | ( | int | row,
|  | QStandardItem * | item
| ) |  | `[inline]`

Search for all occurrences

Definition at line 298 of file qstandarditemmodel.h.

    { setChild(arow, 0, aitem); }

void insertRow | ( | int | row,
|  | const QList< QStandardItem * > & | items
| ) |  |

Search for all occurrences

void insertColumn | ( | int | column,
|  | const QList< QStandardItem * > & | items
| ) |  |

Search for all occurrences

void insertRows | ( | int | row,
|  | const QList< QStandardItem * > & | items
| ) |  |

Search for all occurrences

void insertRows | ( | int | row,
|  | int | count
| ) |  |

Search for all occurrences

void insertColumns | ( | int | column,
|  | int | count
| ) |  |

Search for all occurrences

void removeRow | ( | int | row | ) |

Search for all occurrences

void removeColumn | ( | int | column | ) |

Search for all occurrences

void removeRows | ( | int | row,
|  | int | count
| ) |  |

Search for all occurrences

void removeColumns | ( | int | column,
|  | int | count
| ) |  |

Search for all occurrences

void appendRow | ( | const QList< QStandardItem * > & | items | ) | `[inline]`

Search for all occurrences

Definition at line 301 of file qstandarditemmodel.h.

    { insertRow(rowCount(), aitems); }

void appendRows | ( | const QList< QStandardItem * > & | items | ) | `[inline]`

Search for all occurrences

Definition at line 304 of file qstandarditemmodel.h.

    { insertRows(rowCount(), aitems); }

void appendColumn | ( | const QList< QStandardItem * > & | items | ) | `[inline]`

Search for all occurrences

Definition at line 307 of file qstandarditemmodel.h.

    { insertColumn(columnCount(), aitems); }

void insertRow | ( | int | row,
|  | QStandardItem * | item
| ) |  | `[inline]`

Search for all occurrences

Definition at line 310 of file qstandarditemmodel.h.

    { insertRow(arow, QList<QStandardItem*>() << aitem); }

void appendRow | ( | QStandardItem * | item | ) | `[inline]`

Search for all occurrences

Definition at line 313 of file qstandarditemmodel.h.

    { insertRow(rowCount(), aitem); }

QStandardItem* takeChild | ( | int | row,
|  | int | column = `0`
| ) |  |

Search for all occurrences

QList<QStandardItem*> takeRow | ( | int | row | ) |

Search for all occurrences

QList<QStandardItem*> takeColumn | ( | int | column | ) |

Search for all occurrences

void sortChildren | ( | int | column,
|  | Qt::SortOrder | order = `Qt::AscendingOrder`
| ) |  |

Search for all occurrences

virtual QStandardItem* clone | ( |  | ) | const `[virtual]`

Search for all occurrences

virtual int type | ( |  | ) | const `[virtual]`

Search for all occurrences

virtual void read | ( | QDataStream & | in | ) | `[virtual]`

Search for all occurrences

virtual void write | ( | QDataStream & | out | ) | const `[virtual]`

Search for all occurrences

virtual bool operator< | ( | const QStandardItem & | other | ) | const `[virtual]`

QStandardItem& operator= | ( | const QStandardItem & | other | ) | `[protected]`

void emitDataChanged | ( |  | ) | `[protected]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QStandardItemModelPrivate `[friend]`

Search for all occurrences

Definition at line 249 of file qstandarditemmodel.h.

friend class QStandardItemModel `[friend]`

Search for all occurrences

Definition at line 250 of file qstandarditemmodel.h.

## Member Data Documentation

QScopedPointer<QStandardItemPrivate> d_ptr `[protected]`

Search for all occurrences

Definition at line 243 of file qstandarditemmodel.h.

The documentation for this class was generated from the following file:

- QtGui/qstandarditemmodel.h

QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem
QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem QStandardItem