#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDir>
#include <QGuiApplication>
#include <QQmlEngine>
#include <QQuickView>
#include <QDebug>

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

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

void MainWindow::on_pushButton_clicked()
{

    QQuickView *view = new QQuickView;

    //view.setResizeMode(QQuickView::SizeRootObjectToView);
    //view->setSource(QUrl::fromLocalFile("C:/qt.project/untitled2/pathview/pathview-example.qml"));
    //view->setSource(QUrl::fromLocalFile("C:/qt.project/untitled2/objectmodel/objectmodel.qml"));

    qDebug()<<"flavio";


//    view->setSource(QUrl("qrc:/qml/objectmodel/objectmodel.qml"));
    view->setSource(QUrl("qrc:/qml/pathview/pathview-example.qml"));
    view->show();

}
