# HG changeset patch # User John W. Eaton # Date 1422048626 18000 # Node ID 6b2d7a5dc62af562c77660f898710f10c01baba6 # Parent af0399a5aae0bb815419d3bc2ac62abcea5e084d use xevent instead of ev to avoid shadowed warnings diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/BaseControl.cc --- 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 (ev); + 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 (ev); + 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 (ev)); + 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, ev); + return Object::eventFilter (watched, xevent); } }; // namespace QtHandles diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/Container.cc --- 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 (ev->child ())->setMouseTracking (hasMouseTracking ()); + qobject_cast (xevent->child ())->setMouseTracking (hasMouseTracking ()); } } diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/Figure.cc --- 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 (ev)->action (); + QAction* a = dynamic_cast (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 (ev)->child + if (dynamic_cast (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 (ev)->action (); + QAction* a = dynamic_cast (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); diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/GLCanvas.cc --- 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 diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/Panel.cc --- 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 (ev); + QMouseEvent* m = dynamic_cast (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 ()->isVisible ()) diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/TextEdit.cc --- 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 (); } diff -r af0399a5aae0 -r 6b2d7a5dc62a libgui/graphics/ToolBar.cc --- 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 (ev); + QActionEvent* ae = dynamic_cast (xevent); QToolBar* bar = qWidget (); 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)));