From f50329c16a7fd52c98cf174314505e941ee34b43 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 28 Sep 2015 15:11:23 -0700 Subject: [PATCH] New QGCCanvas control to fix redraw bug --- src/QmlControls/QGCCanvas.qml | 17 +++++++++++++++++ src/QmlControls/QGroundControl.Controls.qmldir | 1 + 2 files changed, 18 insertions(+) create mode 100644 src/QmlControls/QGCCanvas.qml diff --git a/src/QmlControls/QGCCanvas.qml b/src/QmlControls/QGCCanvas.qml new file mode 100644 index 000000000..1b7d6e3b9 --- /dev/null +++ b/src/QmlControls/QGCCanvas.qml @@ -0,0 +1,17 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 + +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 + +/// Canvas has some sort of bug in it which can cause it to not paint when top level Views +/// are switched. In order to fix this we ahve a signal hacked into ScreenTools to force +/// a repaint. +Canvas { + Connections { + target: ScreenTools + + onRepaintRequested: arrowCanvas.requestPaint() + } +} diff --git a/src/QmlControls/QGroundControl.Controls.qmldir b/src/QmlControls/QGroundControl.Controls.qmldir index cc9b94af8..5d72b54cc 100644 --- a/src/QmlControls/QGroundControl.Controls.qmldir +++ b/src/QmlControls/QGroundControl.Controls.qmldir @@ -9,6 +9,7 @@ QGCComboBox 1.0 QGCComboBox.qml QGCColoredImage 1.0 QGCColoredImage.qml QGCToolBarButton 1.0 QGCToolBarButton.qml QGCMovableItem 1.0 QGCMovableItem.qml +QGCCanvas 1.0 QGCCanvas.qml SubMenuButton 1.0 SubMenuButton.qml IndicatorButton 1.0 IndicatorButton.qml -- 2.22.0