Mercurial > octave
comparison libgui/graphics/Panel.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 |
---|---|
36 #include "Canvas.h" | 36 #include "Canvas.h" |
37 #include "Container.h" | 37 #include "Container.h" |
38 #include "ContextMenu.h" | 38 #include "ContextMenu.h" |
39 #include "Panel.h" | 39 #include "Panel.h" |
40 #include "QtHandlesUtils.h" | 40 #include "QtHandlesUtils.h" |
41 | |
42 #include "octave-qobject.h" | |
43 | 41 |
44 #include "graphics.h" | 42 #include "graphics.h" |
45 #include "interpreter.h" | 43 #include "interpreter.h" |
46 | 44 |
47 namespace octave | 45 namespace octave |
91 | 89 |
92 return bw; | 90 return bw; |
93 } | 91 } |
94 | 92 |
95 Panel * | 93 Panel * |
96 Panel::create (octave::base_qobject& oct_qobj, octave::interpreter& interp, | 94 Panel::create (octave::interpreter& interp, |
97 const graphics_object& go) | 95 const graphics_object& go) |
98 { | 96 { |
99 Object *parent = parentObject (interp, go); | 97 Object *parent = parentObject (interp, go); |
100 | 98 |
101 if (parent) | 99 if (parent) |
102 { | 100 { |
103 Container *container = parent->innerContainer (); | 101 Container *container = parent->innerContainer (); |
104 | 102 |
105 if (container) | 103 if (container) |
106 return new Panel (oct_qobj, interp, go, new QFrame (container)); | 104 return new Panel (interp, go, new QFrame (container)); |
107 } | 105 } |
108 | 106 |
109 return nullptr; | 107 return nullptr; |
110 } | 108 } |
111 | 109 |
112 Panel::Panel (octave::base_qobject& oct_qobj, octave::interpreter& interp, | 110 Panel::Panel (octave::interpreter& interp, |
113 const graphics_object& go, QFrame *frame) | 111 const graphics_object& go, QFrame *frame) |
114 : Object (oct_qobj, interp, go, frame), m_container (nullptr), | 112 : Object (interp, go, frame), m_container (nullptr), |
115 m_title (nullptr), m_blockUpdates (false), | 113 m_title (nullptr), m_blockUpdates (false), |
116 m_previous_bbox (Matrix (1, 4, 0)) | 114 m_previous_bbox (Matrix (1, 4, 0)) |
117 { | 115 { |
118 uipanel::properties& pp = properties<uipanel> (); | 116 uipanel::properties& pp = properties<uipanel> (); |
119 | 117 |
126 frame->setLineWidth (octave::math::round (pp.get_borderwidth ())); | 124 frame->setLineWidth (octave::math::round (pp.get_borderwidth ())); |
127 QPalette pal = frame->palette (); | 125 QPalette pal = frame->palette (); |
128 setupPalette (pp, pal); | 126 setupPalette (pp, pal); |
129 frame->setPalette (pal); | 127 frame->setPalette (pal); |
130 | 128 |
131 m_container = new Container (frame, oct_qobj, interp); | 129 m_container = new Container (frame, interp); |
132 m_container->canvas (m_handle); | 130 m_container->canvas (m_handle); |
133 | 131 |
134 connect (m_container, SIGNAL (interpeter_event (const fcn_callback&)), | 132 connect (m_container, SIGNAL (interpeter_event (const fcn_callback&)), |
135 this, SIGNAL (interpeter_event (const fcn_callback&))); | 133 this, SIGNAL (interpeter_event (const fcn_callback&))); |
136 | 134 |