OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Slots | Private Attributes | List of all members
dealii::ParameterGui::ParameterDelegate Class Reference

The ParameterDelegate class implements special delegates for the QTreeWidget class used in the parameterGUI. More...

#include <parameter_delegate.h>

Inheritance diagram for dealii::ParameterGui::ParameterDelegate:
Inheritance graph
[legend]
Collaboration diagram for dealii::ParameterGui::ParameterDelegate:
Collaboration graph
[legend]

Public Member Functions

 ParameterDelegate (const int value_column, QObject *parent=0)
 Constructor, value_column specifies the column of the parameter tree this delegate will be used on. More...
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 This function creates the appropriate editor for the parameter based on the index. More...
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 Reimplemented from QItemDelegate. More...
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Reimplemented from QItemDelegate. More...
 
void setEditorData (QWidget *editor, const QModelIndex &index) const
 Reimplemented from QItemDelegate. More...
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 Reimplemented from QItemDelegate. More...
 

Private Slots

void commit_and_close_editor ()
 Reimplemented from QItemDelegate. More...
 

Private Attributes

int value_column
 The column this delegate will be used on. More...
 
double double_steps
 For parameters of type double a spin box will be shown as editor. More...
 
unsigned int int_steps
 For parameters of type integer a spin box will be shown as editor. More...
 
unsigned int double_decimals
 For parameters of type double a spin box will be shown as editor. More...
 

Detailed Description

The ParameterDelegate class implements special delegates for the QTreeWidget class used in the parameterGUI.

The QTreeWidget class provides some different standard delegates for editing parameters shown in the tree structure. The ParameterDelegate class provides special editors for the different types of parameters defined in the ParameterHandler class. For all parameter types based on strings as "Anything", "MultipleSelection" "Map" and "List" a simple line editor will be shown up. In the case of integer and double type parameters the editor is a spin box and for "Selection" type parameters a combo box will be shown up. For parameters of type "FileName" and "DirectoryName" the delegate shows a BrowseLineEdit editor. The column of the tree structure with the parameter values has to be set in the constructor.

Note
This class is used in the graphical user interface for the ParameterHandler class. It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
Author
Martin Steigemann, Wolfgang Bangerth, 2010

Constructor & Destructor Documentation

dealii::ParameterGui::ParameterDelegate::ParameterDelegate ( const int  value_column,
QObject *  parent = 0 
)

Constructor, value_column specifies the column of the parameter tree this delegate will be used on.

Member Function Documentation

void dealii::ParameterGui::ParameterDelegate::commit_and_close_editor ( )
privateslot

Reimplemented from QItemDelegate.

QWidget* dealii::ParameterGui::ParameterDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

This function creates the appropriate editor for the parameter based on the index.

void dealii::ParameterGui::ParameterDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

Reimplemented from QItemDelegate.

void dealii::ParameterGui::ParameterDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const

Reimplemented from QItemDelegate.

void dealii::ParameterGui::ParameterDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const

Reimplemented from QItemDelegate.

QSize dealii::ParameterGui::ParameterDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

Reimplemented from QItemDelegate.

Member Data Documentation

unsigned int dealii::ParameterGui::ParameterDelegate::double_decimals
private

For parameters of type double a spin box will be shown as editor.

The spin box will show parameters with a precision of double_decimals.

double dealii::ParameterGui::ParameterDelegate::double_steps
private

For parameters of type double a spin box will be shown as editor.

Any click on the spin box will change the value about double_steps.

unsigned int dealii::ParameterGui::ParameterDelegate::int_steps
private

For parameters of type integer a spin box will be shown as editor.

Any click on the spin box will change the value about int_steps.

int dealii::ParameterGui::ParameterDelegate::value_column
private

The column this delegate will be used on.


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