# HG changeset patch # User John W. Eaton # Date 1620064106 14400 # Node ID c7b104ebed4d901fda0bf5c61af00179e1a5315b # Parent 07591becbc404e31861492252aba6db2fd0db92f eliminate octave_dock_widget::main_win function * variable-editor.cc (variable_editor::tab_to_front): Use parentWidget instad of calling main_win. * octave_dock_widget.h (octave_dock_widget::main_win): Delete. diff -r 07591becbc40 -r c7b104ebed4d libgui/src/octave-dock-widget.h --- a/libgui/src/octave-dock-widget.h Mon May 03 13:30:29 2021 -0400 +++ b/libgui/src/octave-dock-widget.h Mon May 03 13:48:26 2021 -0400 @@ -130,8 +130,6 @@ void handle_active_dock_changed (octave_dock_widget*, octave_dock_widget*); - QMainWindow * main_win (void) { return m_parent; } - void save_settings (void); void moveEvent (QMoveEvent *event); @@ -179,7 +177,6 @@ QRect m_recent_float_geom; QRect m_recent_dock_geom; bool m_waiting_for_mouse_button_release; - }; } diff -r 07591becbc40 -r c7b104ebed4d libgui/src/variable-editor.cc --- a/libgui/src/variable-editor.cc Mon May 03 13:30:29 2021 -0400 +++ b/libgui/src/variable-editor.cc Mon May 03 13:48:26 2021 -0400 @@ -1362,18 +1362,25 @@ void variable_editor::tab_to_front (void) { - if (parent () != nullptr) + QWidget *parent = parentWidget (); + + if (parent) { - QList barlist = main_win ()->findChildren (); + QList barlist = parent->findChildren (); + QVariant this_value (reinterpret_cast (this)); for (auto *tbar : barlist) - for (int i = 0; i < tbar->count (); i++) - if (tbar->tabData (i) == this_value) + { + for (int i = 0; i < tbar->count (); i++) { - tbar->setCurrentIndex (i); - return; + if (tbar->tabData (i) == this_value) + { + tbar->setCurrentIndex (i); + return; + } } + } } }