From 29a19e2e84ddf0292c021d636c8183c675d47499 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 19 Dec 2013 20:20:37 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'qt-ui/maintab.cpp') 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)) -- cgit v1.2.3-70-g09d2