#include <RelativePositions.h>
List of all members.
Public Member Functions |
void | addStation (QString stationName) |
QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
int | indexOf (QString stationName) |
| RelativePositionsDelegate (QObject *parent=0) |
void | setEditorData (QWidget *editor, const QModelIndex &index) const |
void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
QString | stationAt (int i) |
Constructor & Destructor Documentation
References TRACE.
: QItemDelegate(parent)
{
TRACE;}
Member Function Documentation
References w.
{
if(index.column()<2) {
QComboBox * w=new QComboBox(parent);
w->addItems(_stationList);
connect(w, SIGNAL(activated(int)), this, SLOT(comboCommit()));
return w;
} else {
QLineEdit * w=new QLineEdit(parent);
w->setReadOnly(true);
return w;
}
}
References TRACE, and w.
{
TRACE;
if(index.column()<0) return;
if(index.column()<2) {
QComboBox *w=qobject_cast<QComboBox *>(editor);
if(!w) return;
int pos=w->findText(index.model()->data(index).toString(), Qt::MatchExactly);
w->setCurrentIndex(pos);
} else {
QLineEdit * w= qobject_cast<QLineEdit *>(editor);
if( !w) return;
w->setText(index.model() ->data(index).toString());
w->selectAll();
}
}
References TRACE, and w.
{
TRACE;
if(index.column()>-1 && index.column()<2) {
QComboBox *w=qobject_cast<QComboBox *>(editor);
if(!w) return;
model->setData(index, w->currentText());
}
}
The documentation for this class was generated from the following files: