blob: eafb0af8d25669fa4e489a2f097b3257492a9a37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include "qmlpage.h"
#include <QtDeclarative/QDeclarativeView>
#include <QVBoxLayout>
#include <QDebug>
#include <QDeclarativeContext>
QMLPage::QMLPage(const QString qmlfile, QWidget *parent) :
QWidget(parent)
{
// http://harmattan-dev.nokia.com/docs/library/html/qt4/qml-integration.html
QDeclarativeView *qmlView = new QDeclarativeView;
qmlView->setSource(QUrl::fromLocalFile("keydetails.qml"));
QDeclarativeContext *context = qmlView->rootContext();
context->setContextProperty("var1", "derText");
qDebug() << "qml:::::" << QUrl::fromLocalFile("keydetails.qml");
//QWidget *widget = myExistingWidget();
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(qmlView);
}
|