10#include <QtCore/qlist.h>
11#include <QtCore/qmap.h>
127 if (std::any_of(roles.
keyBegin(), roles.
keyEnd(), [](
int role) ->
bool {
128 return role != Qt::DisplayRole && role != Qt::EditRole;
136 return setData(
index, roleIter.value(), roleIter.key());
150 if (
index.row() < 0 ||
index.row() >= lst.size())
154 return lst.at(
index.row());
169 if (!
index.isValid())
187 if (
index.row() >= 0 &&
index.row() < lst.size()
190 if (lst.at(
index.row()) == valueString)
192 lst.replace(
index.row(), valueString);
256 const auto it = lst.begin() +
row;
286 fromRow +=
count - 1;
297 return s1.first <
s2.first;
302 return s1.first >
s2.first;
313 const int lstCount = lst.size();
315 for (
int i = 0;
i < lstCount; ++
i)
325 for (
int i = 0;
i < lstCount; ++
i) {
332 const int numOldIndexes = oldList.
size();
333 newList.
reserve(numOldIndexes);
334 for (
int i = 0;
i < numOldIndexes; ++
i)
372#include "moc_qstringlistmodel.cpp"
virtual Qt::DropActions supportedDropActions() const
void endResetModel()
Completes a model reset operation.
bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
void endRemoveRows()
Ends a row removal operation.
QModelIndexList persistentIndexList() const
void endMoveRows()
Ends a row move operation.
Q_INVOKABLE int int const QModelIndex & destinationParent
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles=QList< int >())
This signal is emitted whenever the data in an existing item changes.
Q_INVOKABLE int int const QModelIndex int destinationChild
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
bool checkIndex(const QModelIndex &index, CheckIndexOptions options=CheckIndexOption::NoOption) const
Q_INVOKABLE int sourceRow
void endInsertRows()
Ends a row insertion operation.
void beginResetModel()
Begins a model reset operation.
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
void beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins a row removal operation.
void beginInsertRows(const QModelIndex &parent, int first, int last)
Begins a row insertion operation.
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
QObject * parent() const
Returns a pointer to the parent object.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator constFind(const Key &key) const
key_iterator keyBegin() const
const_iterator constEnd() const
key_iterator keyEnd() const
constexpr int row() const noexcept
Returns the row this model index refers to.
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Removes count rows from the model, beginning at the given row.
QStringList stringList() const
Returns the string list used by the model to store data.
QStringListModel(QObject *parent=nullptr)
Constructs a string list model with the given parent.
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
\reimp
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Inserts count rows into the model, beginning at the given row.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the flags for the item with the given index.
QMap< int, QVariant > itemData(const QModelIndex &index) const override
\reimp
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows in the model.
void setStringList(const QStringList &strings)
Sets the model's internal string list to strings.
bool clearItemData(const QModelIndex &index) override
\reimp
bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles) override
\reimp
Qt::DropActions supportedDropActions() const override
\reimp
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns data for the specified role, from the item with the given index.
bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets the data for the specified role in the item with the given index in the model,...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLchar ** strings
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLenum GLenum GLsizei count
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
GLfixed GLfixed GLint GLint order
static bool ascendingLessThan(const QPair< QString, int > &s1, const QPair< QString, int > &s2)
static bool decendingLessThan(const QPair< QString, int > &s1, const QPair< QString, int > &s2)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent