Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
98abf5a7
Commit
98abf5a7
authored
Oct 18, 2013
by
John Tapsell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash when removing an item from a custom widget
parent
6c347709
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+10
-1
QGCToolWidget.h
src/ui/designer/QGCToolWidget.h
+1
-0
No files found.
src/ui/designer/QGCToolWidget.cc
View file @
98abf5a7
...
...
@@ -529,11 +529,20 @@ void QGCToolWidget::addToolWidget(QGCToolWidgetItem* widget)
ui
->
hintLabel
=
NULL
;
}
connect
(
widget
,
SIGNAL
(
editingFinished
()),
this
,
SLOT
(
storeWidgetsToSettings
()));
connect
(
widget
,
SIGNAL
(
destroyed
()),
this
,
SLOT
(
storeWidgetsToSettings
()));
connect
(
widget
,
SIGNAL
(
destroyed
()),
this
,
SLOT
(
widgetRemoved
()));
toolLayout
->
addWidget
(
widget
);
toolItemList
.
append
(
widget
);
}
void
QGCToolWidget
::
widgetRemoved
()
{
//Must static cast and not dynamic cast since the object is in the destructor
//and we only want to use it as a pointer value
QGCToolWidgetItem
*
widget
=
static_cast
<
QGCToolWidgetItem
*>
(
QObject
::
sender
());
toolItemList
.
removeAll
(
widget
);
storeWidgetsToSettings
();
}
void
QGCToolWidget
::
exportWidget
()
{
const
QString
widgetFileExtension
(
".qgw"
);
...
...
src/ui/designer/QGCToolWidget.h
View file @
98abf5a7
...
...
@@ -102,6 +102,7 @@ protected slots:
void
addCommand
();
void
addLabel
();
void
setTitle
();
void
widgetRemoved
();
private:
/** Do not use this from outside the class to set the object name,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment