From 70a55798bb2230ebe0daef08619e6b51a370be36 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 7 Feb 2015 12:24:37 -0800 Subject: [PATCH] Move Palette registration out of FactSystem Since this is generic Qml support not specific to FactSystem --- src/FactSystem/FactSystem.cc | 2 -- src/QGCApplication.cc | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/FactSystem/FactSystem.cc b/src/FactSystem/FactSystem.cc index 0fe30b35f..650166b21 100644 --- a/src/FactSystem/FactSystem.cc +++ b/src/FactSystem/FactSystem.cc @@ -28,7 +28,6 @@ #include "UASManager.h" #include "QGCApplication.h" #include "VehicleComponent.h" -#include "QGCPalette.h" #include @@ -44,7 +43,6 @@ FactSystem::FactSystem(QObject* parent) : // FIXME: Where should these go? qmlRegisterUncreatableType(_factSystemQmlUri, 1, 0, "VehicleComponent", "Can only reference VehicleComponent"); - qmlRegisterType(_factSystemQmlUri, 1, 0, "QGCPalette"); } FactSystem::~FactSystem() diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index f383226e6..70370c2ce 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -247,6 +247,9 @@ void QGCApplication::_initCommon(void) // Avoid Using setFont(). In the Qt docu you can read the following: // "Warning: Do not use this function in conjunction with Qt Style Sheets." // setFont(fontDatabase.font(fontFamilyName, "Roman", 12)); + + // Register our Qml palette before anyone tries to use it + qmlRegisterType("QGroundControl.Palette", 1, 0, "QGCPalette"); } bool QGCApplication::_initForNormalAppBoot(void) -- 2.22.0