All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Types | Public Member Functions
QGpGuiWave::ModeDelegate Class Reference

Brief description of class still missing. More...

#include <ModeDelegate.h>

List of all members.

Public Types

enum  Flag {
  Phase = 1, Group = 2, Rayleigh = 4, Love = 8,
  Vertical = 16, Radial = 32, Transverse = 64
}

Public Member Functions

QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Mode defaultMode () const
 ModeDelegate (QObject *parent=0)
void setDefaultIndex (int i)
void setDefaultRingIndex (int i)
void setEditorData (QWidget *editor, const QModelIndex &index) const
void setFlags (Flags f)
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const

Detailed Description

Brief description of class still missing.

Full description of class still missing


Member Enumeration Documentation

Enumerator:
Phase 
Group 
Rayleigh 
Love 
Vertical 
Radial 
Transverse 
{Phase=1, Group=2, Rayleigh=4, Love=8, Vertical=16, Radial=32, Transverse=64};

Constructor & Destructor Documentation

QGpGuiWave::ModeDelegate::ModeDelegate ( QObject *  parent = 0)

Description of constructor still missing

References Love, Phase, and TRACE.

  : QItemDelegate(parent)
{
  TRACE;
  _flags=Phase | Group | Rayleigh | Love;
  _defaultIndex=0;
  _defaultRingIndex=0;
}

Member Function Documentation

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

References Phase, Radial, QGpCoreTools::tr(), TRACE, Transverse, Vertical, and w.

{
  TRACE;
  switch (index.column()) {
  case 2: {
      QSpinBox * w=new QSpinBox(parent);
      return w;
    }
  case 1: {
      QComboBox * w=new QComboBox(parent);
      if(_flags & Rayleigh) w->addItem(tr( "Rayleigh" ));
      if(_flags & Love) w->addItem(tr( "Love" ));
      if(_flags & Vertical) w->addItem(tr( "Vertical" ));
      if(_flags & Radial) w->addItem(tr( "Radial" ));
      if(_flags & Transverse) w->addItem(tr( "Transverse" ));
      return w;
    }
  default: {
      QComboBox * w=new QComboBox(parent);
      if(_flags & Phase) w->addItem(tr( "Phase" ));
      if(_flags & Group) w->addItem(tr( "Group" ));
      return w;
    }
  }
}

References Phase, Radial, QGpCoreWave::Mode::setIndex(), QGpCoreWave::Mode::setPolarisation(), QGpCoreWave::Mode::setRingIndex(), QGpCoreWave::Mode::setSlowness(), TRACE, Transverse, and Vertical.

{
  TRACE;
  Mode m;
  if(_flags & Rayleigh) m.setPolarisation(Mode::Rayleigh);
  else if(_flags & Love) m.setPolarisation(Mode::Love);
  else if(_flags & Vertical) m.setPolarisation(Mode::Vertical);
  else if(_flags & Radial) m.setPolarisation(Mode::Radial);
  else if(_flags & Transverse) m.setPolarisation(Mode::Transverse);
  if(_flags & Phase) m.setSlowness(Mode::Phase);
  else if(_flags & Group) m.setSlowness(Mode::Group);
  m.setIndex(_defaultIndex);
  m.setRingIndex(_defaultRingIndex);
  return m;
}

Referenced by QGpGuiWave::ModalCurveBrowser::setDefaultModeIndex().

{_defaultIndex=i;}

Referenced by QGpGuiWave::ModalCurveBrowser::setDefaultModeRingIndex().

{_defaultRingIndex=i;}
void QGpGuiWave::ModeDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const

References TRACE, and w.

{
  TRACE;
  switch (index.column()) {
  case 2: {
      QSpinBox * w=qobject_cast<QSpinBox *>(editor);
      if( !w) return;
       w->setValue(index.model() ->data(index).toInt());
   }
    break;
  default: {
      QComboBox * w=qobject_cast<QComboBox *>(editor);
      if( !w) return;
      int pos=w->findText(index.model() ->data(index).toString(), Qt::MatchExactly);
      w->setCurrentIndex(pos);
    }
    break;
  }
}
void QGpGuiWave::ModeDelegate::setFlags ( Flags  f) [inline]
void QGpGuiWave::ModeDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const

References TRACE, and w.

{
  TRACE;
  switch (index.column()) {
  case 2: {
      QSpinBox * w=qobject_cast<QSpinBox *>(editor);
      if( !w) return;
      model->setData(index, w->value());
    }
    break;
  default: {
      QComboBox * w=qobject_cast<QComboBox *>(editor);
      if( !w) return;
      model->setData(index, w->currentText());
    }
    break;
  }
}

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