MIRA
Public Member Functions | List of all members
SpinBoxDelegate Class Reference

Delegate for a QTableWidgetItem (or any model-view item for that matter). More...

#include <widgets/SpinBoxDelegate.h>

Inheritance diagram for SpinBoxDelegate:
Inheritance graph
[legend]

Public Member Functions

 SpinBoxDelegate (QObject *parent=0)
 
virtual ~SpinBoxDelegate ()
 
void setSpinBoxFormat (double minRange, double maxRange, double step, double defvalue, const QString &suffix="", bool buttons=true, unsigned int decimals=2)
 
void setRange (double minRange, double maxRange, double step)
 
void setDefaultValue (double defvalue)
 
void setSuffix (const QString &suffix)
 
void setShowButtons (bool show)
 
void setDecimals (unsigned int decimals)
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
void setEditorData (QWidget *editor, const QModelIndex &index) const
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
QString displayText (const QVariant &value, const QLocale &locale) const
 

Detailed Description

Delegate for a QTableWidgetItem (or any model-view item for that matter).

Is able to format a double value to two decimals precision

Constructor & Destructor Documentation

◆ SpinBoxDelegate()

SpinBoxDelegate ( QObject *  parent = 0)

◆ ~SpinBoxDelegate()

virtual ~SpinBoxDelegate ( )
virtual

Member Function Documentation

◆ setSpinBoxFormat()

void setSpinBoxFormat ( double  minRange,
double  maxRange,
double  step,
double  defvalue,
const QString &  suffix = "",
bool  buttons = true,
unsigned int  decimals = 2 
)

◆ setRange()

void setRange ( double  minRange,
double  maxRange,
double  step 
)

◆ setDefaultValue()

void setDefaultValue ( double  defvalue)

◆ setSuffix()

void setSuffix ( const QString &  suffix)

◆ setShowButtons()

void setShowButtons ( bool  show)

◆ setDecimals()

void setDecimals ( unsigned int  decimals)

◆ createEditor()

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

◆ setEditorData()

void setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const

◆ setModelData()

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

◆ updateEditorGeometry()

void updateEditorGeometry ( QWidget *  editor,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

◆ displayText()

QString displayText ( const QVariant &  value,
const QLocale &  locale 
) const

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