26 changed files with 473 additions and 645 deletions
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,88 @@ |
|||||||
|
import QtQuick 2.2 |
||||||
|
import QtQuick.Controls 1.2 |
||||||
|
import QtQuick.Controls.Styles 1.2 |
||||||
|
import QtGraphicalEffects 1.0 |
||||||
|
import QGroundControl.FactSystem 1.0 |
||||||
|
|
||||||
|
Button { |
||||||
|
checkable: true |
||||||
|
height: 80 |
||||||
|
|
||||||
|
text: "Button" |
||||||
|
property bool setupComplete: true |
||||||
|
property bool setupIndicator: true |
||||||
|
|
||||||
|
style: ButtonStyle { |
||||||
|
id: buttonStyle |
||||||
|
|
||||||
|
property var __qgcpal: QGCPalette { |
||||||
|
colorGroup: control.enabled ? QGCPalette.Active : QGCPalette.Disabled |
||||||
|
} |
||||||
|
|
||||||
|
background: Rectangle { |
||||||
|
id: innerRect |
||||||
|
readonly property real titleHeight: 30 |
||||||
|
|
||||||
|
border.color: control.checked ? "#eee333" : "#676767" |
||||||
|
radius: 10 |
||||||
|
|
||||||
|
color: control.checked ? "#eee333" : "#343434" |
||||||
|
|
||||||
|
Text { |
||||||
|
id: titleBar |
||||||
|
|
||||||
|
width: parent.width |
||||||
|
height: parent.titleHeight |
||||||
|
|
||||||
|
verticalAlignment: TextEdit.AlignVCenter |
||||||
|
horizontalAlignment: TextEdit.AlignHCenter |
||||||
|
|
||||||
|
text: control.text |
||||||
|
font.pixelSize: 12 |
||||||
|
color: control.checked ? "black" : "white" |
||||||
|
|
||||||
|
Rectangle { |
||||||
|
id: setupIndicator |
||||||
|
|
||||||
|
readonly property real indicatorRadius: 6 |
||||||
|
|
||||||
|
x: parent.width - (indicatorRadius * 2) - 5 |
||||||
|
y: (parent.height - (indicatorRadius * 2)) / 2 |
||||||
|
width: indicatorRadius * 2 |
||||||
|
height: indicatorRadius * 2 |
||||||
|
|
||||||
|
radius: indicatorRadius |
||||||
|
color: control.setupIndicator ? (control.setupComplete ? "green" : "red") : innerRect.color |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Rectangle { |
||||||
|
width: parent.width |
||||||
|
height: parent.height - parent.titleHeight |
||||||
|
|
||||||
|
y: parent.titleHeight |
||||||
|
|
||||||
|
color: __qgcpal.window |
||||||
|
border.color: control.checked ? "#eee333" : "#676767" |
||||||
|
|
||||||
|
Image { |
||||||
|
id: buttonImage |
||||||
|
source: "setupButtonImage.png" |
||||||
|
sourceSize: Qt.size(parent.width - 20, parent.height - 20) |
||||||
|
anchors.horizontalCenter: parent.horizontalCenter |
||||||
|
anchors.verticalCenter: parent.verticalCenter |
||||||
|
smooth: true |
||||||
|
visible: false |
||||||
|
} |
||||||
|
|
||||||
|
ColorOverlay { |
||||||
|
anchors.fill: buttonImage |
||||||
|
source: buttonImage |
||||||
|
color: control.checked ? "#eee333" : "#58585a" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
label: Item {} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,2 @@ |
|||||||
|
Module QGroundControl.Controls |
||||||
|
SetupButton 1.0 SetupButton.qml |
@ -1,163 +0,0 @@ |
|||||||
import QtQuick 2.2 |
|
||||||
import QtQuick.Controls 1.2 |
|
||||||
import QtQuick.Controls.Styles 1.2 |
|
||||||
|
|
||||||
Button { |
|
||||||
text: "Button" |
|
||||||
property bool setupComplete: false |
|
||||||
|
|
||||||
property var summaryModel: ListModel { |
|
||||||
ListElement { name: "Row 1"; state: "State 1" } |
|
||||||
ListElement { name: "Row 2"; state: "State 2" } |
|
||||||
ListElement { name: "Row 3"; state: "State 3" } |
|
||||||
} |
|
||||||
|
|
||||||
style: ButtonStyle { |
|
||||||
id: buttonStyle |
|
||||||
background: Rectangle { |
|
||||||
id: innerRect |
|
||||||
readonly property real titleHeight: 30 |
|
||||||
|
|
||||||
//property alias summaryModel: summaryList.model |
|
||||||
|
|
||||||
border.color: "#888" |
|
||||||
radius: 10 |
|
||||||
|
|
||||||
color: control.activeFocus ? "#47b" : "white" |
|
||||||
opacity: control.hovered || control.activeFocus ? 1 : 0.75 |
|
||||||
Behavior on opacity {NumberAnimation{ duration: 100 }} |
|
||||||
|
|
||||||
Text { |
|
||||||
id: titleBar |
|
||||||
|
|
||||||
width: parent.width |
|
||||||
height: parent.titleHeight |
|
||||||
|
|
||||||
verticalAlignment: TextEdit.AlignVCenter |
|
||||||
horizontalAlignment: TextEdit.AlignHCenter |
|
||||||
|
|
||||||
text: control.text |
|
||||||
font.pixelSize: 12 |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
id: setupIndicator |
|
||||||
|
|
||||||
property bool setupComplete: true |
|
||||||
readonly property real indicatorRadius: 6 |
|
||||||
|
|
||||||
x: parent.width - (indicatorRadius * 2) - 5 |
|
||||||
y: (parent.height - (indicatorRadius * 2)) / 2 |
|
||||||
width: indicatorRadius * 2 |
|
||||||
height: indicatorRadius * 2 |
|
||||||
|
|
||||||
radius: indicatorRadius |
|
||||||
color: control.setupComplete ? "green" : "red" |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
width: parent.width |
|
||||||
height: parent.height - parent.titleHeight |
|
||||||
|
|
||||||
y: parent.titleHeight |
|
||||||
|
|
||||||
border.color: "#888" |
|
||||||
|
|
||||||
gradient: Gradient { |
|
||||||
GradientStop { position: 0; color: "#ffffff" } |
|
||||||
GradientStop { position: 1; color: "#000000" } |
|
||||||
} |
|
||||||
|
|
||||||
ListView { |
|
||||||
id: summaryList |
|
||||||
anchors.fill: parent |
|
||||||
model: control.summaryModel |
|
||||||
delegate: Row { |
|
||||||
Text { text: modelData.name } |
|
||||||
Text { text: modelData.state } |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
label: Item {} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/* |
|
||||||
Rectangle { |
|
||||||
readonly property real titleHeight: 30 |
|
||||||
|
|
||||||
property alias title: titleBar.text |
|
||||||
property alias setupComplete: setupIndicator.setupComplete |
|
||||||
//property alias summaryModel: summaryList.model |
|
||||||
|
|
||||||
border.color: "#888" |
|
||||||
radius: 10 |
|
||||||
|
|
||||||
gradient: Gradient { |
|
||||||
GradientStop { position: 0 ; color: "#cccccc" } |
|
||||||
GradientStop { position: 1 ; color: "#aaa" } |
|
||||||
} |
|
||||||
|
|
||||||
Text { |
|
||||||
id: titleBar |
|
||||||
|
|
||||||
width: parent.width |
|
||||||
height: parent.titleHeight |
|
||||||
|
|
||||||
verticalAlignment: TextEdit.AlignVCenter |
|
||||||
horizontalAlignment: TextEdit.AlignHCenter |
|
||||||
|
|
||||||
text: qsTr("TITLE") |
|
||||||
font.pixelSize: 12 |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
id: setupIndicator |
|
||||||
|
|
||||||
property bool setupComplete: true |
|
||||||
readonly property real indicatorRadius: 6 |
|
||||||
|
|
||||||
x: parent.width - (indicatorRadius * 2) - 5 |
|
||||||
y: (parent.height - (indicatorRadius * 2)) / 2 |
|
||||||
width: indicatorRadius * 2 |
|
||||||
height: indicatorRadius * 2 |
|
||||||
|
|
||||||
radius: indicatorRadius |
|
||||||
color: setupComplete ? "green" : "red" |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
width: parent.width |
|
||||||
height: parent.height - parent.titleHeight |
|
||||||
|
|
||||||
y: parent.titleHeight |
|
||||||
|
|
||||||
border.color: "#888" |
|
||||||
|
|
||||||
gradient: Gradient { |
|
||||||
GradientStop { |
|
||||||
position: 0 |
|
||||||
color: "#ffffff" |
|
||||||
} |
|
||||||
|
|
||||||
GradientStop { |
|
||||||
position: 1 |
|
||||||
color: "#000000" |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
ListView { |
|
||||||
id: summaryList |
|
||||||
anchors.fill: parent |
|
||||||
model: ListModel { |
|
||||||
ListElement { name: "Row 1"; state: "State 1" } |
|
||||||
ListElement { name: "Row 2"; state: "State 2" } |
|
||||||
ListElement { name: "Row 3"; state: "State 3" } |
|
||||||
} |
|
||||||
delegate: Row { Text { text: modelData.name } Text { text: modelData.state } } |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
*/ |
|
@ -1,51 +0,0 @@ |
|||||||
import QtQuick 2.2 |
|
||||||
import QtQuick.Controls 1.2 |
|
||||||
import QtQuick.Controls.Styles 1.2 |
|
||||||
//import QGroundControl.FactControls 1.0 |
|
||||||
|
|
||||||
Item { |
|
||||||
id: item1 |
|
||||||
width: 500 |
|
||||||
height: 500 |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
id: innerRect |
|
||||||
color: "#d298d2" |
|
||||||
z: 1 |
|
||||||
anchors.rightMargin: 15 |
|
||||||
anchors.leftMargin: 15 |
|
||||||
anchors.bottomMargin: 15 |
|
||||||
anchors.topMargin: 40 |
|
||||||
anchors.fill: parent |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
id: close |
|
||||||
x: parent.width - (width / 2) |
|
||||||
y: 0 - (height / 2) |
|
||||||
width: 30 |
|
||||||
height: 30 |
|
||||||
color: "#ffffff" |
|
||||||
radius: 15 |
|
||||||
z: 2 |
|
||||||
border.color: "#000000" |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
id: outerRect |
|
||||||
color: "#ffffff" |
|
||||||
opacity: 0.8 |
|
||||||
anchors.fill: parent |
|
||||||
|
|
||||||
Text { |
|
||||||
id: title |
|
||||||
x: 237 |
|
||||||
y: 8 |
|
||||||
text: qsTr("Setup Pane") |
|
||||||
anchors.horizontalCenter: parent.horizontalCenter |
|
||||||
font.pointSize: 20 |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,90 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<ui version="4.0"> |
||||||
|
<class>SetupView</class> |
||||||
|
<widget class="QWidget" name="SetupView"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>0</x> |
||||||
|
<y>0</y> |
||||||
|
<width>946</width> |
||||||
|
<height>821</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="windowTitle"> |
||||||
|
<string>Form</string> |
||||||
|
</property> |
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||||
|
<item> |
||||||
|
<widget class="QGCQuickWidget" name="buttonHolder"> |
||||||
|
<property name="sizePolicy"> |
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> |
||||||
|
<horstretch>0</horstretch> |
||||||
|
<verstretch>0</verstretch> |
||||||
|
</sizepolicy> |
||||||
|
</property> |
||||||
|
<property name="minimumSize"> |
||||||
|
<size> |
||||||
|
<width>160</width> |
||||||
|
<height>0</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
<property name="maximumSize"> |
||||||
|
<size> |
||||||
|
<width>160</width> |
||||||
|
<height>16777215</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
<property name="resizeMode"> |
||||||
|
<enum>QGCQuickWidget::SizeRootObjectToView</enum> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QWidget" name="setupWidget"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>0</x> |
||||||
|
<y>0</y> |
||||||
|
<width>400</width> |
||||||
|
<height>300</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="windowTitle"> |
||||||
|
<string>Form</string> |
||||||
|
</property> |
||||||
|
<property name="autoFillBackground"> |
||||||
|
<bool>true</bool> |
||||||
|
</property> |
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2"> |
||||||
|
<item> |
||||||
|
<layout class="QVBoxLayout" name="setupWidgetLayout"/> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<spacer name="verticalSpacer"> |
||||||
|
<property name="orientation"> |
||||||
|
<enum>Qt::Vertical</enum> |
||||||
|
</property> |
||||||
|
<property name="sizeHint" stdset="0"> |
||||||
|
<size> |
||||||
|
<width>20</width> |
||||||
|
<height>40</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
</spacer> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<customwidgets> |
||||||
|
<customwidget> |
||||||
|
<class>QGCQuickWidget</class> |
||||||
|
<extends>QQuickWidget</extends> |
||||||
|
<header>QGCQuickWidget.h</header> |
||||||
|
<container>1</container> |
||||||
|
</customwidget> |
||||||
|
</customwidgets> |
||||||
|
<resources/> |
||||||
|
<connections/> |
||||||
|
</ui> |
@ -0,0 +1,88 @@ |
|||||||
|
import QtQuick 2.2 |
||||||
|
import QtQuick.Controls 1.2 |
||||||
|
import QtQuick.Controls.Styles 1.2 |
||||||
|
import QGroundControl.FactSystem 1.0 |
||||||
|
import QGroundControl.Controls 1.0 |
||||||
|
|
||||||
|
Rectangle { |
||||||
|
id: topLevel |
||||||
|
|
||||||
|
QGCPalette { id: palette; colorGroup: QGCPalette.Active } |
||||||
|
color: palette.window |
||||||
|
|
||||||
|
signal firmwareButtonClicked; |
||||||
|
signal summaryButtonClicked; |
||||||
|
signal parametersButtonClicked; |
||||||
|
signal setupButtonClicked(variant component); |
||||||
|
|
||||||
|
ExclusiveGroup { id: setupButtonGroup } |
||||||
|
|
||||||
|
Component { |
||||||
|
id: disconnectedButtons |
||||||
|
|
||||||
|
Column { |
||||||
|
spacing: 10 |
||||||
|
|
||||||
|
SetupButton { |
||||||
|
id: firmwareButton; objectName: "firmwareButton" |
||||||
|
width: parent.width |
||||||
|
text: "FIRMWARE" |
||||||
|
setupIndicator: false |
||||||
|
exclusiveGroup: setupButtonGroup |
||||||
|
onClicked: topLevel.firmwareButtonClicked() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Component { |
||||||
|
id: connectedButtons |
||||||
|
|
||||||
|
Column { |
||||||
|
spacing: 10 |
||||||
|
|
||||||
|
SetupButton { |
||||||
|
id: summaryButton; objectName: "summaryButton" |
||||||
|
width: parent.width |
||||||
|
text: "VEHICLE SUMMARY" |
||||||
|
setupIndicator: false |
||||||
|
exclusiveGroup: setupButtonGroup |
||||||
|
onClicked: topLevel.summaryButtonClicked() |
||||||
|
} |
||||||
|
|
||||||
|
SetupButton { |
||||||
|
id: firmwareButton; objectName: "firmwareButton" |
||||||
|
width: parent.width |
||||||
|
text: "FIRMWARE" |
||||||
|
setupIndicator: false |
||||||
|
exclusiveGroup: setupButtonGroup |
||||||
|
onClicked: topLevel.firmwareButtonClicked() |
||||||
|
} |
||||||
|
|
||||||
|
Repeater { |
||||||
|
model: autopilot.components |
||||||
|
|
||||||
|
SetupButton { |
||||||
|
width: parent.width |
||||||
|
text: modelData.name.toUpperCase() |
||||||
|
setupComplete: modelData.setupComplete |
||||||
|
exclusiveGroup: setupButtonGroup |
||||||
|
onClicked: topLevel.setupButtonClicked(modelData) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
SetupButton { |
||||||
|
width: parent.width |
||||||
|
text: "PARAMETERS" |
||||||
|
setupIndicator: false |
||||||
|
exclusiveGroup: setupButtonGroup |
||||||
|
onClicked: topLevel.parametersButtonClicked() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
Loader { |
||||||
|
anchors.fill: parent |
||||||
|
sourceComponent: autopilot ? connectedButtons : disconnectedButtons |
||||||
|
} |
||||||
|
} |
@ -1,34 +0,0 @@ |
|||||||
import QtQuick 2.2 |
|
||||||
import QtQuick.Controls 1.2 |
|
||||||
import QtQuick.Controls.Styles 1.2 |
|
||||||
import QGroundControl.FactSystem 1.0 |
|
||||||
|
|
||||||
Rectangle { |
|
||||||
QGCPalette { id: palette; colorGroup: QGCPalette.Active } |
|
||||||
|
|
||||||
color: palette.window |
|
||||||
|
|
||||||
Item { |
|
||||||
anchors.margins: 20 |
|
||||||
anchors.fill: parent |
|
||||||
|
|
||||||
Rectangle { id: header; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8; |
|
||||||
Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Setup" } |
|
||||||
} |
|
||||||
|
|
||||||
Text { width: parent.width; height: parent.height - header.height - footer.height; |
|
||||||
anchors.top: header.bottom |
|
||||||
color: palette.windowText |
|
||||||
horizontalAlignment: Text.AlignHCenter |
|
||||||
verticalAlignment: Text.AlignVCenter |
|
||||||
text: "Vehicle Setup is only available while vehicle is connected." } |
|
||||||
|
|
||||||
Rectangle { id: footer; anchors.bottom: parent.bottom; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8; |
|
||||||
|
|
||||||
Button { id: firmwareButton; objectName: "firmwareButton"; |
|
||||||
anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter; |
|
||||||
text: "Firmware Upgrade" |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,19 +0,0 @@ |
|||||||
#include "SetupWidgetHolder.h" |
|
||||||
#include "ui_SetupWidgetHolder.h" |
|
||||||
|
|
||||||
SetupWidgetHolder::SetupWidgetHolder(QWidget *parent) : |
|
||||||
QDialog(parent), |
|
||||||
ui(new Ui::SetupWidgetHolder) |
|
||||||
{ |
|
||||||
ui->setupUi(this); |
|
||||||
} |
|
||||||
|
|
||||||
SetupWidgetHolder::~SetupWidgetHolder() |
|
||||||
{ |
|
||||||
delete ui; |
|
||||||
} |
|
||||||
|
|
||||||
void SetupWidgetHolder::setInnerWidget(QWidget* widget) |
|
||||||
{ |
|
||||||
ui->setupWidgetLayout->addWidget(widget); |
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
#ifndef SETUPWIDGETHOLDER_H |
|
||||||
#define SETUPWIDGETHOLDER_H |
|
||||||
|
|
||||||
#include <QDialog> |
|
||||||
|
|
||||||
namespace Ui { |
|
||||||
class SetupWidgetHolder; |
|
||||||
} |
|
||||||
|
|
||||||
class SetupWidgetHolder : public QDialog |
|
||||||
{ |
|
||||||
Q_OBJECT |
|
||||||
|
|
||||||
public: |
|
||||||
explicit SetupWidgetHolder(QWidget *parent = 0); |
|
||||||
~SetupWidgetHolder(); |
|
||||||
|
|
||||||
void setInnerWidget(QWidget* widget); |
|
||||||
|
|
||||||
private: |
|
||||||
Ui::SetupWidgetHolder *ui; |
|
||||||
}; |
|
||||||
|
|
||||||
#endif // SETUPWIDGETHOLDER_H
|
|
@ -1,40 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<ui version="4.0"> |
|
||||||
<class>SetupWidgetHolder</class> |
|
||||||
<widget class="QDialog" name="SetupWidgetHolder"> |
|
||||||
<property name="geometry"> |
|
||||||
<rect> |
|
||||||
<x>0</x> |
|
||||||
<y>0</y> |
|
||||||
<width>400</width> |
|
||||||
<height>300</height> |
|
||||||
</rect> |
|
||||||
</property> |
|
||||||
<property name="windowTitle"> |
|
||||||
<string>Form</string> |
|
||||||
</property> |
|
||||||
<property name="autoFillBackground"> |
|
||||||
<bool>true</bool> |
|
||||||
</property> |
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2"> |
|
||||||
<item> |
|
||||||
<layout class="QVBoxLayout" name="setupWidgetLayout"/> |
|
||||||
</item> |
|
||||||
<item> |
|
||||||
<spacer name="verticalSpacer"> |
|
||||||
<property name="orientation"> |
|
||||||
<enum>Qt::Vertical</enum> |
|
||||||
</property> |
|
||||||
<property name="sizeHint" stdset="0"> |
|
||||||
<size> |
|
||||||
<width>20</width> |
|
||||||
<height>40</height> |
|
||||||
</size> |
|
||||||
</property> |
|
||||||
</spacer> |
|
||||||
</item> |
|
||||||
</layout> |
|
||||||
</widget> |
|
||||||
<resources/> |
|
||||||
<connections/> |
|
||||||
</ui> |
|
@ -1,35 +0,0 @@ |
|||||||
/*=====================================================================
|
|
||||||
|
|
||||||
QGroundControl Open Source Ground Control Station |
|
||||||
|
|
||||||
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
|
||||||
|
|
||||||
This file is part of the QGROUNDCONTROL project |
|
||||||
|
|
||||||
QGROUNDCONTROL is free software: you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU General Public License as published by |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
QGROUNDCONTROL is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
======================================================================*/ |
|
||||||
|
|
||||||
/// @file
|
|
||||||
/// @author Don Gagne <don@thegagnes.com>
|
|
||||||
|
|
||||||
#include "VehicleComponentSummaryItem.h" |
|
||||||
|
|
||||||
VehicleComponentSummaryItem::VehicleComponentSummaryItem(const QString& name, const QString& state, QObject* parent) : |
|
||||||
QObject(parent), |
|
||||||
_name(name), |
|
||||||
_state(state) |
|
||||||
{ |
|
||||||
|
|
||||||
} |
|
@ -1,57 +0,0 @@ |
|||||||
/*=====================================================================
|
|
||||||
|
|
||||||
QGroundControl Open Source Ground Control Station |
|
||||||
|
|
||||||
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
|
||||||
|
|
||||||
This file is part of the QGROUNDCONTROL project |
|
||||||
|
|
||||||
QGROUNDCONTROL is free software: you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU General Public License as published by |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
QGROUNDCONTROL is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
======================================================================*/ |
|
||||||
|
|
||||||
#ifndef VehicleComponentSummaryItem_H |
|
||||||
#define VehicleComponentSummaryItem_H |
|
||||||
|
|
||||||
#include <QObject> |
|
||||||
#include <QQmlContext> |
|
||||||
#include <QQuickItem> |
|
||||||
|
|
||||||
#include "UASInterface.h" |
|
||||||
|
|
||||||
/// @file
|
|
||||||
/// @brief Vehicle Component class. A vehicle component is an object which
|
|
||||||
/// abstracts the physical portion of a vehicle into a set of
|
|
||||||
/// configurable values and user interface.
|
|
||||||
/// @author Don Gagne <don@thegagnes.com>
|
|
||||||
|
|
||||||
class VehicleComponentSummaryItem : public QObject |
|
||||||
{ |
|
||||||
Q_OBJECT |
|
||||||
|
|
||||||
Q_PROPERTY(QString name READ name CONSTANT) |
|
||||||
Q_PROPERTY(QString state READ state CONSTANT) |
|
||||||
|
|
||||||
public: |
|
||||||
VehicleComponentSummaryItem(const QString& name, const QString& state, QObject* parent = NULL); |
|
||||||
|
|
||||||
QString name(void) const { return _name; } |
|
||||||
QString state(void) const { return _state; } |
|
||||||
|
|
||||||
protected: |
|
||||||
QString _name; |
|
||||||
QString _state; |
|
||||||
}; |
|
||||||
|
|
||||||
#endif |
|
@ -1,10 +1,14 @@ |
|||||||
import QtQuick 2.2 |
import QtQuick 2.2 |
||||||
import QtQuick.Controls 1.2 |
import QtQuick.Controls 1.2 |
||||||
import QtQuick.Controls.Styles 1.2 |
import QtQuick.Controls.Styles 1.2 |
||||||
//import QGroundControl.FactControls 1.0 |
import QGroundControl.FactControls 1.0 |
||||||
|
|
||||||
Row { |
|
||||||
width: 200 |
Rectangle { |
||||||
Text { id: firstCol; text: "Col 1" } |
QGCPalette { id: palette; colorGroup: enabled ? QGCPalette.Active : QGCPalette.Disabled } |
||||||
Text { horizontalAlignment: Text.AlignRight; width: parent.width - firstCol.contentWidth; text: "Col 2" } |
|
||||||
|
width: 100 |
||||||
|
height: 100 |
||||||
|
color: "#e43f3f" |
||||||
|
// palette.windowText |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue