17 #include "ShellView.h"
20 #include <QQmlContext>
26 ShellView::ShellView(QQmlEngine *engine, QObject *qmlArgs)
27 : QQuickView(engine, nullptr)
29 setResizeMode(QQuickView::SizeRootObjectToView);
31 setTitle(QStringLiteral(
"Unity8"));
33 rootContext()->setContextProperty(QStringLiteral(
"applicationArguments"), qmlArgs);
35 QUrl source(::qmlDirectory() +
"/OrientedShell.qml");
38 connect(
this, &QWindow::widthChanged,
this, &ShellView::onWidthChanged);
39 connect(
this, &QWindow::heightChanged,
this, &ShellView::onHeightChanged);
42 void ShellView::onWidthChanged(
int w)
52 rootObject()->setWidth(w);
55 void ShellView::onHeightChanged(
int h)
58 rootObject()->setHeight(h);