diff --git a/custom-example/src/CustomQuickInterface.cc b/custom-example/src/CustomQuickInterface.cc index 790402d09d3c5723291a2509380897a619bf89d3..3208270401f8fafcc57e687675b680b7cd4aed69 100644 --- a/custom-example/src/CustomQuickInterface.cc +++ b/custom-example/src/CustomQuickInterface.cc @@ -25,6 +25,7 @@ static const char* kGroupName = "CustomSettings"; static const char* kShowGimbalCtl = "ShowGimbalCtl"; +static const char* kShowAttitudeWidget = "ShowAttitudeWidget"; //----------------------------------------------------------------------------- CustomQuickInterface::CustomQuickInterface(QObject* parent) @@ -45,7 +46,8 @@ CustomQuickInterface::init() { QSettings settings; settings.beginGroup(kGroupName); - _showGimbalControl = settings.value(kShowGimbalCtl, true).toBool(); + _showGimbalControl = settings.value(kShowGimbalCtl, false).toBool(); + _showAttitudeWidget = settings.value(kShowAttitudeWidget, false).toBool(); } //----------------------------------------------------------------------------- @@ -60,3 +62,16 @@ CustomQuickInterface::setShowGimbalControl(bool set) emit showGimbalControlChanged(); } } + +//----------------------------------------------------------------------------- +void +CustomQuickInterface::setShowAttitudeWidget(bool set) +{ + if(_showAttitudeWidget != set) { + _showAttitudeWidget = set; + QSettings settings; + settings.beginGroup(kGroupName); + settings.setValue(kShowAttitudeWidget,set); + emit showAttitudeWidgetChanged(); + } +} diff --git a/custom-example/src/CustomQuickInterface.h b/custom-example/src/CustomQuickInterface.h index 9253fb8c29345be50d2103a432b2104015cf10cb..c0bc2e110c44f3c2743c2cc6403c4d00e0658c80 100644 --- a/custom-example/src/CustomQuickInterface.h +++ b/custom-example/src/CustomQuickInterface.h @@ -29,12 +29,20 @@ public: CustomQuickInterface(QObject* parent = nullptr); ~CustomQuickInterface(); Q_PROPERTY(bool showGimbalControl READ showGimbalControl WRITE setShowGimbalControl NOTIFY showGimbalControlChanged) + Q_PROPERTY(bool showAttitudeWidget READ showAttitudeWidget WRITE setShowAttitudeWidget NOTIFY showAttitudeWidgetChanged) bool showGimbalControl () { return _showGimbalControl; } void setShowGimbalControl (bool set); void init (); + + bool showAttitudeWidget () { return _showAttitudeWidget; } + void setShowAttitudeWidget (bool set); + signals: void showGimbalControlChanged (); + void showAttitudeWidgetChanged(); + private: bool _showGimbalControl = true; + bool _showAttitudeWidget = false; };