Paste P556

Masterwork From Distant Lands
ActivePublic

Authored by apol on Mar 13 2020, 1:12 PM.
diff --git a/discover/DiscoverObject.cpp b/discover/DiscoverObject.cpp
index bfccb6d0..bc33d82a 100644
--- a/discover/DiscoverObject.cpp
+++ b/discover/DiscoverObject.cpp
@@ -55,7 +55,9 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include <KStandardAction>
+#include <KCrash>
#include <kcoreaddons_version.h>
+#include <kcrash_version.h>
// #include <KSwitchLanguageDialog>
// DiscoverCommon includes
@@ -351,6 +353,12 @@ void DiscoverObject::integrateObject(QObject* object)
QWindow::Visibility visibility(QWindow::Visibility(window.readEntry<int>("visibility", QWindow::Windowed)));
rootObject()->setVisibility(qMax(visibility, QQuickView::AutomaticVisibility));
}
+ connect(rootObject(), &QQuickView::sceneGraphError, this, [] (QQuickWindow::SceneGraphError /*error*/, const QString &message) {
+#if KCrash_VERSION >= QT_VERSION_CHECK(5, 69, 0)
+ KCrash::setErrorMessage(message);
+#endif
+ qFatal("%s", qPrintable(message));
+ });
object->installEventFilter(this);
connect(object, &QObject::destroyed, qGuiApp, &QCoreApplication::quit);
@@ -496,9 +504,9 @@ void DiscoverObject::loadTest(const QUrl& url)
new DiscoverTestExecutor(rootObject(), engine(), url);
}
-QWindow* DiscoverObject::rootObject() const
+QQuickWindow* DiscoverObject::rootObject() const
{
- return qobject_cast<QWindow*>(m_engine->rootObjects().at(0));
+ return qobject_cast<QQuickWindow*>(m_engine->rootObjects().at(0));
}
void DiscoverObject::showPassiveNotification(const QString& msg)
diff --git a/discover/DiscoverObject.h b/discover/DiscoverObject.h
index 7d43d46f..32c042ca 100644
--- a/discover/DiscoverObject.h
+++ b/discover/DiscoverObject.h
@@ -58,7 +58,7 @@ class DiscoverObject : public QObject
void loadTest(const QUrl& url);
static bool isRoot();
- QWindow* rootObject() const;
+ QQuickWindow* rootObject() const;
void showPassiveNotification(const QString &msg);
QRect initialGeometry() const;
apol edited the content of this paste. (Show Details)Mar 13 2020, 1:12 PM
apol changed the title of this paste from untitled to Masterwork From Distant Lands.
ndavis added a subscriber: ndavis.Mar 13 2020, 1:21 PM