mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
890d60ff9e
commit
29a19e2e84
1 changed files with 1 additions and 6 deletions
|
@ -31,6 +31,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
editMode(NONE)
|
editMode(NONE)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
ui.tagWidget->setFocusPolicy(Qt::StrongFocus); // Don't get focus by 'Wheel'
|
||||||
ui.cylinders->setModel(cylindersModel);
|
ui.cylinders->setModel(cylindersModel);
|
||||||
ui.weights->setModel(weightModel);
|
ui.weights->setModel(weightModel);
|
||||||
closeMessage();
|
closeMessage();
|
||||||
|
@ -286,12 +287,6 @@ bool MainTab::eventFilter(QObject* object, QEvent* event)
|
||||||
|
|
||||||
if (editMode != NONE)
|
if (editMode != NONE)
|
||||||
return false;
|
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)
|
// for the dateTimeEdit widget we need to ignore Wheel events as well (as long as we aren't editing)
|
||||||
if (object->objectName() == "dateTimeEdit" &&
|
if (object->objectName() == "dateTimeEdit" &&
|
||||||
(event->type() == QEvent::FocusIn || event->type() == QEvent::Wheel))
|
(event->type() == QEvent::FocusIn || event->type() == QEvent::Wheel))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue