[qet] qet/qet: [5012] Minor : fix warning |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5012
Author: blacksun
Date: 2017-08-09 11:03:04 +0200 (Wed, 09 Aug 2017)
Log Message:
-----------
Minor : fix warning
Modified Paths:
--------------
trunk/sources/diagramview.cpp
Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp 2017-08-06 11:35:01 UTC (rev 5011)
+++ trunk/sources/diagramview.cpp 2017-08-09 09:03:04 UTC (rev 5012)
@@ -638,13 +638,18 @@
}
/**
- Handles "key press" events. Reimplemented here to switch to visualisation
- mode if needed.
-*/
-void DiagramView::keyPressEvent(QKeyEvent *e) {
- if (m_event_interface && m_event_interface->keyPressEvent(e)) return;
+ * @brief DiagramView::keyPressEvent
+ * Handles "key press" events. Reimplemented here to switch to visualisation
+ * mode if needed.
+ * @param e
+ */
+void DiagramView::keyPressEvent(QKeyEvent *e)
+{
+ if (m_event_interface && m_event_interface->keyPressEvent(e))
+ return;
+
ProjectView *current_project = this->diagramEditor()->acessCurrentProject();
-switch(e -> key())
+ switch(e -> key())
{
case Qt::Key_PageUp:
current_project->changeTabUp();
@@ -684,29 +689,38 @@
case Qt::Key_ZoomIn:
zoom(1.15);
return;
- case Qt::Key_Minus:
+ case Qt::Key_Minus: {
if (e->modifiers() & Qt::ControlModifier)
zoom(0.85);
- case Qt::Key_Plus:
+ }
+ break;
+ case Qt::Key_Plus: {
if (e->modifiers() & Qt::ControlModifier)
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);
- }
- case Qt::Key_Down:
- if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){
+ }
+ break;
+ case Qt::Key_Down: {
+ if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e);
- }
- case Qt::Key_Left:
- if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){
+ }
+ break;
+ case Qt::Key_Left: {
+ if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e);
- }
- case Qt::Key_Right:
- if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty())){
+ }
+ break;
+ case Qt::Key_Right: {
+ if(!(m_diagram->selectedContent().items(DiagramContent::All).isEmpty()))
scrollOnMovement(e);
- }
+ }
+ break;
}
+
switchToVisualisationModeIfNeeded(e);
QGraphicsView::keyPressEvent(e);
}