Fixes the Combobox behavior on the inline-edit

This patch fixes the combobox behavior on the inline edit
to what it was ( well, similar to ) the GTK version,
up and arrow keys will walk you to the list of choices,
and it will update the other data as soon as you walks over it

one drawback is that you cant ( for now, since I do have a
very big headache at the moment ) cancel, since the cancel
will just forgets the item and do not call 'setData' on the
model, but we already called it while walking on the list.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-07-16 19:13:58 -03:00
parent c5a0c4e0d7
commit 1a0a4b7e08
3 changed files with 43 additions and 23 deletions

View file

@ -22,9 +22,10 @@ public:
virtual void setEditorData(QWidget* editor, const QModelIndex& index) const;
virtual void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
virtual bool eventFilter(QObject* object, QEvent* event);
public slots:
void testActivation(const QString& s);
protected:
QAbstractItemModel *model;
QComboBox *comboBox; // warning - it's null everytime a edit's finished.
};
class TankInfoDelegate : public ComboBoxDelegate{