Mercurial > octave
comparison libgui/graphics/EditControl.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 "Container.h" | 32 #include "Container.h" |
33 #include "EditControl.h" | 33 #include "EditControl.h" |
34 #include "TextEdit.h" | 34 #include "TextEdit.h" |
35 #include "QtHandlesUtils.h" | 35 #include "QtHandlesUtils.h" |
36 | 36 |
37 #include "octave-qobject.h" | |
38 | |
39 namespace octave | 37 namespace octave |
40 { | 38 { |
41 | 39 |
42 EditControl * | 40 EditControl * |
43 EditControl::create (octave::base_qobject& oct_qobj, | 41 EditControl::create (octave::interpreter& interp, const graphics_object& go) |
44 octave::interpreter& interp, const graphics_object& go) | |
45 { | 42 { |
46 Object *parent = parentObject (interp, go); | 43 Object *parent = parentObject (interp, go); |
47 | 44 |
48 if (parent) | 45 if (parent) |
49 { | 46 { |
52 if (container) | 49 if (container) |
53 { | 50 { |
54 uicontrol::properties& up = Utils::properties<uicontrol> (go); | 51 uicontrol::properties& up = Utils::properties<uicontrol> (go); |
55 | 52 |
56 if ((up.get_max () - up.get_min ()) > 1) | 53 if ((up.get_max () - up.get_min ()) > 1) |
57 return new EditControl (oct_qobj, interp, go, | 54 return new EditControl (interp, go, |
58 new TextEdit (container)); | 55 new TextEdit (container)); |
59 else | 56 else |
60 return new EditControl (oct_qobj, interp, go, | 57 return new EditControl (interp, go, |
61 new QLineEdit (container)); | 58 new QLineEdit (container)); |
62 } | 59 } |
63 } | 60 } |
64 | 61 |
65 return nullptr; | 62 return nullptr; |
66 } | 63 } |
67 | 64 |
68 EditControl::EditControl (octave::base_qobject& oct_qobj, | 65 EditControl::EditControl (octave::interpreter& interp, |
69 octave::interpreter& interp, | |
70 const graphics_object& go, QLineEdit *edit) | 66 const graphics_object& go, QLineEdit *edit) |
71 : BaseControl (oct_qobj, interp, go, edit), m_multiLine (false), | 67 : BaseControl (interp, go, edit), m_multiLine (false), |
72 m_textChanged (false) | 68 m_textChanged (false) |
73 { | 69 { |
74 init (edit); | 70 init (edit); |
75 } | 71 } |
76 | 72 |
99 this, &EditControl::editingFinished); | 95 this, &EditControl::editingFinished); |
100 connect (edit, &QLineEdit::returnPressed, | 96 connect (edit, &QLineEdit::returnPressed, |
101 this, &EditControl::returnPressed); | 97 this, &EditControl::returnPressed); |
102 } | 98 } |
103 | 99 |
104 EditControl::EditControl (octave::base_qobject& oct_qobj, | 100 EditControl::EditControl (octave::interpreter& interp, |
105 octave::interpreter& interp, | |
106 const graphics_object& go, TextEdit *edit) | 101 const graphics_object& go, TextEdit *edit) |
107 : BaseControl (oct_qobj, interp, go, edit), m_multiLine (true), | 102 : BaseControl (interp, go, edit), m_multiLine (true), |
108 m_textChanged (false) | 103 m_textChanged (false) |
109 { | 104 { |
110 init (edit); | 105 init (edit); |
111 } | 106 } |
112 | 107 |