All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Brief description of class still missing. More...
#include <NameLineDelegate.h>
Signals | |
void | dataChanged () const |
Public Member Functions | |
QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
NameLineDelegate (QObject *parent=0) | |
void | setEditorData (QWidget *editor, const QModelIndex &index) const |
void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
Brief description of class still missing.
Full description of class still missing
SciFigs::NameLineDelegate::NameLineDelegate | ( | QObject * | parent = 0 | ) | [inline] |
: QItemDelegate(parent) {}
QWidget * SciFigs::NameLineDelegate::createEditor | ( | QWidget * | parent, |
const QStyleOptionViewItem & | option, | ||
const QModelIndex & | index | ||
) | const |
{ TRACE; DoubleSpinBox * w=new DoubleSpinBox(parent); connect(w, SIGNAL(valueChanged(double)), this, SLOT(commitWidgetData())); switch(index.column()) { case 0: case 1: w->setMinimum(-100); w->setMaximum(100); w->setSingleStep(0.05); break; default: w->setMinimum(-90); w->setMaximum(90); w->setSingleStep(10); break; } return w; }
void SciFigs::NameLineDelegate::dataChanged | ( | ) | const [signal] |
Referenced by setModelData().
void SciFigs::NameLineDelegate::setEditorData | ( | QWidget * | editor, |
const QModelIndex & | index | ||
) | const |
References TRACE.
{ TRACE; DoubleSpinBox * w= qobject_cast<DoubleSpinBox *>(editor); if( !w) return; w->setValue(index.model()->data(index).toDouble()); }
void SciFigs::NameLineDelegate::setModelData | ( | QWidget * | editor, |
QAbstractItemModel * | model, | ||
const QModelIndex & | index | ||
) | const |
References dataChanged(), TRACE, and QGpGuiTools::DoubleSpinBox::value().
{ TRACE; DoubleSpinBox * w= qobject_cast<DoubleSpinBox *>(editor); if( !w) return; if(model->data(index)!=w->value()) { model->setData(index, w->value()); emit dataChanged(); } }