changeset 19650:709f3a77685d gui-release

avoid shadowed variable warnings in libgui sources * BaseControl.cc, BaseControl.h, Container.cc, ContextMenu.cc, Figure.cc, FigureWindow.cc, GLCanvas.cc, GenericEventNotify.h, Menu.cc, MouseModeActionGroup.cc, Panel.cc, TextEdit.cc, TextEdit.h, ToolBar.cc: Rename local variables to avoid shadowing class members or functions.
author John W. Eaton <jwe@octave.org>
date Fri, 23 Jan 2015 14:53:10 -0500
parents 4c1f638a381e
children 844448ae53f3
files libgui/graphics/BaseControl.cc libgui/graphics/BaseControl.h 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 14 files changed, 79 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/BaseControl.cc	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/BaseControl.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -147,9 +147,9 @@
     }
 }
 
-bool BaseControl::eventFilter (QObject* watched, QEvent* event)
+bool BaseControl::eventFilter (QObject* watched, QEvent* ev)
 {
-  switch (event->type ())
+  switch (ev->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*> (ev);
 	  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*> (ev);
 	  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*> (ev));
           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, ev);
 }
 
 }; // namespace QtHandles
--- a/libgui/graphics/BaseControl.h	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/BaseControl.h	Fri Jan 23 14:53:10 2015 -0500
@@ -39,7 +39,7 @@
 
   Container* innerContainer (void) { return 0; }
 
-  bool eventFilter (QObject* watched, QEvent* event);
+  bool eventFilter (QObject* watched, QEvent* e);
 
 protected:
   void init (QWidget* w, bool callBase = false);
--- a/libgui/graphics/Container.cc	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/Container.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -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& gh, 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 (gh);
 
       if (go)
 	{
 	  graphics_object fig = go.get_ancestor ("figure");
 
 	  m_canvas = Canvas::create (fig.get("renderer").string_value (),
-				     this, handle);
+				     this, gh);
 
 	  QWidget* canvasWidget = m_canvas->qWidget ();
 
@@ -96,11 +96,11 @@
     }
 }
 
-void Container::childEvent (QChildEvent* event)
+void Container::childEvent (QChildEvent* ev)
 {
-  if (event->child ()->isWidgetType ())
+  if (ev->child ()->isWidgetType ())
     {
-      qobject_cast<QWidget*> (event->child ())->setMouseTracking (hasMouseTracking ());
+      qobject_cast<QWidget*> (ev->child ())->setMouseTracking (hasMouseTracking ());
     }
 }
 
--- a/libgui/graphics/ContextMenu.cc	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/ContextMenu.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -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	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/Figure.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -493,7 +493,7 @@
   gh_manager::post_function (Figure::updateBoundingBoxHelper, d);
 }
 
-bool Figure::eventNotifyBefore (QObject* obj, QEvent* event)
+bool Figure::eventNotifyBefore (QObject* obj, QEvent* ev)
 {
   if (! m_blockUpdates)
     {
@@ -503,11 +503,11 @@
 	}
       else if (obj == m_menuBar)
 	{
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::ActionRemoved:
 		{
-		  QAction* a = dynamic_cast<QActionEvent*> (event)->action ();
+		  QAction* a = dynamic_cast<QActionEvent*> (ev)->action ();
 
 		  if (! a->isSeparator ()
 		      && a->objectName () != "builtinMenu")
@@ -520,10 +520,10 @@
 	}
       else
 	{
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::Close:
-	      event->ignore ();
+	      ev->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* ev)
 {
   if (! m_blockUpdates)
     {
       if (watched == m_container)
         {
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::Resize:
 	      updateBoundingBox (true, UpdateBoundingBoxSize);
 	      break;
 	    case QEvent::ChildAdded:
-	      if (dynamic_cast<QChildEvent*> (event)->child
+	      if (dynamic_cast<QChildEvent*> (ev)->child
 		  ()->isWidgetType())
 		{
 		  gh_manager::auto_lock lock;
@@ -561,11 +561,11 @@
         }
       else if (watched == m_menuBar)
         {
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::ActionAdded:
 		{
-		  QAction* a = dynamic_cast<QActionEvent*> (event)->action ();
+		  QAction* a = dynamic_cast<QActionEvent*> (ev)->action ();
 
 		  if (! a->isSeparator ()
                       && a->objectName () != "builtinMenu")
@@ -578,7 +578,7 @@
         }
       else
         {
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::Move:
 	      updateBoundingBox (false, UpdateBoundingBoxPosition);
--- a/libgui/graphics/FigureWindow.cc	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/FigureWindow.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -31,8 +31,8 @@
 namespace QtHandles
 {
 
-FigureWindow::FigureWindow (QWidget* parent)
-  : FigureWindowBase (parent)
+FigureWindow::FigureWindow (QWidget* xparent)
+  : FigureWindowBase (xparent)
 {
 }
 
--- a/libgui/graphics/GLCanvas.cc	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/GLCanvas.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -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& gh)
+  : QGLWidget (xparent), Canvas (gh)
 {
   setFocusPolicy (Qt::ClickFocus);
 }
@@ -47,9 +47,9 @@
 {
 }
 
-void GLCanvas::draw (const graphics_handle& handle)
+void GLCanvas::draw (const graphics_handle& gh)
 {
-  graphics_object go = gh_manager::get_object (handle);
+  graphics_object go = gh_manager::get_object (gh);
 
   if (go)
     {
@@ -119,31 +119,31 @@
   canvasPaintEvent ();
 }
 
-void GLCanvas::mouseMoveEvent (QMouseEvent* event)
+void GLCanvas::mouseMoveEvent (QMouseEvent* ev)
 {
-  canvasMouseMoveEvent (event);
+  canvasMouseMoveEvent (ev);
 }
 
-void GLCanvas::mousePressEvent (QMouseEvent* event)
+void GLCanvas::mousePressEvent (QMouseEvent* ev)
 {
-  canvasMousePressEvent (event);
+  canvasMousePressEvent (ev);
 }
 
-void GLCanvas::mouseReleaseEvent (QMouseEvent* event)
+void GLCanvas::mouseReleaseEvent (QMouseEvent* ev)
 {
-  canvasMouseReleaseEvent (event);
+  canvasMouseReleaseEvent (ev);
 }
 
-void GLCanvas::keyPressEvent (QKeyEvent* event)
+void GLCanvas::keyPressEvent (QKeyEvent* ev)
 {
-  if (! canvasKeyPressEvent (event))
-    QGLWidget::keyPressEvent (event);
+  if (! canvasKeyPressEvent (ev))
+    QGLWidget::keyPressEvent (ev);
 }
 
-void GLCanvas::keyReleaseEvent (QKeyEvent* event)
+void GLCanvas::keyReleaseEvent (QKeyEvent* ev)
 {
-  if (! canvasKeyReleaseEvent (event))
-    QGLWidget::keyReleaseEvent (event);
+  if (! canvasKeyReleaseEvent (ev))
+    QGLWidget::keyReleaseEvent (ev);
 }
 
 }; // namespace QtHandles
--- a/libgui/graphics/GenericEventNotify.h	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/GenericEventNotify.h	Fri Jan 23 14:53:10 2015 -0500
@@ -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	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/Menu.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -58,20 +58,20 @@
 
 Menu* Menu::create (const graphics_object& go)
 {
-  Object* parent = Object::parentObject (go);
+  Object* parent_obj = Object::parentObject (go);
 
-  if (parent)
+  if (parent_obj)
     {
-      QObject* qObj = parent->qObject ();
+      QObject* qObj = parent_obj->qObject ();
 
       if (qObj)
-	return new Menu (go, new QAction (qObj), parent);
+	return new Menu (go, new QAction (qObj), parent_obj);
     }
 
   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	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/MouseModeActionGroup.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -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	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/Panel.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -144,13 +144,13 @@
 {
 }
 
-bool Panel::eventFilter (QObject* watched, QEvent* event)
+bool Panel::eventFilter (QObject* watched, QEvent* ev)
 {
   if (! m_blockUpdates)
     {
       if (watched == qObject ())
 	{
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::Resize:
 		{
@@ -179,7 +179,7 @@
 	      break;
 	    case QEvent::MouseButtonPress:
 		{
-		  QMouseEvent* m = dynamic_cast<QMouseEvent*> (event);
+		  QMouseEvent* m = dynamic_cast<QMouseEvent*> (ev);
 
 		  if (m->button () == Qt::RightButton)
 		    {
@@ -195,7 +195,7 @@
 	}
       else if (watched == m_container)
 	{
-	  switch (event->type ())
+	  switch (ev->type ())
 	    {
 	    case QEvent::Resize:
 	      if (qWidget<QWidget> ()->isVisible ())
--- a/libgui/graphics/TextEdit.cc	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/TextEdit.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -31,20 +31,20 @@
 namespace QtHandles
 {
 
-void TextEdit::focusOutEvent (QFocusEvent* event)
+void TextEdit::focusOutEvent (QFocusEvent* ev)
 {
-  QTextEdit::focusOutEvent (event);
+  QTextEdit::focusOutEvent (ev);
 
   emit editingFinished ();
 }
 
-void TextEdit::keyPressEvent (QKeyEvent* event)
+void TextEdit::keyPressEvent (QKeyEvent* ev)
 {
-  QTextEdit::keyPressEvent (event);
+  QTextEdit::keyPressEvent (ev);
 
-  if ((event->key () == Qt::Key_Return
-       || event->key () == Qt::Key_Enter)
-      && event->modifiers () == Qt::ControlModifier)
+  if ((ev->key () == Qt::Key_Return
+       || ev->key () == Qt::Key_Enter)
+      && ev->modifiers () == Qt::ControlModifier)
     emit editingFinished ();
 }
 
--- a/libgui/graphics/TextEdit.h	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/TextEdit.h	Fri Jan 23 14:53:10 2015 -0500
@@ -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	Fri Jan 23 14:37:43 2015 -0500
+++ b/libgui/graphics/ToolBar.cc	Fri Jan 23 14:53:10 2015 -0500
@@ -118,21 +118,21 @@
     }
 }
 
-bool ToolBar::eventFilter (QObject* watched, QEvent* event)
+bool ToolBar::eventFilter (QObject* watched, QEvent* ev)
 {
   if (watched == qObject ())
     {
-      switch (event->type ())
+      switch (ev->type ())
 	{
 	case QEvent::ActionAdded:
 	case QEvent::ActionRemoved:
 	    {
-	      QActionEvent* ae = dynamic_cast<QActionEvent*> (event);
+	      QActionEvent* ae = dynamic_cast<QActionEvent*> (ev);
 	      QToolBar* bar = qWidget<QToolBar> ();
 
 	      if (ae->action () != m_empty)
 		{
-		  if (event->type () == QEvent::ActionAdded)
+		  if (ev->type () == QEvent::ActionAdded)
 		    {
 		      if (bar->actions ().size () == 2)
 			QTimer::singleShot (0, this, SLOT (hideEmpty (void)));