|
Tulip Plugins
|
#include <ElementCollection.h>
Public Types | |
| enum | ElementCollectionType { SelectionType = 33 } |
Public Member Functions | |
| ElementCollection (QObject *parent=0) | |
| ElementCollection (const QStringList &strings, QObject *parent=0) | |
| ElementCollection (const ElementCollection &other) | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| QVariant | data (const QModelIndex &index, int role) const |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| void | addElement (const QString &label) |
| void | setAllElementSelection (bool selected) |
| void | setElementSelection (int element, bool selected) |
| QList< int > | selectedElement () const |
| ElementCollection & | operator= (const ElementCollection &) |
| ElementCollection::ElementCollection | ( | QObject * | parent = 0 | ) | [explicit] |
Constructs a string list model with the given parent.
| ElementCollection::ElementCollection | ( | const QStringList & | strings, |
| QObject * | parent = 0 |
||
| ) |
Constructs a string list model containing the specified strings with the given parent.
| ElementCollection::ElementCollection | ( | const ElementCollection & | other | ) |
| void ElementCollection::addElement | ( | const QString & | label | ) |
| QVariant ElementCollection::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const |
Returns data for the specified role, from the item with the given index.
If the view requests an invalid index, an invalid variant is returned.
| Qt::ItemFlags ElementCollection::flags | ( | const QModelIndex & | index | ) | const |
Returns the flags for the item with the given index.
Valid items are enabled, selectable, and editable.
| bool ElementCollection::insertRows | ( | int | row, |
| int | count, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) |
Inserts count rows into the model, beginning at the given row.
The parent index of the rows is optional and is only used for consistency with QAbstractItemModel. By default, a null index is specified, indicating that the rows are inserted in the top level of the model.
| ElementCollection & ElementCollection::operator= | ( | const ElementCollection & | other | ) |
| bool ElementCollection::removeRows | ( | int | row, |
| int | count, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) |
Removes count rows from the model, beginning at the given row.
The parent index of the rows is optional and is only used for consistency with QAbstractItemModel. By default, a null index is specified, indicating that the rows are removed in the top level of the model.
| int ElementCollection::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Returns the number of rows in the model. This value corresponds to the number of items in the model's internal string list.
The optional parent argument is in most models used to specify the parent of the rows to be counted. Because this is a list if a valid parent is specified, the result will always be 0.
| QList< int > ElementCollection::selectedElement | ( | ) | const |
| void ElementCollection::setAllElementSelection | ( | bool | selected | ) |
| bool ElementCollection::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role = Qt::EditRole |
||
| ) |
Sets the data for the specifed role in the item with the given index in the model, to the provided value.
The dataChanged() signal is emitted if the item is changed.
| void ElementCollection::setElementSelection | ( | int | element, |
| bool | selected | ||
| ) |
1.7.4