Optika GUI Toolik  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
Optika::Delegate Class Reference

The delegate used for the Optika package. For non-documented functions please refer to the Qt API. More...

#include <Optika_delegate.hpp>

Inherits QItemDelegate.

Constructors

 Delegate (QObject *parent=0)
 Constructs a Delegate. More...
 

Overridden from QItemDelegate

QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
virtual void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
 

Constant obtaining functions.

static const QString & getBoolEditorTrue ()
 Gets the value the delegate uses to represent "true" when constructing comboboxes for boolean parameters. More...
 
static const QString & getBoolEditorFalse ()
 Gets the value the delegate uses to represent "false" when constructing comboboxes for boolean parameters. More...
 

Private Functions

QWidget * getArrayEditor (const QModelIndex &index, QString type, QWidget *parent, bool isTwoD=false) const
 Creates an ArrayWidget to edit the parameter at the given QModelIndex. More...
 
void setArrayWidgetData (QWidget *editor, QString type, const QModelIndex &index, bool isTwoD=false) const
 Sets the data in an array widget to the current values found at index. More...
 
QVariant extractValueFromArray (QWidget *editor, QString type, bool isTwoD=false) const
 Gets an array from an ArrayWidget and puts it into a QVariant. More...
 

Detailed Description

The delegate used for the Optika package. For non-documented functions please refer to the Qt API.

Definition at line 58 of file Optika_delegate.hpp.

Constructor & Destructor Documentation

Optika::Delegate::Delegate ( QObject *  parent = 0)

Constructs a Delegate.

Parameters
parentThe parent object of the Delegate.

Definition at line 52 of file Optika_delegate.cpp.

Member Function Documentation

QWidget * Optika::Delegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

Definition at line 54 of file Optika_delegate.cpp.

void Optika::Delegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
virtual

Definition at line 162 of file Optika_delegate.cpp.

void Optika::Delegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const

Definition at line 195 of file Optika_delegate.cpp.

void Optika::Delegate::updateEditorGeometry ( QWidget *  editor,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
virtual

Definition at line 244 of file Optika_delegate.cpp.

static const QString& Optika::Delegate::getBoolEditorTrue ( )
inlinestatic

Gets the value the delegate uses to represent "true" when constructing comboboxes for boolean parameters.

Returns
The value the delegate uses to represent "true" when constructing comboboxes for boolean parameters.

Definition at line 99 of file Optika_delegate.hpp.

static const QString& Optika::Delegate::getBoolEditorFalse ( )
inlinestatic

Gets the value the delegate uses to represent "false" when constructing comboboxes for boolean parameters.

Returns
The value the delegate uses to represent "false" when constructing comboboxes for boolean parameters.

Definition at line 113 of file Optika_delegate.hpp.

QWidget * Optika::Delegate::getArrayEditor ( const QModelIndex &  index,
QString  type,
QWidget *  parent,
bool  isTwoD = false 
) const
private

Creates an ArrayWidget to edit the parameter at the given QModelIndex.

Parameters
indexIndex of the parameter to edit.
typeThe template type of the array.
parentThe parent widget.
Returns
An array widget with which to edit the parameter.

Definition at line 248 of file Optika_delegate.cpp.

void Optika::Delegate::setArrayWidgetData ( QWidget *  editor,
QString  type,
const QModelIndex &  index,
bool  isTwoD = false 
) const
private

Sets the data in an array widget to the current values found at index.

Parameters
editorArrayWidget whose values are to be set.
typeThe template type of the array.
indexThe index of the parameter whose values are going to be put in the ArrayWidget.

Definition at line 299 of file Optika_delegate.cpp.

QVariant Optika::Delegate::extractValueFromArray ( QWidget *  editor,
QString  type,
bool  isTwoD = false 
) const
private

Gets an array from an ArrayWidget and puts it into a QVariant.

Parameters
editorThe ArrayWidget which has the array we want to put into a QVariant.
typethe template type of the array.
Returns
A Qvariant containing an array that is equal to the array in the given ArrayWidget.

Definition at line 333 of file Optika_delegate.cpp.


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