A container for a generic Object Model derived from some Base.
More...
#include <objectmodelbase.h>
|
| ObjectModelBase (QObject *parent) |
| Constructor. More...
|
|
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns in the specified model (currently this is always 2). More...
|
|
QVariant | dataForObject (QObject *object, const QModelIndex &index, int role) const |
| Returns the data for the specified object. More...
|
|
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Returns the header data for the Object, given a section (column), orientation and role. More...
|
|
QMap< int, QVariant > | itemData (const QModelIndex &index) const override |
|
template<typename Base>
class GammaRay::ObjectModelBase< Base >
A container for a generic Object Model derived from some Base.
◆ ObjectModelBase()
Constructor.
- Parameters
-
parent | is the parent object for this instance. |
◆ columnCount()
Returns the number of columns in the specified model (currently this is always 2).
- Parameters
-
parent | is the model QModelIndex. |
- Returns
- the column count for specified model.
◆ dataForObject()
Returns the data for the specified object.
- Parameters
-
object | is a pointer to a QObject. |
index | is the model QModelIndex. |
role | is the Qt role. |
- Returns
- on success, a QVariant containing the data for the specified QObject; QVariant() if some anamoly occurs.
◆ headerData()
template<typename Base >
QVariant GammaRay::ObjectModelBase< Base >::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
|
inlineoverride |
Returns the header data for the Object, given a section (column), orientation and role.
- Parameters
-
section | an integer (either 0 or 1) corresponding to the section (column). |
orientation | is the Qt::Orientation. |
role | is the Qt role. |
- Returns
- on success, a QVariant containing the header data; QVariant() if some anamoly occurs.