All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
GeopsyGui::RingEditorDelegate Class Reference

#include <RingEditor.h>

List of all members.

Public Member Functions

QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 RingEditorDelegate (QObject *parent=0)
void setEditorData (QWidget *editor, const QModelIndex &index) const
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const

Constructor & Destructor Documentation

References TRACE.

    : QItemDelegate(parent)
{
  TRACE;}

Member Function Documentation

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

References w.

{
  if(index.column() < 2) {
    DoubleSpinBox * w=new DoubleSpinBox(parent);
    connect(w,SIGNAL(valueChanged(double)), this, SLOT(commitSpin()));
    w->setMinimum(0.0);
    w->setMaximum(1e99);
    return w;
  } else return 0;
}
void GeopsyGui::RingEditorDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const

References TRACE, and w.

{
  TRACE;
  DoubleSpinBox * w=qobject_cast<DoubleSpinBox *>(editor);
  if( !w) return ;
  w->setValue(index.model() ->data(index).toDouble());
}
void GeopsyGui::RingEditorDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const

References TRACE, QGpGuiTools::DoubleSpinBox::value(), and w.

{
  TRACE;
  DoubleSpinBox * w=qobject_cast<DoubleSpinBox *>(editor);
  if( !w) return ;
  model->setData(index, w->value());
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines