summaryrefslogtreecommitdiffstats
path: root/tests/manual/compressed_textures/main.cpp
blob: 1ccf77e5a163eea5f7d0a036c11e0bc99230d935 (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
26
27
28
// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include <QQuickView>
#include <QGuiApplication>
#include <QQmlContext>
#include <QDir>

QStringList createTextureFileList()
{
    QDir dir(QString::fromUtf8(DATA_DIR));
    return dir.entryList();
}

int main(int argc, char* argv[])
{
    QGuiApplication app(argc, argv);
    QQuickView view;

    QQmlContext *ctx =view.rootContext();
    ctx->setContextProperty(QStringLiteral("_pathPrefix"), QString::fromUtf8(DATA_DIR));
    ctx->setContextProperty(QStringLiteral("_texturesList"), createTextureFileList());

    view.setSource(QUrl("qrc:/main.qml"));
    view.show();

    return app.exec();
}