48 #ifndef QT_NO_STRINGLISTMODEL 199 if (count < 1 || row < 0 || row >
rowCount(parent))
204 for (
int r = 0; r < count; ++r)
225 if (count <= 0 || row < 0 || (row + count) >
rowCount(parent))
230 for (
int r = 0; r < count; ++r)
256 for (
int i = 0; i <
lst.
count(); ++i)
266 for (
int i = 0; i < list.
count(); ++i) {
268 forwarding[list.
at(i).second] = i;
273 for (
int i = 0; i < oldList.
count(); ++i)
311 #endif // QT_NO_STRINGLISTMODEL The QVariant class acts like a union for the most common Qt data types.
QModelIndexList persistentIndexList() const
Returns the list of indexes stored as persistent indexes in the model.
#define QT_END_NAMESPACE
This macro expands to.
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
Reimplemented Function
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
void insert(int i, const T &t)
Inserts value at index position i in the list.
int count(const T &t) const
Returns the number of occurrences of value in the list.
virtual Qt::DropActions supportedDropActions() const
Returns the drop actions supported by this model.
The QAbstractListModel class provides an abstract model that can be subclassed to create one-dimensio...
void endInsertRows()
Ends a row insertion operation.
The QString class provides a Unicode character string.
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
Inserts count rows into the model, beginning at the given row.
The QObject class is the base class of all Qt objects.
void endResetModel()
Completes a model reset operation.
QStringList stringList() const
Returns the string list used by the model to store data.
QModelIndex index(int row, int column=0, const QModelIndex &parent=QModelIndex()) const
Returns the index of the data in row and column with parent.
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
Changes the QPersistentModelIndexes that is equal to the indexes in the given from model index list t...
static bool ascendingLessThan(const QPair< QString, int > &s1, const QPair< QString, int > &s2)
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setStringList(const QStringList &strings)
Sets the model's internal string list to strings.
void layoutAboutToBeChanged()
This signal is emitted just before the layout of a model is changed.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
int row() const
Returns the row this model index refers to.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the data for the specified role in the item with the given index in the model, to the provided value.
const T & at(int i) const
Returns the item at index position i in the list.
QStringListModel(QObject *parent=0)
Constructs a string list model with the given parent.
The QStringList class provides a list of strings.
void endRemoveRows()
Ends a row removal operation.
void clear()
Removes all items from the list.
void layoutChanged()
This signal is emitted whenever the layout of items exposed by the model has changed; for example...
static bool decendingLessThan(const QPair< QString, int > &s1, const QPair< QString, int > &s2)
void replace(int i, const T &t)
Replaces the item at index position i with value.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
void qSort(RandomAccessIterator start, RandomAccessIterator end)
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows in the model.
QObject * parent() const
Returns a pointer to the parent object.
void beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins a row removal operation.
The QModelIndex class is used to locate data in a data model.
int size() const
Returns the number of items in the list.
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This signal is emitted whenever the data in an existing item changes.
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the flags for the item with the given index.
Qt::DropActions supportedDropActions() const
Reimplemented Function
QVariant data(const QModelIndex &index, int role) const
Returns data for the specified role, from the item with the given index.
void beginResetModel()
Begins a model reset operation.
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Removes count rows from the model, beginning at the given row.
void beginInsertRows(const QModelIndex &parent, int first, int last)
Begins a row insertion operation.
The QList class is a template class that provides lists.
void removeAt(int i)
Removes the item at index position i.