Commit 3b5740bc authored by Pritam Ghanghas's avatar Pritam Ghanghas

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol into apm_mode_support

parents 3a3a8afc 3ba9c2f8
......@@ -21,23 +21,25 @@ test_script:
- if "%CONFIG%" EQU "debug" ( debug\qgroundcontrol --unittest )
after_build:
- if "%CONFIG%" EQU "installer" ( appveyor PushArtifact C:\projects\qgroundcontrol\release\qgroundcontrol-installer-win32.exe )
- if "%CONFIG%" EQU "installer" ( appveyor PushArtifact C:\projects\qgroundcontrol\release\qgroundcontrol.exe )
deploy:
- provider: S3
name: qgroundcontrol-s3
access_key_id: AKIAIVORNALE7NHD3T6Q
access_key_id:
secure: IGAojLMqokL+76DbdulmWDA3MTsxEBBi3ReVVSqTy9c=
secret_access_key:
secure: RiYqaR+3T2PMNz2j5ur8LCA6H/Zfd4jTX33CZE5iBxm+zaz4QLs25p0B7prpaoNN
bucket: qgrondcontrol
bucket: qgroundcontrol
set_public: true
folder: "%APPVEYOR_REPO_BRANCH%"
artifact: C:\projects\qgroundcontrol\release\qgroundcontrol-installer-win32.exe
folder: $(APPVEYOR_REPO_BRANCH)
artifcat: 'release\qgroundcontrol.exe'
on:
CONFIG: installer
- provider: GitHub
artifact: C:\projects\qgroundcontrol\release\qgroundcontrol-installer-win32.exe
artifact: 'release\qgroundcontrol.exe'
draft: false
prerelease: false
on:
appveyor_repo_tag: true
CONFIG: installer
appveyor_repo_tag: true
\ No newline at end of file
......@@ -162,12 +162,10 @@ INCLUDEPATH += \
FORMS += \
src/QGCQmlWidgetHolder.ui \
src/ui/Linechart.ui \
src/ui/LogReplayLinkConfigurationWidget.ui \
src/ui/MainWindow.ui \
src/ui/MAVLinkSettingsWidget.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCLinkConfiguration.ui \
src/ui/QGCMapRCToParamDialog.ui \
src/ui/QGCMAVLinkLogPlayer.ui \
......@@ -185,7 +183,9 @@ FORMS += \
!MobileBuild {
FORMS += \
src/ui/Linechart.ui \
src/ui/MultiVehicleDockWidget.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCHilConfiguration.ui \
src/ui/QGCHilFlightGearConfiguration.ui \
src/ui/QGCHilJSBSimConfiguration.ui \
......@@ -230,6 +230,7 @@ HEADERS += \
src/QGCApplication.h \
src/QGCComboBox.h \
src/QGCConfig.h \
src/QGCDockWidget.h \
src/QGCFileDialog.h \
src/QGCGeo.h \
src/QGCLoggingCategory.h \
......@@ -251,19 +252,11 @@ HEADERS += \
src/uas/UAS.h \
src/uas/UASInterface.h \
src/uas/UASMessageHandler.h \
src/ui/linechart/ChartPlot.h \
src/ui/linechart/IncrementalPlot.h \
src/ui/linechart/LinechartPlot.h \
src/ui/linechart/Linecharts.h \
src/ui/linechart/LinechartWidget.h \
src/ui/linechart/Scrollbar.h \
src/ui/linechart/ScrollZoomer.h \
src/ui/LogReplayLinkConfigurationWidget.h \
src/ui/MainWindow.h \
src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCLinkConfiguration.h \
src/ui/QGCMapRCToParamDialog.h \
src/ui/QGCMAVLinkLogPlayer.h \
......@@ -289,10 +282,17 @@ HEADERS += \
src/comm/QGCHilLink.h \
src/comm/QGCJSBSimLink.h \
src/comm/QGCXPlaneLink.h \
src/QGCDockWidget.h \
src/ui/CameraView.h \
src/ui/HILDockWidget.h \
src/ui/linechart/ChartPlot.h \
src/ui/linechart/IncrementalPlot.h \
src/ui/linechart/LinechartPlot.h \
src/ui/linechart/Linecharts.h \
src/ui/linechart/LinechartWidget.h \
src/ui/linechart/Scrollbar.h \
src/ui/linechart/ScrollZoomer.h \
src/ui/MultiVehicleDockWidget.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCHilConfiguration.h \
src/ui/QGCHilFlightGearConfiguration.h \
src/ui/QGCHilJSBSimConfiguration.h \
......@@ -340,6 +340,7 @@ SOURCES += \
src/QGC.cc \
src/QGCApplication.cc \
src/QGCComboBox.cc \
src/QGCDockWidget.cc \
src/QGCFileDialog.cc \
src/QGCLoggingCategory.cc \
src/QGCPalette.cc \
......@@ -356,19 +357,11 @@ SOURCES += \
src/uas/FileManager.cc \
src/uas/UAS.cc \
src/uas/UASMessageHandler.cc \
src/ui/linechart/ChartPlot.cc \
src/ui/linechart/IncrementalPlot.cc \
src/ui/linechart/LinechartPlot.cc \
src/ui/linechart/Linecharts.cc \
src/ui/linechart/LinechartWidget.cc \
src/ui/linechart/Scrollbar.cc \
src/ui/linechart/ScrollZoomer.cc \
src/ui/LogReplayLinkConfigurationWidget.cc \
src/ui/MainWindow.cc \
src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/QGCLinkConfiguration.cc \
src/ui/QGCMapRCToParamDialog.cpp \
src/ui/QGCMAVLinkLogPlayer.cc \
......@@ -393,10 +386,17 @@ SOURCES += \
src/comm/QGCFlightGearLink.cc \
src/comm/QGCJSBSimLink.cc \
src/comm/QGCXPlaneLink.cc \
src/QGCDockWidget.cc \
src/ui/CameraView.cc \
src/ui/HILDockWidget.cc \
src/ui/linechart/ChartPlot.cc \
src/ui/linechart/IncrementalPlot.cc \
src/ui/linechart/LinechartPlot.cc \
src/ui/linechart/Linecharts.cc \
src/ui/linechart/LinechartWidget.cc \
src/ui/linechart/Scrollbar.cc \
src/ui/linechart/ScrollZoomer.cc \
src/ui/MultiVehicleDockWidget.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/QGCHilConfiguration.cc \
src/ui/QGCHilFlightGearConfiguration.cc \
src/ui/QGCHilJSBSimConfiguration.cc \
......
......@@ -46,7 +46,7 @@ installer {
# easier to debug user crashes.
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY $${DESTDIR_WIN}\\qgroundcontrol.pdb
#QMAKE_POST_LINK += $$escape_expand(\\n) del $${DESTDIR_WIN}\\qgroundcontrol.pdb
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\qgroundcontrol-installer-win32.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\qgroundcontrol.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
#QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY qgroundcontrol.pdb $${DESTDIR_WIN}
#QMAKE_POST_LINK += $$escape_expand(\\n) del qgroundcontrol.pdb
OTHER_FILES += deploy/qgroundcontrol_installer.nsi
......
......@@ -63,7 +63,7 @@ Supported builds are 64 bit, built using the clang compiler.
Supported builds for Linux are 32 or 64-bit, built using gcc.
#### Install Qt5.4 and SDL1.2 prerequistites
* For Fedora: `sudo yum install qt-creator qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtwebkit-devel SDL-devel SDL-static systemd-devel qt5-qtgraphicaleffects qt5-qtquickcontrols`
* For Fedora: `sudo yum install qt-creator qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtwebkit-devel SDL-devel SDL-static systemd-devel qt5-qtgraphicaleffects qt5-qtquickcontrols qt5-qtlocation-devel`
* For Arch Linux: `pacman -Sy qtcreator qt5-base qt5-declarative qt5-serialport qt5-svg qt5-webkit`
* For Ubuntu: Please be aware that the time of writing, Qt5.4 is unavailable in the official repositories Ubuntu 14.04/Mint 17
* Add this PPA for Qt5.4: `sudo add-apt-repository ppa:beineri/opt-qt541-trusty`
......
[Desktop Entry]
Type=Application
Name=qgroundcontrol
GenericName=Ground Control Station
Comment=UAS ground control station
Icon=qgroundcontrol
Exec=qgroundcontrol
Terminal=false
Categories=Utility;
Keywords=computer;
......@@ -117,6 +117,7 @@
<file alias="QGroundControl/Controls/DropButton.qml">src/QmlControls/DropButton.qml</file>
<file alias="QGroundControl/Controls/RoundButton.qml">src/QmlControls/RoundButton.qml</file>
<file alias="QGroundControl/Controls/QGCCanvas.qml">src/QmlControls/QGCCanvas.qml</file>
<file alias="QGroundControl/Controls/ExclusiveGroupItem.qml">src/QmlControls/ExclusiveGroupItem.qml</file>
<!-- Vehicle Setup -->
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
......
......@@ -35,7 +35,7 @@ This file is part of the QGROUNDCONTROL project
const char* kMainFlightDisplayViewGroup = "FlightDisplayView";
FlightDisplayView::FlightDisplayView(QWidget *parent)
: QGCQmlWidgetHolder(parent)
: QGCQmlWidgetHolder(QString(), NULL, parent)
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setObjectName("FlightDisplayView");
......
......@@ -34,8 +34,8 @@ This file is part of the QGROUNDCONTROL project
const char* kMainFlightDisplayWidgetGroup = "FlightDisplayWidget";
FlightDisplayWidget::FlightDisplayWidget(QWidget *parent)
: QGCQmlWidgetHolder(parent)
FlightDisplayWidget::FlightDisplayWidget(const QString& title, QAction* action, QWidget *parent)
: QGCQmlWidgetHolder(title, action, parent)
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setObjectName("FlightDisplayWidget");
......@@ -86,6 +86,8 @@ FlightDisplayWidget::FlightDisplayWidget(QWidget *parent)
setSource(QUrl::fromUserInput("qrc:/qml/FlightDisplayWidget.qml"));
setVisible(true);
loadSettings();
}
FlightDisplayWidget::~FlightDisplayWidget()
......
......@@ -30,7 +30,7 @@ class FlightDisplayWidget : public QGCQmlWidgetHolder
{
Q_OBJECT
public:
FlightDisplayWidget(QWidget* parent = NULL);
FlightDisplayWidget(const QString& title, QAction* action, QWidget* parent = NULL);
~FlightDisplayWidget();
/// @brief Invokes the Flight Display Options menu
......
......@@ -50,8 +50,8 @@ Map {
property string mapName: 'defaultMap'
property string mapType: QGroundControl.flightMapSettings.mapTypeForMapName(mapName)
property alias mapWidgets: controlWidgets
property bool isSatelliteMap: false
property bool isSatelliteMap: mapType == "Satellite Map" || mapType == "Hybrid Map"
property real lon: (longitude >= -180 && longitude <= 180) ? longitude : 0
property real lat: (latitude >= -90 && latitude <= 90) ? latitude : 0
......@@ -289,4 +289,11 @@ Map {
}
}
*/
MouseArea {
//-- TODO: Check if this is still needed when we switch to 5.5.1
//-- Workaround for QTBUG-46388 (Pinch zoom doesn't work without it on mobile)
anchors.fill: parent
}
} // Map
......@@ -35,9 +35,11 @@ This file is part of the QGROUNDCONTROL project
const char* MissionEditor::_settingsGroup = "MissionEditor";
MissionEditor::MissionEditor(QWidget *parent)
: QGCQmlWidgetHolder(parent)
: QGCQmlWidgetHolder(QString(), NULL, parent)
, _missionItems(NULL)
, _canEdit(true)
, _activeVehicle(NULL)
, _liveHomePositionAvailable(false)
{
// Get rid of layout default margins
QLayout* pl = layout();
......@@ -45,11 +47,16 @@ MissionEditor::MissionEditor(QWidget *parent)
pl->setContentsMargins(0,0,0,0);
}
Vehicle* activeVehicle = MultiVehicleManager::instance()->activeVehicle();
MultiVehicleManager* multiVehicleMgr = MultiVehicleManager::instance();
connect(multiVehicleMgr, &MultiVehicleManager::activeVehicleChanged, this, &MissionEditor::_activeVehicleChanged);
Vehicle* activeVehicle = multiVehicleMgr->activeVehicle();
if (activeVehicle) {
MissionManager* missionManager = activeVehicle->missionManager();
connect(missionManager, &MissionManager::newMissionItemsAvailable, this, &MissionEditor::_newMissionItemsAvailable);
_newMissionItemsAvailable();
_activeVehicleChanged(activeVehicle);
} else {
_missionItems = new QmlObjectListModel(this);
_initAllMissionItems();
......@@ -135,52 +142,6 @@ void MissionEditor::removeMissionItem(int index)
_recalcAll();
}
void MissionEditor::moveUp(int index)
{
if (!_canEdit) {
qWarning() << "addMissionItem called with _canEdit == false";
return;
}
if (_missionItems->count() < 2 || index <= 0 || index >= _missionItems->count()) {
return;
}
MissionItem item1 = *qobject_cast<MissionItem*>(_missionItems->get(index - 1));
MissionItem item2 = *qobject_cast<MissionItem*>(_missionItems->get(index));
_missionItems->removeAt(index - 1);
_missionItems->removeAt(index - 1);
_missionItems->insert(index - 1, new MissionItem(item2, _missionItems));
_missionItems->insert(index, new MissionItem(item1, _missionItems));
_recalcAll();
}
void MissionEditor::moveDown(int index)
{
if (!_canEdit) {
qWarning() << "addMissionItem called with _canEdit == false";
return;
}
if (_missionItems->count() < 2 || index >= _missionItems->count() - 1) {
return;
}
MissionItem item1 = *qobject_cast<MissionItem*>(_missionItems->get(index));
MissionItem item2 = *qobject_cast<MissionItem*>(_missionItems->get(index + 1));
_missionItems->removeAt(index);
_missionItems->removeAt(index);
_missionItems->insert(index, new MissionItem(item2, _missionItems));
_missionItems->insert(index + 1, new MissionItem(item1, _missionItems));
_recalcAll();
}
void MissionEditor::loadMissionFromFile(void)
{
QString errorString;
......@@ -389,3 +350,34 @@ void MissionEditor::_itemCommandChanged(MavlinkQmlSingleton::Qml_MAV_CMD command
_recalcChildItems();
_recalcWaypointLines();
}
void MissionEditor::_activeVehicleChanged(Vehicle* activeVehicle)
{
if (_activeVehicle) {
disconnect(_activeVehicle, &Vehicle::homePositionAvailableChanged, this, &MissionEditor::_activeVehicleHomePositionAvailableChanged);
disconnect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionEditor::_activeVehicleHomePositionChanged);
_activeVehicle = NULL;
_activeVehicleHomePositionAvailableChanged(false);
}
_activeVehicle = activeVehicle;
if (_activeVehicle) {
connect(_activeVehicle, &Vehicle::homePositionAvailableChanged, this, &MissionEditor::_activeVehicleHomePositionAvailableChanged);
connect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionEditor::_activeVehicleHomePositionChanged);
_activeVehicleHomePositionChanged(_activeVehicle->homePosition());
_activeVehicleHomePositionAvailableChanged(_activeVehicle->homePositionAvailable());
}
}
void MissionEditor::_activeVehicleHomePositionAvailableChanged(bool homePositionAvailable)
{
_liveHomePositionAvailable = homePositionAvailable;
emit liveHomePositionAvailableChanged(_liveHomePositionAvailable);
}
void MissionEditor::_activeVehicleHomePositionChanged(const QGeoCoordinate& homePosition)
{
_liveHomePosition = homePosition;
emit liveHomePositionChanged(_liveHomePosition);
}
......@@ -26,6 +26,7 @@ This file is part of the QGROUNDCONTROL project
#include "QGCQmlWidgetHolder.h"
#include "QmlObjectListModel.h"
#include "Vehicle.h"
class MissionEditor : public QGCQmlWidgetHolder
{
......@@ -35,9 +36,11 @@ public:
MissionEditor(QWidget* parent = NULL);
~MissionEditor();
Q_PROPERTY(QmlObjectListModel* missionItems READ missionItems NOTIFY missionItemsChanged)
Q_PROPERTY(QmlObjectListModel* waypointLines READ waypointLines NOTIFY waypointLinesChanged)
Q_PROPERTY(bool canEdit READ canEdit NOTIFY canEditChanged)
Q_PROPERTY(QmlObjectListModel* missionItems READ missionItems NOTIFY missionItemsChanged)
Q_PROPERTY(QmlObjectListModel* waypointLines READ waypointLines NOTIFY waypointLinesChanged)
Q_PROPERTY(bool canEdit READ canEdit NOTIFY canEditChanged)
Q_PROPERTY(bool liveHomePositionAvailable READ liveHomePositionAvailable NOTIFY liveHomePositionAvailableChanged)
Q_PROPERTY(QGeoCoordinate liveHomePosition READ liveHomePosition NOTIFY liveHomePositionChanged)
Q_INVOKABLE int addMissionItem(QGeoCoordinate coordinate);
Q_INVOKABLE void getMissionItems(void);
......@@ -45,24 +48,29 @@ public:
Q_INVOKABLE void loadMissionFromFile(void);
Q_INVOKABLE void saveMissionToFile(void);
Q_INVOKABLE void removeMissionItem(int index);
Q_INVOKABLE void moveUp(int index);
Q_INVOKABLE void moveDown(int index);
// Property accessors
QmlObjectListModel* missionItems(void) { return _missionItems; }
QmlObjectListModel* waypointLines(void) { return &_waypointLines; }
bool canEdit(void) { return _canEdit; }
bool liveHomePositionAvailable(void) { return _liveHomePositionAvailable; }
QGeoCoordinate liveHomePosition(void) { return _liveHomePosition; }
signals:
void missionItemsChanged(void);
void canEditChanged(bool canEdit);
void waypointLinesChanged(void);
void liveHomePositionAvailableChanged(bool homePositionAvailable);
void liveHomePositionChanged(const QGeoCoordinate& homePosition);
private slots:
void _newMissionItemsAvailable();
void _itemCoordinateChanged(const QGeoCoordinate& coordinate);
void _itemCommandChanged(MavlinkQmlSingleton::Qml_MAV_CMD command);
void _activeVehicleChanged(Vehicle* activeVehicle);
void _activeVehicleHomePositionAvailableChanged(bool homePositionAvailable);
void _activeVehicleHomePositionChanged(const QGeoCoordinate& homePosition);
private:
void _recalcSequence(void);
......@@ -78,7 +86,10 @@ private:
QmlObjectListModel* _missionItems;
QmlObjectListModel _waypointLines;
bool _canEdit; ///< true: UI can edit these items, false: can't edit, can only send to vehicle or save
Vehicle* _activeVehicle;
bool _liveHomePositionAvailable;
QGeoCoordinate _liveHomePosition;
static const char* _settingsGroup;
};
......
This diff is collapsed.
......@@ -450,9 +450,11 @@ bool QGCApplication::_initForNormalAppBoot(void)
splashScreen->finish(mainWindow);
mainWindow->splashScreenFinished();
#ifndef __mobile__
// Now that main window is up check for lost log files
connect(this, &QGCApplication::checkForLostLogFiles, MAVLinkProtocol::instance(), &MAVLinkProtocol::checkForLostLogFiles);
emit checkForLostLogFiles();
#endif
// Load known link configurations
LinkManager::instance()->loadLinkConfigurationList();
......
......@@ -24,24 +24,51 @@
#include "QGCDockWidget.h"
#include <QCloseEvent>
#include <QSettings>
QGCDockWidget::QGCDockWidget(const QString& title, QAction* action, QWidget *parent, Qt::WindowFlags flags) :
QDockWidget(title, parent, flags),
_action(action)
const char* QGCDockWidget::_settingsGroup = "DockWidgets";
QGCDockWidget::QGCDockWidget(const QString& title, QAction* action, QWidget* parent)
: QWidget(parent)
, _title(title)
, _action(action)
{
QDockWidget::DockWidgetFeatures features = QDockWidget::DockWidgetMovable;
if (action) {
features |= QDockWidget::DockWidgetClosable;
}
setFeatures(features);
if (action) {
setWindowTitle(title);
setWindowFlags(Qt::Tool);
loadSettings();
}
}
// Instead of destroying the widget just hide it
void QGCDockWidget::closeEvent(QCloseEvent* event)
{
Q_ASSERT(_action);
event->ignore();
_action->trigger();
if (_action) {
saveSettings();
event->ignore();
_action->trigger();
}
}
void QGCDockWidget::loadSettings(void)
{
if (_action) {
QSettings settings;
settings.beginGroup(_settingsGroup);
if (settings.contains(_title)) {
restoreGeometry(settings.value(_title).toByteArray());
}
}
}
void QGCDockWidget::saveSettings(void)
{
if (_action) {
QSettings settings;
settings.beginGroup(_settingsGroup);
settings.setValue(_title, saveGeometry());
}
}
......@@ -27,21 +27,22 @@
#include <QDockWidget>
#include <QAction>
/// @file
/// @brief Subclass of QDockWidget so we can intercept the closeEvent.
///
/// @author Don Gagne <don@thegagnes.com>
class QGCDockWidget : public QDockWidget {
class QGCDockWidget : public QWidget {
Q_OBJECT
public:
QGCDockWidget(const QString& title, QAction* action, QWidget *parent = 0, Qt::WindowFlags flags = 0);
/// Pass in title = QString() and action = NULL when just using as a regular widget
QGCDockWidget(const QString& title, QAction* action, QWidget *parent = 0);
void loadSettings(void);
void saveSettings(void);
void closeEvent(QCloseEvent* event);
private:
QAction* _action;
protected:
QString _title;
QAction* _action;
static const char* _settingsGroup;
};
......
......@@ -26,10 +26,14 @@
#include "QGCQmlWidgetHolder.h"
QGCQmlWidgetHolder::QGCQmlWidgetHolder(QWidget *parent) :
QWidget(parent)
QGCQmlWidgetHolder::QGCQmlWidgetHolder(const QString& title, QAction* action, QWidget *parent) :
QGCDockWidget(title, action, parent)
{
_ui.setupUi(this);
if (action) {
setWindowTitle(title);
}
setResizeMode(QQuickWidget::SizeRootObjectToView);
}
......
......@@ -27,10 +27,10 @@
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include <QWidget>
#include "QGCDockWidget.h"
#include "AutoPilotPlugin.h"
#include "ui_QGCQmlWidgetHolder.h"
#include "AutoPilotPlugin.h"
namespace Ui {
class QGCQmlWidgetHolder;
......@@ -38,12 +38,16 @@ class QGCQmlWidgetHolder;
/// This is used to create widgets which are implemented in QML.
class QGCQmlWidgetHolder : public QWidget
class QGCQmlWidgetHolder : public QGCDockWidget
{
Q_OBJECT
public:
explicit QGCQmlWidgetHolder(QWidget *parent = 0);
// This has a title and action since the base class is QGCDockWidget. In order to use this
// control as a normal QWidget, not a doc widget just pass in:
// title = QString()
// action = NULL
explicit QGCQmlWidgetHolder(const QString& title, QAction* action, QWidget *parent = 0);
~QGCQmlWidgetHolder();
/// Sets the UAS into the widget which in turn will load facts into the context
......
import QtQuick 2.4
import QtQuick.Controls 1.2
/// The ExclusiveGroupItem control can be used as a base class for a control which
/// needs support for ExclusiveGroup
Item {
id: _root
property bool checked: false
property ExclusiveGroup exclusiveGroup: null
onExclusiveGroupChanged: {
if (exclusiveGroup) {
exclusiveGroup.bindCheckable(_root)
}
}
}
......@@ -13,17 +13,16 @@ import QGroundControl.Palette 1.0
Rectangle {
id: _root
property var missionItem
property var missionItem ///< MissionItem associated with this editor
property bool readOnly ///< true: read only view, false: full editing view
signal clicked
signal remove
signal moveUp
signal moveDown
height: missionItem.isCurrentItem ?
(missionItem.textFieldFacts.count * (measureTextField.height + _margin)) +
(missionItem.checkboxFacts.count * (measureCheckbox.height + _margin)) +
commandPicker.height + deleteButton.height + (_margin * 9) :
commandPicker.height + (deleteButton.visible ? deleteButton.height : 0) + (_margin * 9) :
commandPicker.height + (_margin * 2)
color: missionItem.isCurrentItem ? qgcPal.buttonHighlight : qgcPal.windowShade
......@@ -63,7 +62,6 @@ Rectangle {
onClicked: _root.clicked()
}
QGCComboBox {
id: commandPicker
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 10
......@@ -71,7 +69,7 @@ Rectangle {
anchors.right: parent.right
currentIndex: missionItem.commandByIndex
model: missionItem.commandNames
visible: missionItem.sequenceNumber != 0
visible: missionItem.sequenceNumber != 0 // Item 0 is home position, can't change item type
onActivated: missionItem.commandByIndex = index
}
......@@ -79,7 +77,7 @@ Rectangle {
Rectangle {
anchors.fill: commandPicker
color: qgcPal.button
visible: missionItem.sequenceNumber == 0
visible: missionItem.sequenceNumber == 0 // Item 0 is home position, can't change item type
QGCLabel {
id: homeLabel
......@@ -119,6 +117,7 @@ Rectangle {
height: textField.height
QGCLabel {
id: textFieldLabel
anchors.baseline: textField.baseline
text: object.name
}
......@@ -129,6 +128,14 @@ Rectangle {
width: _editFieldWidth
showUnits: true
fact: object
visible: !_root.readOnly
}
FactLabel {
anchors.baseline: textFieldLabel.baseline
anchors.right: parent.right
fact: object
visible: _root.readOnly
}
}
}
......@@ -160,26 +167,13 @@ Rectangle {
readonly property real buttonWidth: (width - (_margin * 2)) / 3
QGCButton {
id: deleteButton
width: parent.buttonWidth
text: "Delete"
id: deleteButton
width: parent.buttonWidth
text: "Delete"
visible: !readOnly
onClicked: _root.remove()
}
QGCButton {
width: parent.buttonWidth
text: "Up"