mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make the Qt ComboBox behave in a Better Way
So, the ComboBox is a beast, and when used on a Delegate it's very hard to get things right, wich is a pitty, because I overly like qt. So: 1 - Combobox needs to show the popup when user press ↓ and ↑ keys 2 - Combobox needs to select when user press enter, not twice. 3 - Combobox neesds to select when user selects from the mouse, not pressing enter after. 4 - Combobox needs to not mess with stuff when moving around. Everything that I listed there works on a non-delegate combobox, but for some reason, a delegate missed those, so I reimplemented all. not nice, but now we have a code that will work, I hope. *fingers crossed* Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
bc837163f5
commit
e6be14bf10
2 changed files with 23 additions and 0 deletions
|
@ -24,6 +24,8 @@ public:
|
|||
virtual bool eventFilter(QObject* object, QEvent* event);
|
||||
public slots:
|
||||
void testActivation(const QString& s);
|
||||
//HACK: try to get rid of this in the future.
|
||||
void fakeActivation();
|
||||
virtual void revertModelData(QWidget* widget, QAbstractItemDelegate::EndEditHint hint) = 0;
|
||||
protected:
|
||||
QAbstractItemModel *model;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue