QAdvanced Item View  0.4
The QAIV (Qt Advanced Item Views) library provides GUI and utility classes extending the capabilities of the Qt item views.
 All Classes Functions Variables Enumerations Enumerator Properties Groups Pages
Public Types | Public Member Functions | List of all members
QConditionalDecoration Class Reference

The QConditionalDecoration provides a conditional decorarion for model items. More...

#include <qconditionaldecoration.h>

Inheritance diagram for QConditionalDecoration:
QAbstractItemModelDecoration

Public Types

enum  MatchFlag {
  MatchFlagInvalid = -1, Contains = 1, ContainsNot, EndsWith,
  EndsNotWith, IsBetween, IsEmpty, IsEqual,
  IsGreater, IsGreaterOrEqual, IsLessOrEqual, IsLess,
  IsNotBetween, IsNotEmpty, IsNotEqual, StartsWith,
  StartsNotWith
}
 

Public Member Functions

 QConditionalDecoration ()
 
 QConditionalDecoration (int column)
 
void addCondition (QConditionalDecoration::MatchFlag matchFlag, const QVariant &value, const QString &set, const QString &name)
 
QConditionalDecoration::MatchFlag matchFlag (int index) const
 
int count () const
 
QVariant decorate (const QModelIndex &index, int role=Qt::DecorationRole) const
 
QString iconName (int index) const
 
bool matches (const QModelIndex &index, const QVariantMap &properties) const
 
QVariantMap properties (int index) const
 
void setHighlightRole (int role)
 
void setDefaultDecoration (const QString &set, const QString &name)
 
QVariant value (int index) const
 
- Public Member Functions inherited from QAbstractItemModelDecoration
 QAbstractItemModelDecoration ()
 
 ~QAbstractItemModelDecoration ()
 
QIcon defaultIcon () const
 
QVariant property (const QString &key, const QVariant &defaultValue=QVariant()) const
 
QMap< QString, QVariant > properties () const
 
bool restoreState (const QByteArray &state)
 
QByteArray saveState () const
 
void setProperty (const QString &name, const QVariant &value)
 
void setProperties (const QVariantMap &properties)
 

Detailed Description

The QConditionalDecoration provides a conditional decorarion for model items.

Member Enumeration Documentation

This enum describes the type of matches that can be used when decorating an item.

Enumerator
Contains 

The data provided by the item contains the value.

ContainsNot 

The data provided by the item does not contain the value.

EndsWith 

The data provided by the item ends with the value.

EndsNotWith 

The data provided by the item does not end with the value.

IsBetween 

The data provided by the item is between the range specified.

IsEmpty 

The item contains empty data.

IsEqual 

The data provided by the item is equal to the value.

IsGreater 

The data provided by the item is greater than the value.

IsGreaterOrEqual 

The data provided by the item is greater or equal to value.

IsLessOrEqual 

The data provided by the item is less or equal to the value.

IsLess 

The data provided is less than the value.

IsNotBetween 

The data provided by the item is not between the specified range.

IsNotEmpty 

The item contains data.

IsNotEqual 

The data provided by the item is not equal to the value.

StartsWith 

The data provided by the item starts with the search term.

StartsNotWith 

The data provided by the item does not start the value.

Constructor & Destructor Documentation

QConditionalDecoration::QConditionalDecoration ( )

Constructs an invalid QConditionalDecoration.

QConditionalDecoration::QConditionalDecoration ( int  column)

Constructs a QConditionalDecoration with the specified column.

Member Function Documentation

void QConditionalDecoration::addCondition ( QConditionalDecoration::MatchFlag  matchFlag,
const QVariant &  value,
const QString &  set,
const QString &  name 
)

Adds a condition with the given matchFlag and value.

int QConditionalDecoration::count ( ) const

Returns the number of conditions.

QVariant QConditionalDecoration::decorate ( const QModelIndex &  index,
int  role = Qt::DecorationRole 
) const
virtual

Returns the decoration for the given index.

Implements QAbstractItemModelDecoration.

QString QConditionalDecoration::iconName ( int  index) const

Returns the icon name of the condition at the given index or QString::null if index does not exists.

QConditionalDecoration::MatchFlag QConditionalDecoration::matchFlag ( int  index) const

Returns the match flag for the given index or QModelItemDecoration::MatchFlagInvalid if index does not exists.

QVariantMap QConditionalDecoration::properties ( int  index) const

Returns the properties of the condition at the given index.

void QConditionalDecoration::setHighlightRole ( int  role)

Sets the item role that is used to query the source model's data when highlighting items.

QVariant QConditionalDecoration::value ( int  index) const

Returns the value at the given index.


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