~cr3/+junk/frontend

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
26
#include <QtDeclarative/QDeclarativeView>
#include <QVBoxLayout>
#include <QUrl>
#include "frontend.h"
#include "ui_frontend.h"

Frontend::Frontend(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Frontend)
{
    ui->setupUi(this);
}

void Frontend::showQML(QString path)
{
    QDeclarativeView *qmlView = new QDeclarativeView;
    qmlView->setSource(QUrl::fromLocalFile(path));

    QVBoxLayout *layout = new QVBoxLayout(ui->frame);
    layout->addWidget(qmlView);
}

Frontend::~Frontend()
{
    delete ui;
}