mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:36:44 +02:00
Fix QML debug info: print last QML loaded file instead of Desktop.qml
This commit is contained in:
parent
d64a6ecda7
commit
01699e26a5
2 changed files with 7 additions and 3 deletions
|
@ -658,10 +658,8 @@ void OffscreenUi::createDesktop(const QUrl& url) {
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
getSurfaceContext()->setContextProperty("DebugQML", QVariant(true));
|
getSurfaceContext()->setContextProperty("DebugQML", QVariant(true));
|
||||||
getSurfaceContext()->setContextProperty("DebugQMLFile", QVariant(url.toString()));
|
#else
|
||||||
#else
|
|
||||||
getSurfaceContext()->setContextProperty("DebugQML", QVariant(false));
|
getSurfaceContext()->setContextProperty("DebugQML", QVariant(false));
|
||||||
getSurfaceContext()->setContextProperty("DebugQMLFile", QVariant(""));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
load(url, [=](QQmlContext* context, QObject* newObject) {
|
load(url, [=](QQmlContext* context, QObject* newObject) {
|
||||||
|
|
|
@ -909,6 +909,12 @@ void OffscreenQmlSurface::loadInternal(const QUrl& qmlSource, bool createNewCont
|
||||||
finalQmlSource = _qmlContext->resolvedUrl(qmlSource);
|
finalQmlSource = _qmlContext->resolvedUrl(qmlSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
getSurfaceContext()->setContextProperty("DebugQMLFile", QVariant(finalQmlSource.toString()));
|
||||||
|
#else
|
||||||
|
getSurfaceContext()->setContextProperty("DebugQMLFile", QVariant(""));
|
||||||
|
#endif
|
||||||
|
|
||||||
auto targetContext = contextForUrl(finalQmlSource, parent, createNewContext);
|
auto targetContext = contextForUrl(finalQmlSource, parent, createNewContext);
|
||||||
auto qmlComponent = new QQmlComponent(_qmlContext->engine(), finalQmlSource, QQmlComponent::PreferSynchronous);
|
auto qmlComponent = new QQmlComponent(_qmlContext->engine(), finalQmlSource, QQmlComponent::PreferSynchronous);
|
||||||
if (qmlComponent->isLoading()) {
|
if (qmlComponent->isLoading()) {
|
||||||
|
|
Loading…
Reference in a new issue