Provides a collection of tools around QAbstractItemModel.
More...
#include <qttools/core/item_model_utils.h>
|
static bool | isValidRow (const QAbstractItemModel *model, int row, const QModelIndex &parent=QModelIndex()) |
|
static bool | isValidColumn (const QAbstractItemModel *model, int col, const QModelIndex &parent=QModelIndex()) |
|
template<typename INT_CONTAINER > |
static bool | validRows (const QAbstractItemModel *model, const INT_CONTAINER &rows, const QModelIndex &parent=QModelIndex()) |
|
static int | findDataInRow (const QAbstractItemModel *model, int col, const QVariant &value) |
| Try to find a value in a given column of a model. More...
|
|
static QVariant | tableData (const QAbstractItemModel *model, int row, int col, int role=Qt::DisplayRole) |
| Same as QAbstractItemModel::data() but more concise. More...
|
|
template<typename INT_CONTAINER > |
static void | removeRows (QAbstractItemModel *model, const INT_CONTAINER &rows) |
|
Provides a collection of tools around QAbstractItemModel.
int qtcore::ItemModelUtils::findDataInRow |
( |
const QAbstractItemModel * |
model, |
|
|
int |
col, |
|
|
const QVariant & |
value |
|
) |
| |
|
static |
Try to find a value in a given column of a model.
- Returns
- Index of the row where the first match of
value
could be found
- Return values
-
-1 | if value could not be found |
bool qtcore::ItemModelUtils::isValidColumn |
( |
const QAbstractItemModel * |
model, |
|
|
int |
col, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
static |
bool qtcore::ItemModelUtils::isValidRow |
( |
const QAbstractItemModel * |
model, |
|
|
int |
row, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
static |
template<typename INT_CONTAINER >
void qtcore::ItemModelUtils::removeRows |
( |
QAbstractItemModel * |
model, |
|
|
const INT_CONTAINER & |
rows |
|
) |
| |
|
static |
QVariant qtcore::ItemModelUtils::tableData |
( |
const QAbstractItemModel * |
model, |
|
|
int |
row, |
|
|
int |
col, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| |
|
static |
Same as QAbstractItemModel::data() but more concise.
template<typename INT_CONTAINER >
bool qtcore::ItemModelUtils::validRows |
( |
const QAbstractItemModel * |
model, |
|
|
const INT_CONTAINER & |
rows, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: