Quark  0.1
AbstractTableModelBase Class Reference

A non-parameterized abstract base class for Quark table models. More...

#include <AbstractTableModelBase.h++>

Inheritance diagram for AbstractTableModelBase:

Public Types

enum  Option { None = 0, Sorted = 1 << 0, ReverseSorted = 1 << 2 }
 Model options. More...
 

Public Member Functions

 Q_DECLARE_FLAGS (Options, Option)
 
virtual ~AbstractTableModelBase ()
 Destructor. More...
 
void setEditable (bool editable)
 Sets the editability of the model. More...
 
bool isEditable () const
 Tests the editability of the model. More...
 
bool isSorted () const
 Tests if the model is a sorted model. More...
 
int fieldCount () const
 Returns the number of fields in the model. More...
 
const FieldgetField (int field) const
 Returns the specified field of the model. More...
 
QString getFieldName (int field) const
 Returns the name of the specified field. More...
 

Static Public Attributes

static const int DescriptionRole
 An item's description role. More...
 
static const int SortRole
 An item's sort role. More...
 

Protected Member Functions

 AbstractTableModelBase (Options options=0, QObject *parent=NULL)
 Constructs an AbstractTableModelBase with the given options. More...
 
FieldaddField (const QString &name)
 Adds a new field to the model. More...
 

Detailed Description

A non-parameterized abstract base class for Quark table models.

This class should not be subclassed directly.

Author
Mark Lindner

Member Enumeration Documentation

◆ Option

enum Option

Model options.

Enumerator
None 

No options set.

Sorted 

The model should be sorted in ascending order.

ReverseSorted 

The model should be sorted in descending order.

Constructor & Destructor Documentation

◆ ~AbstractTableModelBase()

virtual ~AbstractTableModelBase ( )
virtual

Destructor.

◆ AbstractTableModelBase()

AbstractTableModelBase ( Options  options = 0,
QObject *  parent = NULL 
)
protected

Constructs an AbstractTableModelBase with the given options.

Member Function Documentation

◆ addField()

Field& addField ( const QString &  name)
protected

Adds a new field to the model.

Parameters
nameThe name of the field. This will be used as the header label for the corresponding column.
Returns
Field A field object representing this field; the appearance of the items in the corresponding column can be customized by setting properties of this object.

◆ fieldCount()

int fieldCount ( ) const

Returns the number of fields in the model.

◆ getField()

const Field& getField ( int  field) const

Returns the specified field of the model.

◆ getFieldName()

QString getFieldName ( int  field) const

Returns the name of the specified field.

◆ isEditable()

bool isEditable ( ) const
inline

Tests the editability of the model.

◆ isSorted()

bool isSorted ( ) const

Tests if the model is a sorted model.

◆ Q_DECLARE_FLAGS()

Q_DECLARE_FLAGS ( Options  ,
Option   
)

◆ setEditable()

void setEditable ( bool  editable)
inline

Sets the editability of the model.

Member Data Documentation

◆ DescriptionRole

const int DescriptionRole
static

An item's description role.

◆ SortRole

const int SortRole
static

An item's sort role.


The documentation for this class was generated from the following file: