diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-12-19 20:20:37 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-20 09:53:05 -0800 |
commit | 29a19e2e84ddf0292c021d636c8183c675d47499 (patch) | |
tree | 092c1d79c9dddbe7483f484a8671e97049fd1655 | |
parent | 890d60ff9ec1876ccc3e7af87bf1eb28a480a8e9 (diff) | |
download | subsurface-29a19e2e84ddf0292c021d636c8183c675d47499.tar.gz |
Fix the cursor problem on the TagWidget
The problem was the Focus Prevention system on the
EventFilter. Instead of that we can pass the setFocusPolicy (
strongFocus ) that ignores the mousewheel. simpler and cleaner.
Fixes #376
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/maintab.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 08079c82d..13f26e5bd 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -31,6 +31,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), editMode(NONE) { ui.setupUi(this); + ui.tagWidget->setFocusPolicy(Qt::StrongFocus); // Don't get focus by 'Wheel' ui.cylinders->setModel(cylindersModel); ui.weights->setModel(weightModel); closeMessage(); @@ -286,12 +287,6 @@ bool MainTab::eventFilter(QObject* object, QEvent* event) if (editMode != NONE) return false; - // we want to prevent the user from accidentally enabling editMode: - // for the tagWidget we ignore FocusIn - that's both a click and starting the scroll wheel - // this means a click by itself won't start edit mode - but typing something will - if (object->objectName() == "tagWidget" && - event->type() == QEvent::FocusIn) - return true; // for the dateTimeEdit widget we need to ignore Wheel events as well (as long as we aren't editing) if (object->objectName() == "dateTimeEdit" && (event->type() == QEvent::FocusIn || event->type() == QEvent::Wheel)) |