blob: 3a8f17b0f29763f02f3ad94bc2c0cc2ff4018cd7 (
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 <QtCore/QDir>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlContext>
#include <UiHelpers/UiFileSystemModel>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
UiHelpers::UiFileSystemModel model;
model.setRootPath(QDir::tempPath());
QQuickView v;
v.rootContext()->setContextProperty("fsmodel", &model);
v.setWindowTitle(QObject::tr("Dir View"));
v.setResizeMode(QQuickView::SizeRootObjectToView);
v.resize(640, 480);
v.setSource(QUrl::fromLocalFile("main.qml"));
v.show();
return app.exec();
}
|