Brief description of class still missing. More...
#include <ModeDelegate.h>
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 |
Brief description of class still missing.
Full description of class still missing
QGpGuiWave::ModeDelegate::ModeDelegate | ( | QObject * | parent = 0 | ) |
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; } } }
Mode QGpGuiWave::ModeDelegate::defaultMode | ( | ) | const |
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; }
void QGpGuiWave::ModeDelegate::setDefaultIndex | ( | int | i | ) | [inline] |
Referenced by QGpGuiWave::ModalCurveBrowser::setDefaultModeIndex().
{_defaultIndex=i;}
void QGpGuiWave::ModeDelegate::setDefaultRingIndex | ( | int | i | ) | [inline] |
Referenced by QGpGuiWave::ModalCurveBrowser::setDefaultModeRingIndex().
{_defaultRingIndex=i;}
void QGpGuiWave::ModeDelegate::setEditorData | ( | QWidget * | editor, |
const QModelIndex & | index | ||
) | const |
{ 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] |
Referenced by QGpGuiWave::ModalCurveBrowser::setModeFlags().
{_flags=f;}
void QGpGuiWave::ModeDelegate::setModelData | ( | QWidget * | editor, |
QAbstractItemModel * | model, | ||
const QModelIndex & | index | ||
) | const |