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:
parent
1c23dcd2e4
commit
710f73d219
@ -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);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ TEMPLATE = lib
|
||||
TARGET = Core
|
||||
DEFINES += CORE_LIBRARY
|
||||
|
||||
QT += declarative \
|
||||
QT += qml quick \
|
||||
xml \
|
||||
network \
|
||||
script \
|
||||
|
@ -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 {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
This list model was created for the AuthorsDialog.
|
||||
*/
|
||||
import QtQuick 1.1
|
||||
import QtQuick 2.0
|
||||
|
||||
ListModel {
|
||||
${LIST_ELEMENTS}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import QtQuick 1.1
|
||||
import QtQuick 2.0
|
||||
|
||||
Rectangle {
|
||||
id: scrollDecorator
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user