Mercurial > octave
comparison libgui/graphics/ButtonGroup.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 |
---|---|
43 #include "ToggleButtonControl.h" | 43 #include "ToggleButtonControl.h" |
44 #include "RadioButtonControl.h" | 44 #include "RadioButtonControl.h" |
45 #include "QtHandlesUtils.h" | 45 #include "QtHandlesUtils.h" |
46 #include "qt-graphics-toolkit.h" | 46 #include "qt-graphics-toolkit.h" |
47 | 47 |
48 #include "octave-qobject.h" | |
49 #include "octave-qtutils.h" | 48 #include "octave-qtutils.h" |
50 | 49 |
51 #include "interpreter.h" | 50 #include "interpreter.h" |
52 #include "oct-map.h" | 51 #include "oct-map.h" |
53 | 52 |
98 | 97 |
99 return bw; | 98 return bw; |
100 } | 99 } |
101 | 100 |
102 ButtonGroup * | 101 ButtonGroup * |
103 ButtonGroup::create (octave::base_qobject& oct_qobj, | 102 ButtonGroup::create (octave::interpreter& interp, const graphics_object& go) |
104 octave::interpreter& interp, const graphics_object& go) | |
105 { | 103 { |
106 Object *parent = parentObject (interp, go); | 104 Object *parent = parentObject (interp, go); |
107 | 105 |
108 if (parent) | 106 if (parent) |
109 { | 107 { |
110 Container *container = parent->innerContainer (); | 108 Container *container = parent->innerContainer (); |
111 | 109 |
112 if (container) | 110 if (container) |
113 { | 111 { |
114 QFrame *frame = new QFrame (container); | 112 QFrame *frame = new QFrame (container); |
115 return new ButtonGroup (oct_qobj, interp, go, | 113 return new ButtonGroup (interp, go, |
116 new QButtonGroup (frame), frame); | 114 new QButtonGroup (frame), frame); |
117 } | 115 } |
118 } | 116 } |
119 | 117 |
120 return nullptr; | 118 return nullptr; |
121 } | 119 } |
122 | 120 |
123 ButtonGroup::ButtonGroup (octave::base_qobject& oct_qobj, | 121 ButtonGroup::ButtonGroup (octave::interpreter& interp, |
124 octave::interpreter& interp, | |
125 const graphics_object& go, | 122 const graphics_object& go, |
126 QButtonGroup *buttongroup, QFrame *frame) | 123 QButtonGroup *buttongroup, QFrame *frame) |
127 : Object (oct_qobj, interp, go, frame), m_hiddenbutton (nullptr), | 124 : Object (interp, go, frame), m_hiddenbutton (nullptr), |
128 m_container (nullptr), m_title (nullptr), m_blockUpdates (false) | 125 m_container (nullptr), m_title (nullptr), m_blockUpdates (false) |
129 { | 126 { |
130 uibuttongroup::properties& pp = properties<uibuttongroup> (); | 127 uibuttongroup::properties& pp = properties<uibuttongroup> (); |
131 | 128 |
132 frame->setObjectName ("UIButtonGroup"); | 129 frame->setObjectName ("UIButtonGroup"); |
142 m_buttongroup = buttongroup; | 139 m_buttongroup = buttongroup; |
143 m_hiddenbutton = new QRadioButton (frame); | 140 m_hiddenbutton = new QRadioButton (frame); |
144 m_hiddenbutton->hide (); | 141 m_hiddenbutton->hide (); |
145 m_buttongroup->addButton (m_hiddenbutton); | 142 m_buttongroup->addButton (m_hiddenbutton); |
146 | 143 |
147 m_container = new Container (frame, oct_qobj, interp); | 144 m_container = new Container (frame, interp); |
148 m_container->canvas (m_handle); | 145 m_container->canvas (m_handle); |
149 | 146 |
150 connect (m_container, SIGNAL (interpeter_event (const fcn_callback&)), | 147 connect (m_container, SIGNAL (interpeter_event (const fcn_callback&)), |
151 this, SIGNAL (interpeter_event (const fcn_callback&))); | 148 this, SIGNAL (interpeter_event (const fcn_callback&))); |
152 | 149 |