Fix a bug : try to find parent on a NULL operation in TabDelegate

This commit is contained in:
Grégory Soutadé 2012-02-28 11:02:34 +01:00
parent beaace517f
commit 4addfc99d5

View File

@ -38,7 +38,8 @@ void TabDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
QLineEdit *line = qobject_cast<QLineEdit *>(editor);
QString value = line->text().trimmed();
if ((*_operations)[index.row()].parent)
if (index.row() < _operations->size() && (*_operations)[index.row()].id &&
(*_operations)[index.row()].parent)
model->setData(index, qVariantFromValue(" " + value));
else
model->setData(index, qVariantFromValue(value));