com.trolltech.qt.gui
Class QStandardItem

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.gui.QStandardItem
All Implemented Interfaces:
QtJambiInterface

public class QStandardItem
extends QtJambiObject

The QStandardItem class provides an item for use with the QStandardItemModel class.

Items usually contain text, icons, or checkboxes.

Each item can have its own background brush which is set with the setBackground function. The current background brush can be found with background. The text label for each item can be rendered with its own font and brush. These are specified with the setFont and setForeground functions, and read with font and foreground.

By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. Each item's flags can be changed by calling setFlags. Checkable items can be checked and unchecked with the setCheckState function. The corresponding checkState function indicates whether the item is currently checked.

You can store application-specific data in an item by calling setData.

Each item can have a two-dimensional table of child items. This makes it possible to build hierarchies of items. The typical hierarchy is the tree, in which case the child table is a table with a single column (a list).

The dimensions of the child table can be set with setRowCount and setColumnCount. Items can be positioned in the child table with setChild. Get a pointer to a child item with child. New rows and columns of children can also be inserted with insertRow and insertColumn, or appended with appendRow and appendColumn. When using the append and insert functions, the dimensions of the child table will grow as needed.

An existing row of children can be removed with removeRow or takeRow; correspondingly, a column can be removed with removeColumn or takeColumn.

An item's children can be sorted by calling sortChildren.

Subclassing

When subclassing QStandardItem to provide custom items, it is possible to define new types for them so that they can be distinguished from the base class. The type function should be reimplemented to return a new type value equal to or greater than UserType.

Reimplement data and setData if you want to perform custom handling of data queries and/or control how an item's data is represented.

Reimplement clone if you want QStandardItemModel to be able to create instances of your custom item class on demand (see QStandardItemModel::setItemPrototype()).

Reimplement read and write if you want to control how items are represented in their serialized form.

Reimplement operator< if you want to control the semantics of item comparison. operator< determines the sorted order when sorting items with sortChildren or with QStandardItemModel::sort().

See Also:
QStandardItemModel, Item View Convenience Classes, Model/View Programming

Nested Class Summary
static class QStandardItem.ItemType
          This enum describes the types that are used to describe standard items.
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
  QStandardItem()
          Constructs an item.
  QStandardItem(int rows)
          Equivalent to QStandardItem(rows, 1).
  QStandardItem(int rows, int columns)
          Constructs an item with rows rows and columns columns of child items.
  QStandardItem(QIcon icon, java.lang.String text)
          Constructs an item with the given icon and text.
protected QStandardItem(QStandardItem other)
          Constructs a copy of other.
  QStandardItem(java.lang.String text)
          Constructs an item with the given text.
 
Method Summary
 java.lang.String accessibleDescription()
          Returns the item's accessible description.
 java.lang.String accessibleText()
          Returns the item's accessible text.
 void appendColumn(java.util.List<QStandardItem> items)
          Appends a column containing items.
 void appendRow(java.util.List<QStandardItem> items)
          Appends a row containing items.
 void appendRow(QStandardItem item)
          Appends a row containing item.
 void appendRows(java.util.List<QStandardItem> items)
          Appends rows containing items.
 QBrush background()
          Returns the brush used to render the item's background.
 Qt.CheckState checkState()
          Returns the checked state of the item.
 QStandardItem child(int row)
          Equivalent to child(row, 0).
 QStandardItem child(int row, int column)
          Returns the child item at (row, column) if one has been set; otherwise returns 0.
 QStandardItem clone()
          Returns a copy of this item.
 int column()
          Returns the column where the item is located in its parent's child table, or -1 if the item has no parent.
 int columnCount()
          Returns the number of child item columns that the item has.
 java.lang.Object data()
          Equivalent to data(Qt::UserRole + 1).
 java.lang.Object data(int role)
          Returns the item's data for the given role, or an invalid QVariant if there is no data for the role.
 Qt.ItemFlags flags()
          Returns the item flags for the item.
 QFont font()
          Returns the font used to render the item's text.
 QBrush foreground()
          Returns the brush used to render the item's foreground (e.g. text).
static QStandardItem fromNativePointer(QNativePointer nativePointer)
          This function returns the QStandardItem instance pointed to by nativePointer
 boolean hasChildren()
          Returns true if this item has any children; otherwise returns false.
 QIcon icon()
          Returns the item's icon.
 QModelIndex index()
          Returns the QModelIndex associated with this item.
 void insertColumn(int column, java.util.List<QStandardItem> items)
          Inserts a column at column containing items.
 void insertColumns(int column, int count)
          Inserts count columns of child items at column column.
 void insertRow(int row, java.util.List<QStandardItem> items)
          Inserts a row at row containing items.
 void insertRow(int row, QStandardItem item)
          Inserts a row at row containing item.
 void insertRows(int row, int count)
          Inserts count rows of child items at row row.
 void insertRows(int row, java.util.List<QStandardItem> items)
          Inserts items at row.
 boolean isCheckable()
          Returns whether the item is user-checkable.
 boolean isDragEnabled()
          Returns whether the item is drag enabled.
 boolean isDropEnabled()
          Returns whether the item is drop enabled.
 boolean isEditable()
          Returns whether the item can be edited by the user.
 boolean isEnabled()
          Returns whether the item is enabled.
 boolean isSelectable()
          Returns whether the item is selectable by the user.
 boolean isTristate()
          Returns whether the item is tristate; that is, if it's checkable with tree separate states.
 QStandardItemModel model()
          Returns the QStandardItemModel that this item belongs to.
 QStandardItem parent()
          Returns the item's parent item, or 0 if the item has no parent.
 void read(QDataStream in)
          Reads the item from stream in.
 void readFrom(QDataStream in)
          Reads a QStandardItem from in.
 void removeColumn(int column)
          Removes the given column.
 void removeColumns(int column, int count)
          Removes count columns at column column.
 void removeRow(int row)
          Removes the given row.
 void removeRows(int row, int count)
          Removes count rows at row row.
 int row()
          Returns the row where the item is located in its parent's child table, or -1 if the item has no parent.
 int rowCount()
          Returns the number of child item rows that the item has.
 void setAccessibleDescription(java.lang.String accessibleDescription)
          Sets the item's accessible description to the string specified by accessibleDescription.
 void setAccessibleText(java.lang.String accessibleText)
          Sets the item's accessible text to the string specified by accessibleText.
 void setBackground(QBrush brush)
          Sets the item's background brush to the specified brush.
 void setCheckable(boolean checkable)
          Sets whether the item is user-checkable.
 void setCheckState(Qt.CheckState checkState)
          Sets the check state of the item to be checkState.
 void setChild(int row, int column, QStandardItem item)
          Sets the child item at (row, column) to item.
 void setChild(int row, QStandardItem item)
          Sets the child at row to item.
 void setColumnCount(int columns)
          Sets the number of child item columns to columns.
 void setData(java.lang.Object value)
          Equivalent to setData(value, Qt::UserRole + 1).
 void setData(java.lang.Object value, int role)
          Sets the item's data for the given role to the specified value.
 void setDragEnabled(boolean dragEnabled)
          Sets whether the item is drag enabled.
 void setDropEnabled(boolean dropEnabled)
          Sets whether the item is drop enabled.
 void setEditable(boolean editable)
          Sets whether the item is editable.
 void setEnabled(boolean enabled)
          Sets whether the item is enabled.
 void setFlags(Qt.ItemFlag... flags)
          Sets the item flags for the item to flags.
 void setFlags(Qt.ItemFlags flags)
          Sets the item flags for the item to flags.
 void setFont(QFont font)
          Sets the font used to display the item's text to the given font.
 void setForeground(QBrush brush)
          Sets the brush used to display the item's foreground (e.g. text) to the given brush.
 void setIcon(QIcon icon)
          Sets the item's icon to the icon specified.
 void setRowCount(int rows)
          Sets the number of child item rows to rows.
 void setSelectable(boolean selectable)
          Sets whether the item is selectable.
 void setSizeHint(QSize sizeHint)
          Sets the size hint for the item to be sizeHint.
 void setStatusTip(java.lang.String statusTip)
          Sets the item's status tip to the string specified by statusTip.
 void setText(java.lang.String text)
          Sets the item's text to the text specified.
 void setTextAlignment(Qt.Alignment textAlignment)
          Sets the text alignment for the item's text to the textAlignment specified.
 void setTextAlignment(Qt.AlignmentFlag... textAlignment)
          Sets the text alignment for the item's text to the textAlignment specified.
 void setToolTip(java.lang.String toolTip)
          Sets the item's tooltip to the string specified by toolTip.
 void setTristate(boolean tristate)
          Sets whether the item is tristate.
 void setWhatsThis(java.lang.String whatsThis)
          Sets the item's "What's This?" help to the string specified by whatsThis.
 QSize sizeHint()
          Returns the size hint set for the item, or an invalid QSize if no size hint has been set.
 void sortChildren(int column)
          Equivalent to sortChildren(column, Qt::AscendingOrder).
 void sortChildren(int column, Qt.SortOrder order)
          Sorts the children of the item using the given order, by the values in the given column.
 java.lang.String statusTip()
          Returns the item's status tip.
 QStandardItem takeChild(int row)
          Equivalent to takeChild(row, 0).
 QStandardItem takeChild(int row, int column)
          Removes the child item at (row, column) without deleting it, and returns a pointer to the item.
 java.util.List<QStandardItem> takeColumn(int column)
          Removes column without deleting the column items, and returns a list of pointers to the removed items.
 java.util.List<QStandardItem> takeRow(int row)
          Removes row without deleting the row items, and returns a list of pointers to the removed items.
 java.lang.String text()
          Returns the item's text.
 Qt.Alignment textAlignment()
          Returns the text alignment for the item's text.
 java.lang.String toolTip()
          Returns the item's tooltip.
 int type()
          Returns the type of this item.
 java.lang.String whatsThis()
          Returns the item's "What's This?" help.
 void write(QDataStream out)
          Writes the item to stream out.
 void writeTo(QDataStream out)
          Writes thisQStandardItem to out.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QStandardItem

public QStandardItem(java.lang.String text)

Constructs an item with the given text.


QStandardItem

public QStandardItem(int rows)

Equivalent to QStandardItem(rows, 1).


QStandardItem

public QStandardItem(int rows,
                     int columns)

Constructs an item with rows rows and columns columns of child items.


QStandardItem

public QStandardItem(QIcon icon,
                     java.lang.String text)

Constructs an item with the given icon and text.


QStandardItem

public QStandardItem()

Constructs an item.


QStandardItem

protected QStandardItem(QStandardItem other)

Constructs a copy of other. Note that model is not copied.

This function is useful when reimplementing clone.

Method Detail

accessibleDescription

public final java.lang.String accessibleDescription()

Returns the item's accessible description.

The accessible description is used by assistive technologies (i.e. for users who cannot use conventional means of interaction).

See Also:
setAccessibleDescription, accessibleText

accessibleText

public final java.lang.String accessibleText()

Returns the item's accessible text.

The accessible text is used by assistive technologies (i.e. for users who cannot use conventional means of interaction).

See Also:
setAccessibleText, accessibleDescription

appendColumn

public final void appendColumn(java.util.List<QStandardItem> items)

Appends a column containing items. If necessary, the row count is increased to the size of items.

See Also:
insertColumn

appendRow

public final void appendRow(QStandardItem item)

Appends a row containing item.

When building a list or a tree that has only one column, this function provides a convenient way to append a single new item.


appendRow

public final void appendRow(java.util.List<QStandardItem> items)

Appends a row containing items. If necessary, the column count is increased to the size of items.

See Also:
insertRow

appendRows

public final void appendRows(java.util.List<QStandardItem> items)

Appends rows containing items. The column count will not change.

See Also:
insertRow

background

public final QBrush background()

Returns the brush used to render the item's background.

See Also:
foreground, setBackground

checkState

public final Qt.CheckState checkState()

Returns the checked state of the item.

See Also:
setCheckState, isCheckable

child

public final QStandardItem child(int row)

Equivalent to child(row, 0).


child

public final QStandardItem child(int row,
                                 int column)

Returns the child item at (row, column) if one has been set; otherwise returns 0.

See Also:
setChild, takeChild, parent

column

public final int column()

Returns the column where the item is located in its parent's child table, or -1 if the item has no parent.

See Also:
row, parent

columnCount

public final int columnCount()

Returns the number of child item columns that the item has.

See Also:
setColumnCount, rowCount

flags

public final Qt.ItemFlags flags()

Returns the item flags for the item.

The item flags determine how the user can interact with the item.

By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target.

See Also:
setFlags

font

public final QFont font()

Returns the font used to render the item's text.

See Also:
setFont

foreground

public final QBrush foreground()

Returns the brush used to render the item's foreground (e.g. text).

See Also:
setForeground, background

hasChildren

public final boolean hasChildren()

Returns true if this item has any children; otherwise returns false.

See Also:
rowCount, columnCount, child

icon

public final QIcon icon()

Returns the item's icon.

See Also:
setIcon, iconSize

index

public final QModelIndex index()

Returns the QModelIndex associated with this item.

When you need to invoke item functionality in a QModelIndex-based API (e.g. QAbstractItemView), you can call this function to obtain an index that corresponds to the item's location in the model.

If the item is not associated with a model, an invalid QModelIndex is returned.

See Also:
model, QStandardItemModel::itemFromIndex

insertColumn

public final void insertColumn(int column,
                               java.util.List<QStandardItem> items)

Inserts a column at column containing items. If necessary, the row count is increased to the size of items.

See Also:
insertColumns, insertRow

insertColumns

public final void insertColumns(int column,
                                int count)

Inserts count columns of child items at column column.

See Also:
insertColumn, insertRows

insertRow

public final void insertRow(int row,
                            QStandardItem item)

Inserts a row at row containing item.

When building a list or a tree that has only one column, this function provides a convenient way to insert a single new item.


insertRow

public final void insertRow(int row,
                            java.util.List<QStandardItem> items)

Inserts a row at row containing items. If necessary, the column count is increased to the size of items.

See Also:
insertRows, insertColumn

insertRows

public final void insertRows(int row,
                             java.util.List<QStandardItem> items)

Inserts items at row. The column count wont be changed.

See Also:
insertRow, insertColumn

insertRows

public final void insertRows(int row,
                             int count)

Inserts count rows of child items at row row.

See Also:
insertRow, insertColumns

isCheckable

public final boolean isCheckable()

Returns whether the item is user-checkable.

The default value is false.

See Also:
setCheckable, checkState, isTristate

isDragEnabled

public final boolean isDragEnabled()

Returns whether the item is drag enabled. An item that is drag enabled can be dragged by the user.

The default value is true.

Note that item dragging must be enabled in the view for dragging to work; see QAbstractItemView::dragEnabled.

See Also:
setDragEnabled, isDropEnabled, flags

isDropEnabled

public final boolean isDropEnabled()

Returns whether the item is drop enabled. When an item is drop enabled, it can be used as a drop target.

The default value is true.

See Also:
setDropEnabled, isDragEnabled, flags

isEditable

public final boolean isEditable()

Returns whether the item can be edited by the user.

When an item is editable (and enabled), the user can edit the item by invoking one of the view's edit triggers; see QAbstractItemView::editTriggers.

The default value is true.

See Also:
setEditable, flags

isEnabled

public final boolean isEnabled()

Returns whether the item is enabled.

When an item is enabled, the user can interact with it. The possible types of interaction are specified by the other item flags, such as isEditable and isSelectable.

The default value is true.

See Also:
setEnabled, flags

isSelectable

public final boolean isSelectable()

Returns whether the item is selectable by the user.

The default value is true.

See Also:
setSelectable, flags

isTristate

public final boolean isTristate()

Returns whether the item is tristate; that is, if it's checkable with tree separate states.

The default value is false.

See Also:
setTristate, isCheckable, checkState

model

public final QStandardItemModel model()

Returns the QStandardItemModel that this item belongs to.

If the item is not a child of another item that belongs to the model, this function returns 0.

See Also:
index

writeTo

public final void writeTo(QDataStream out)
Writes thisQStandardItem to out.


readFrom

public final void readFrom(QDataStream in)
Reads a QStandardItem from in.


parent

public final QStandardItem parent()

Returns the item's parent item, or 0 if the item has no parent.

See Also:
child

removeColumn

public final void removeColumn(int column)

Removes the given column. The items that were in the column are deleted.

See Also:
takeColumn, removeColumns, removeRow

removeColumns

public final void removeColumns(int column,
                                int count)

Removes count columns at column column. The items that were in those columns are deleted.

See Also:
removeColumn, removeRows

removeRow

public final void removeRow(int row)

Removes the given row. The items that were in the row are deleted.

See Also:
takeRow, removeRows, removeColumn

removeRows

public final void removeRows(int row,
                             int count)

Removes count rows at row row. The items that were in those rows are deleted.

See Also:
removeRow, removeColumn

row

public final int row()

Returns the row where the item is located in its parent's child table, or -1 if the item has no parent.

See Also:
column, parent

rowCount

public final int rowCount()

Returns the number of child item rows that the item has.

See Also:
setRowCount, columnCount

setAccessibleDescription

public final void setAccessibleDescription(java.lang.String accessibleDescription)

Sets the item's accessible description to the string specified by accessibleDescription.

The accessible description is used by assistive technologies (i.e. for users who cannot use conventional means of interaction).

See Also:
accessibleDescription, setAccessibleText

setAccessibleText

public final void setAccessibleText(java.lang.String accessibleText)

Sets the item's accessible text to the string specified by accessibleText.

The accessible text is used by assistive technologies (i.e. for users who cannot use conventional means of interaction).

See Also:
accessibleText, setAccessibleDescription

setBackground

public final void setBackground(QBrush brush)

Sets the item's background brush to the specified brush.

See Also:
background, setForeground

setCheckState

public final void setCheckState(Qt.CheckState checkState)

Sets the check state of the item to be checkState.

See Also:
checkState, setCheckable

setCheckable

public final void setCheckable(boolean checkable)

Sets whether the item is user-checkable. If checkable is true, the item can be checked by the user; otherwise, the user cannot check the item.

The item delegate will render a checkable item with a check box next to the item's text.

See Also:
isCheckable, setCheckState, setTristate

setChild

public final void setChild(int row,
                           int column,
                           QStandardItem item)

Sets the child item at (row, column) to item. This item (the parent item) takes ownership of item. If necessary, the row count and column count are increased to fit the item.

See Also:
child

setChild

public final void setChild(int row,
                           QStandardItem item)

Sets the child at row to item.

See Also:
child

setColumnCount

public final void setColumnCount(int columns)

Sets the number of child item columns to columns. If this is less than columnCount, the data in the unwanted columns is discarded.

See Also:
columnCount, setRowCount

setDragEnabled

public final void setDragEnabled(boolean dragEnabled)

Sets whether the item is drag enabled. If dragEnabled is true, the item can be dragged by the user; otherwise, the user cannot drag the item.

Note that you also need to ensure that item dragging is enabled in the view; see QAbstractItemView::dragEnabled.

See Also:
isDragEnabled, setDropEnabled, setFlags

setDropEnabled

public final void setDropEnabled(boolean dropEnabled)

Sets whether the item is drop enabled. If dropEnabled is true, the item can be used as a drop target; otherwise, it cannot.

Note that you also need to ensure that drops are enabled in the view; see QWidget::acceptDrops(); and that the model supports the desired drop actions; see QAbstractItemModel::supportedDropActions().

See Also:
isDropEnabled, setDragEnabled, setFlags

setEditable

public final void setEditable(boolean editable)

Sets whether the item is editable. If editable is true, the item can be edited by the user; otherwise, the user cannot edit the item.

How the user can edit items in a view is determined by the view's edit triggers; see QAbstractItemView::editTriggers.

See Also:
isEditable, setFlags

setEnabled

public final void setEnabled(boolean enabled)

Sets whether the item is enabled. If enabled is true, the item is enabled, meaning that the user can interact with the item; if enabled is false, the user cannot interact with the item.

This flag takes presedence over the other item flags; e.g. if an item is not enabled, it cannot be selected by the user, even if the Qt::ItemIsSelectable flag has been set.

See Also:
isEnabled, Qt::ItemIsEnabled, setFlags

setFlags

public final void setFlags(Qt.ItemFlag... flags)

Sets the item flags for the item to flags.

The item flags determine how the user can interact with the item. This is often used to disable an item.

See Also:
flags, setData

setFlags

public final void setFlags(Qt.ItemFlags flags)

Sets the item flags for the item to flags.

The item flags determine how the user can interact with the item. This is often used to disable an item.

See Also:
flags, setData

setFont

public final void setFont(QFont font)

Sets the font used to display the item's text to the given font.

See Also:
font, setText, setForeground

setForeground

public final void setForeground(QBrush brush)

Sets the brush used to display the item's foreground (e.g. text) to the given brush.

See Also:
foreground, setBackground, setFont

setIcon

public final void setIcon(QIcon icon)

Sets the item's icon to the icon specified.

See Also:
icon

setRowCount

public final void setRowCount(int rows)

Sets the number of child item rows to rows. If this is less than rowCount, the data in the unwanted rows is discarded.

See Also:
rowCount, setColumnCount

setSelectable

public final void setSelectable(boolean selectable)

Sets whether the item is selectable. If selectable is true, the item can be selected by the user; otherwise, the user cannot select the item.

You can control the selection behavior and mode by manipulating their view properties; see QAbstractItemView::selectionMode and QAbstractItemView::selectionBehavior.

See Also:
isSelectable, setFlags

setSizeHint

public final void setSizeHint(QSize sizeHint)

Sets the size hint for the item to be sizeHint. If no size hint is set, the item delegate will compute the size hint based on the item data.

See Also:
sizeHint

setStatusTip

public final void setStatusTip(java.lang.String statusTip)

Sets the item's status tip to the string specified by statusTip.

See Also:
statusTip, setToolTip, setWhatsThis

setText

public final void setText(java.lang.String text)

Sets the item's text to the text specified.

See Also:
text, setFont, setForeground

setTextAlignment

public final void setTextAlignment(Qt.AlignmentFlag... textAlignment)

Sets the text alignment for the item's text to the textAlignment specified.

See Also:
textAlignment

setTextAlignment

public final void setTextAlignment(Qt.Alignment textAlignment)

Sets the text alignment for the item's text to the textAlignment specified.

See Also:
textAlignment

setToolTip

public final void setToolTip(java.lang.String toolTip)

Sets the item's tooltip to the string specified by toolTip.

See Also:
toolTip, setStatusTip, setWhatsThis

setTristate

public final void setTristate(boolean tristate)

Sets whether the item is tristate. If tristate is true, the item is checkable with three separate states; otherwise, the item is checkable with two states. (Note that this also requires that the item is checkable; see isCheckable.)

See Also:
isTristate, setCheckable, setCheckState

setWhatsThis

public final void setWhatsThis(java.lang.String whatsThis)

Sets the item's "What's This?" help to the string specified by whatsThis.

See Also:
whatsThis, setStatusTip, setToolTip

sizeHint

public final QSize sizeHint()

Returns the size hint set for the item, or an invalid QSize if no size hint has been set.

If no size hint has been set, the item delegate will compute the size hint based on the item data.

See Also:
setSizeHint

sortChildren

public final void sortChildren(int column)

Equivalent to sortChildren(column, Qt::AscendingOrder).


sortChildren

public final void sortChildren(int column,
                               Qt.SortOrder order)

Sorts the children of the item using the given order, by the values in the given column.

See Also:
operator<

statusTip

public final java.lang.String statusTip()

Returns the item's status tip.

See Also:
setStatusTip, toolTip, whatsThis

takeChild

public final QStandardItem takeChild(int row)

Equivalent to takeChild(row, 0).


takeChild

public final QStandardItem takeChild(int row,
                                     int column)

Removes the child item at (row, column) without deleting it, and returns a pointer to the item. If there was no child at the given location, then this function returns 0.

Note that this function, unlike takeRow and takeColumn, does not affect the dimensions of the child table.

See Also:
child, takeRow, takeColumn

takeColumn

public final java.util.List<QStandardItem> takeColumn(int column)

Removes column without deleting the column items, and returns a list of pointers to the removed items. For items in the column that have not been set, the corresponding pointers in the list will be 0.

See Also:
removeColumn, insertColumn, takeRow

takeRow

public final java.util.List<QStandardItem> takeRow(int row)

Removes row without deleting the row items, and returns a list of pointers to the removed items. For items in the row that have not been set, the corresponding pointers in the list will be 0.

See Also:
removeRow, insertRow, takeColumn

text

public final java.lang.String text()

Returns the item's text. This is the text that's presented to the user in a view.

See Also:
setText

textAlignment

public final Qt.Alignment textAlignment()

Returns the text alignment for the item's text.

See Also:
setTextAlignment

toolTip

public final java.lang.String toolTip()

Returns the item's tooltip.

See Also:
setToolTip, statusTip, whatsThis

whatsThis

public final java.lang.String whatsThis()

Returns the item's "What's This?" help.

See Also:
setWhatsThis, toolTip, statusTip

clone

public QStandardItem clone()

Returns a copy of this item. The item's children are not copied.

When subclassing QStandardItem, you can reimplement this function to provide QStandardItemModel with a factory that it can use to create new items on demand.

Overrides:
clone in class java.lang.Object
See Also:
QStandardItemModel::setItemPrototype, operator=

data

public final java.lang.Object data()

Equivalent to data(Qt::UserRole + 1).


data

public java.lang.Object data(int role)

Returns the item's data for the given role, or an invalid QVariant if there is no data for the role.

See Also:
setData

read

public void read(QDataStream in)

Reads the item from stream in. Only the data and flags of the item are read, not the child items.

See Also:
write

setData

public final void setData(java.lang.Object value)

Equivalent to setData(value, Qt::UserRole + 1).


setData

public void setData(java.lang.Object value,
                    int role)

Sets the item's data for the given role to the specified value.

See Also:
Qt::ItemDataRole, data, setFlags

type

public int type()

Returns the type of this item. The type is used to distinguish custom items from the base class. When subclassing QStandardItem, you should reimplement this function and return a new value greater than or equal to UserType.

See Also:
QStandardItem::Type

write

public void write(QDataStream out)

Writes the item to stream out. Only the data and flags of the item are written, not the child items.

See Also:
read

fromNativePointer

public static QStandardItem fromNativePointer(QNativePointer nativePointer)
This function returns the QStandardItem instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.