# HG changeset patch # User John W. Eaton # Date 1405607244 14400 # Node ID dbb207d10d7c91bd2c8caf34ec61f3fa1cd47a31 # Parent f1edad3b410619da3b1a14f7b16179089933693b 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. diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/BaseControl.cc --- 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 (event); + QMouseEvent* m = dynamic_cast (xevent); graphics_object go = object (); uicontrol::properties& up = Utils::properties (go); graphics_object fig = go.get_ancestor ("figure"); @@ -200,7 +200,7 @@ { gh_manager::auto_lock lock; - QMouseEvent* m = dynamic_cast (event); + QMouseEvent* m = dynamic_cast (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 (event)); + Utils::makeKeyEventStruct (dynamic_cast (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 diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/Container.cc --- 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 (event->child ())->setMouseTracking (hasMouseTracking ()); + qobject_cast (xevent->child ())->setMouseTracking (hasMouseTracking ()); } } diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/ContextMenu.cc --- 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* w = xparent->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 (); - QMenu* menu = qWidget (); + QMenu* xmenu = qWidget (); 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); diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/Figure.cc --- 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 (event)->action (); + QAction* a = dynamic_cast (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 (event)->child + if (dynamic_cast (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 (event)->action (); + QAction* a = dynamic_cast (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); diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/FigureWindow.cc --- 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) { } diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/GLCanvas.cc --- 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 diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/GenericEventNotify.h --- 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) \ diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/Menu.cc --- 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 (); @@ -92,7 +92,7 @@ m_separator->setVisible (up.is_visible ()); } - MenuContainer* menuContainer = dynamic_cast (parent); + MenuContainer* menuContainer = dynamic_cast (xparent); if (menuContainer) m_parent = menuContainer->menu (); diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/MouseModeActionGroup.cc --- 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)); diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/Panel.cc --- 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 (event); + QMouseEvent* m = dynamic_cast (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 ()->isVisible ()) diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/TextEdit.cc --- 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 (); } diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/TextEdit.h --- 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: diff -r f1edad3b4106 -r dbb207d10d7c libgui/graphics/ToolBar.cc --- 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 (event); + QActionEvent* ae = dynamic_cast (xevent); QToolBar* bar = qWidget (); 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)));