mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Diagram view, improve behavior with track pad
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3293 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -584,8 +584,8 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e) {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool DiagramView::gestures() const {
|
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
|
Manage wheel event of mouse
|
||||||
@@ -593,20 +593,14 @@ bool DiagramView::gestures() const {
|
|||||||
*/
|
*/
|
||||||
void DiagramView::wheelEvent(QWheelEvent *e) {
|
void DiagramView::wheelEvent(QWheelEvent *e) {
|
||||||
//Zoom and scrolling
|
//Zoom and scrolling
|
||||||
if (e->buttons() != Qt::MidButton & !gestures ()) {
|
if ( gestures() ) {
|
||||||
if (!(e -> modifiers() & Qt::ControlModifier )) {
|
if (e -> modifiers() & Qt::ControlModifier)
|
||||||
if (e -> delta() > 0){
|
e -> delta() > 0 ? zoomInSlowly() : zoomOutSlowly();
|
||||||
zoomIn();
|
else
|
||||||
}
|
QGraphicsView::wheelEvent(e);
|
||||||
else{
|
} else {
|
||||||
zoomOut();
|
e -> delta() > 0 ? zoomIn(): zoomOut();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
|
||||||
QAbstractScrollArea::wheelEvent(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user