aboutsummaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2018-12-18 17:16:35 +0100
committerLoïc Collignon [ IoT.bzh ] <loic.collignon@iot.bzh>2018-12-19 10:06:56 +0000
commitd32d36b936cb031ba1b11c67c0d9c6afbdc280b3 (patch)
treea5a09e31bb41ced3ddea5dddf92530d187da4341 /app/main.cpp
parentf8da591c53f17df877e354896dbbf18410c53b6c (diff)
Reworked the way qml create sliders
Use the qml MVC to populate a ListView with components based on a template VolumeSlider. Should now handle potential disconnections, volume changes by third-party and also fix the issue where sliders are set to 0 at startup. Change-Id: I2961d5a1584a121c473ece253faa90a747c64445 Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/main.cpp b/app/main.cpp
index c0d4b5b..255b39d 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -20,6 +20,7 @@
#include <QtCore/QCommandLineParser>
#include <QtCore/QUrlQuery>
#include <QtCore/QDir>
+#include <QtCore/QList>
#include <QtCore/QStandardPaths>
#include <QtCore/QThread>
#include <QtGui/QGuiApplication>
@@ -36,7 +37,8 @@
#else
#include <QScreen>
#endif
-#include "mixer.h"
+#include "mixer.hpp"
+#include "audiorole.hpp"
int main(int argc, char *argv[])
{
@@ -82,7 +84,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
AGLScreenInfo screenInfo(qwm->get_scale_factor());
- engine.rootContext()->setContextProperty(QStringLiteral("screenInfo"), &screenInfo);
+ engine.rootContext()->setContextProperty(QStringLiteral("scale_factor"), screenInfo.scale_factor());
// Request a surface as described in layers.json windowmanager’s file
if (qwm->requestSurface(graphic_role) != 0) {
exit(EXIT_FAILURE);
@@ -101,8 +103,9 @@ int main(int argc, char *argv[])
qDebug("Surface %s got tapShortcut\n", graphic_role.toStdString().c_str());
qwm->activateWindow(graphic_role);
});
+#else
+ engine.rootContext()->setContextProperty(QStringLiteral("scale_factor"), 1.0);
#endif
-
engine.load(QUrl(QStringLiteral("qrc:/Mixer.qml")));
// Find the instantiated model QObject and connect the signals/slots