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
f82b33a4
Commit
f82b33a4
authored
Nov 26, 2011
by
oberion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deleting the MainWindow instance after closing application
Fixed some destructor commands
parent
259845de
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
19 deletions
+46
-19
QGCCore.cc
src/QGCCore.cc
+2
-1
HDDisplay.cc
src/ui/HDDisplay.cc
+18
-3
HSIDisplay.cc
src/ui/HSIDisplay.cc
+5
-0
HSIDisplay.h
src/ui/HSIDisplay.h
+1
-1
MainWindow.cc
src/ui/MainWindow.cc
+8
-8
MainWindow.h
src/ui/MainWindow.h
+1
-1
QGCRemoteControlView.cc
src/ui/QGCRemoteControlView.cc
+11
-5
No files found.
src/QGCCore.cc
View file @
f82b33a4
...
...
@@ -204,8 +204,9 @@ QGCCore::~QGCCore()
{
//mainWindow->storeSettings();
mainWindow
->
close
();
mainWindow
->
deleteLater
();
//
mainWindow->deleteLater();
// Delete singletons
delete
MainWindow
::
instance
();
delete
LinkManager
::
instance
();
delete
UASManager
::
instance
();
}
...
...
src/ui/HDDisplay.cc
View file @
f82b33a4
...
...
@@ -50,8 +50,8 @@ HDDisplay::HDDisplay(QStringList* plotList, QString title, QWidget *parent) :
acceptUnitList
(
new
QStringList
()),
lastPaintTime
(
0
),
columns
(
3
),
valuesChanged
(
true
)
/*
,
m_ui(
new Ui::HDDisplay)*/
valuesChanged
(
true
),
m_ui
(
NULL
)
{
setWindowTitle
(
title
);
//m_ui->setupUi(this);
...
...
@@ -135,7 +135,22 @@ HDDisplay::HDDisplay(QStringList* plotList, QString title, QWidget *parent) :
HDDisplay
::~
HDDisplay
()
{
saveState
();
delete
m_ui
;
if
(
this
->
refreshTimer
)
{
delete
this
->
refreshTimer
;
}
if
(
this
->
acceptList
)
{
delete
this
->
acceptList
;
}
if
(
this
->
acceptUnitList
)
{
delete
this
->
acceptUnitList
;
}
if
(
this
->
m_ui
)
{
delete
m_ui
;
}
}
QSize
HDDisplay
::
sizeHint
()
const
...
...
src/ui/HSIDisplay.cc
View file @
f82b33a4
...
...
@@ -136,6 +136,11 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
setFocusPolicy
(
Qt
::
StrongFocus
);
}
HSIDisplay
::~
HSIDisplay
()
{
}
void
HSIDisplay
::
resetMAVState
()
{
mavInitialized
=
false
;
...
...
src/ui/HSIDisplay.h
View file @
f82b33a4
...
...
@@ -48,7 +48,7 @@ class HSIDisplay : public HDDisplay
Q_OBJECT
public:
HSIDisplay
(
QWidget
*
parent
=
0
);
//
~HSIDisplay();
~
HSIDisplay
();
public
slots
:
void
setActiveUAS
(
UASInterface
*
uas
);
...
...
src/ui/MainWindow.cc
View file @
f82b33a4
...
...
@@ -91,7 +91,7 @@ MainWindow::MainWindow(QWidget *parent):
currentStyle
(
QGC_MAINWINDOW_STYLE_INDOOR
),
aboutToCloseFlag
(
false
),
changingViewsFlag
(
false
),
centerStackActionGroup
(
this
),
centerStackActionGroup
(
new
QActionGroup
(
this
)
),
styleFileName
(
QCoreApplication
::
applicationDirPath
()
+
"/style-indoor.css"
),
autoReconnect
(
false
),
lowPowerMode
(
false
)
...
...
@@ -138,7 +138,7 @@ MainWindow::MainWindow(QWidget *parent):
setCorner
(
Qt
::
BottomRightCorner
,
Qt
::
RightDockWidgetArea
);
// Setup UI state machines
centerStackActionGroup
.
setExclusive
(
true
);
centerStackActionGroup
->
setExclusive
(
true
);
centerStack
=
new
QStackedWidget
(
this
);
setCentralWidget
(
centerStack
);
...
...
@@ -246,8 +246,8 @@ MainWindow::~MainWindow()
if
(
dockWidget
)
{
// Remove dock widget from main window
removeDockWidget
(
dockWidget
);
delete
dockWidget
->
widget
();
//
removeDockWidget(dockWidget);
//
delete dockWidget->widget();
delete
dockWidget
;
}
else
...
...
@@ -417,14 +417,14 @@ void MainWindow::buildCommonWidgets()
parametersDockWidget
->
setObjectName
(
"PARAMETER_INTERFACE_DOCKWIDGET"
);
addTool
(
parametersDockWidget
,
tr
(
"Calibration and Parameters"
),
Qt
::
RightDockWidgetArea
);
}
if
(
!
hsiDockWidget
)
{
hsiDockWidget
=
new
QDockWidget
(
tr
(
"Horizontal Situation Indicator"
),
this
);
hsiDockWidget
->
setWidget
(
new
HSIDisplay
(
this
)
);
hsiDockWidget
->
setObjectName
(
"HORIZONTAL_SITUATION_INDICATOR_DOCK_WIDGET"
);
addTool
(
hsiDockWidget
,
tr
(
"Horizontal Situation"
),
Qt
::
BottomDockWidgetArea
);
}
if
(
!
headDown1DockWidget
)
{
headDown1DockWidget
=
new
QDockWidget
(
tr
(
"Flight Display"
),
this
);
HDDisplay
*
hdDisplay
=
new
HDDisplay
(
acceptList
,
"Flight Display"
,
this
);
...
...
@@ -442,7 +442,7 @@ void MainWindow::buildCommonWidgets()
headDown2DockWidget
->
setObjectName
(
"HEAD_DOWN_DISPLAY_2_DOCK_WIDGET"
);
addTool
(
headDown2DockWidget
,
tr
(
"Actuator Status"
),
Qt
::
RightDockWidgetArea
);
}
if
(
!
rcViewDockWidget
)
{
rcViewDockWidget
=
new
QDockWidget
(
tr
(
"Radio Control"
),
this
);
rcViewDockWidget
->
setWidget
(
new
QGCRemoteControlView
(
this
)
);
...
...
@@ -555,7 +555,7 @@ void MainWindow::addCentralWidget(QWidget* widget, const QString& title)
QVariant
var
;
var
.
setValue
((
QWidget
*
)
widget
);
tempAction
->
setData
(
var
);
centerStackActionGroup
.
addAction
(
tempAction
);
centerStackActionGroup
->
addAction
(
tempAction
);
connect
(
tempAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showCentralWidget
()));
connect
(
widget
,
SIGNAL
(
visibilityChanged
(
bool
)),
tempAction
,
SLOT
(
setChecked
(
bool
)));
tempAction
->
setChecked
(
widget
->
isVisible
());
...
...
src/ui/MainWindow.h
View file @
f82b33a4
...
...
@@ -303,7 +303,7 @@ protected:
QSettings
settings
;
QStackedWidget
*
centerStack
;
QActionGroup
centerStackActionGroup
;
QActionGroup
*
centerStackActionGroup
;
// Center widgets
QPointer
<
Linecharts
>
linechartWidget
;
...
...
src/ui/QGCRemoteControlView.cc
View file @
f82b33a4
...
...
@@ -43,8 +43,8 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) :
uasId
(
-
1
),
rssi
(
0.0
f
),
updated
(
false
),
channelLayout
(
new
QVBoxLayout
())
//
,
//ui(new Ui::QGCRemoteControlView
)
channelLayout
(
new
QVBoxLayout
()),
ui
(
NULL
)
{
ui
->
setupUi
(
this
);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
...
...
@@ -71,8 +71,14 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) :
QGCRemoteControlView
::~
QGCRemoteControlView
()
{
delete
ui
;
delete
channelLayout
;
if
(
this
->
ui
)
{
delete
ui
;
}
if
(
this
->
channelLayout
)
{
delete
channelLayout
;
}
}
void
QGCRemoteControlView
::
setUASId
(
int
id
)
...
...
@@ -172,7 +178,7 @@ void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized)
void
QGCRemoteControlView
::
appendChannelWidget
(
int
channelId
)
{
// Create new layout
QHBoxLayout
*
layout
=
new
QHBoxLayout
();
QHBoxLayout
*
layout
=
new
QHBoxLayout
(
this
);
// Add content
layout
->
addWidget
(
new
QLabel
(
QString
(
"Channel %1"
).
arg
(
channelId
+
1
),
this
));
QLabel
*
raw
=
new
QLabel
(
this
);
...
...
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