changeset 19623:6b2d7a5dc62a gui-release

use xevent instead of ev to avoid shadowed warnings
author John W. Eaton <jwe@octave.org>
date Fri, 23 Jan 2015 16:30:26 -0500
parents af0399a5aae0
children 9803fd881504 2f4406e9dad6
files libgui/graphics/BaseControl.cc libgui/graphics/Container.cc libgui/graphics/Figure.cc libgui/graphics/GLCanvas.cc libgui/graphics/Panel.cc libgui/graphics/TextEdit.cc libgui/graphics/ToolBar.cc
diffstat 7 files changed, 47 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/BaseControl.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/BaseControl.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -147,9 +147,9 @@
     }
 }
 
-bool BaseControl::eventFilter (QObject* watched, QEvent* ev)
+bool BaseControl::eventFilter (QObject* watched, QEvent* xevent)
 {
-  switch (ev->type ())
+  switch (xevent->type ())
     {
     case QEvent::Resize:
       if (m_normalizedFont)
@@ -164,7 +164,7 @@
         {
           gh_manager::auto_lock lock;
 
-          QMouseEvent* m = dynamic_cast<QMouseEvent*> (ev);
+          QMouseEvent* m = dynamic_cast<QMouseEvent*> (xevent);
           graphics_object go = object ();
           uicontrol::properties& up = Utils::properties<uicontrol> (go);
           graphics_object fig = go.get_ancestor ("figure");
@@ -200,7 +200,7 @@
         {
           gh_manager::auto_lock lock;
 
-          QMouseEvent* m = dynamic_cast<QMouseEvent*> (ev);
+          QMouseEvent* m = dynamic_cast<QMouseEvent*> (xevent);
           graphics_object go = object ();
           graphics_object fig = go.get_ancestor ("figure");
 
@@ -215,7 +215,7 @@
           gh_manager::auto_lock lock;
 
           octave_scalar_map keyData =
-            Utils::makeKeyEventStruct (dynamic_cast<QKeyEvent*> (ev));
+            Utils::makeKeyEventStruct (dynamic_cast<QKeyEvent*> (xevent));
           graphics_object fig = object ().get_ancestor ("figure");
 
           gh_manager::post_set (fig.get_handle (), "currentcharacter",
@@ -226,7 +226,7 @@
     default: break;
     }
 
-  return Object::eventFilter (watched, ev);
+  return Object::eventFilter (watched, xevent);
 }
 
 }; // namespace QtHandles
--- a/libgui/graphics/Container.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/Container.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -96,11 +96,11 @@
     }
 }
 
-void Container::childEvent (QChildEvent* ev)
+void Container::childEvent (QChildEvent* xevent)
 {
-  if (ev->child ()->isWidgetType ())
+  if (xevent->child ()->isWidgetType ())
     {
-      qobject_cast<QWidget*> (ev->child ())->setMouseTracking (hasMouseTracking ());
+      qobject_cast<QWidget*> (xevent->child ())->setMouseTracking (hasMouseTracking ());
     }
 }
 
--- a/libgui/graphics/Figure.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/Figure.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -493,7 +493,7 @@
   gh_manager::post_function (Figure::updateBoundingBoxHelper, d);
 }
 
-bool Figure::eventNotifyBefore (QObject* obj, QEvent* ev)
+bool Figure::eventNotifyBefore (QObject* obj, QEvent* xevent)
 {
   if (! m_blockUpdates)
     {
@@ -503,11 +503,11 @@
         }
       else if (obj == m_menuBar)
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::ActionRemoved:
                 {
-                  QAction* a = dynamic_cast<QActionEvent*> (ev)->action ();
+                  QAction* a = dynamic_cast<QActionEvent*> (xevent)->action ();
 
                   if (! a->isSeparator ()
                       && a->objectName () != "builtinMenu")
@@ -520,10 +520,10 @@
         }
       else
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::Close:
-              ev->ignore ();
+              xevent->ignore ();
               gh_manager::post_callback (m_handle, "closerequestfcn");
               return true;
             default:
@@ -535,19 +535,19 @@
   return false;
 }
 
-void Figure::eventNotifyAfter (QObject* watched, QEvent* ev)
+void Figure::eventNotifyAfter (QObject* watched, QEvent* xevent)
 {
   if (! m_blockUpdates)
     {
       if (watched == m_container)
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::Resize:
               updateBoundingBox (true, UpdateBoundingBoxSize);
               break;
             case QEvent::ChildAdded:
-              if (dynamic_cast<QChildEvent*> (ev)->child
+              if (dynamic_cast<QChildEvent*> (xevent)->child
                   ()->isWidgetType())
                 {
                   gh_manager::auto_lock lock;
@@ -561,11 +561,11 @@
         }
       else if (watched == m_menuBar)
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::ActionAdded:
                 {
-                  QAction* a = dynamic_cast<QActionEvent*> (ev)->action ();
+                  QAction* a = dynamic_cast<QActionEvent*> (xevent)->action ();
 
                   if (! a->isSeparator ()
                       && a->objectName () != "builtinMenu")
@@ -578,7 +578,7 @@
         }
       else
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::Move:
               updateBoundingBox (false, UpdateBoundingBoxPosition);
--- a/libgui/graphics/GLCanvas.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/GLCanvas.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -119,31 +119,31 @@
   canvasPaintEvent ();
 }
 
-void GLCanvas::mouseMoveEvent (QMouseEvent* ev)
+void GLCanvas::mouseMoveEvent (QMouseEvent* xevent)
 {
-  canvasMouseMoveEvent (ev);
+  canvasMouseMoveEvent (xevent);
 }
 
-void GLCanvas::mousePressEvent (QMouseEvent* ev)
+void GLCanvas::mousePressEvent (QMouseEvent* xevent)
 {
-  canvasMousePressEvent (ev);
+  canvasMousePressEvent (xevent);
 }
 
-void GLCanvas::mouseReleaseEvent (QMouseEvent* ev)
+void GLCanvas::mouseReleaseEvent (QMouseEvent* xevent)
 {
-  canvasMouseReleaseEvent (ev);
+  canvasMouseReleaseEvent (xevent);
 }
 
-void GLCanvas::keyPressEvent (QKeyEvent* ev)
+void GLCanvas::keyPressEvent (QKeyEvent* xevent)
 {
-  if (! canvasKeyPressEvent (ev))
-    QGLWidget::keyPressEvent (ev);
+  if (! canvasKeyPressEvent (xevent))
+    QGLWidget::keyPressEvent (xevent);
 }
 
-void GLCanvas::keyReleaseEvent (QKeyEvent* ev)
+void GLCanvas::keyReleaseEvent (QKeyEvent* xevent)
 {
-  if (! canvasKeyReleaseEvent (ev))
-    QGLWidget::keyReleaseEvent (ev);
+  if (! canvasKeyReleaseEvent (xevent))
+    QGLWidget::keyReleaseEvent (xevent);
 }
 
 }; // namespace QtHandles
--- a/libgui/graphics/Panel.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/Panel.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -144,13 +144,13 @@
 {
 }
 
-bool Panel::eventFilter (QObject* watched, QEvent* ev)
+bool Panel::eventFilter (QObject* watched, QEvent* xevent)
 {
   if (! m_blockUpdates)
     {
       if (watched == qObject ())
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::Resize:
                 {
@@ -179,7 +179,7 @@
               break;
             case QEvent::MouseButtonPress:
                 {
-                  QMouseEvent* m = dynamic_cast<QMouseEvent*> (ev);
+                  QMouseEvent* m = dynamic_cast<QMouseEvent*> (xevent);
 
                   if (m->button () == Qt::RightButton)
                     {
@@ -195,7 +195,7 @@
         }
       else if (watched == m_container)
         {
-          switch (ev->type ())
+          switch (xevent->type ())
             {
             case QEvent::Resize:
               if (qWidget<QWidget> ()->isVisible ())
--- a/libgui/graphics/TextEdit.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/TextEdit.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -31,20 +31,20 @@
 namespace QtHandles
 {
 
-void TextEdit::focusOutEvent (QFocusEvent* ev)
+void TextEdit::focusOutEvent (QFocusEvent* xevent)
 {
-  QTextEdit::focusOutEvent (ev);
+  QTextEdit::focusOutEvent (xevent);
 
   emit editingFinished ();
 }
 
-void TextEdit::keyPressEvent (QKeyEvent* ev)
+void TextEdit::keyPressEvent (QKeyEvent* xevent)
 {
-  QTextEdit::keyPressEvent (ev);
+  QTextEdit::keyPressEvent (xevent);
 
-  if ((ev->key () == Qt::Key_Return
-       || ev->key () == Qt::Key_Enter)
-      && ev->modifiers () == Qt::ControlModifier)
+  if ((xevent->key () == Qt::Key_Return
+       || xevent->key () == Qt::Key_Enter)
+      && xevent->modifiers () == Qt::ControlModifier)
     emit editingFinished ();
 }
 
--- a/libgui/graphics/ToolBar.cc	Fri Jan 23 16:24:46 2015 -0500
+++ b/libgui/graphics/ToolBar.cc	Fri Jan 23 16:30:26 2015 -0500
@@ -118,21 +118,21 @@
     }
 }
 
-bool ToolBar::eventFilter (QObject* watched, QEvent* ev)
+bool ToolBar::eventFilter (QObject* watched, QEvent* xevent)
 {
   if (watched == qObject ())
     {
-      switch (ev->type ())
+      switch (xevent->type ())
         {
         case QEvent::ActionAdded:
         case QEvent::ActionRemoved:
             {
-              QActionEvent* ae = dynamic_cast<QActionEvent*> (ev);
+              QActionEvent* ae = dynamic_cast<QActionEvent*> (xevent);
               QToolBar* bar = qWidget<QToolBar> ();
 
               if (ae->action () != m_empty)
                 {
-                  if (ev->type () == QEvent::ActionAdded)
+                  if (xevent->type () == QEvent::ActionAdded)
                     {
                       if (bar->actions ().size () == 2)
                         QTimer::singleShot (0, this, SLOT (hideEmpty (void)));