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
d63457c5
Commit
d63457c5
authored
Aug 23, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1789 from DonLakeFlyer/WindowsClose
Queue delayed window close if open connections
parents
2974c58c
8a3218b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
MainWindow.cc
src/ui/MainWindow.cc
+10
-6
MainWindow.h
src/ui/MainWindow.h
+2
-1
No files found.
src/ui/MainWindow.cc
View file @
d63457c5
...
...
@@ -634,12 +634,16 @@ void MainWindow::closeEvent(QCloseEvent *event)
tr
(
"There are still active connections to vehicles. Do you want to disconnect these before closing?"
),
QMessageBox
::
Yes
|
QMessageBox
::
Cancel
,
QMessageBox
::
Cancel
);
if
(
button
==
QMessageBox
::
Yes
)
{
LinkManager
::
instance
()
->
disconnectAll
();
}
else
{
event
->
ignore
();
return
;
}
if
(
button
==
QMessageBox
::
Yes
)
{
LinkManager
::
instance
()
->
disconnectAll
();
// The above disconnect causes a flurry of activity as the vehicle components are removed. This in turn
// causes the Windows Version of Qt to crash if you allow the close event to be accepted. In order to prevent
// the crash, we ignore the close event and setup a delayed timer to close the window after things settle down.
QTimer
::
singleShot
(
1500
,
this
,
&
MainWindow
::
_closeWindow
);
}
event
->
ignore
();
return
;
}
// This will process any remaining flight log save dialogs
...
...
src/ui/MainWindow.h
View file @
d63457c5
...
...
@@ -287,7 +287,8 @@ private slots:
#ifdef UNITTEST_BUILD
void
_showQmlTestWidget
(
void
);
#endif
void
_closeWindow
(
void
)
{
close
();
}
private:
/// Constructor is private since all creation should be through MainWindow::_create
MainWindow
(
QSplashScreen
*
splashScreen
);
...
...
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