Minor : fix warning

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5012 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-08-09 09:03:04 +00:00
parent e71fc99464
commit 3c535b2904

View File

@@ -638,11 +638,16 @@ void DiagramView::focusInEvent(QFocusEvent *e) {
} }
/** /**
Handles "key press" events. Reimplemented here to switch to visualisation * @brief DiagramView::keyPressEvent
mode if needed. * Handles "key press" events. Reimplemented here to switch to visualisation
* mode if needed.
* @param e
*/ */
void DiagramView::keyPressEvent(QKeyEvent *e) { void DiagramView::keyPressEvent(QKeyEvent *e)
if (m_event_interface && m_event_interface->keyPressEvent(e)) return; {
if (m_event_interface && m_event_interface->keyPressEvent(e))
return;
ProjectView *current_project = this->diagramEditor()->acessCurrentProject(); ProjectView *current_project = this->diagramEditor()->acessCurrentProject();
switch(e -> key()) switch(e -> key())
{ {
@@ -684,29 +689,38 @@ switch(e -> key())
case Qt::Key_ZoomIn: case Qt::Key_ZoomIn:
zoom(1.15); zoom(1.15);
return; return;
case Qt::Key_Minus: case Qt::Key_Minus: {
if (e->modifiers() & Qt::ControlModifier) if (e->modifiers() & Qt::ControlModifier)
zoom(0.85); zoom(0.85);
case Qt::Key_Plus: }
break;
case Qt::Key_Plus: {
if (e->modifiers() & Qt::ControlModifier) if (e->modifiers() & Qt::ControlModifier)
zoom(1.15); zoom(1.15);
case Qt::Key_Up: }
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){ break;
case Qt::Key_Up: {
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e); scrollOnMovement(e);
} }
case Qt::Key_Down: break;
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){ case Qt::Key_Down: {
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e); scrollOnMovement(e);
} }
case Qt::Key_Left: break;
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){ case Qt::Key_Left: {
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e); scrollOnMovement(e);
} }
case Qt::Key_Right: break;
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){ case Qt::Key_Right: {
if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e); scrollOnMovement(e);
} }
break;
} }
switchToVisualisationModeIfNeeded(e); switchToVisualisationModeIfNeeded(e);
QGraphicsView::keyPressEvent(e); QGraphicsView::keyPressEvent(e);
} }