FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | List of all members
qtcore::ItemModelUtils Class Reference

Provides a collection of tools around QAbstractItemModel. More...

#include <qttools/core/item_model_utils.h>

Static Public Member Functions

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)
 

Detailed Description

Provides a collection of tools around QAbstractItemModel.

Member Function Documentation

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
-1if 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: