2021-04-01 00:28:01 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <interfaces/shell.h>
|
|
|
|
#include <interfaces/window.h>
|
|
|
|
|
2021-04-06 11:39:27 +00:00
|
|
|
int main(int argc, char **argv)
|
2021-04-01 00:28:01 +00:00
|
|
|
{
|
|
|
|
LayerShellQt::Shell::useLayerShell();
|
|
|
|
|
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
QQmlApplicationEngine engine;
|
2021-04-06 11:39:27 +00:00
|
|
|
engine.loadData(
|
|
|
|
"import QtQuick.Controls 2.10\n"
|
|
|
|
"import QtQuick 2.10\n"
|
|
|
|
"\n"
|
|
|
|
"ApplicationWindow {"
|
|
|
|
" width: 100; height: 100\n"
|
|
|
|
" visible: true\n"
|
|
|
|
" Rectangle { color: 'red'; anchors.fill: parent }"
|
|
|
|
"}"
|
2021-04-01 00:28:01 +00:00
|
|
|
|
2021-04-06 11:39:27 +00:00
|
|
|
,
|
|
|
|
QStringLiteral("bananaland:/potato.qml"));
|
2021-04-01 00:28:01 +00:00
|
|
|
|
2021-04-06 11:39:27 +00:00
|
|
|
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [](QObject *object) {
|
2021-04-01 00:28:01 +00:00
|
|
|
auto layerWindow = LayerShellQt::Window::get(qobject_cast<QWindow *>(object));
|
|
|
|
Q_ASSERT(layerWindow);
|
|
|
|
layerWindow->setMargins({50, 50, 50, 50});
|
|
|
|
});
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|