Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SkywardHub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
SkywardHub
Commits
8d6df420
Commit
8d6df420
authored
1 year ago
by
Raul Radu
Browse files
Options
Downloads
Patches
Plain Diff
[Modules] CommandPad using smart pointers
parent
65588da9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/Modules/CommandPad/CommandPad.cpp
+4
-9
4 additions, 9 deletions
src/shared/Modules/CommandPad/CommandPad.cpp
src/shared/Modules/CommandPad/CommandPad.h
+2
-2
2 additions, 2 deletions
src/shared/Modules/CommandPad/CommandPad.h
with
6 additions
and
11 deletions
src/shared/Modules/CommandPad/CommandPad.cpp
+
4
−
9
View file @
8d6df420
...
...
@@ -24,12 +24,7 @@
CommandPad
::
CommandPad
()
:
Module
(
ModuleId
::
COMMAND_PAD
)
{
setupUi
();
}
CommandPad
::~
CommandPad
()
{
delete
messagesListComboBox
;
for
(
auto
key
:
formElements
.
keys
())
delete
formElements
[
key
];
}
CommandPad
::~
CommandPad
()
{}
XmlObject
CommandPad
::
toXmlObject
()
{
...
...
@@ -61,11 +56,11 @@ void CommandPad::setupUi()
QVBoxLayout
*
outerLayout
=
new
QVBoxLayout
;
outerLayout
->
addStretch
();
messagesListComboBox
=
new
QComboBox
;
messagesListComboBox
=
std
::
make_unique
<
QComboBox
>
()
;
messagesListComboBox
->
setSizePolicy
(
QSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Fixed
));
messagesListComboBox
->
addItems
(
MessagesList
::
messagesList
);
outerLayout
->
addWidget
(
messagesListComboBox
);
outerLayout
->
addWidget
(
messagesListComboBox
.
get
()
);
QGridLayout
*
formGridLayout
=
new
QGridLayout
;
outerLayout
->
addLayout
(
formGridLayout
);
...
...
@@ -81,7 +76,7 @@ void CommandPad::setupUi()
currentMessage
=
"PING_TC"
;
messagesListComboBox
->
setCurrentText
(
currentMessage
);
connect
(
messagesListComboBox
,
&
QComboBox
::
currentTextChanged
,
this
,
connect
(
messagesListComboBox
.
get
()
,
&
QComboBox
::
currentTextChanged
,
this
,
[
=
](
QString
key
)
{
if
(
formElements
.
contains
(
key
))
...
...
This diff is collapsed.
Click to expand it.
src/shared/Modules/CommandPad/CommandPad.h
+
2
−
2
View file @
8d6df420
...
...
@@ -38,6 +38,6 @@ private:
void
setupUi
();
QString
currentMessage
;
QComboBox
*
messagesListComboBox
;
QMap
<
QString
,
MessageFormElement
*
>
formElements
;
std
::
unique_ptr
<
QComboBox
>
messagesListComboBox
;
QMap
<
QString
,
std
::
unique_ptr
<
MessageFormElement
>
>
formElements
;
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment