Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f82b33a4
Commit
f82b33a4
authored
Nov 26, 2011
by
oberion
Browse files
Deleting the MainWindow instance after closing application
Fixed some destructor commands
parent
259845de
Changes
7
Show whitespace changes
Inline
Side-by-side
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
();
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
...
...
@@ -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
()
{
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
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment