I don;t see where you set
...
editor->setEditable(true);
...
...
editor->setEditable(true);
...
To copy to clipboard, switch view to plain text mode
at first. then QComboBox has not such signal editingFinished, but QLineEdit has.
so, you should write like this:
editor->setEditable(true);
editor
->addItem
(QString::fromUtf8(""),
"0");
while(...) editor->addItem(...);
editor
->setSizeAdjustPolicy
(QComboBox::AdjustToContents);
connect(editor->lineEdit(), SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
return editor;
}
QWidget *CekSenetDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const {
QComboBox *editor = new QComboBox(parent);
editor->setEditable(true);
editor->addItem(QString::fromUtf8(""), "0");
while(...) editor->addItem(...);
editor->setSizeAdjustPolicy(QComboBox::AdjustToContents);
connect(editor->lineEdit(), SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
return editor;
}
To copy to clipboard, switch view to plain text mode
Bookmarks