#include "test.h"
#include <QQmlEngine>
#include <QQmlComponent>
#include <QDebug>

Test::Test(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);

	connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(clicked()));

	QQmlEngine *engine = new QQmlEngine;
	QQmlComponent * component = new QQmlComponent(engine, QUrl::fromLocalFile(QCoreApplication::applicationDirPath() + "\\main.qml"));

	QObject *myObject = component->create();
	item = qobject_cast<QWindow*>(myObject);

	qDebug() << component->errorString();
}

Test::~Test()
{

}

void Test::clicked()
{

	item->setVisible(!item->isVisible());

}
