Commit a205135f authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated KDeclarative::setupContext()

parent 90ff8bab
......@@ -18,17 +18,21 @@
#include "kgdeclarativeview.h"
#include <kdeclarative/kdeclarative.h>
// KF
#include <KDeclarative/KDeclarative>
#include <KLocalizedContext>
// Qt
#include <QQmlContext>
KgDeclarativeView::KgDeclarativeView(QWidget *parent) :
QQuickWidget(parent),
d(nullptr) //unused for now, for future expandability
{
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
// binds things like i18n and icons
kdeclarative.setupContext();
QQmlEngine* engine = this->engine();
KDeclarative::KDeclarative::setupEngine(engine);
KLocalizedContext *localizedContextObject = new KLocalizedContext(engine);
engine->rootContext()->setContextObject(localizedContextObject);
setResizeMode(SizeRootObjectToView);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment