forked from fgrehm/qmlunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqmllogger.cpp
More file actions
32 lines (23 loc) · 724 Bytes
/
qmllogger.cpp
File metadata and controls
32 lines (23 loc) · 724 Bytes
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
27
28
29
30
31
32
#include "qmllogger.h"
#include <QtGui>
QmlLogger::QmlLogger(QString qmlUnitPath, QObject *parent) :
QObject(parent) {
dialog = new QDialog();
this->qmlUnitPath = qmlUnitPath;
dialog->setWindowTitle(tr("QmlUnit"));
view = new QDeclarativeView(dialog);
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
QHBoxLayout* layout = new QHBoxLayout();
layout->setSpacing(0);
layout->setMargin(0);
layout->addWidget(view);
dialog->setLayout(layout);
}
void QmlLogger::setup(){
view->setSource(QUrl(qmlUnitPath + "/QmlTestRunner.qml"));
dialog->setMinimumSize(800, 600);
dialog->show();
}
QDeclarativeEngine* QmlLogger::engine(){
return view->engine();
}