All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Brief description of class still missing. More...
#include <ColumnTextDelegate.h>
Public Member Functions | |
| ColumnTextDelegate (QObject *parent=0) | |
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| void | setEditorData (QWidget *editor, const QModelIndex &index) const |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| void | setTypes (QStringList t) |
| const QStringList & | types () const |
Brief description of class still missing.
Full description of class still missing
| QGpGuiTools::ColumnTextDelegate::ColumnTextDelegate | ( | QObject * | parent = 0 | ) | [inline] |
: QItemDelegate(parent) {}
| QWidget * QGpGuiTools::ColumnTextDelegate::createEditor | ( | QWidget * | parent, |
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | const |
| void QGpGuiTools::ColumnTextDelegate::setEditorData | ( | QWidget * | editor, |
| const QModelIndex & | index | ||
| ) | const |
{
TRACE;
switch (index.row()) {
case 0: {
QComboBox * w=qobject_cast<QComboBox *>(editor);
ASSERT(w);
int i=w->findText(index.model()->data(index).toString());
w->setCurrentIndex(i);
break;
}
case 1:
case 2:
case 3: {
QLineEdit * w=qobject_cast<QLineEdit *>(editor);
ASSERT(w);
w->setText(index.model()->data(index).toString());
w->selectAll();
break;
}
default:
break;
}
}
| void QGpGuiTools::ColumnTextDelegate::setModelData | ( | QWidget * | editor, |
| QAbstractItemModel * | model, | ||
| const QModelIndex & | index | ||
| ) | const |
{
TRACE;
switch (index.row()) {
case 0: {
QComboBox * w=qobject_cast<QComboBox *>(editor);
ASSERT(w);
if(model->data(index)!=w->currentText()) {
model->setData(index, w->currentText());
}
break;
}
case 1:
case 2:
case 3: {
QLineEdit * w=qobject_cast<QLineEdit *>(editor);
ASSERT(w);
if(model->data(index)!=w->text()) {
model->setData(index, w->text());
}
break;
}
default:
break;
}
}
| void QGpGuiTools::ColumnTextDelegate::setTypes | ( | QStringList | t | ) | [inline] |
Referenced by QGpGuiTools::ColumnTextWidget::ColumnTextWidget().
{_types=t;}
| const QStringList& QGpGuiTools::ColumnTextDelegate::types | ( | ) | const [inline] |
{return _types;}