changeset 18931:dbb207d10d7c

eliminate some shadowed variable declaration warnings * BaseControl.cc, Container.cc, ContextMenu.cc, Figure.cc, FigureWindow.cc, GLCanvas.cc, GenericEventNotify.h, Menu.cc, MouseModeActionGroup.cc, Panel.cc, TextEdit.cc, TextEdit.h, ToolBar.cc: Avoid shadowed variable declaration warnings.
author John W. Eaton <jwe@octave.org>
date Thu, 17 Jul 2014 10:27:24 -0400
parents f1edad3b4106
children edc4791fbcb2
files libgui/graphics/BaseControl.cc libgui/graphics/Container.cc libgui/graphics/ContextMenu.cc libgui/graphics/Figure.cc libgui/graphics/FigureWindow.cc libgui/graphics/GLCanvas.cc libgui/graphics/GenericEventNotify.h libgui/graphics/Menu.cc libgui/graphics/MouseModeActionGroup.cc libgui/graphics/Panel.cc libgui/graphics/TextEdit.cc libgui/graphics/TextEdit.h libgui/graphics/ToolBar.cc
diffstat 13 files changed, 77 insertions(+), 77 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/BaseControl.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/BaseControl.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -147,9 +147,9 @@
     }
 }
 
-bool BaseControl::eventFilter (QObject* watched, QEvent* event)
+bool BaseControl::eventFilter (QObject* watched, QEvent* xevent)
 {
-  switch (event->type ())
+  switch (xevent->type ())
     {
     case QEvent::Resize:
       if (m_normalizedFont)
@@ -164,7 +164,7 @@
         {
           gh_manager::auto_lock lock;
 
-          QMouseEvent* m = dynamic_cast<QMouseEvent*> (event);
+          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*> (event);
+          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*> (event));
+            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, event);
+  return Object::eventFilter (watched, xevent);
 }
 
 }; // namespace QtHandles
--- a/libgui/graphics/Container.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/Container.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -37,8 +37,8 @@
 namespace QtHandles
 {
 
-Container::Container (QWidget* parent)
-  : ContainerBase (parent), m_canvas (0)
+Container::Container (QWidget* xparent)
+  : ContainerBase (xparent), m_canvas (0)
 {
   setFocusPolicy (Qt::ClickFocus);
 }
@@ -47,18 +47,18 @@
 {
 }
 
-Canvas* Container::canvas (const graphics_handle& handle, bool create)
+Canvas* Container::canvas (const graphics_handle& xhandle, bool xcreate)
 {
-  if (! m_canvas && create)
+  if (! m_canvas && xcreate)
     {
-      graphics_object go = gh_manager::get_object (handle);
+      graphics_object go = gh_manager::get_object (xhandle);
 
       if (go)
         {
           graphics_object fig = go.get_ancestor ("figure");
 
           m_canvas = Canvas::create (fig.get("renderer").string_value (),
-                                     this, handle);
+                                     this, xhandle);
 
           QWidget* canvasWidget = m_canvas->qWidget ();
 
@@ -96,11 +96,11 @@
     }
 }
 
-void Container::childEvent (QChildEvent* event)
+void Container::childEvent (QChildEvent* xevent)
 {
-  if (event->child ()->isWidgetType ())
+  if (xevent->child ()->isWidgetType ())
     {
-      qobject_cast<QWidget*> (event->child ())->setMouseTracking (hasMouseTracking ());
+      qobject_cast<QWidget*> (xevent->child ())->setMouseTracking (hasMouseTracking ());
     }
 }
 
--- a/libgui/graphics/ContextMenu.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/ContextMenu.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -35,11 +35,11 @@
 
 ContextMenu* ContextMenu::create (const graphics_object& go)
 {
-  Object* parent = Object::parentObject (go);
+  Object* xparent = Object::parentObject (go);
 
-  if (parent)
+  if (xparent)
     {
-      QWidget* w = parent->qWidget<QWidget> ();
+      QWidget* w = xparent->qWidget<QWidget> ();
 
       return new ContextMenu (go, new QMenu (w));
     }
@@ -47,13 +47,13 @@
   return 0;
 }
 
-ContextMenu::ContextMenu (const graphics_object& go, QMenu* menu)
-    : Object (go, menu)
+ContextMenu::ContextMenu (const graphics_object& go, QMenu* xmenu)
+    : Object (go, xmenu)
 {
-  menu->setAutoFillBackground (true);
+  xmenu->setAutoFillBackground (true);
 
-  connect (menu, SIGNAL (aboutToShow (void)), SLOT (aboutToShow (void)));
-  connect (menu, SIGNAL (aboutToHide (void)), SLOT (aboutToHide (void)));
+  connect (xmenu, SIGNAL (aboutToShow (void)), SLOT (aboutToShow (void)));
+  connect (xmenu, SIGNAL (aboutToHide (void)), SLOT (aboutToHide (void)));
 }
 
 ContextMenu::~ContextMenu (void)
@@ -63,7 +63,7 @@
 void ContextMenu::update (int pId)
 {
   uicontextmenu::properties& up = properties<uicontextmenu> ();
-  QMenu* menu = qWidget<QMenu> ();
+  QMenu* xmenu = qWidget<QMenu> ();
 
   switch (pId)
     {
@@ -71,17 +71,17 @@
       if (up.is_visible ())
         {
           Matrix pos = up.get_position ().matrix_value ();
-          QWidget* parentW = menu->parentWidget ();
+          QWidget* parentW = xmenu->parentWidget ();
           QPoint pt;
 
           pt.rx () = xround (pos(0));
           pt.ry () = parentW->height () - xround (pos(1));
           pt = parentW->mapToGlobal (pt);
 
-          menu->popup (pt);
+          xmenu->popup (pt);
         }
       else
-        menu->hide ();
+        xmenu->hide ();
       break;
     default:
       Object::update (pId);
--- a/libgui/graphics/Figure.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/Figure.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -493,7 +493,7 @@
   gh_manager::post_function (Figure::updateBoundingBoxHelper, d);
 }
 
-bool Figure::eventNotifyBefore (QObject* obj, QEvent* event)
+bool Figure::eventNotifyBefore (QObject* obj, QEvent* xevent)
 {
   if (! m_blockUpdates)
     {
@@ -503,11 +503,11 @@
         }
       else if (obj == m_menuBar)
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::ActionRemoved:
                 {
-                  QAction* a = dynamic_cast<QActionEvent*> (event)->action ();
+                  QAction* a = dynamic_cast<QActionEvent*> (xevent)->action ();
 
                   if (! a->isSeparator ()
                       && a->objectName () != "builtinMenu")
@@ -520,10 +520,10 @@
         }
       else
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::Close:
-              event->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* event)
+void Figure::eventNotifyAfter (QObject* watched, QEvent* xevent)
 {
   if (! m_blockUpdates)
     {
       if (watched == m_container)
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::Resize:
               updateBoundingBox (true, UpdateBoundingBoxSize);
               break;
             case QEvent::ChildAdded:
-              if (dynamic_cast<QChildEvent*> (event)->child
+              if (dynamic_cast<QChildEvent*> (xevent)->child
                   ()->isWidgetType())
                 {
                   gh_manager::auto_lock lock;
@@ -561,11 +561,11 @@
         }
       else if (watched == m_menuBar)
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::ActionAdded:
                 {
-                  QAction* a = dynamic_cast<QActionEvent*> (event)->action ();
+                  QAction* a = dynamic_cast<QActionEvent*> (xevent)->action ();
 
                   if (! a->isSeparator ()
                       && a->objectName () != "builtinMenu")
@@ -578,7 +578,7 @@
         }
       else
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::Move:
               updateBoundingBox (false, UpdateBoundingBoxPosition);
--- a/libgui/graphics/FigureWindow.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/FigureWindow.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -31,8 +31,8 @@
 namespace QtHandles
 {
 
-FigureWindow::FigureWindow (QWidget* parent)
-  : FigureWindowBase (parent)
+FigureWindow::FigureWindow (QWidget* xparent)
+  : FigureWindowBase (xparent)
 {
 }
 
--- a/libgui/graphics/GLCanvas.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/GLCanvas.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -37,8 +37,8 @@
 namespace QtHandles
 {
 
-GLCanvas::GLCanvas (QWidget* parent, const graphics_handle& handle)
-  : QGLWidget (parent), Canvas (handle)
+GLCanvas::GLCanvas (QWidget* xparent, const graphics_handle& xhandle)
+  : QGLWidget (xparent), Canvas (xhandle)
 {
   setFocusPolicy (Qt::ClickFocus);
 }
@@ -47,9 +47,9 @@
 {
 }
 
-void GLCanvas::draw (const graphics_handle& handle)
+void GLCanvas::draw (const graphics_handle& xhandle)
 {
-  graphics_object go = gh_manager::get_object (handle);
+  graphics_object go = gh_manager::get_object (xhandle);
 
   if (go)
     {
@@ -119,31 +119,31 @@
   canvasPaintEvent ();
 }
 
-void GLCanvas::mouseMoveEvent (QMouseEvent* event)
+void GLCanvas::mouseMoveEvent (QMouseEvent* xevent)
 {
-  canvasMouseMoveEvent (event);
+  canvasMouseMoveEvent (xevent);
 }
 
-void GLCanvas::mousePressEvent (QMouseEvent* event)
+void GLCanvas::mousePressEvent (QMouseEvent* xevent)
 {
-  canvasMousePressEvent (event);
+  canvasMousePressEvent (xevent);
 }
 
-void GLCanvas::mouseReleaseEvent (QMouseEvent* event)
+void GLCanvas::mouseReleaseEvent (QMouseEvent* xevent)
 {
-  canvasMouseReleaseEvent (event);
+  canvasMouseReleaseEvent (xevent);
 }
 
-void GLCanvas::keyPressEvent (QKeyEvent* event)
+void GLCanvas::keyPressEvent (QKeyEvent* xevent)
 {
-  if (! canvasKeyPressEvent (event))
-    QGLWidget::keyPressEvent (event);
+  if (! canvasKeyPressEvent (xevent))
+    QGLWidget::keyPressEvent (xevent);
 }
 
-void GLCanvas::keyReleaseEvent (QKeyEvent* event)
+void GLCanvas::keyReleaseEvent (QKeyEvent* xevent)
 {
-  if (! canvasKeyReleaseEvent (event))
-    QGLWidget::keyReleaseEvent (event);
+  if (! canvasKeyReleaseEvent (xevent))
+    QGLWidget::keyReleaseEvent (xevent);
 }
 
 }; // namespace QtHandles
--- a/libgui/graphics/GenericEventNotify.h	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/GenericEventNotify.h	Thu Jul 17 10:27:24 2014 -0400
@@ -86,7 +86,7 @@
 class T : public B, public GenericEventNotifySender \
 { \
 public: \
-  T (QWidget* parent) : B (parent), GenericEventNotifySender () { } \
+  T (QWidget* xparent) : B (xparent), GenericEventNotifySender () { } \
   ~ T (void) { } \
 \
   bool event (QEvent* evt) \
--- a/libgui/graphics/Menu.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/Menu.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -71,7 +71,7 @@
   return 0;
 }
 
-Menu::Menu (const graphics_object& go, QAction* action, Object* parent)
+Menu::Menu (const graphics_object& go, QAction* action, Object* xparent)
     : Object (go, action), m_parent (0), m_separator (0)
 {
   uimenu::properties& up = properties<uimenu> ();
@@ -92,7 +92,7 @@
       m_separator->setVisible (up.is_visible ());
     }
 
-  MenuContainer* menuContainer = dynamic_cast<MenuContainer*> (parent);
+  MenuContainer* menuContainer = dynamic_cast<MenuContainer*> (xparent);
 
   if (menuContainer)
     m_parent = menuContainer->menu ();
--- a/libgui/graphics/MouseModeActionGroup.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/MouseModeActionGroup.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -33,8 +33,8 @@
 namespace QtHandles
 {
 
-MouseModeActionGroup::MouseModeActionGroup (QObject* parent)
-  : QObject (parent), m_current (0)
+MouseModeActionGroup::MouseModeActionGroup (QObject* xparent)
+  : QObject (xparent), m_current (0)
 {
   m_actions.append (new QAction (QIcon (":/images/rotate.png"),
                                  tr ("Rotate"), this));
--- a/libgui/graphics/Panel.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/Panel.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -144,13 +144,13 @@
 {
 }
 
-bool Panel::eventFilter (QObject* watched, QEvent* event)
+bool Panel::eventFilter (QObject* watched, QEvent* xevent)
 {
   if (! m_blockUpdates)
     {
       if (watched == qObject ())
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::Resize:
                 {
@@ -179,7 +179,7 @@
               break;
             case QEvent::MouseButtonPress:
                 {
-                  QMouseEvent* m = dynamic_cast<QMouseEvent*> (event);
+                  QMouseEvent* m = dynamic_cast<QMouseEvent*> (xevent);
 
                   if (m->button () == Qt::RightButton)
                     {
@@ -195,7 +195,7 @@
         }
       else if (watched == m_container)
         {
-          switch (event->type ())
+          switch (xevent->type ())
             {
             case QEvent::Resize:
               if (qWidget<QWidget> ()->isVisible ())
--- a/libgui/graphics/TextEdit.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/TextEdit.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -31,20 +31,20 @@
 namespace QtHandles
 {
 
-void TextEdit::focusOutEvent (QFocusEvent* event)
+void TextEdit::focusOutEvent (QFocusEvent* xevent)
 {
-  QTextEdit::focusOutEvent (event);
+  QTextEdit::focusOutEvent (xevent);
 
   emit editingFinished ();
 }
 
-void TextEdit::keyPressEvent (QKeyEvent* event)
+void TextEdit::keyPressEvent (QKeyEvent* xevent)
 {
-  QTextEdit::keyPressEvent (event);
+  QTextEdit::keyPressEvent (xevent);
 
-  if ((event->key () == Qt::Key_Return
-       || event->key () == Qt::Key_Enter)
-      && event->modifiers () == Qt::ControlModifier)
+  if ((xevent->key () == Qt::Key_Return
+       || xevent->key () == Qt::Key_Enter)
+      && xevent->modifiers () == Qt::ControlModifier)
     emit editingFinished ();
 }
 
--- a/libgui/graphics/TextEdit.h	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/TextEdit.h	Thu Jul 17 10:27:24 2014 -0400
@@ -33,7 +33,7 @@
   Q_OBJECT
 
 public:
-  TextEdit (QWidget* parent) : QTextEdit(parent) { }
+  TextEdit (QWidget* xparent) : QTextEdit (xparent) { }
   ~TextEdit (void) { }
 
 signals:
--- a/libgui/graphics/ToolBar.cc	Thu Jul 17 09:33:27 2014 -0400
+++ b/libgui/graphics/ToolBar.cc	Thu Jul 17 10:27:24 2014 -0400
@@ -118,21 +118,21 @@
     }
 }
 
-bool ToolBar::eventFilter (QObject* watched, QEvent* event)
+bool ToolBar::eventFilter (QObject* watched, QEvent* xevent)
 {
   if (watched == qObject ())
     {
-      switch (event->type ())
+      switch (xevent->type ())
         {
         case QEvent::ActionAdded:
         case QEvent::ActionRemoved:
             {
-              QActionEvent* ae = dynamic_cast<QActionEvent*> (event);
+              QActionEvent* ae = dynamic_cast<QActionEvent*> (xevent);
               QToolBar* bar = qWidget<QToolBar> ();
 
               if (ae->action () != m_empty)
                 {
-                  if (event->type () == QEvent::ActionAdded)
+                  if (xevent->type () == QEvent::ActionAdded)
                     {
                       if (bar->actions ().size () == 2)
                         QTimer::singleShot (0, this, SLOT (hideEmpty (void)));