Mercurial > octave
comparison libgui/graphics/ContextMenu.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 | 796f54d4ddbf |
children | 431f80aba37a |
comparison
equal
deleted
inserted
replaced
31638:474e184321d3 | 31639:ca7d58406f82 |
---|---|
31 | 31 |
32 #include "ContextMenu.h" | 32 #include "ContextMenu.h" |
33 #include "QtHandlesUtils.h" | 33 #include "QtHandlesUtils.h" |
34 #include "qt-graphics-toolkit.h" | 34 #include "qt-graphics-toolkit.h" |
35 | 35 |
36 #include "octave-qobject.h" | |
37 | |
38 #include "interpreter.h" | 36 #include "interpreter.h" |
39 | 37 |
40 namespace octave | 38 namespace octave |
41 { | 39 { |
42 | 40 |
43 ContextMenu * | 41 ContextMenu * |
44 ContextMenu::create (octave::base_qobject& oct_qobj, | 42 ContextMenu::create (octave::interpreter& interp, const graphics_object& go) |
45 octave::interpreter& interp, const graphics_object& go) | |
46 { | 43 { |
47 Object *xparent = parentObject (interp, go); | 44 Object *xparent = parentObject (interp, go); |
48 | 45 |
49 if (xparent) | 46 if (xparent) |
50 { | 47 { |
51 QWidget *w = xparent->qWidget<QWidget> (); | 48 QWidget *w = xparent->qWidget<QWidget> (); |
52 | 49 |
53 return new ContextMenu (oct_qobj, interp, go, new QMenu (w)); | 50 return new ContextMenu (interp, go, new QMenu (w)); |
54 } | 51 } |
55 | 52 |
56 return nullptr; | 53 return nullptr; |
57 } | 54 } |
58 | 55 |
59 ContextMenu::ContextMenu (octave::base_qobject& oct_qobj, | 56 ContextMenu::ContextMenu (octave::interpreter& interp, |
60 octave::interpreter& interp, | |
61 const graphics_object& go, QMenu *xmenu) | 57 const graphics_object& go, QMenu *xmenu) |
62 : Object (oct_qobj, interp, go, xmenu) | 58 : Object (interp, go, xmenu) |
63 { | 59 { |
64 xmenu->setAutoFillBackground (true); | 60 xmenu->setAutoFillBackground (true); |
65 | 61 |
66 connect (xmenu, &QMenu::aboutToShow, this, &ContextMenu::aboutToShow); | 62 connect (xmenu, &QMenu::aboutToShow, this, &ContextMenu::aboutToShow); |
67 connect (xmenu, &QMenu::aboutToHide, this, &ContextMenu::aboutToHide); | 63 connect (xmenu, &QMenu::aboutToHide, this, &ContextMenu::aboutToHide); |