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
2acdf6cf
Commit
2acdf6cf
authored
Apr 18, 2018
by
Patrick J.P
Committed by
Patrick José Pereira
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FlightDisplayView: Correct windows crash with video popup
Signed-off-by:
Patrick J.P
<
patrickelectric@gmail.com
>
parent
e7381f6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
14 deletions
+49
-14
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+49
-14
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
2acdf6cf
...
...
@@ -212,7 +212,23 @@ QGCView {
_flightVideo
.
state
=
"
unpopup
"
videoWindow
.
visible
=
false
}
}
/* This timer will startVideo again after the popup window appears and is loaded.
* Such approach was the only one to avoid a crash for windows users
*/
Timer
{
id
:
videoPopUpTimer
interval
:
2000
;
running
:
false
;
repeat
:
false
onTriggered
:
{
// If state is popup, the next one will be popup-finished
if
(
_flightVideo
.
state
==
"
popup
"
)
{
_flightVideo
.
state
=
"
popup-finished
"
}
QGroundControl
.
videoManager
.
startVideo
()
}
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
_mainIsMap
?
_flightMap
.
isSatelliteMap
:
true
}
...
...
@@ -270,6 +286,20 @@ QGCView {
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
visible
:
QGroundControl
.
videoManager
.
hasVideo
&&
(
!
_mainIsMap
||
_isPipVisible
)
onParentChanged
:
{
/* If video comes back from popup
* correct anchors.
* Such thing is not possible with ParentChange.
*/
if
(
parent
==
_panel
)
{
// Do anchors again after popup
anchors
.
left
=
_panel
.
left
anchors
.
bottom
=
_panel
.
bottom
anchors
.
margins
=
ScreenTools
.
defaultFontPixelHeight
}
}
states
:
[
State
{
name
:
"
pipMode
"
...
...
@@ -296,36 +326,41 @@ QGCView {
State
{
name
:
"
popup
"
StateChangeScript
{
script
:
QGroundControl
.
videoManager
.
stopVideo
()
script
:
{
// Stop video, restart it again with Timer
// Avoiding crashs if ParentChange is not yet done
QGroundControl
.
videoManager
.
stopVideo
()
videoPopUpTimer
.
running
=
true
}
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
true
}
},
State
{
name
:
"
popup-finished
"
ParentChange
{
target
:
_flightVideo
parent
:
videoItem
x
:
0
y
:
0
width
:
videoWindow
.
width
height
:
videoWindow
.
height
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
true
width
:
videoItem
.
width
height
:
videoItem
.
height
}
},
State
{
name
:
"
unpopup
"
StateChangeScript
{
script
:
QGroundControl
.
videoManager
.
stopVideo
()
script
:
{
QGroundControl
.
videoManager
.
stopVideo
()
videoPopUpTimer
.
running
=
true
}
}
ParentChange
{
target
:
_flightVideo
parent
:
_panel
}
PropertyChanges
{
target
:
_flightVideo
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
false
...
...
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