Quark  0.1
FlagsModel Class Reference

A data model for storing a list of named flags. More...

#include <FlagsModel.h++>

Inheritance diagram for FlagsModel:

Public Member Functions

 FlagsModel (QObject *parent=NULL)
 Constructor. More...
 
virtual ~FlagsModel ()
 Destructor. More...
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 Specified by QAbstractListModel. More...
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 Specified by QAbstractListModel. More...
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Specified by QAbstractListModel. More...
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 Specified by QAbstractListModel. More...
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 Specified by QAbstractListModel. More...
 
QBitArray getFlags () const
 Returns a bitmask of of flags which are set (checked) in the model, as a QBitArray. More...
 
QBitArray getPartialFlags () const
 Returns a bitmask of the flags which are partially set (partially checked) in the model, as a QBitArray. More...
 
void setFlags (const QBitArray &flags, const QBitArray &partialFlags=QBitArray())
 Sets the states of the flags in the model. More...
 
void setFlagNames (const QStringList &names)
 Sets the names of the flags. More...
 
void setEditable (bool editable)
 Specifies whether the model is editable. More...
 
void setTriState (bool triState)
 Specifies whether the model support tri-state (partially checked) flags. More...
 

Detailed Description

A data model for storing a list of named flags.

Each flag is represented by a checkable item in the list model. The model can support both binary and tri-state ("partially checked") flags.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ FlagsModel()

FlagsModel ( QObject *  parent = NULL)

Constructor.

◆ ~FlagsModel()

virtual ~FlagsModel ( )
virtual

Destructor.

Member Function Documentation

◆ columnCount()

virtual int columnCount ( const QModelIndex &  parent = QModelIndex()) const
inlinevirtual

Specified by QAbstractListModel.

◆ data()

virtual QVariant data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

Specified by QAbstractListModel.

◆ flags()

virtual Qt::ItemFlags flags ( const QModelIndex &  index) const
virtual

Specified by QAbstractListModel.

◆ getFlags()

QBitArray getFlags ( ) const
inline

Returns a bitmask of of flags which are set (checked) in the model, as a QBitArray.

◆ getPartialFlags()

QBitArray getPartialFlags ( ) const
inline

Returns a bitmask of the flags which are partially set (partially checked) in the model, as a QBitArray.

◆ rowCount()

virtual int rowCount ( const QModelIndex &  parent = QModelIndex()) const
inlinevirtual

Specified by QAbstractListModel.

◆ setData()

virtual bool setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

Specified by QAbstractListModel.

◆ setEditable()

void setEditable ( bool  editable)

Specifies whether the model is editable.

◆ setFlagNames()

void setFlagNames ( const QStringList &  names)

Sets the names of the flags.

Parameters
namesThe list of names.

◆ setFlags()

void setFlags ( const QBitArray &  flags,
const QBitArray &  partialFlags = QBitArray() 
)

Sets the states of the flags in the model.

Parameters
flagsa bitmask indicating which flags are set (checked).
partialFlagsa bitmask indicating which flags are partially set (partially checked).

◆ setTriState()

void setTriState ( bool  triState)

Specifies whether the model support tri-state (partially checked) flags.


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