From 56502b79f63ed8e73c7aca4ba079c480c33e7858 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 3 Feb 2024 01:02:04 -0800 Subject: [PATCH] fix: log QQmlComponent creation error strings --- src/cpp/rootwrapper.cpp | 1 + src/cpp/scavenge.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/cpp/rootwrapper.cpp b/src/cpp/rootwrapper.cpp index b840957e..87b0d7a4 100644 --- a/src/cpp/rootwrapper.cpp +++ b/src/cpp/rootwrapper.cpp @@ -33,6 +33,7 @@ void RootWrapper::reloadGraph(bool hard) { SCAVENGE_PARENT = nullptr; if (obj == nullptr) { + qWarning() << component.errorString().toStdString().c_str(); qWarning() << "failed to create root component"; return; } diff --git a/src/cpp/scavenge.cpp b/src/cpp/scavenge.cpp index b61f658f..50c1f8f4 100644 --- a/src/cpp/scavenge.cpp +++ b/src/cpp/scavenge.cpp @@ -36,5 +36,10 @@ QObject* createComponentScavengeable( if (instance->parent() != nullptr) instance->setParent(&parent); component.setInitialProperties(instance, initialProperties); component.completeCreate(); + + if (instance == nullptr) { + qWarning() << component.errorString().toStdString().c_str(); + } + return instance; }