From 6d57536ff31fbd1f531b2f310bf62dfa24492c3f Mon Sep 17 00:00:00 2001 From: m_thread Date: Mon, 11 Nov 2013 10:01:16 +0100 Subject: [PATCH 01/30] OP-1107 Still not working but all gui elements are in place. --- .../{authorsdialog.cpp => aboutdialog.cpp} | 46 ++-- .../{authorsdialog.h => aboutdialog.h} | 37 ++-- .../src/plugins/coreplugin/aboutdialog.ui | 36 ++++ .../src/plugins/coreplugin/core.qrc | 2 - .../src/plugins/coreplugin/coreplugin.pro | 15 +- .../src/plugins/coreplugin/mainwindow.cpp | 87 ++------ .../src/plugins/coreplugin/mainwindow.h | 13 +- .../plugins/coreplugin/qml/AboutDialog.qml | 200 +++++++++--------- .../coreplugin/qml/AuthorsModel.qml.template | 2 +- .../coreplugin/qml/ScrollDecorator.qml | 40 ---- .../src/plugins/coreplugin/qml/TabWidget.qml | 102 --------- .../src/plugins/coreplugin/versiondialog.cpp | 109 ---------- .../src/plugins/coreplugin/versiondialog.h | 44 ---- 13 files changed, 195 insertions(+), 538 deletions(-) rename ground/openpilotgcs/src/plugins/coreplugin/{authorsdialog.cpp => aboutdialog.cpp} (77%) rename ground/openpilotgcs/src/plugins/coreplugin/{authorsdialog.h => aboutdialog.h} (74%) create mode 100644 ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui delete mode 100644 ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml delete mode 100644 ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml delete mode 100644 ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp delete mode 100644 ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h diff --git a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp similarity index 77% rename from ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp rename to ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp index c4f94d6aa..b6a9016a0 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp @@ -1,14 +1,9 @@ /** ****************************************************************************** * - * @file authorsdialog.cpp + * @file aboutdialog.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -26,46 +21,38 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "authorsdialog.h" +#include "aboutdialog.h" +#include "ui_aboutdialog.h" #include "version_info/version_info.h" #include "coreconstants.h" #include "icore.h" -#include - #include #include #include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include - -using namespace Core; -using namespace Core::Internal; using namespace Core::Constants; -AuthorsDialog::AuthorsDialog(QWidget *parent) - : QDialog(parent) +AboutDialog::AboutDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutDialog) { - // We need to set the window icon explicitly here since for some reason the - // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME) + ui->setupUi(this); setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png")); setWindowTitle(tr("About OpenPilot")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - // This loads a QML doc containing a Tabbed view - QDeclarativeView *view = new QDeclarativeView(this); + + // This loads a QML doc + QQuickView *view = new QQuickView(); + QWidget *container = QWidget::createWindowContainer(view, this); view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml")); + ui->verticalLayout->addWidget(container); QString version = QLatin1String(GCS_VERSION_LONG); version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate); @@ -108,3 +95,8 @@ AuthorsDialog::AuthorsDialog(QWidget *parent) // Expose the version description to the QML doc view->rootContext()->setContextProperty("version", description); } + +AboutDialog::~AboutDialog() +{ + delete ui; +} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.h b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h similarity index 74% rename from ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.h rename to ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h index 7c88cdf0e..d9d97f1eb 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h @@ -1,14 +1,9 @@ /** ****************************************************************************** * - * @file authors.h + * @file aboutdialog.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -26,19 +21,25 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef AUTHORSDIALOG_H -#define AUTHORSDIALOG_H +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H #include -namespace Core { -namespace Internal { -class AuthorsDialog : public QDialog { - Q_OBJECT -public: - explicit AuthorsDialog(QWidget *parent); -}; -} // namespace Internal -} // namespace Core +namespace Ui { +class AboutDialog; +} -#endif // AUTHORSDIALOG_H +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +private: + Ui::AboutDialog *ui; +}; + +#endif // ABOUTDIALOG_H diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui new file mode 100644 index 000000000..6e50a77c3 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui @@ -0,0 +1,36 @@ + + + AboutDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + diff --git a/ground/openpilotgcs/src/plugins/coreplugin/core.qrc b/ground/openpilotgcs/src/plugins/coreplugin/core.qrc index 8a4418c53..f8158f9be 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/core.qrc +++ b/ground/openpilotgcs/src/plugins/coreplugin/core.qrc @@ -62,8 +62,6 @@ images/cpu.png images/tx-rx.svg qml/images/tab.png - qml/ScrollDecorator.qml - qml/TabWidget.qml qml/AboutDialog.qml ../../../../../build/openpilotgcs-synthetics/AuthorsModel.qml diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro index 1631fda8f..312fc2acb 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = Core DEFINES += CORE_LIBRARY -QT += declarative \ +QT += quick \ xml \ network \ script \ @@ -32,7 +32,6 @@ SOURCES += mainwindow.cpp \ uniqueidmanager.cpp \ messagemanager.cpp \ messageoutputwindow.cpp \ - versiondialog.cpp \ iuavgadget.cpp \ uavgadgetmanager/uavgadgetmanager.cpp \ uavgadgetmanager/uavgadgetview.cpp \ @@ -70,8 +69,8 @@ SOURCES += mainwindow.cpp \ uavgadgetdecorator.cpp \ workspacesettings.cpp \ uavconfiginfo.cpp \ - authorsdialog.cpp \ - telemetrymonitorwidget.cpp + telemetrymonitorwidget.cpp \ + aboutdialog.cpp HEADERS += mainwindow.h \ tabpositionindicator.h \ @@ -105,7 +104,6 @@ HEADERS += mainwindow.h \ iversioncontrol.h \ iview.h \ icorelistener.h \ - versiondialog.h \ core_global.h \ basemode.h \ baseview.h \ @@ -131,15 +129,16 @@ HEADERS += mainwindow.h \ uavgadgetdecorator.h \ workspacesettings.h \ uavconfiginfo.h \ - authorsdialog.h \ iconfigurableplugin.h \ - telemetrymonitorwidget.h + telemetrymonitorwidget.h \ + aboutdialog.h FORMS += dialogs/settingsdialog.ui \ dialogs/shortcutsettings.ui \ generalsettings.ui \ uavgadgetoptionspage.ui \ - workspacesettings.ui + workspacesettings.ui \ + aboutdialog.ui RESOURCES += core.qrc \ fancyactionbar.qrc diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index ecb57a0b2..179ca92f7 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -45,7 +45,7 @@ #include "uavgadgetinstancemanager.h" #include "workspacesettings.h" -#include "authorsdialog.h" +#include "aboutdialog.h" #include "baseview.h" #include "ioutputpane.h" #include "icorelistener.h" @@ -56,7 +56,6 @@ #include "threadmanager.h" #include "uniqueidmanager.h" #include "variablemanager.h" -#include "versiondialog.h" #include #include @@ -114,8 +113,7 @@ MainWindow::MainWindow() : m_modeManager(0), m_connectionManager(0), m_mimeDatabase(new MimeDatabase), - m_versionDialog(0), - m_authorsDialog(0), + m_aboutDialog(0), m_activeContext(0), m_generalSettings(new GeneralSettings), m_shortcutSettings(new ShortcutSettings), @@ -793,7 +791,7 @@ void MainWindow::registerDefaultActions() #ifdef Q_WS_MAC cmd->action()->setMenuRole(QAction::ApplicationSpecificRole); #endif - connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutOpenPilotAuthors())); + connect(tmpaction, SIGNAL(triggered()), this, SLOT(showAboutDialog())); } void MainWindow::newFile() @@ -802,42 +800,6 @@ void MainWindow::newFile() void MainWindow::openFile() {} -/*static QList getNonEditorFileFactories() - { - QList tmp; - return tmp; - } - - static IFileFactory *findFileFactory(const QList &fileFactories, - const MimeDatabase *db, - const QFileInfo &fi) - { - if (const MimeType mt = db->findByFile(fi)) { - const QString type = mt.type(); - foreach (IFileFactory *factory, fileFactories) { - if (factory->mimeTypes().contains(type)) - return factory; - } - } - return 0; - } - - // opens either an editor or loads a project - void MainWindow::openFiles(const QStringList &fileNames) - { - QList nonEditorFileFactories = getNonEditorFileFactories(); - - foreach (const QString &fileName, fileNames) { - const QFileInfo fi(fileName); - const QString absoluteFilePath = fi.absoluteFilePath(); - if (IFileFactory *fileFactory = findFileFactory(nonEditorFileFactories, mimeDatabase(), fi)) { - fileFactory->open(absoluteFilePath); - } else { - - } - } - }*/ - void MainWindow::setFocusToEditor() {} @@ -1404,43 +1366,24 @@ void MainWindow::openRecentFile() if (!fileName.isEmpty()) {} } -void MainWindow::aboutOpenPilotGCS() +void MainWindow::showAboutDialog() { - if (!m_versionDialog) { - m_versionDialog = new VersionDialog(this); - connect(m_versionDialog, SIGNAL(finished(int)), - this, SLOT(destroyVersionDialog())); + if (!m_aboutDialog) { + m_aboutDialog = new AboutDialog(this); + connect(m_aboutDialog, SIGNAL(finished(int)), + this, SLOT(destroyAboutDialog())); } - m_versionDialog->show(); + m_aboutDialog->show(); } -void MainWindow::destroyVersionDialog() +void MainWindow::destroyAboutDialog() { - if (m_versionDialog) { - m_versionDialog->deleteLater(); - m_versionDialog = 0; + if (m_aboutDialog) { + m_aboutDialog->deleteLater(); + m_aboutDialog = 0; } } -void MainWindow::aboutOpenPilotAuthors() -{ - if (!m_authorsDialog) { - m_authorsDialog = new AuthorsDialog(this); - connect(m_authorsDialog, SIGNAL(finished(int)), - this, SLOT(destroyAuthorsDialog())); - } - m_authorsDialog->show(); -} - -void MainWindow::destroyAuthorsDialog() -{ - if (m_authorsDialog) { - m_authorsDialog->deleteLater(); - m_authorsDialog = 0; - } -} - - void MainWindow::aboutPlugins() { PluginDialog dialog(this); @@ -1456,12 +1399,8 @@ void MainWindow::setFullScreen(bool on) if (on) { setWindowState(windowState() | Qt::WindowFullScreen); - // statusBar()->hide(); - // menuBar()->hide(); } else { setWindowState(windowState() & ~Qt::WindowFullScreen); - // menuBar()->show(); - // statusBar()->show(); } } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h index a1aa1f508..c19903424 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h @@ -43,6 +43,8 @@ class QToolButton; class MyTabWidget; QT_END_NAMESPACE +class AboutDialog; + namespace Core { class ActionManager; class BaseMode; @@ -72,8 +74,6 @@ class FancyTabWidget; class GeneralSettings; class ShortcutSettings; class WorkspaceSettings; -class VersionDialog; -class AuthorsDialog; class CORE_EXPORT MainWindow : public EventFilteringMainWindow { Q_OBJECT @@ -154,12 +154,10 @@ private slots: void openRecentFile(); void setFocusToEditor(); void saveAll(); - void aboutOpenPilotGCS(); + void showAboutDialog(); + void destroyAboutDialog(); void aboutPlugins(); - void aboutOpenPilotAuthors(); void updateFocusWidget(QWidget *old, QWidget *now); - void destroyVersionDialog(); - void destroyAuthorsDialog(); void modeChanged(Core::IMode *mode); void showUavGadgetMenus(bool show, bool hasSplitter); void applyTabBarSettings(QTabWidget::TabPosition pos, bool movable); @@ -191,8 +189,7 @@ private: MimeDatabase *m_mimeDatabase; MyTabWidget *m_modeStack; Core::BaseView *m_outputView; - VersionDialog *m_versionDialog; - AuthorsDialog *m_authorsDialog; + AboutDialog *m_aboutDialog; IContext *m_activeContext; diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml index 9e1d64f20..b6e7b7299 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml @@ -1,110 +1,100 @@ - /**************************************************************************** - ** - ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:BSD$ - ** You may use this file under the terms of the BSD license as follows: - ** - ** "Redistribution and use in source and binary forms, with or without - ** modification, are permitted provided that the following conditions are - ** met: - ** * Redistributions of source code must retain the above copyright - ** notice, this list of conditions and the following disclaimer. - ** * Redistributions in binary form must reproduce the above copyright - ** notice, this list of conditions and the following disclaimer in - ** the documentation and/or other materials provided with the - ** distribution. - ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor - ** the names of its contributors may be used to endorse or promote - ** products derived from this software without specific prior written - ** permission. - ** - ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +/** + ****************************************************************************** + * + * @file aboutdialog.qml + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. + *****************************************************************************/ +/* + * This program 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. + * + * This program 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 this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ - import QtQuick 1.1 - - // This is a tabbed pane element. Add a nested Rectangle to add a tab. - TabWidget { - // Define AuthorsModel as type - property AuthorsModel authors: AuthorsModel {} - - id: tabs - width: 640; height: 480 - // This tab is for the GCS version information - Rectangle { - property string title: "OpenPilot GCS" - anchors.fill: parent - color: "#e3e3e3" - - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#e3e3e3" - Image { - source: "../images/openpilot_logo_128.png" - x: 0; y: 0; z: 100 - fillMode: Image.PreserveAspectFit - } - Flickable { - anchors.fill: parent - anchors.centerIn: parent - Text { - id: versionLabel - x: 156; y: 0 - width: 430; height: 379 - horizontalAlignment: Qt.AlignLeft - font.pixelSize: 12 - wrapMode: Text.WordWrap - // @var version exposed in authorsdialog.cpp - text: version - } +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 + +GridLayout { + width: 600 + height: 400 + ColumnLayout { + id: columnLayout1 + anchors.fill: parent + spacing: 10 + RowLayout { + id: rowLayout1 + Image { + id: logo + anchors.left: parent.left + anchors.leftMargin: 10 + anchors.top: parent.top + anchors.topMargin: 10 + source: "../images/openpilot_logo_128.png" + z: 100 + fillMode: Image.PreserveAspectFit + } + TabView { + id: tabs + anchors.left: logo.right + anchors.leftMargin: 10 + anchors.right: parent.right + anchors.rightMargin: 10 + anchors.top: parent.top + anchors.topMargin: 10 + Layout.fillHeight: true + Layout.fillWidth: true + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + Tab { + title: qsTr("About") + Text { + id: versionLabel + anchors.fill: parent + anchors.margins: 10 + font.pixelSize: 12 + wrapMode: Text.WordWrap + text: version + } + } + + Tab { + title: qsTr("Contributors") + ListView { + id: authorsView + anchors.fill: parent + anchors.margins: 10 + + spacing: 3 + model: authors + delegate: Text { + text: name + } + clip: true + } } } } - // This tab is for the authors/contributors/credits - Rectangle { - property string title: "Contributors" - anchors.fill: parent; color: "#e3e3e3" - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#e3e3e3" - Text { - id: description - text: "

These people have been key contributors to the OpenPilot project. Without the work of the people in this list, OpenPilot would not be what it is today.

This list is sorted alphabetically by name

" - width: 600 - wrapMode: Text.WordWrap - - } - ListView { - id: authorsView - y: description.y + description.height + 20 - width: parent.width; height: parent.height - description.height - 20 - spacing: 3 - model: authors - delegate: Text { - text: name - } - clip: true - } - ScrollDecorator { - flickableItem: authorsView - } - } - } + Button { + id: button + x: 512 + y: 369 + text: qsTr("Ok") + activeFocusOnPress: true + anchors.right: parent.right + anchors.rightMargin: 10 + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + } + } } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template b/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template index 63d7e45cc..8bbabc0ab 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template @@ -1,7 +1,7 @@ /* This list model was created for the AuthorsDialog. */ -import QtQuick 1.1 +import QtQuick 2.0 ListModel { ${LIST_ELEMENTS} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml deleted file mode 100644 index 24c79c927..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml +++ /dev/null @@ -1,40 +0,0 @@ -import QtQuick 1.1 - -Rectangle { - id: scrollDecorator - - property Flickable flickableItem: null - - Loader { - id: scrollLoader - sourceComponent: scrollDecorator.flickableItem ? scrollBar : undefined - } - - Component.onDestruction: scrollLoader.sourceComponent = undefined - - Component { - id: scrollBar - Rectangle { - property Flickable flickable: scrollDecorator.flickableItem - - parent: flickable - anchors.right: parent.right - - smooth: true - radius: 2 - color: "gray" - border.color: "lightgray" - border.width: 1.0 - opacity: flickable.moving ? 0.8 : 0.4 - - Behavior on opacity { - NumberAnimation { duration: 500 } - } - - width: 4 - height: flickable.height * (flickable.height / flickable.contentHeight) - y: flickable.height * (flickable.contentY / flickable.contentHeight) - visible: flickable.height < flickable.contentHeight - } - } -} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml deleted file mode 100644 index b6ce6bd41..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 - -Item { - id: tabWidget - - // Setting the default property to stack.children means any child items - // of the TabWidget are actually added to the 'stack' item's children. - // See the "Property Binding" - // documentation for details on default properties. - default property alias content: stack.children - - property int current: 0 - - onCurrentChanged: setOpacities() - Component.onCompleted: setOpacities() - - function setOpacities() { - for (var i = 0; i < stack.children.length; ++i) { - stack.children[i].opacity = (i == current ? 1 : 0) - } - } - - Row { - id: header - - Repeater { - model: stack.children.length - delegate: Rectangle { - width: tabWidget.width / stack.children.length; height: 36 - - Rectangle { - width: parent.width; height: 1 - anchors { bottom: parent.bottom; bottomMargin: 1 } - color: "#acb2c2" - } - BorderImage { - anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 } - border { left: 7; right: 7 } - source: "images/tab.png" - visible: tabWidget.current == index - } - Text { - horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter - anchors.fill: parent - text: stack.children[index].title - elide: Text.ElideRight - font.bold: tabWidget.current == index - } - MouseArea { - anchors.fill: parent - onClicked: tabWidget.current = index - } - } - } - } - - Item { - id: stack - width: tabWidget.width - anchors.top: header.bottom; anchors.bottom: tabWidget.bottom - } -} \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp deleted file mode 100644 index 6887239fe..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - ****************************************************************************** - * - * @file versiondialog.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin - *****************************************************************************/ -/* - * This program 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. - * - * This program 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 this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "versiondialog.h" -#include "version_info/version_info.h" -#include "coreconstants.h" -#include "icore.h" - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace Core; -using namespace Core::Internal; -using namespace Core::Constants; - -VersionDialog::VersionDialog(QWidget *parent) - : QDialog(parent) -{ - // We need to set the window icon explicitly here since for some reason the - // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME) - setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png")); - - setWindowTitle(tr("About OpenPilot GCS")); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - QGridLayout *layout = new QGridLayout(this); - layout->setSizeConstraint(QLayout::SetFixedSize); - - const QString description = tr( - "

OpenPilot Ground Control Station

" - "GCS Revision: %1
" - "UAVO Hash: %2
" - "
" - "Built from %3
" - "Built on %4 at %5
" - "Based on Qt %6 (%7 bit)
" - "
" - "© %8, 2010-%9. All rights reserved.
" - "
" - "This program 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.
" - "
" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.
" - ).arg( - VersionInfo::revision().left(60), // %1 - VersionInfo::uavoHash().left(8), // %2 - VersionInfo::origin(), // $3 - QLatin1String(__DATE__), // %4 - QLatin1String(__TIME__), // %5 - QLatin1String(QT_VERSION_STR), // %6 - QString::number(QSysInfo::WordSize), // %7 - QLatin1String(GCS_AUTHOR), // %8 - VersionInfo::year() // %9 - ); - - QLabel *copyRightLabel = new QLabel(description); - copyRightLabel->setWordWrap(true); - copyRightLabel->setOpenExternalLinks(true); - copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); - - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); - QTC_ASSERT(closeButton, /**/); - buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole)); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - - QLabel *logoLabel = new QLabel; - logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/openpilot_logo_128.png"))); - layout->addWidget(logoLabel, 0, 0, 1, 1); - layout->addWidget(copyRightLabel, 0, 1, 4, 4); - layout->addWidget(buttonBox, 4, 0, 1, 5); -} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h b/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h deleted file mode 100644 index 58fd217b7..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/versiondialog.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - ****************************************************************************** - * - * @file versiondialog.h - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup CorePlugin Core Plugin - * @{ - * @brief The Core GCS plugin - *****************************************************************************/ -/* - * This program 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. - * - * This program 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 this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef VERSIONDIALOG_H -#define VERSIONDIALOG_H - -#include - -namespace Core { -namespace Internal { -class VersionDialog : public QDialog { - Q_OBJECT -public: - explicit VersionDialog(QWidget *parent); -}; -} // namespace Internal -} // namespace Core - -#endif // VERSIONDIALOG_H From c06bbdb5cc6270b9d42e8fdb9e09e243f6d392c2 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Sun, 20 Oct 2013 14:49:59 +1000 Subject: [PATCH 02/30] Updated pfd.svg and related PFD qml files Still WIP, implemented: * horizont rendering * altitude scale * speed scale * vsi scale * basic compass, without extra marks/points * fixed horizont center mark --- artwork/PFD/pfd.svg | 8229 ++++++++--------- .../pfd/default/AltitudeScale.qml | 45 +- .../openpilotgcs/pfd/default/Compass.qml | 63 +- .../pfd/default/HorizontCenter.qml | 25 + .../share/openpilotgcs/pfd/default/Pfd.qml | 22 +- .../openpilotgcs/pfd/default/PfdWorldView.qml | 66 +- .../openpilotgcs/pfd/default/RollScale.qml | 28 + .../openpilotgcs/pfd/default/SpeedScale.qml | 42 +- .../openpilotgcs/pfd/default/VsiScale.qml | 39 +- .../share/openpilotgcs/pfd/default/pfd.svg | 8219 ++++++++-------- 10 files changed, 7538 insertions(+), 9240 deletions(-) create mode 100644 ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml create mode 100644 ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml diff --git a/artwork/PFD/pfd.svg b/artwork/PFD/pfd.svg index abdc4f8c5..d6c1f8278 100644 --- a/artwork/PFD/pfd.svg +++ b/artwork/PFD/pfd.svg @@ -7,1607 +7,19 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1038.8931" - height="707.56323" + width="640" + height="480" id="svg2" version="1.1" - inkscape:version="0.48.3.1 r9886" - sodipodi:docname="pfd-11.svg" - style="display:inline" - inkscape:export-filename="C:\Users\Nuno\Desktop\OpenPilot\PFD\PFD-4.png" - inkscape:export-xdpi="71.993568" - inkscape:export-ydpi="71.993568"> + inkscape:version="0.48.2 r9819" + sodipodi:docname="pfd.svg" + inkscape:export-filename="/Users/muralha/Desktop/new PFD ideas/pfd/test2.png" + inkscape:export-xdpi="72" + inkscape:export-ydpi="72"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="defs4" /> - - - - - - - - + inkscape:guide-bbox="true"> + position="320,275.14994" + id="guide4799" /> - + position="299.42715,305" + id="guide7549" /> + position="215.3671,225.48102" + id="guide8295" /> - - - - - - + position="273.07596,436.08863" + id="guide8297" /> + position="328.00768,112" + id="guide8892" /> @@ -1721,2998 +73,3739 @@ image/svg+xml - + - - - - - + id="horizon" + inkscape:label="#g4445" + transform="translate(0,10)"> + + - - - 10 - - - 10 - - - 20 - - - 20 - - - -10 - - - -10 - - - -20 - - - -20 - - - - - - - - - - - - - - + id="path4731" + d="m -163.61586,169.00008 970.78709,0" + style="fill:none;stroke:#ffffff;stroke-width:2.99985003;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - - - Link - - - - Bat. - - - - GPS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SPD - - ALT - m/s - m - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 - 1 - 2 - 1 + + id="pitch-scale" + inkscape:label="#g8154" + transform="translate(0,10)"> + + ft/s + style="font-size:12px;font-weight:normal;fill:#ffffff;fill-opacity:1;stroke:none;-inkscape-font-specification:Sans" + y="133.48935" + x="268.41406" + id="tspan6198" + sodipodi:role="line">10 + 10 + + + 20 VSI + style="font-size:12px;font-weight:normal;fill:#ffffff;fill-opacity:1;stroke:none;-inkscape-font-specification:Sans" + y="93.489349" + x="356.41406" + id="tspan6314" + sodipodi:role="line">20 + + + 20 + 20 + + + 10 + 10 + + + 30 + 30 + + + 40 + 40 + + + 50 + 50 + + + 60 + 60 + + + 70 + 70 + + + 80 + 80 + + + 90 + 90 + + + 40 + 40 + + + 30 + 30 + + + 60 + 60 + + + 50 + 50 + + + 80 + 80 + + + 70 + 70 + + + 90 + 90 - - - - - - - - - - - - - - - - - - - - - - - - - 00:00:00 + id="home-eta-text"> + + + + + + + + + - + 0000000 - 000 + id="path6537" + inkscape:connector-curvature="0" /> + + + + + + + - + inkscape:label="home-heading-text" + style="display:inline"> + + + + + + - + + GPS - Sats - + Tx - Rx - Throttle + id="path6284" + inkscape:connector-curvature="0" /> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1018,98 +1259,138 @@ x="551" y="21" /> - + mA + id="path6812" + inkscape:connector-curvature="0" /> + + - V - WPT - HDG - DIST - MODE - ETA + style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;display:inline;font-family:Sans" + id="battery-volt-label"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1122,45 +1403,76 @@ inkscape:groupmode="layer" id="layer66" inkscape:label="battery-milliamp-text"> - 99999 + + + + + + + - 12.60 + + + + + + + + style="display:inline"> - 00:00:00 + id="waypoint-eta-text"> + + + + + + + + + - 00000000 + id="waypoint-distance-text"> + + + + + + + + + - 000 + id="waypoint-heading-text"> + + + + - Drive Circle Right + id="waypoint-mode-text"> + + + + + + + + + + + + + + + + + - + description or # + id="waypoint-description-text"> + + + + + + + + + + + + + + + + style="display:inline"> + style="display:inline"> + style="display:inline"> - 3D + + + + @@ -1827,7 +2338,8 @@ id="layer7" inkscape:label="compass" style="display:inline" - transform="translate(0,-4)"> + transform="translate(0,-4)" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> @@ -2190,10 +2703,11 @@ + inkscape:transform-center-x="-0.112375" + inkscape:label="#path5060" /> - + N - + + 33 - + + + + + 30 - + + + W - 24 - 21 - + S - + + + + + + + + + + + + + 15 - + + + + + 12 - + + + E - + + + + 6 - + + 3 + inkscape:transform-center-x="-36.348111" + inkscape:transform-center-y="-62.956749" + style="font-size:33.9886322px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;display:inline;font-family:Sans" + id="compass30" + inkscape:label="#compass-30"> + + + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="font-size:13.59545326px;text-align:center;text-anchor:middle;fill:#ffffff" + id="path6227" + inkscape:connector-curvature="0" /> + style="font-size:13.59545326px;text-align:center;text-anchor:middle;fill:#ffffff" + id="path6229" + inkscape:connector-curvature="0" /> + style="font-size:13.59545326px;text-align:center;text-anchor:middle;fill:#ffffff" + id="path6231" + inkscape:connector-curvature="0" /> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> - + + m/s + id="path6208" + inkscape:connector-curvature="0" /> + + + + style="display:inline"> + id="speed1" + inkscape:connector-curvature="0" + inkscape:label="#path8333" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path8335" /> + id="speed-2" + inkscape:connector-curvature="0" + inkscape:label="#path8373" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path8375" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path3522" /> + id="speed-3" + inkscape:connector-curvature="0" + inkscape:label="#path3524" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path3530" /> + id="speed4" + inkscape:connector-curvature="0" + inkscape:label="#path3532" /> + + @@ -3169,19 +3720,35 @@ id="layer21" inkscape:label="speed-text" style="display:inline"> - 00000 + + + + + + + - m + inkscape:label="altitude-unit" + style="display:inline"> + + + + inkscape:groupmode="layer"> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path9780" /> + id="altitude2" + inkscape:connector-curvature="0" + inkscape:label="#path9782" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path9806" /> + id="altitude-1" + inkscape:connector-curvature="0" + inkscape:label="#path9808" /> + id="altitude-4" + inkscape:connector-curvature="0" + inkscape:label="#path3492" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:label="#path3494" /> + + + - @@ -3375,7 +3959,8 @@ inkscape:groupmode="layer" id="layer46" inkscape:label="altitude-waypoint" - style="display:inline"> + style="display:inline" + sodipodi:insensitive="true"> - 00000 + id="altitude-text"> + + + + + + - ft/s + inkscape:label="vsi-unit" + style="display:inline"> + + + + + + + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + inkscape:label="vsi-scale" + style="display:inline" + sodipodi:insensitive="true"> @@ -3538,7 +4156,8 @@ inkscape:groupmode="layer" id="layer42" inkscape:label="vsi-centerline" - style="display:inline"> + style="display:inline" + sodipodi:insensitive="true"> - + AUTOPILOT + id="path6165" + inkscape:connector-curvature="0" /> + + + + + + + + + + inkscape:label="warning-master-caution" + style="display:inline"> @@ -3613,18 +4269,76 @@ width="125" id="rect4803" style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none" /> - MASTER CAUTION + + + + + + + + + + + + + + + - + RC INPUT + id="path6123" + inkscape:connector-curvature="0" /> + + + + + + + + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> + style="display:inline" + sodipodi:insensitive="true"> Date: Sat, 9 Nov 2013 11:03:04 +1000 Subject: [PATCH 07/30] Correctly find the position of GPS fix element using coordinates of "gps-mode-text" element --- .../share/openpilotgcs/pfd/default/Info.qml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 741a2ea78..7759188d6 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -25,14 +25,16 @@ Item { } } - Text { - text: ["No GPS", "No Fix", "Fix2D", "Fix3D"][GPSPositionSensor.Status] + SvgElementPositionItem { + sceneSize: info.sceneSize + elementName: "gps-mode-text" - // TODO: get coords from svg file, as soon as "gps-mode-text" text is converted to path - x: info.sceneSize.width * 0.05 - y: info.sceneSize.height * 0.006 + Text { + text: ["No GPS", "No Fix", "Fix2D", "Fix3D"][GPSPositionSensor.Status] - font.pixelSize: info.sceneSize.height * 0.02 - color: "white" + anchors.centerIn: parent + font.pixelSize: parent.height*1.2 + color: "white" + } } } From 071f81370a8c1ddbba18227852a106006bc712e1 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Sat, 9 Nov 2013 11:03:33 +1000 Subject: [PATCH 08/30] Display the speed waypoint element if not 0 --- .../share/openpilotgcs/pfd/default/SpeedScale.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml index 4d59b5351..215fca11e 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml @@ -56,6 +56,18 @@ Item { } } } + + SvgElementImage { + id: speed_waypoint + elementName: "speed-waypoint" + sceneSize: sceneItem.sceneSize + visible: PathDesired.EndingVelocity !== 0.0 + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + anchors.verticalCenterOffset: speed_scale.height/30 * (sceneItem.groundSpeed - PathDesired.EndingVelocity) + } } SvgElementImage { From 40629f62db28fc172688a958153e9f5640169d15 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Sat, 9 Nov 2013 11:13:23 +1000 Subject: [PATCH 09/30] Display the altitude waypoint --- .../share/openpilotgcs/pfd/default/AltitudeScale.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml index 7c207c67e..9a4b05697 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml @@ -50,6 +50,18 @@ Item { } } } + + SvgElementImage { + id: altitude_waypoint + elementName: "altitude-waypoint" + sceneSize: sceneItem.sceneSize + visible: PathDesired.End_Down !== 0.0 + + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + + anchors.verticalCenterOffset: -altitude_scale.height/30 * (PositionState.Down - PathDesired.End_Down) + } } SvgElementImage { From cab2d22bbb29df831c4cf145268a4219e22ffe94 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Sat, 9 Nov 2013 11:20:38 +1000 Subject: [PATCH 10/30] PFD: Display altitude vector bar --- .../share/openpilotgcs/pfd/default/AltitudeScale.qml | 11 +++++++++++ .../src/plugins/pfdqml/pfdqmlgadgetwidget.cpp | 1 + 2 files changed, 12 insertions(+) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml index 9a4b05697..800cf4bd5 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml @@ -51,6 +51,17 @@ Item { } } + SvgElementImage { + id: altitude_vector + elementName: "altitude-vector" + sceneSize: sceneItem.sceneSize + + height: -NedAccel.Down * altitude_scale.height/30 + + anchors.left: parent.left + anchors.bottom: parent.verticalCenter + } + SvgElementImage { id: altitude_waypoint elementName: "altitude-waypoint" diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp index bf6a74c08..d0f599dd8 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp @@ -64,6 +64,7 @@ PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWidget *parent) : "GPSPositionSensor" << "GCSTelemetryStats" << "SystemAlarms" << + "NedAccel" << "FlightBatteryState"; ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); From 9507431cd681c1b83d53d2b13051656da63c00e7 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Wed, 13 Nov 2013 23:07:03 +0100 Subject: [PATCH 11/30] OP-1109: port libs/utils - swgImageProvider --- ground/openpilotgcs/src/libs/utils/svgimageprovider.cpp | 2 +- ground/openpilotgcs/src/libs/utils/svgimageprovider.h | 4 ++-- ground/openpilotgcs/src/libs/utils/utils.pro | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/libs/utils/svgimageprovider.cpp b/ground/openpilotgcs/src/libs/utils/svgimageprovider.cpp index 2b9a8c79a..14804dbc5 100644 --- a/ground/openpilotgcs/src/libs/utils/svgimageprovider.cpp +++ b/ground/openpilotgcs/src/libs/utils/svgimageprovider.cpp @@ -32,7 +32,7 @@ SvgImageProvider::SvgImageProvider(const QString &basePath) : QObject(), - QDeclarativeImageProvider(QDeclarativeImageProvider::Image), + QQuickImageProvider(QQuickImageProvider::Image), m_basePath(basePath) {} diff --git a/ground/openpilotgcs/src/libs/utils/svgimageprovider.h b/ground/openpilotgcs/src/libs/utils/svgimageprovider.h index e24f51e5a..a58b312b5 100644 --- a/ground/openpilotgcs/src/libs/utils/svgimageprovider.h +++ b/ground/openpilotgcs/src/libs/utils/svgimageprovider.h @@ -29,13 +29,13 @@ #define SVGIMAGEPROVIDER_H_ #include -#include +#include #include #include #include "utils_global.h" -class QTCREATOR_UTILS_EXPORT SvgImageProvider : public QObject, public QDeclarativeImageProvider { +class QTCREATOR_UTILS_EXPORT SvgImageProvider : public QObject, public QQuickImageProvider { Q_OBJECT public: SvgImageProvider(const QString &basePath); diff --git a/ground/openpilotgcs/src/libs/utils/utils.pro b/ground/openpilotgcs/src/libs/utils/utils.pro index aff6db1e0..202751020 100644 --- a/ground/openpilotgcs/src/libs/utils/utils.pro +++ b/ground/openpilotgcs/src/libs/utils/utils.pro @@ -6,7 +6,7 @@ QT += gui \ xml \ svg \ opengl \ - declarative \ + qml quick \ widgets DEFINES += QTCREATOR_UTILS_LIB From 067b2e61ae20ddbdfb570a0886982ace4afab522 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Thu, 14 Nov 2013 00:04:12 +0100 Subject: [PATCH 12/30] OP-1109: port plugins/QMLView --- .../src/plugins/qmlview/qmlview.pro | 2 +- .../src/plugins/qmlview/qmlviewgadget.cpp | 4 +++- .../src/plugins/qmlview/qmlviewgadget.h | 9 ++++++++- .../plugins/qmlview/qmlviewgadgetfactory.cpp | 2 +- .../plugins/qmlview/qmlviewgadgetwidget.cpp | 18 ++++++------------ .../src/plugins/qmlview/qmlviewgadgetwidget.h | 6 +++--- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlview.pro b/ground/openpilotgcs/src/plugins/qmlview/qmlview.pro index c2897f3a0..de95a7218 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlview.pro +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlview.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = QMLView QT += svg QT += opengl -QT += declarative +QT += qml quick include(../../openpilotgcsplugin.pri) include(../../plugins/coreplugin/coreplugin.pri) diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp index d5aa1749c..53db5d56e 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp @@ -33,7 +33,9 @@ QmlViewGadget::QmlViewGadget(QString classId, QmlViewGadgetWidget *widget, QWidget *parent) : IUAVGadget(classId, parent), m_widget(widget) -{} +{ + m_parent = parent; +} QmlViewGadget::~QmlViewGadget() { diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h index 152c58042..fe7fac302 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.h @@ -46,11 +46,18 @@ public: QWidget *widget() { - return m_widget; + if(!m_container){ + m_container = QWidget::createWindowContainer(m_widget, m_parent); + m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_container->setMinimumSize(64, 64); + } + return m_container; } void loadConfiguration(IUAVGadgetConfiguration *config); private: + QWidget *m_container; + QWidget *m_parent; QmlViewGadgetWidget *m_widget; }; diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetfactory.cpp index 20b7693bb..619f15179 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetfactory.cpp @@ -42,7 +42,7 @@ QmlViewGadgetFactory::~QmlViewGadgetFactory() Core::IUAVGadget *QmlViewGadgetFactory::createGadget(QWidget *parent) { - QmlViewGadgetWidget *gadgetWidget = new QmlViewGadgetWidget(parent); + QmlViewGadgetWidget *gadgetWidget = new QmlViewGadgetWidget(); return new QmlViewGadget(QString("QmlViewGadget"), gadgetWidget, parent); } diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.cpp index 9abbb4b23..808cf3e80 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.cpp @@ -38,14 +38,12 @@ #include #include -#include -#include +#include +#include -QmlViewGadgetWidget::QmlViewGadgetWidget(QWidget *parent) : - QDeclarativeView(parent) +QmlViewGadgetWidget::QmlViewGadgetWidget(QWindow *parent) : + QQuickView(parent) { - setMinimumSize(64, 64); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setResizeMode(SizeRootObjectToView); QStringList objectsToExport; @@ -90,7 +88,7 @@ void QmlViewGadgetWidget::setQmlFile(QString fn) qDebug() << Q_FUNC_INFO << fn; setSource(QUrl::fromLocalFile(fn)); - foreach(const QDeclarativeError &error, errors()) { + foreach(const QQmlError &error, errors()) { qDebug() << error.description(); } } @@ -100,9 +98,5 @@ void QmlViewGadgetWidget::setQmlFile(QString fn) */ void QmlViewGadgetWidget::enableOpenGL(bool flag) { - if (flag) { - setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); - } else { - setViewport(new QWidget); - } + Q_UNUSED(flag) } diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.h b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.h index 783cc963e..ef54fcf1b 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadgetwidget.h @@ -30,7 +30,7 @@ #include "qmlviewgadgetconfiguration.h" -#include +#include #include #include @@ -40,11 +40,11 @@ class UAVObject; -class QmlViewGadgetWidget : public QDeclarativeView { +class QmlViewGadgetWidget : public QQuickView { Q_OBJECT public: - QmlViewGadgetWidget(QWidget *parent = 0); + QmlViewGadgetWidget(QWindow *parent = 0); ~QmlViewGadgetWidget(); void setQmlFile(QString fn); From 1c23dcd2e497344e78f08ecc217848ad1ddf28ff Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Thu, 14 Nov 2013 00:04:34 +0100 Subject: [PATCH 13/30] OP-1109: port plugin/welcome --- .../src/plugins/welcome/qml/ActivityPanel.qml | 3 ++- .../plugins/welcome/qml/CommunityPanel.qml | 2 +- .../src/plugins/welcome/qml/NewsPanel.qml | 3 ++- .../plugins/welcome/qml/ScrollDecorator.qml | 2 +- .../src/plugins/welcome/qml/SitesPanel.qml | 2 +- .../plugins/welcome/qml/WelcomePageButton.qml | 2 +- .../src/plugins/welcome/qml/main.qml | 2 +- .../src/plugins/welcome/welcome.pro | 2 +- .../src/plugins/welcome/welcomemode.cpp | 27 +++++++++++-------- .../src/plugins/welcome/welcomemode.h | 1 + 10 files changed, 27 insertions(+), 19 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml b/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml index 111c4d7e9..fdc258500 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml @@ -1,4 +1,5 @@ -import QtQuick 1.1 +import QtQuick 2.0 +import QtQuick.XmlListModel 2.0 Item { id: container diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/CommunityPanel.qml b/ground/openpilotgcs/src/plugins/welcome/qml/CommunityPanel.qml index caa3678b2..20f19fd70 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/CommunityPanel.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/CommunityPanel.qml @@ -1,5 +1,5 @@ // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 -import QtQuick 1.1 +import QtQuick 2.0 Item { property alias sourceSize: background.sourceSize diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/NewsPanel.qml b/ground/openpilotgcs/src/plugins/welcome/qml/NewsPanel.qml index 6d794b210..0e6a8ef99 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/NewsPanel.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/NewsPanel.qml @@ -1,5 +1,6 @@ // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 -import QtQuick 1.1 +import QtQuick 2.0 +import QtQuick.XmlListModel 2.0 Item { id: container diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/ScrollDecorator.qml b/ground/openpilotgcs/src/plugins/welcome/qml/ScrollDecorator.qml index 24c79c927..5e4e7e8d9 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/ScrollDecorator.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/ScrollDecorator.qml @@ -1,4 +1,4 @@ -import QtQuick 1.1 +import QtQuick 2.0 Rectangle { id: scrollDecorator diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/SitesPanel.qml b/ground/openpilotgcs/src/plugins/welcome/qml/SitesPanel.qml index c94f243e2..00f2e3664 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/SitesPanel.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/SitesPanel.qml @@ -1,5 +1,5 @@ // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 -import QtQuick 1.1 +import QtQuick 2.0 Item { id: container diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/WelcomePageButton.qml b/ground/openpilotgcs/src/plugins/welcome/qml/WelcomePageButton.qml index 9e5c1a74f..618baee73 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/WelcomePageButton.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/WelcomePageButton.qml @@ -1,5 +1,5 @@ // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 -import QtQuick 1.1 +import QtQuick 2.0 Item { id: welcomeButton diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/main.qml b/ground/openpilotgcs/src/plugins/welcome/qml/main.qml index 82e7b1064..7a58a8fa3 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/main.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/main.qml @@ -1,4 +1,4 @@ -import QtQuick 1.1 +import QtQuick 2.0 Rectangle { id: container diff --git a/ground/openpilotgcs/src/plugins/welcome/welcome.pro b/ground/openpilotgcs/src/plugins/welcome/welcome.pro index eb44bc8da..40eba229c 100644 --- a/ground/openpilotgcs/src/plugins/welcome/welcome.pro +++ b/ground/openpilotgcs/src/plugins/welcome/welcome.pro @@ -1,6 +1,6 @@ TEMPLATE = lib TARGET = Welcome -QT += network declarative +QT += network qml quick include(../../openpilotgcsplugin.pri) include(welcome_dependencies.pri) diff --git a/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp b/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp index 501c4ba7a..838d28ff7 100644 --- a/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp +++ b/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp @@ -45,10 +45,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -59,7 +59,7 @@ namespace Welcome { struct WelcomeModePrivate { WelcomeModePrivate(); - QDeclarativeView *declarativeView; + QQuickView *quickView; }; WelcomeModePrivate::WelcomeModePrivate() @@ -70,15 +70,15 @@ WelcomeMode::WelcomeMode() : m_d(new WelcomeModePrivate), m_priority(Core::Constants::P_MODE_WELCOME) { - m_d->declarativeView = new QDeclarativeView; - m_d->declarativeView->setResizeMode(QDeclarativeView::SizeRootObjectToView); - m_d->declarativeView->engine()->rootContext()->setContextProperty("welcomePlugin", this); - m_d->declarativeView->setSource(QUrl("qrc:/welcome/qml/main.qml")); + m_d->quickView = new QQuickView; + m_d->quickView->setResizeMode(QQuickView::SizeRootObjectToView); + m_d->quickView->engine()->rootContext()->setContextProperty("welcomePlugin", this); + m_d->quickView->setSource(QUrl("qrc:/welcome/qml/main.qml")); } WelcomeMode::~WelcomeMode() { - delete m_d->declarativeView; + delete m_d->quickView; delete m_d; } @@ -99,7 +99,12 @@ int WelcomeMode::priority() const QWidget *WelcomeMode::widget() { - return m_d->declarativeView; + if(!m_container){ + m_container = QWidget::createWindowContainer(m_d->quickView); + m_container->setMinimumSize(64, 64); + m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + } + return m_container; } const char *WelcomeMode::uniqueModeName() const diff --git a/ground/openpilotgcs/src/plugins/welcome/welcomemode.h b/ground/openpilotgcs/src/plugins/welcome/welcomemode.h index fa3f22856..b6e837cc9 100644 --- a/ground/openpilotgcs/src/plugins/welcome/welcomemode.h +++ b/ground/openpilotgcs/src/plugins/welcome/welcomemode.h @@ -72,6 +72,7 @@ public slots: void triggerAction(const QString &actionId); private: + QWidget *m_container; WelcomeModePrivate *m_d; int m_priority; }; From 710f73d219a594edde335eff85590c3e966f891b Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Thu, 14 Nov 2013 00:25:24 +0100 Subject: [PATCH 14/30] OP-1109: port coreplugin/AutorsDialog. TODO: fix dialog/view size handling --- .../src/plugins/coreplugin/authorsdialog.cpp | 16 +++++++++------- .../src/plugins/coreplugin/coreplugin.pro | 2 +- .../src/plugins/coreplugin/qml/AboutDialog.qml | 2 +- .../coreplugin/qml/AuthorsModel.qml.template | 2 +- .../plugins/coreplugin/qml/ScrollDecorator.qml | 2 +- .../src/plugins/coreplugin/qml/TabWidget.qml | 4 ++-- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp index c4f94d6aa..8bb2713d1 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/authorsdialog.cpp @@ -44,10 +44,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include using namespace Core; using namespace Core::Internal; @@ -63,9 +63,7 @@ AuthorsDialog::AuthorsDialog(QWidget *parent) setWindowTitle(tr("About OpenPilot")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // This loads a QML doc containing a Tabbed view - QDeclarativeView *view = new QDeclarativeView(this); - view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml")); - + QQuickView *view = new QQuickView(); QString version = QLatin1String(GCS_VERSION_LONG); version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate); @@ -107,4 +105,8 @@ AuthorsDialog::AuthorsDialog(QWidget *parent) ); // Expose the version description to the QML doc view->rootContext()->setContextProperty("version", description); + view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml")); + view->setResizeMode(QQuickView::SizeRootObjectToView); + QWidget * container = QWidget::createWindowContainer(view,this); + container->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro index 1631fda8f..667e99192 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = Core DEFINES += CORE_LIBRARY -QT += declarative \ +QT += qml quick \ xml \ network \ script \ diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml index 9e1d64f20..68993a098 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ - import QtQuick 1.1 + import QtQuick 2.0 // This is a tabbed pane element. Add a nested Rectangle to add a tab. TabWidget { diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template b/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template index 63d7e45cc..8bbabc0ab 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AuthorsModel.qml.template @@ -1,7 +1,7 @@ /* This list model was created for the AuthorsDialog. */ -import QtQuick 1.1 +import QtQuick 2.0 ListModel { ${LIST_ELEMENTS} diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml index 24c79c927..5e4e7e8d9 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/ScrollDecorator.qml @@ -1,4 +1,4 @@ -import QtQuick 1.1 +import QtQuick 2.0 Rectangle { id: scrollDecorator diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml index b6ce6bd41..47e982442 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/TabWidget.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.0 Item { id: tabWidget @@ -99,4 +99,4 @@ Item { width: tabWidget.width anchors.top: header.bottom; anchors.bottom: tabWidget.bottom } -} \ No newline at end of file +} From bac4f96d1cf4b8fbcb671f4f303cc6cf32030e37 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Thu, 14 Nov 2013 00:48:00 +0100 Subject: [PATCH 15/30] OP-1109: port plugins/pfdqml --- .../pfd/default/AltitudeScale.qml | 2 +- .../openpilotgcs/pfd/default/Compass.qml | 2 +- .../pfd/default/HorizontCenter.qml | 2 +- .../share/openpilotgcs/pfd/default/Info.qml | 2 +- .../share/openpilotgcs/pfd/default/Pfd.qml | 2 +- .../pfd/default/PfdIndicators.qml | 2 +- .../pfd/default/PfdTerrainView.qml | 2 +- .../openpilotgcs/pfd/default/PfdWorldView.qml | 2 +- .../openpilotgcs/pfd/default/RollScale.qml | 2 +- .../openpilotgcs/pfd/default/SpeedScale.qml | 2 +- .../pfd/default/SvgElementImage.qml | 2 +- .../pfd/default/SvgElementPositionItem.qml | 2 +- .../openpilotgcs/pfd/default/VsiScale.qml | 2 +- .../openpilotgcs/pfd/default/Warnings.qml | 2 +- .../src/plugins/pfdqml/pfdqml.pro | 2 +- .../src/plugins/pfdqml/pfdqmlgadget.cpp | 5 +++- .../src/plugins/pfdqml/pfdqmlgadget.h | 9 ++++++- .../plugins/pfdqml/pfdqmlgadgetfactory.cpp | 2 +- .../src/plugins/pfdqml/pfdqmlgadgetwidget.cpp | 27 +++++-------------- .../src/plugins/pfdqml/pfdqmlgadgetwidget.h | 6 ++--- 20 files changed, 37 insertions(+), 42 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml index 800cf4bd5..18df7808e 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/AltitudeScale.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml index 45daff990..198b9502c 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Compass.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 import "." Item { diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml index e49145fca..c5f7c36f1 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/HorizontCenter.qml @@ -1,4 +1,4 @@ -import QtQuick 1.1 +import QtQuick 2.0 Item { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml index 7759188d6..2697019a6 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Info.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: info diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index 18fd41c40..0670e1f36 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -1,4 +1,4 @@ -import QtQuick 1.1 +import QtQuick 2.0 Rectangle { color: "#666666" diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdIndicators.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdIndicators.qml index 641bbbb2e..a254f231e 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdIndicators.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdIndicators.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdTerrainView.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdTerrainView.qml index 2beebf05f..21355d16f 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdTerrainView.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdTerrainView.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 import org.OpenPilot 1.0 OsgEarth { diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml index ef21f0a20..5fa6f764d 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/PfdWorldView.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: worldView diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml index d3551046c..66263efd6 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/RollScale.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 import "." Item { diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml index 215fca11e..e0b971afa 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SpeedScale.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementImage.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementImage.qml index 2830ac941..6006380f0 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementImage.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementImage.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Image { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementPositionItem.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementPositionItem.qml index fc1d81cb6..cc43a024b 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementPositionItem.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/SvgElementPositionItem.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml index 29f846859..c40591424 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/VsiScale.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: sceneItem diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml index 12af0d24b..0f86755e0 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Warnings.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 2.0 Item { id: warnings diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqml.pro b/ground/openpilotgcs/src/plugins/pfdqml/pfdqml.pro index 55f15b4d2..0d7da9e26 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqml.pro +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqml.pro @@ -2,7 +2,7 @@ TEMPLATE = lib TARGET = PfdQml QT += svg QT += opengl -QT += declarative +QT += qml quick OSG { DEFINES += USE_OSG } diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.cpp index 365a323b7..30e803f33 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.cpp @@ -21,7 +21,10 @@ PfdQmlGadget::PfdQmlGadget(QString classId, PfdQmlGadgetWidget *widget, QWidget *parent) : IUAVGadget(classId, parent), m_widget(widget) -{} +{ + m_container = NULL; + m_parent = parent; +} PfdQmlGadget::~PfdQmlGadget() { diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h index b6525007f..131ab9b31 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadget.h @@ -35,11 +35,18 @@ public: QWidget *widget() { - return m_widget; + if(!m_container){ + m_container = QWidget::createWindowContainer(m_widget, m_parent); + m_container->setMinimumSize(64, 64); + m_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + } + return m_container; } void loadConfiguration(IUAVGadgetConfiguration *config); private: + QWidget *m_container; + QWidget *m_parent; PfdQmlGadgetWidget *m_widget; }; diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetfactory.cpp index f7d6b1f66..197f1929d 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetfactory.cpp @@ -31,7 +31,7 @@ PfdQmlGadgetFactory::~PfdQmlGadgetFactory() Core::IUAVGadget *PfdQmlGadgetFactory::createGadget(QWidget *parent) { - PfdQmlGadgetWidget *gadgetWidget = new PfdQmlGadgetWidget(parent); + PfdQmlGadgetWidget *gadgetWidget = new PfdQmlGadgetWidget(); return new PfdQmlGadget(QString("PfdQmlGadget"), gadgetWidget, parent); } diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp index d0f599dd8..7f0262ad3 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp @@ -29,12 +29,11 @@ #include #include -#include -#include -#include +#include +#include -PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWidget *parent) : - QDeclarativeView(parent), +PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWindow *parent) : + QQuickView(parent), m_openGLEnabled(false), m_terrainEnabled(false), m_actualPositionUsed(false), @@ -46,8 +45,6 @@ PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWidget *parent) : m_altitudeUnit("m"), m_altitudeFactor(1.0) { - setMinimumSize(64, 64); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setResizeMode(SizeRootObjectToView); // setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); @@ -107,7 +104,7 @@ void PfdQmlGadgetWidget::setQmlFile(QString fn) qDebug() << Q_FUNC_INFO << fn; setSource(QUrl::fromLocalFile(fn)); - foreach(const QDeclarativeError &error, errors()) { + foreach(const QQmlError &error, errors()) { qDebug() << error.description(); } } @@ -165,19 +162,7 @@ void PfdQmlGadgetWidget::setAltitudeFactor(double factor) void PfdQmlGadgetWidget::setOpenGLEnabled(bool arg) { - if (m_openGLEnabled != arg) { - m_openGLEnabled = arg; - - qDebug() << Q_FUNC_INFO << "Set OPENGL" << m_openGLEnabled; - if (m_openGLEnabled) { - setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); - } else { - setViewport(new QWidget); - } - - // update terrainEnabled status with opengl status chaged setTerrainEnabled(m_terrainEnabled); - } } // Switch between PositionState UAVObject position @@ -197,7 +182,7 @@ void PfdQmlGadgetWidget::mouseReleaseEvent(QMouseEvent *event) setQmlFile(m_qmlFileName); } - QDeclarativeView::mouseReleaseEvent(event); + QQuickView::mouseReleaseEvent(event); } void PfdQmlGadgetWidget::setLatitude(double arg) diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.h b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.h index 42b21edee..222fb8ce4 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.h @@ -18,9 +18,9 @@ #define PFDQMLGADGETWIDGET_H_ #include "pfdqmlgadgetconfiguration.h" -#include +#include -class PfdQmlGadgetWidget : public QDeclarativeView { +class PfdQmlGadgetWidget : public QQuickView { Q_OBJECT Q_PROPERTY(QString earthFile READ earthFile WRITE setEarthFile NOTIFY earthFileChanged) Q_PROPERTY(bool terrainEnabled READ terrainEnabled WRITE setTerrainEnabled NOTIFY terrainEnabledChanged) @@ -37,7 +37,7 @@ class PfdQmlGadgetWidget : public QDeclarativeView { Q_PROPERTY(double altitude READ altitude WRITE setAltitude NOTIFY altitudeChanged) public: - PfdQmlGadgetWidget(QWidget *parent = 0); + PfdQmlGadgetWidget(QWindow *parent = 0); ~PfdQmlGadgetWidget(); void setQmlFile(QString fn); From c179d388e32aa9057fc034245df117e40dda2e68 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Thu, 14 Nov 2013 00:48:34 +0100 Subject: [PATCH 16/30] OP-1109: fix uninitialized use of m_container --- ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp index 53db5d56e..aa071e893 100644 --- a/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp +++ b/ground/openpilotgcs/src/plugins/qmlview/qmlviewgadget.cpp @@ -34,6 +34,7 @@ QmlViewGadget::QmlViewGadget(QString classId, QmlViewGadgetWidget *widget, QWidg IUAVGadget(classId, parent), m_widget(widget) { + m_container = NULL; m_parent = parent; } From 89e261c3f8fa2685d34a93a95c18f7e7572dee5c Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Thu, 14 Nov 2013 22:41:39 +0100 Subject: [PATCH 17/30] OP-1109: added required DLLs --- ground/openpilotgcs/copydata.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 0f30ae9fc..257e19d4d 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -31,6 +31,9 @@ equals(copydata, 1) { Qt5SerialPort$${DS}.dll \ Qt5Multimedia$${DS}.dll \ Qt5MultimediaWidgets$${DS}.dll \ + Qt5Quick$${DS}.dll \ + Qt5Qml$${DS}.dll \ + Qt5V8$${DS}.dll \ icuin51.dll \ icudt51.dll \ icuuc51.dll From 300888e8b125ce008c7b8f68af4562a1d0ed4407 Mon Sep 17 00:00:00 2001 From: m_thread Date: Fri, 15 Nov 2013 11:58:59 +0100 Subject: [PATCH 18/30] OP-1107 Implements the new About dialog in QtQuick 2.0. --- .../src/plugins/coreplugin/aboutdialog.cpp | 62 ++++++------ .../src/plugins/coreplugin/aboutdialog.h | 9 +- .../src/plugins/coreplugin/aboutdialog.ui | 36 ------- .../src/plugins/coreplugin/coreplugin.pro | 6 +- .../plugins/coreplugin/qml/AboutDialog.qml | 98 +++++++++++++------ 5 files changed, 103 insertions(+), 108 deletions(-) delete mode 100644 ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp index b6a9016a0..9f6077a97 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp @@ -31,56 +31,33 @@ #include #include #include +#include -#include +#include +#include +#include #include using namespace Core::Constants; AboutDialog::AboutDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AboutDialog) + QDialog(parent) { - ui->setupUi(this); - setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png")); setWindowTitle(tr("About OpenPilot")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - // This loads a QML doc - QQuickView *view = new QQuickView(); - QWidget *container = QWidget::createWindowContainer(view, this); - view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml")); - - ui->verticalLayout->addWidget(container); - - QString version = QLatin1String(GCS_VERSION_LONG); - version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate); - - QString ideRev; - - // : This gets conditionally inserted as argument %8 into the description string. - ideRev = tr("From revision %1
").arg(VersionInfo::revision().left(10)); + setMinimumSize(600, 400); + setMaximumSize(800, 600); const QString description = tr( - "

OpenPilot Ground Control Station

" - "GCS Revision: %1
" + "Revision: %1
" "UAVO Hash: %2
" "
" "Built from %3
" "Built on %4 at %5
" "Based on Qt %6 (%7 bit)
" "
" - "© %8, 2010-%9. All rights reserved.
" - "
" - "This program 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.
" - "
" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " - "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.
" + "© %8, 2010-%9. All rights reserved.
" ).arg( VersionInfo::revision().left(60), // %1 VersionInfo::uavoHash().left(8), // %2 @@ -92,11 +69,28 @@ AboutDialog::AboutDialog(QWidget *parent) : QLatin1String(GCS_AUTHOR), // %8 VersionInfo::year() // %9 ); - // Expose the version description to the QML doc + + QQuickView *view = new QQuickView(); + view->rootContext()->setContextProperty("dialog", this); view->rootContext()->setContextProperty("version", description); + view->setResizeMode(QQuickView::SizeRootObjectToView); + view->setSource(QUrl("qrc:/core/qml/AboutDialog.qml")); + + QWidget * container = QWidget::createWindowContainer(view); + container->setMinimumSize(600, 400); + container->setMaximumSize(800, 600); + container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + QVBoxLayout *lay = new QVBoxLayout(); + lay->setContentsMargins(0,0,0,0); + setLayout(lay); + layout()->addWidget(container); +} + +void AboutDialog::openUrl(const QString &url) +{ + QDesktopServices::openUrl(QUrl(url)); } AboutDialog::~AboutDialog() { - delete ui; } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h index d9d97f1eb..6bce8d24b 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.h @@ -26,10 +26,6 @@ #include -namespace Ui { -class AboutDialog; -} - class AboutDialog : public QDialog { Q_OBJECT @@ -38,8 +34,9 @@ public: explicit AboutDialog(QWidget *parent = 0); ~AboutDialog(); -private: - Ui::AboutDialog *ui; +public slots: + void openUrl(const QString &url); + }; #endif // ABOUTDIALOG_H diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui deleted file mode 100644 index 6e50a77c3..000000000 --- a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.ui +++ /dev/null @@ -1,36 +0,0 @@ - - - AboutDialog - - - - 0 - 0 - 400 - 300 - - - - Dialog - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro index 312fc2acb..f566a71e0 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreplugin.pro @@ -2,7 +2,8 @@ TEMPLATE = lib TARGET = Core DEFINES += CORE_LIBRARY -QT += quick \ +QT += qml \ + quick \ xml \ network \ script \ @@ -137,8 +138,7 @@ FORMS += dialogs/settingsdialog.ui \ dialogs/shortcutsettings.ui \ generalsettings.ui \ uavgadgetoptionspage.ui \ - workspacesettings.ui \ - aboutdialog.ui + workspacesettings.ui RESOURCES += core.qrc \ fancyactionbar.qrc diff --git a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml index b6e7b7299..bd3d9c9e6 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml +++ b/ground/openpilotgcs/src/plugins/coreplugin/qml/AboutDialog.qml @@ -2,8 +2,8 @@ ****************************************************************************** * * @file aboutdialog.qml - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013. + * *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -20,20 +20,24 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -import QtQuick 2.0 +import QtQuick 2.1 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 -GridLayout { +Rectangle { + id: container width: 600 height: 400 + + property AuthorsModel authors: AuthorsModel {} + ColumnLayout { id: columnLayout1 anchors.fill: parent spacing: 10 RowLayout { id: rowLayout1 + opacity: 1 Image { id: logo anchors.left: parent.left @@ -43,58 +47,94 @@ GridLayout { source: "../images/openpilot_logo_128.png" z: 100 fillMode: Image.PreserveAspectFit + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { + dialog.openUrl("http://www.openpilot.org") + } + } } - TabView { - id: tabs + + Rectangle { anchors.left: logo.right - anchors.leftMargin: 10 + anchors.margins: 10 anchors.right: parent.right - anchors.rightMargin: 10 anchors.top: parent.top - anchors.topMargin: 10 Layout.fillHeight: true Layout.fillWidth: true anchors.bottom: parent.bottom - anchors.bottomMargin: 10 - Tab { - title: qsTr("About") + color: "transparent" + + ColumnLayout { + anchors.fill: parent + Text { + id: headerLabel + text: qsTr("OpenPilot Ground Control Station") + Layout.fillWidth: true + font.pixelSize: 14 + font.bold: true + + } Text { id: versionLabel - anchors.fill: parent - anchors.margins: 10 + Layout.fillWidth: true font.pixelSize: 12 wrapMode: Text.WordWrap text: version } - } + Text { + id: licenseLabel + Layout.fillWidth: true + font.pixelSize: 9 + wrapMode: Text.WordWrap + text: qsTr("This program 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.\n" + + "The program is provided AS IS with NO WARRANTY OF ANY KIND, " + + "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.") + } - Tab { - title: qsTr("Contributors") - ListView { - id: authorsView - anchors.fill: parent - anchors.margins: 10 + Text { + id: contributorLabel + text: qsTr("Contributors") + Layout.fillWidth: true + font.pixelSize: 14 + font.bold: true - spacing: 3 - model: authors - delegate: Text { - text: name + } + ScrollView { + Layout.fillWidth: true + Layout.fillHeight: true + frameVisible: true + ListView { + id: authorsView + anchors.fill: parent + + spacing: 3 + model: authors + delegate: Text { + font.pixelSize: 12 + text: name + } + clip: true } - clip: true } } } } Button { id: button - x: 512 - y: 369 text: qsTr("Ok") activeFocusOnPress: true anchors.right: parent.right anchors.rightMargin: 10 anchors.bottom: parent.bottom anchors.bottomMargin: 10 + onClicked: dialog.close() } } } From c48c4f5088cc8ea6886c791678c51a52cd18a998 Mon Sep 17 00:00:00 2001 From: m_thread Date: Fri, 15 Nov 2013 12:58:43 +0100 Subject: [PATCH 19/30] OP-1107 removed a faulty include --- ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp index 9f6077a97..abb08535a 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp @@ -22,7 +22,6 @@ */ #include "aboutdialog.h" -#include "ui_aboutdialog.h" #include "version_info/version_info.h" #include "coreconstants.h" From 01423dba8a30d8382de95b121d0d89d96284b5a5 Mon Sep 17 00:00:00 2001 From: m_thread Date: Fri, 15 Nov 2013 13:16:11 +0100 Subject: [PATCH 20/30] OP-1107 Another mistake --- ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp index abb08535a..0e24b4209 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include From 674af2cf35669a31a1dba6eee614e7358f249966 Mon Sep 17 00:00:00 2001 From: m_thread Date: Fri, 15 Nov 2013 13:18:35 +0100 Subject: [PATCH 21/30] OP-1107 :/ --- ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp index 0e24b4209..e47015051 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/aboutdialog.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include From 16c157591b7480aa5a6f162b649ced1674425761 Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Sat, 16 Nov 2013 03:42:11 +1100 Subject: [PATCH 22/30] Create QtQuick directories --- ground/openpilotgcs/copydata.pro | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 257e19d4d..5e3c82727 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -70,6 +70,22 @@ equals(copydata, 1) { data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_PLUGINS]/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() } + # create QtQuick2 plugin directories + QT_QUICK2_DIRS = qtquick \ + qtquick2 \ + qtquick/controls \ + qtquick/dialogs \ + qtquick/layouts \ + qtquick/localstorage \ + qtquick/controls \ + qtquick/particles.2 \ + qtquick/privatewidgets \ + qtquick/window.2 \ + qtquick/xmllistmodel + for(dir, QT_QUICK2_DIRS) { + data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline() + } + # copy MinGW DLLs MINGW_DLLS = SDL.dll for(dll, MINGW_DLLS) { From 85387f000a093c4901fa6861218a83b136d9f0f3 Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Sat, 16 Nov 2013 03:46:04 +1100 Subject: [PATCH 23/30] Only make controls directory once --- ground/openpilotgcs/copydata.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 5e3c82727..31e020d1d 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -77,7 +77,6 @@ equals(copydata, 1) { qtquick/dialogs \ qtquick/layouts \ qtquick/localstorage \ - qtquick/controls \ qtquick/particles.2 \ qtquick/privatewidgets \ qtquick/window.2 \ From d868c12a09279652c19cb38a44e0177ffdadb394 Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Sat, 16 Nov 2013 04:11:53 +1100 Subject: [PATCH 24/30] QtQuick2 DLLs copied, fixed directory name with missing period also --- ground/openpilotgcs/copydata.pro | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 31e020d1d..fc8e89c78 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -72,7 +72,7 @@ equals(copydata, 1) { # create QtQuick2 plugin directories QT_QUICK2_DIRS = qtquick \ - qtquick2 \ + qtquick.2 \ qtquick/controls \ qtquick/dialogs \ qtquick/layouts \ @@ -85,6 +85,14 @@ equals(copydata, 1) { data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline() } + # copy QtQuick plugin DLLs + QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \ + QtQuick.2/plugins.qmltypes \ + QtQuick.2/qmldir + for(dll, QT_QUICK2_DLLS) { + data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_QML]/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() + } + # copy MinGW DLLs MINGW_DLLS = SDL.dll for(dll, MINGW_DLLS) { From f1dd376b79a1d632bd6cd5dea5067a249f8e5bb3 Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Sat, 16 Nov 2013 04:35:09 +1100 Subject: [PATCH 25/30] Standard QtQuick2 working, welcome, PFD etc --- ground/openpilotgcs/copydata.pro | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index fc8e89c78..0b661c32b 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -88,7 +88,32 @@ equals(copydata, 1) { # copy QtQuick plugin DLLs QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \ QtQuick.2/plugins.qmltypes \ - QtQuick.2/qmldir + QtQuick.2/qmldir \ + qtquick/controls/qtquickcontrolsplugin$${DS}.dll \ + qtquick/controls/plugins.qmltypes \ + qtquick/controls/qmldir \ + qtquick/dialogs/dialogplugin$${DS}.dll \ + qtquick/dialogs/plugins.qmltypes \ + qtquick/dialogs/qmldir \ + qtquick/layouts/qquicklayoutsplugin$${DS}.dll \ + qtquick/layouts/plugins.qmltypes \ + qtquick/layouts/qmldir \ + qtquick/localstorage/qmllocalstorageplugin$${DS}.dll \ + qtquick/localstorage/plugins.qmltypes \ + qtquick/localstorage/qmldir \ + qtquick/particles.2/particlesplugin$${DS}.dll \ + qtquick/particles.2/plugins.qmltypes \ + qtquick/particles.2/qmldir \ + qtquick/privatewidgets/widgetsplugin$${DS}.dll \ + qtquick/privatewidgets/plugins.qmltypes \ + qtquick/privatewidgets/qmldir \ + qtquick/window.2/windowplugin$${DS}.dll \ + qtquick/window.2/plugins.qmltypes \ + qtquick/window.2/qmldir \ + qtquick/XmlListModel/qmlxmllistmodelplugin$${DS}.dll \ + qtquick/XmlListModel/plugins.qmltypes \ + qtquick/XmlListModel/qmldir + for(dll, QT_QUICK2_DLLS) { data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_QML]/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() } From e53db99d899ef16db510ec4b1cb4a4a7e9bbbc98 Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Sat, 16 Nov 2013 05:57:39 +1100 Subject: [PATCH 26/30] Add private shared QtQuick types --- ground/openpilotgcs/copydata.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 0b661c32b..9a462bd91 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -74,6 +74,7 @@ equals(copydata, 1) { QT_QUICK2_DIRS = qtquick \ qtquick.2 \ qtquick/controls \ + qtquick/controls/private \ qtquick/dialogs \ qtquick/layouts \ qtquick/localstorage \ @@ -92,6 +93,8 @@ equals(copydata, 1) { qtquick/controls/qtquickcontrolsplugin$${DS}.dll \ qtquick/controls/plugins.qmltypes \ qtquick/controls/qmldir \ + qtquick/controls/private/qtquickcontrolsprivateplugin$${DS}.dll \ + qtquick/controls/private/qmldir \ qtquick/dialogs/dialogplugin$${DS}.dll \ qtquick/dialogs/plugins.qmltypes \ qtquick/dialogs/qmldir \ From 1edfd56d48f55480bf2259174a366c9c20baebe5 Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Sat, 16 Nov 2013 19:18:36 +1100 Subject: [PATCH 27/30] For controls and Dialogs, use Copydir directive as all qml files are needed and this is the "easy way", the other solution is to list every single qml file by hand, these will likely be added to in upcomming releases of Qt and cause maintaince. The downside is three debug DLLs get copied also, if required I can expand copydata.pro to delete them after the copy if required. As we are making some changes to the build system, this at least enables working builds of QtQuick2, if before packaging we do not have a better solution, I will make sure the extra debug DLLs are removed. --- ground/openpilotgcs/copydata.pro | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 9a462bd91..8212cc25b 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -73,9 +73,6 @@ equals(copydata, 1) { # create QtQuick2 plugin directories QT_QUICK2_DIRS = qtquick \ qtquick.2 \ - qtquick/controls \ - qtquick/controls/private \ - qtquick/dialogs \ qtquick/layouts \ qtquick/localstorage \ qtquick/particles.2 \ @@ -86,18 +83,19 @@ equals(copydata, 1) { data_copy.commands += -@$(MKDIR) $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline() } + # Copy QtQuick2 complete directories + # These directories have a lot of files + # Easier to copy everything + QTQ_WHOLE_DIRS = qtquick/controls \ + qtquick/dialogs + for(dir, QTQ_WHOLE_DIRS) { + data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline() + } + # copy QtQuick plugin DLLs QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \ QtQuick.2/plugins.qmltypes \ QtQuick.2/qmldir \ - qtquick/controls/qtquickcontrolsplugin$${DS}.dll \ - qtquick/controls/plugins.qmltypes \ - qtquick/controls/qmldir \ - qtquick/controls/private/qtquickcontrolsprivateplugin$${DS}.dll \ - qtquick/controls/private/qmldir \ - qtquick/dialogs/dialogplugin$${DS}.dll \ - qtquick/dialogs/plugins.qmltypes \ - qtquick/dialogs/qmldir \ qtquick/layouts/qquicklayoutsplugin$${DS}.dll \ qtquick/layouts/plugins.qmltypes \ qtquick/layouts/qmldir \ From d8772c55295fd2ec6313dd905aa4f28691b00cfb Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Mon, 18 Nov 2013 20:04:11 +1100 Subject: [PATCH 28/30] Clean this up, so debug DDLs don't hang around in a release and vice versa --- ground/openpilotgcs/copydata.pro | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 8212cc25b..41f0153b4 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -92,7 +92,23 @@ equals(copydata, 1) { data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_APP_PATH/$$dir\") $$addNewline() } - # copy QtQuick plugin DLLs + # Remove the few unwanted DDLs after whole dir copy + QT_QUICK2_DELS = qtquick/controls/qtquickcontrolsplugin \ + qtquick/controls/private/qtquickcontrolsprivateplugin \ + qtquick/dialogs/dialogplugin + + CONFIG(debug, debug|release) { + for(delfile, QT_QUICK2_DELS) { + data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_APP_PATH/$${delfile}.dll\") $$addNewline() + } + } + CONFIG(release, debug|release) { + for(delfile, QT_QUICK2_DELS) { + data_copy.commands += $(DEL_FILE) $$targetPath(\"$$GCS_APP_PATH/$${delfile}d.dll\") $$addNewline() + } + } + + # Remianing QtQuick plugin DLLs QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \ QtQuick.2/plugins.qmltypes \ QtQuick.2/qmldir \ From 0afbed59952f2eb43d899723445b687c4b0ddf8b Mon Sep 17 00:00:00 2001 From: Fredrik Larrson Date: Mon, 18 Nov 2013 20:13:05 +1100 Subject: [PATCH 29/30] Doh, stupid type in comment, sorry. --- ground/openpilotgcs/copydata.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 41f0153b4..29721b02e 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -108,7 +108,7 @@ equals(copydata, 1) { } } - # Remianing QtQuick plugin DLLs + # Remaining QtQuick plugin DLLs QT_QUICK2_DLLS = QtQuick.2/qtquick2plugin$${DS}.dll \ QtQuick.2/plugins.qmltypes \ QtQuick.2/qmldir \ From 42ad9600446094d09d1a77c048381776d332aeb4 Mon Sep 17 00:00:00 2001 From: Patrick Huebner Date: Mon, 18 Nov 2013 22:43:14 +1100 Subject: [PATCH 30/30] OP-1109 Fix uninitialised use of m_container in welcomemode --- ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp b/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp index 838d28ff7..e2c21956f 100644 --- a/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp +++ b/ground/openpilotgcs/src/plugins/welcome/welcomemode.cpp @@ -74,6 +74,7 @@ WelcomeMode::WelcomeMode() : m_d->quickView->setResizeMode(QQuickView::SizeRootObjectToView); m_d->quickView->engine()->rootContext()->setContextProperty("welcomePlugin", this); m_d->quickView->setSource(QUrl("qrc:/welcome/qml/main.qml")); + m_container = NULL; } WelcomeMode::~WelcomeMode()