[qet] [3293] Diagram view, improve behavior with track pad |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3293
Author: blacksun
Date: 2014-08-31 11:45:01 +0200 (Sun, 31 Aug 2014)
Log Message:
-----------
Diagram view, improve behavior with track pad
Modified Paths:
--------------
trunk/sources/diagramview.cpp
Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp 2014-08-30 09:28:12 UTC (rev 3292)
+++ trunk/sources/diagramview.cpp 2014-08-31 09:45:01 UTC (rev 3293)
@@ -584,8 +584,8 @@
* @return
*/
bool DiagramView::gestures() const {
- return(QETApp::settings().value("diagramview/gestures", true).toBool());
- }
+ return(QETApp::settings().value("diagramview/gestures", true).toBool());
+}
/**
Manage wheel event of mouse
@@ -593,20 +593,14 @@
*/
void DiagramView::wheelEvent(QWheelEvent *e) {
//Zoom and scrolling
- if (e->buttons() != Qt::MidButton & !gestures ()) {
- if (!(e -> modifiers() & Qt::ControlModifier )) {
- if (e -> delta() > 0){
- zoomIn();
- }
- else{
- zoomOut();
- }
- }
- } else {
- QAbstractScrollArea::wheelEvent(e);
- }
-
-
+ if ( gestures() ) {
+ if (e -> modifiers() & Qt::ControlModifier)
+ e -> delta() > 0 ? zoomInSlowly() : zoomOutSlowly();
+ else
+ QGraphicsView::wheelEvent(e);
+ } else {
+ e -> delta() > 0 ? zoomIn(): zoomOut();
+ }
}