Replaced .engine() by pointer access b/c of backward compatibility

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
Dominique Fuchs 2019-12-08 13:18:46 +01:00
parent ae7eddf7c9
commit 66bfccc738

View file

@ -39,14 +39,15 @@ Systray::Systray() // TODO: make singleton, provide ::instance()
, _accountMenuModel(nullptr)
{
// Create QML tray engine, build component, set C++ backend context used in window.qml
// Use pointer instead of engine() helper function until Qt 5.12 is minimum standard
QQmlEngine *engine = new QQmlEngine;
QQmlComponent systray(engine, QUrl(QStringLiteral("qrc:/qml/src/gui/tray/init.qml")));
_trayContext = engine->contextForObject(systray.create());
_accountMenuModel = UserModel::instance();
systray.engine()->addImageProvider("avatars", new ImageProvider);
systray.engine()->rootContext()->setContextProperty("systrayBackend", _accountMenuModel);
engine->addImageProvider("avatars", new ImageProvider);
engine->rootContext()->setContextProperty("systrayBackend", _accountMenuModel);
// TODO: hack to pass the icon to QML
//ctxt->setContextProperty("theme", QLatin1String("colored"));