1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-1109: port coreplugin/AutorsDialog.

TODO: fix dialog/view size handling
This commit is contained in:
Alessio Morale 2013-11-14 00:25:24 +01:00
parent 1c23dcd2e4
commit 710f73d219
6 changed files with 15 additions and 13 deletions

View File

@ -44,10 +44,10 @@
#include <QPushButton>
#include <QTextBrowser>
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/qdeclarativeview.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtQuick>
#include <QQuickView>
#include <QQmlEngine>
#include <QQmlContext>
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);
}

View File

@ -2,7 +2,7 @@ TEMPLATE = lib
TARGET = Core
DEFINES += CORE_LIBRARY
QT += declarative \
QT += qml quick \
xml \
network \
script \

View File

@ -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 {

View File

@ -1,7 +1,7 @@
/*
This list model was created for the AuthorsDialog.
*/
import QtQuick 1.1
import QtQuick 2.0
ListModel {
${LIST_ELEMENTS}

View File

@ -1,4 +1,4 @@
import QtQuick 1.1
import QtQuick 2.0
Rectangle {
id: scrollDecorator

View File

@ -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
}
}
}