Commit 72121356 authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

Port away from deprecated KDeclarative::setupEngine()

parent ba067e10
Pipeline #246562 failed with stage
in 4 minutes and 41 seconds
......@@ -15,6 +15,7 @@
#include <QQuickItem>
#include <QStandardPaths>
#include <kdeclarative_version.h>
#include <kquickiconprovider.h>
AssetListWidget::AssetListWidget(QWidget *parent)
: QQuickWidget(parent)
......@@ -22,7 +23,11 @@ AssetListWidget::AssetListWidget(QWidget *parent)
{
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
#if KDECLARATIVE_VERSION < QT_VERSION_CHECK(5, 98, 0)
kdeclarative.setupEngine(engine());
#else
engine()->addImageProvider(QStringLiteral("icon"), new KQuickIconProvider);
#endif
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
}
......
......@@ -43,6 +43,7 @@ signals:
void reloadFavorites();
};
// TODO we use Qt 5.15 now where this is fixed
// see https://bugreports.qt.io/browse/QTBUG-57714, don't expose a QWidget as a context property
class EffectListWidgetProxy : public QObject
{
......
......@@ -26,7 +26,6 @@
#include "utils/clipboardproxy.hpp"
#include <KDeclarative/KDeclarative>
// #include <QUrl>
#include <QAction>
#include <QActionGroup>
#include <QFontDatabase>
......@@ -36,6 +35,8 @@
#include <QQuickItem>
#include <QSortFilterProxyModel>
#include <QUuid>
#include <kdeclarative_version.h>
#include <kquickiconprovider.h>
const int TimelineWidget::comboScale[] = {1, 2, 4, 8, 15, 30, 50, 75, 100, 150, 200, 300, 500, 800, 1000, 1500, 2000, 3000, 6000, 15000, 30000};
......@@ -44,7 +45,11 @@ TimelineWidget::TimelineWidget(QWidget *parent)
{
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
#if KDECLARATIVE_VERSION < QT_VERSION_CHECK(5, 98, 0)
kdeclarative.setupEngine(engine());
#else
engine()->addImageProvider(QStringLiteral("icon"), new KQuickIconProvider);
#endif
engine()->rootContext()->setContextObject(new KLocalizedContext(this));
setClearColor(palette().window().color());
setMouseTracking(true);
......
Supports Markdown
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