PropertyTreeWidget Class Reference

Generic Qt Class for displaying Property-Value pairs. More...

#include <PropertyTreeWidget.h>

Inheritance diagram for PropertyTreeWidget:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PropertyTreeWidget (QWidget *parent=0)
virtual ~PropertyTreeWidget ()
int addSection (const QString &sectionName, const QColor &bgColor, const QColor &altBgColor)
int addSection (const QString &sectionName, int colorNr=-1)
QModelIndex addEntryToSection (int sectionId, const QString &property, const QVariant &value)
QModelIndex addEntry (const QModelIndex &parent, const QString &property, const QVariant &value)
void clear ()
 Removes all sections and entries.

Protected Member Functions

virtual void drawRow (QPainter *p, const QStyleOptionViewItem &viewItem, const QModelIndex &index) const

Protected Attributes

QList< QPair< QColor, QColor > > colors
PropertyTreeModelmodel
QVector< QPair< QColor, QColor > > predefColors

Detailed Description

Generic Qt Class for displaying Property-Value pairs.

PropertyTreeWidget.jpg

The properties can be grouped, each group is displayed in a different color. The view was inspired by the property-editor of Qt-Designer (and uses the same colors)

This class doesn't depend on rose, the rose specific version for displaying info's about SgNode is NodeInfoWidget.

Definition at line 22 of file PropertyTreeWidget.h.


Constructor & Destructor Documentation

PropertyTreeWidget::PropertyTreeWidget ( QWidget *  parent = 0  ) 

Definition at line 12 of file PropertyTreeWidget.cpp.

PropertyTreeWidget::~PropertyTreeWidget (  )  [virtual]

Definition at line 45 of file PropertyTreeWidget.cpp.


Member Function Documentation

QModelIndex PropertyTreeWidget::addEntry ( const QModelIndex &  parent,
const QString &  property,
const QVariant &  value 
)

This method can be used to have a tree structure of prop-value pairs

Parameters:
parent the return value of a previous addEntry() or addEntryToSection()
property String of the property
value value as an QVariant

Definition at line 84 of file PropertyTreeWidget.cpp.

Referenced by NodeInfoWidget::printDeclModifier(), NodeInfoWidget::printFuncModifier(), NodeInfoWidget::printSpecialFuncModifier(), and NodeInfoWidget::setNode().

Here is the call graph for this function:

Here is the caller graph for this function:

QModelIndex PropertyTreeWidget::addEntryToSection ( int  sectionId,
const QString &  property,
const QVariant &  value 
)

Adds a Property-Value pair to a section

Parameters:
sectionId the return value of addSection()
property String of the property
value value as an QVariant
Returns:
modelIndex of the Prop-value pair

Definition at line 74 of file PropertyTreeWidget.cpp.

Referenced by NodeInfoWidget::setNode().

Here is the call graph for this function:

int PropertyTreeWidget::addSection ( const QString &  sectionName,
int  colorNr = -1 
)

Adds a new section

Parameters:
sectionName Title of sections
colorNr which color to use, there are 6 different predefined colors, use 0 to 6 if parameter is negative (default) the next "free" color is used

Definition at line 60 of file PropertyTreeWidget.cpp.

Here is the call graph for this function:

int PropertyTreeWidget::addSection ( const QString &  sectionName,
const QColor &  bgColor,
const QColor &  altBgColor 
)

Each section has a Background-Col and an alternating Bg-color which is used when alternatingRowColors=true

Definition at line 50 of file PropertyTreeWidget.cpp.

Referenced by NodeInfoWidget::setNode().

Here is the call graph for this function:

void PropertyTreeWidget::clear (  ) 

Removes all sections and entries.

Definition at line 119 of file PropertyTreeWidget.cpp.

Referenced by NodeInfoWidget::setNode().

Here is the call graph for this function:

void PropertyTreeWidget::drawRow ( QPainter *  p,
const QStyleOptionViewItem &  viewItem,
const QModelIndex &  index 
) const [protected, virtual]

Definition at line 94 of file PropertyTreeWidget.cpp.

Here is the call graph for this function:


Member Data Documentation

QList<QPair<QColor,QColor> > PropertyTreeWidget::colors [protected]

Definition at line 70 of file PropertyTreeWidget.h.

Referenced by addSection(), clear(), and drawRow().

PropertyTreeModel* PropertyTreeWidget::model [protected]

Definition at line 72 of file PropertyTreeWidget.h.

Referenced by addEntry(), addEntryToSection(), addSection(), clear(), drawRow(), and PropertyTreeWidget().

QVector<QPair<QColor,QColor> > PropertyTreeWidget::predefColors [protected]

Definition at line 75 of file PropertyTreeWidget.h.

Referenced by addSection(), and PropertyTreeWidget().


The documentation for this class was generated from the following files:
Generated on Tue Sep 15 14:48:49 2009 for RoseQtWidgets by  doxygen 1.4.7