Set completion inline due to a bug in Qt for popup mode

This commit is contained in:
2012-03-11 09:04:29 +01:00
parent 8daedb25ab
commit d0d0304ce4
5 changed files with 10 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ QWidget * TabDelegate::createEditor (QWidget * parent, const QStyleOptionViewIte
QLineEdit* lineEdit = new QLineEdit(parent);
if (_completer)
lineEdit->setCompleter(_completer);
lineEdit->setCompleter(_completer);
return lineEdit;
}
@@ -38,11 +38,11 @@ void TabDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
QLineEdit *line = qobject_cast<QLineEdit *>(editor);
QString value = line->text().trimmed();
if (index.row() < _operations->size() && (*_operations)[index.row()].id &&
(*_operations)[index.row()].parent)
model->setData(index, qVariantFromValue(" " + value));
if (index.row() < (int) _operations->size() && (*_operations)[index.row()].id &&
(*_operations)[index.row()].parent)
model->setData(index, qVariantFromValue(" " + value));
else
model->setData(index, qVariantFromValue(value));
model->setData(index, qVariantFromValue(value));
}
void TabDelegate::setEditorData(QWidget *editor,