mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
OP-1109: port plugin/welcome
This commit is contained in:
parent
067b2e61ae
commit
1c23dcd2e4
@ -1,4 +1,5 @@
|
||||
import QtQuick 1.1
|
||||
import QtQuick 2.0
|
||||
import QtQuick.XmlListModel 2.0
|
||||
|
||||
Item {
|
||||
id: container
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick 1.1
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
id: scrollDecorator
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick 1.1
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
|
@ -1,6 +1,6 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = Welcome
|
||||
QT += network declarative
|
||||
QT += network qml quick
|
||||
|
||||
include(../../openpilotgcsplugin.pri)
|
||||
include(welcome_dependencies.pri)
|
||||
|
@ -45,10 +45,10 @@
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtDeclarative/qdeclarative.h>
|
||||
#include <QtDeclarative/qdeclarativeview.h>
|
||||
#include <QtDeclarative/qdeclarativeengine.h>
|
||||
#include <QtDeclarative/qdeclarativecontext.h>
|
||||
#include <QtQuick>
|
||||
#include <QQuickView>
|
||||
#include <QQmlEngine>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
@ -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
|
||||
|
@ -72,6 +72,7 @@ public slots:
|
||||
void triggerAction(const QString &actionId);
|
||||
|
||||
private:
|
||||
QWidget *m_container;
|
||||
WelcomeModePrivate *m_d;
|
||||
int m_priority;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user