Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 1893

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QAbstractListModel" doc="/**
&lt;p&gt;The &lt;a href=&quot;QAbstractListModel.html#QAbstractListModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractListModel&lt;/tt&gt;&lt;/a&gt; class provides an abstract model that can be subclassed to create one-dimensional list models.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractListModel.html#QAbstractListModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractListModel&lt;/tt&gt;&lt;/a&gt; provides a standard interface for models that represent their data as a simple non-hierarchical sequence of items. It is not used directly, but must be subclassed.&lt;/p&gt;
&lt;p&gt;Since the model provides a more specialized interface than &lt;a href=&quot;QAbstractItemModel.html#QAbstractItemModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemModel&lt;/tt&gt;&lt;/a&gt;, it is not suitable for use with tree views; you will need to subclass &lt;a href=&quot;QAbstractItemModel.html#QAbstractItemModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemModel&lt;/tt&gt;&lt;/a&gt; if you want to provide a model for that purpose. If you need to use a number of list models to manage data, it may be more appropriate to subclass &lt;a href=&quot;%2E%2E/gui/QAbstractTableModel.html&quot;&gt;&lt;tt&gt;QAbstractTableModel&lt;/tt&gt;&lt;/a&gt; class instead.&lt;/p&gt;
&lt;p&gt;Simple models can be created by subclassing this class and implementing the minimum number of required functions. For example, we could implement a simple read-only &lt;a href=&quot;%2E%2E/porting4.html#qstringlist&quot;&gt;&lt;tt&gt;QStringList&lt;/tt&gt;&lt;/a&gt;-based model that provides a list of strings to a &lt;a href=&quot;%2E%2E/gui/QListView.html&quot;&gt;&lt;tt&gt;QListView&lt;/tt&gt;&lt;/a&gt; widget. In such a case, we only need to implement the &lt;a href=&quot;QAbstractItemModel.html#rowCount(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;rowCount&lt;/tt&gt;&lt;/a&gt; function to return the number of items in the list, and the &lt;a href=&quot;QAbstractItemModel.html#data(com.trolltech.qt.core.QModelIndex, int)&quot;&gt;&lt;tt&gt;data&lt;/tt&gt;&lt;/a&gt; function to retrieve items from the list.&lt;/p&gt;
&lt;p&gt;Since the model represents a one-dimensional structure, the &lt;a href=&quot;QAbstractItemModel.html#rowCount(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;rowCount&lt;/tt&gt;&lt;/a&gt; function returns the total number of items in the model. The &lt;a href=&quot;QAbstractListModel.html#columnCount(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;columnCount&lt;/tt&gt;&lt;/a&gt; function is implemented for interoperability with all kinds of views, but by default informs views that the model contains only one column.&lt;/p&gt;
&lt;a name=&quot;subclassing&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Subclassing&lt;/h3&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Some general guidelines for subclassing models are available in the &lt;a href=&quot;%2E%2E/model-view-model-subclassing.html&quot;&gt;Model Subclassing Reference&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When subclassing &lt;a href=&quot;QAbstractListModel.html#QAbstractListModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractListModel&lt;/tt&gt;&lt;/a&gt;, you must provide implementations of the &lt;a href=&quot;QAbstractItemModel.html#rowCount(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;rowCount&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QAbstractItemModel.html#data(com.trolltech.qt.core.QModelIndex, int)&quot;&gt;&lt;tt&gt;data&lt;/tt&gt;&lt;/a&gt; functions. Well behaved models also provide a &lt;a href=&quot;QAbstractItemModel.html#headerData(int, com.trolltech.qt.core.Qt.Orientation, int)&quot;&gt;&lt;tt&gt;headerData&lt;/tt&gt;&lt;/a&gt; implementation.&lt;/p&gt;
&lt;p&gt;For editable list models, you must also provide an implementation of &lt;a href=&quot;QAbstractItemModel.html#setData(com.trolltech.qt.core.QModelIndex, java.lang.Object, int)&quot;&gt;&lt;tt&gt;setData&lt;/tt&gt;&lt;/a&gt;, implement the &lt;a href=&quot;QAbstractItemModel.html#flags(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;flags&lt;/tt&gt;&lt;/a&gt; function so that it returns a value containing Qt::ItemIsEditable.&lt;/p&gt;
&lt;p&gt;Note that &lt;a href=&quot;QAbstractListModel.html#QAbstractListModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractListModel&lt;/tt&gt;&lt;/a&gt; provides a default implementation of &lt;a href=&quot;QAbstractListModel.html#columnCount(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;columnCount&lt;/tt&gt;&lt;/a&gt; that informs views that there is only a single column of items in this model.&lt;/p&gt;
&lt;p&gt;Models that provide interfaces to resizable list-like data structures can provide implementations of &lt;a href=&quot;QAbstractItemModel.html#insertRows(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QAbstractItemModel.html#removeRows(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt;. When implementing these functions, it is important to call the appropriate functions so that all connected views are aware of any changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An &lt;a href=&quot;QAbstractItemModel.html#insertRows(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;insertRows&lt;/tt&gt;&lt;/a&gt; implementation must call &lt;a href=&quot;QAbstractItemModel.html#beginInsertRows(com.trolltech.qt.core.QModelIndex, int, int)&quot;&gt;&lt;tt&gt;beginInsertRows&lt;/tt&gt;&lt;/a&gt; &lt;i&gt;before&lt;/i&gt; inserting new rows into the data structure, and it must call &lt;a href=&quot;QAbstractItemModel.html#endInsertRows()&quot;&gt;&lt;tt&gt;endInsertRows&lt;/tt&gt;&lt;/a&gt; &lt;i&gt;immediately afterwards&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;a href=&quot;QAbstractItemModel.html#removeRows(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;removeRows&lt;/tt&gt;&lt;/a&gt; implementation must call &lt;a href=&quot;QAbstractItemModel.html#beginRemoveRows(com.trolltech.qt.core.QModelIndex, int, int)&quot;&gt;&lt;tt&gt;beginRemoveRows&lt;/tt&gt;&lt;/a&gt; &lt;i&gt;before&lt;/i&gt; the rows are removed from the data structure, and it must call &lt;a href=&quot;QAbstractItemModel.html#endRemoveRows()&quot;&gt;&lt;tt&gt;endRemoveRows&lt;/tt&gt;&lt;/a&gt; &lt;i&gt;immediately afterwards&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&gt;

@see &lt;a href=&quot;%2E%2E/model-view-model.html&quot;&gt;Model Classes&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/model-view-model-subclassing.html&quot;&gt;Model Subclassing Reference&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/gui/QAbstractItemView.html&quot;&gt;&lt;tt&gt;QAbstractItemView&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/gui/QAbstractTableModel.html&quot;&gt;&lt;tt&gt;QAbstractTableModel&lt;/tt&gt;&lt;/a&gt;
@see Item Views Puzzle Example&lt;/tt&gt; */">
    <signal name="protected final void dataChanged(com.trolltech.qt.core.QModelIndex topLeft, com.trolltech.qt.core.QModelIndex bottomRight)" doc="/**
&lt;p&gt;This signal is emitted whenever the data in an existing item changes. The affected items are those between &lt;tt&gt;topLeft&lt;/tt&gt; and &lt;tt&gt;bottomRight&lt;/tt&gt; inclusive (of the same parent).&lt;/p&gt;
&lt;p&gt;Note that this signal must be emitted explicitly when reimplementing the &lt;a href=&quot;QAbstractItemModel.html#setData(com.trolltech.qt.core.QModelIndex, java.lang.Object, int)&quot;&gt;&lt;tt&gt;setData&lt;/tt&gt;&lt;/a&gt; function.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.QModelIndex topLeft, com.trolltech.qt.core.QModelIndex bottomRight)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.QModelIndex topLeft)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractListModel.html#headerDataChanged(com.trolltech.qt.core.Qt.Orientation, int, int)&quot;&gt;&lt;tt&gt;headerDataChanged&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractItemModel.html#setData(com.trolltech.qt.core.QModelIndex, java.lang.Object, int)&quot;&gt;&lt;tt&gt;setData&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractListModel.html#layoutChanged()&quot;&gt;&lt;tt&gt;layoutChanged&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void headerDataChanged(com.trolltech.qt.core.Qt.Orientation orientation, int first, int last)" doc="/**
&lt;p&gt;This signal is emitted whenever a header is changed. The &lt;tt&gt;orientation&lt;/tt&gt; indicates whether the horizontal or vertical header has changed. The sections in the header from the &lt;tt&gt;first&lt;/tt&gt; to the &lt;tt&gt;last&lt;/tt&gt; need to be updated.&lt;/p&gt;
&lt;p&gt;Note that this signal must be emitted explicitly when reimplementing the &lt;a href=&quot;QAbstractItemModel.html#setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object, int)&quot;&gt;&lt;tt&gt;setHeaderData&lt;/tt&gt;&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;If you are changing the number of columns or rows you don't need to emit this signal, but use the begin/end functions.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.Qt.Orientation orientation, int first, int last)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.Qt.Orientation orientation, int first)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.core.Qt.Orientation orientation)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractItemModel.html#headerData(int, com.trolltech.qt.core.Qt.Orientation, int)&quot;&gt;&lt;tt&gt;headerData&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractItemModel.html#setHeaderData(int, com.trolltech.qt.core.Qt.Orientation, java.lang.Object, int)&quot;&gt;&lt;tt&gt;setHeaderData&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractListModel.html#dataChanged(com.trolltech.qt.core.QModelIndex, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;dataChanged&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void layoutAboutToBeChanged()" doc="/**
&lt;p&gt;This signal is emitted just before the layout of a model is changed. Components connected to this signal use it to adapt to changes in the model's layout.&lt;/p&gt;
&lt;p&gt;Subclasses should update any persistent model indexes after emitting &lt;a href=&quot;QAbstractListModel.html#layoutAboutToBeChanged()&quot;&gt;&lt;tt&gt;layoutAboutToBeChanged&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractListModel.html#layoutChanged()&quot;&gt;&lt;tt&gt;layoutChanged&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractItemModel.html#changePersistentIndex(com.trolltech.qt.core.QModelIndex, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;changePersistentIndex&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void layoutChanged()" doc="/**
&lt;p&gt;This signal is emitted whenever the layout of items exposed by the model has changed; for example, when the model has been sorted. When this signal is received by a view, it should update the layout of items to reflect this change.&lt;/p&gt;
&lt;p&gt;When subclassing &lt;a href=&quot;QAbstractItemModel.html#QAbstractItemModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemModel&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;%2E%2E/gui/QAbstractProxyModel.html&quot;&gt;&lt;tt&gt;QAbstractProxyModel&lt;/tt&gt;&lt;/a&gt;, ensure that you emit &lt;a href=&quot;QAbstractListModel.html#layoutAboutToBeChanged()&quot;&gt;&lt;tt&gt;layoutAboutToBeChanged&lt;/tt&gt;&lt;/a&gt; before changing the order of items or altering the structure of the data you expose to views, and emit &lt;a href=&quot;QAbstractListModel.html#layoutChanged()&quot;&gt;&lt;tt&gt;layoutChanged&lt;/tt&gt;&lt;/a&gt; after changing the layout.&lt;/p&gt;
&lt;p&gt;Subclasses should update any persistent model indexes before emitting &lt;a href=&quot;QAbstractListModel.html#layoutChanged()&quot;&gt;&lt;tt&gt;layoutChanged&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractListModel.html#layoutAboutToBeChanged()&quot;&gt;&lt;tt&gt;layoutAboutToBeChanged&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractListModel.html#dataChanged(com.trolltech.qt.core.QModelIndex, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;dataChanged&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractListModel.html#headerDataChanged(com.trolltech.qt.core.Qt.Orientation, int, int)&quot;&gt;&lt;tt&gt;headerDataChanged&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractItemModel.html#reset()&quot;&gt;&lt;tt&gt;reset&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractItemModel.html#changePersistentIndex(com.trolltech.qt.core.QModelIndex, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;changePersistentIndex&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QAbstractListModel(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Constructs an abstract list model with the given &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public QAbstractListModel()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractListModel.html#QAbstractListModel(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractListModel&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="public @Deprecated public final int columnCount(com.trolltech.qt.core.QModelIndex parent)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractItemModel.html#rowCount(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;rowCount&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public @Deprecated public final boolean hasChildren(com.trolltech.qt.core.QModelIndex parent)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="public @Deprecated public final com.trolltech.qt.core.QModelIndex parent(com.trolltech.qt.core.QModelIndex child)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractListModel.html#index(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractListModel.html#hasChildren(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;hasChildren&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public boolean dropMimeData(com.trolltech.qt.gui.QMimeData data, com.trolltech.qt.core.Qt.DropAction action, int row, int column, com.trolltech.qt.core.QModelIndex parent)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="public com.trolltech.qt.core.QModelIndex index(int row, int column, com.trolltech.qt.core.QModelIndex parent)" doc="/**
&lt;p&gt;Returns the index of the data in &lt;tt&gt;row&lt;/tt&gt; and &lt;tt&gt;column&lt;/tt&gt; with &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractListModel.html#parent(com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;parent&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QModelIndex index(int row, int column)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractListModel.html#index(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;index&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;row&lt;/tt&gt;, &lt;tt&gt;column&lt;/tt&gt;, QModelIndex()). */"/>
    <method name="public final com.trolltech.qt.core.QModelIndex index(int row)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractListModel.html#index(int, int, com.trolltech.qt.core.QModelIndex)&quot;&gt;index&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;row&lt;/tt&gt;, 0, QModelIndex()). */"/>
</class>