Mercurial > octave
comparison libgui/graphics/ListBoxControl.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 |
---|---|
32 #include <QMouseEvent> | 32 #include <QMouseEvent> |
33 | 33 |
34 #include "Container.h" | 34 #include "Container.h" |
35 #include "ListBoxControl.h" | 35 #include "ListBoxControl.h" |
36 #include "QtHandlesUtils.h" | 36 #include "QtHandlesUtils.h" |
37 | |
38 #include "octave-qobject.h" | |
39 | 37 |
40 namespace octave | 38 namespace octave |
41 { | 39 { |
42 | 40 |
43 static void | 41 static void |
68 } | 66 } |
69 } | 67 } |
70 } | 68 } |
71 | 69 |
72 ListBoxControl * | 70 ListBoxControl * |
73 ListBoxControl::create (octave::base_qobject& oct_qobj, | 71 ListBoxControl::create (octave::interpreter& interp, |
74 octave::interpreter& interp, | |
75 const graphics_object& go) | 72 const graphics_object& go) |
76 { | 73 { |
77 Object *parent = parentObject (interp, go); | 74 Object *parent = parentObject (interp, go); |
78 | 75 |
79 if (parent) | 76 if (parent) |
80 { | 77 { |
81 Container *container = parent->innerContainer (); | 78 Container *container = parent->innerContainer (); |
82 | 79 |
83 if (container) | 80 if (container) |
84 return new ListBoxControl (oct_qobj, interp, go, | 81 return new ListBoxControl (interp, go, |
85 new QListWidget (container)); | 82 new QListWidget (container)); |
86 } | 83 } |
87 | 84 |
88 return nullptr; | 85 return nullptr; |
89 } | 86 } |
90 | 87 |
91 ListBoxControl::ListBoxControl (octave::base_qobject& oct_qobj, | 88 ListBoxControl::ListBoxControl (octave::interpreter& interp, |
92 octave::interpreter& interp, | |
93 const graphics_object& go, QListWidget *list) | 89 const graphics_object& go, QListWidget *list) |
94 : BaseControl (oct_qobj, interp, go, list), m_blockCallback (false), | 90 : BaseControl (interp, go, list), m_blockCallback (false), |
95 m_selectionChanged (false) | 91 m_selectionChanged (false) |
96 { | 92 { |
97 uicontrol::properties& up = properties<uicontrol> (); | 93 uicontrol::properties& up = properties<uicontrol> (); |
98 | 94 |
99 list->addItems (Utils::fromStringVector (up.get_string_vector ())); | 95 list->addItems (Utils::fromStringVector (up.get_string_vector ())); |