diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-10-24 16:23:49 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-24 09:49:36 -0700 |
commit | d543196059ed8f035827ec082618b59a7885a339 (patch) | |
tree | 7a00e6030b8bae865480c950b892a87a1b64d23e /desktop-widgets/tagwidget.h | |
parent | a9a4249b236f07418a3c678d3ec2b7791f957048 (diff) | |
download | subsurface-d543196059ed8f035827ec082618b59a7885a339.tar.gz |
desktop: overwrite drag & drop in TagWidget
The interaction of Qt's drag & drop with GroupedLineEdit was
exceedingly weird. The user was able to scroll the viewport
making the text invisible.
This implements a very primitive alternative drag & drop
functionality: dropped text is regarged as a distinct tag.
This means that it is not possible to modify existing tags
by dropping in the middle of them. Arguably, this might even
be better than arbitrary drag & drop. But even if not perfect,
this fixes a very nasty UI behavior.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tagwidget.h')
-rw-r--r-- | desktop-widgets/tagwidget.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/desktop-widgets/tagwidget.h b/desktop-widgets/tagwidget.h index 510b3c48b..da5091658 100644 --- a/desktop-widgets/tagwidget.h +++ b/desktop-widgets/tagwidget.h @@ -26,7 +26,11 @@ slots: void completionHighlighted(const QString &text); protected: - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(QKeyEvent *e) override; + void dragEnterEvent(QDragEnterEvent *e) override; + void dragLeaveEvent(QDragLeaveEvent *e) override; + void dragMoveEvent(QDragMoveEvent *e) override; + void dropEvent(QDropEvent *e) override; private: void focusOutEvent(QFocusEvent *ev) override; QCompleter *m_completer; |