-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#61 prevent qscrollarea in imagewidget from scrolling on zoom
- Loading branch information
1 parent
617bd68
commit 93717b4
Showing
6 changed files
with
110 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,61 @@ | ||
/*********************************************************************** | ||
* FILENAME : mousewheeleatereventfilter.h | ||
* | ||
* LICENSE: | ||
* qcvTouchUp provides an image processing toolset for editing | ||
* photographs, purposed and packaged for use in a desktop application | ||
* user environment. Copyright (C) 2018, Matthew R. Miller | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation (version 3 of the License). | ||
* | ||
* The framework and libraries used to create this software are licenced | ||
* under the GNU Lesser General Public License (LGPL) version 3 and the | ||
* 3-clause BSD License as agreed upon through the use of the Qt toolkit | ||
* and OpenCV libraries respectively. Copies of the appropriate licenses | ||
* for qcvTouchup, and its source code, can be found in LICENSE.txt, | ||
* LICENSE.Qt.txt, and LICENSE.CV.txt. If not, please see | ||
* <http://www.gnu.org/licenses/> and <https://opencv.org/license.html> | ||
* for further information on licensing. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* If you wish to contact the developer about this project, please do so | ||
* through their account at <https://github.com/mattrussmill> | ||
* | ||
* DESCRIPTION : | ||
* This object is an event filter to disable mouse scroll wheel interactions | ||
* when the ctrl key is held down. | ||
* | ||
* NOTES : | ||
* Some QWidgets have scroll wheel interactions which cannot be disabled. | ||
* | ||
* AUTHOR : Matthew R. Miller START DATE : March 6, 2018 | ||
* | ||
* CHANGES : N/A - N/A | ||
* | ||
* VERSION DATE WHO DETAIL | ||
* 0.1 November 30, 2019 Matthew R. Miller Initial Rev | ||
* | ||
************************************************************************/ | ||
#include "mousewheelctrleatereventfilter.h" | ||
#include <QEvent> | ||
#include <QApplication> | ||
|
||
MouseWheelCtrlEaterEventFilter::MouseWheelCtrlEaterEventFilter(QObject *parent) : QObject(parent) | ||
{ | ||
|
||
} | ||
|
||
//If the event is a mouse scroll wheel event with the ctrl modifier, eventFilter returns true to disable further processing | ||
bool MouseWheelCtrlEaterEventFilter::eventFilter(QObject *watched, QEvent *event) | ||
{ | ||
if(QApplication::queryKeyboardModifiers() & Qt::ControlModifier) | ||
if(event->type() == QEvent::Wheel) | ||
return true; | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters