Mercurial > octave
comparison libgui/graphics/Menu.cc @ 31639:ca7d58406f82
eliminate unnecessary uses of octave_qobject in GUI classes
* BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h,
ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h,
Figure.cc, Figure.h, GLCanvas.cc, GLCanvas.h, ListBoxControl.cc,
ListBoxControl.h, Menu.cc, Menu.h, Object.cc, Object.h, Panel.cc,
Panel.h, PopupMenuControl.cc, PopupMenuControl.h,
PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h,
RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc,
SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h,
ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc,
ToggleTool.h, ToolBar.cc, ToolBar.h, ToolBarButton.cc,
ToolBarButton.h, annotation-dialog.cc, annotation-dialog.h,
qt-graphics-toolkit.cc, qt-graphics-toolkit.h, command-widget.h,
community-news.cc, community-news.h, documentation-bookmarks.cc,
documentation-bookmarks.h, documentation.cc,
external-editor-interface.cc, external-editor-interface.h,
find-files-dialog.cc, find-files-dialog.h, graphics-init.cc,
graphics-init.h, interpreter-qobject.cc, file-editor.cc,
find-dialog.cc, find-dialog.h, main-window.cc, main-window.h,
news-reader.cc, news-reader.h, octave-qobject.cc, release-notes.cc,
resource-manager.cc, set-path-dialog.cc, set-path-dialog.h,
shortcut-manager.cc, shortcut-manager.h, welcome-wizard.cc,
welcome-wizard.h, workspace-model.cc:
Don't store references to octave_qobject in GUI classes where it is
no longer needed. Eliminate unnecessary octave_qobject constructor
arguments. Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 04 Dec 2022 22:57:02 -0500 |
parents | fef2957c38ec |
children | 431f80aba37a |
comparison
equal
deleted
inserted
replaced
31638:474e184321d3 | 31639:ca7d58406f82 |
---|---|
33 #include <QMenuBar> | 33 #include <QMenuBar> |
34 | 34 |
35 #include "Figure.h" | 35 #include "Figure.h" |
36 #include "Menu.h" | 36 #include "Menu.h" |
37 #include "QtHandlesUtils.h" | 37 #include "QtHandlesUtils.h" |
38 | |
39 #include "octave-qobject.h" | |
40 | 38 |
41 namespace octave | 39 namespace octave |
42 { | 40 { |
43 | 41 |
44 static QKeySequence | 42 static QKeySequence |
61 | 59 |
62 return QKeySequence (); | 60 return QKeySequence (); |
63 } | 61 } |
64 | 62 |
65 Menu * | 63 Menu * |
66 Menu::create (octave::base_qobject& oct_qobj, octave::interpreter& interp, | 64 Menu::create (octave::interpreter& interp, |
67 const graphics_object& go) | 65 const graphics_object& go) |
68 { | 66 { |
69 Object *parent_obj = parentObject (interp, go); | 67 Object *parent_obj = parentObject (interp, go); |
70 | 68 |
71 if (parent_obj) | 69 if (parent_obj) |
72 { | 70 { |
73 QObject *qObj = parent_obj->qObject (); | 71 QObject *qObj = parent_obj->qObject (); |
74 | 72 |
75 if (qObj) | 73 if (qObj) |
76 return new Menu (oct_qobj, interp, go, new QAction (qObj), | 74 return new Menu (interp, go, new QAction (qObj), |
77 parent_obj); | 75 parent_obj); |
78 } | 76 } |
79 | 77 |
80 return nullptr; | 78 return nullptr; |
81 } | 79 } |
82 | 80 |
83 Menu::Menu (octave::base_qobject& oct_qobj, octave::interpreter& interp, | 81 Menu::Menu (octave::interpreter& interp, |
84 const graphics_object& go, QAction *action, Object *xparent) | 82 const graphics_object& go, QAction *action, Object *xparent) |
85 : Object (oct_qobj, interp, go, action), m_parent (nullptr), | 83 : Object (interp, go, action), m_parent (nullptr), |
86 m_separator (nullptr) | 84 m_separator (nullptr) |
87 { | 85 { |
88 uimenu::properties& up = properties<uimenu> (); | 86 uimenu::properties& up = properties<uimenu> (); |
89 | 87 |
90 action->setText (Utils::fromStdString (up.get_text ())); | 88 action->setText (Utils::fromStdString (up.get_text ())); |