From 3e7f29a0aae404e7db54815dba7c5d957f9be946 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Wed, 20 Jan 2016 08:37:10 -0800 Subject: [PATCH] Support debug mode for QML UI in debug builds --- libraries/ui/src/OffscreenUi.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 7849bf5b95..8f70931085 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -238,7 +238,12 @@ void OffscreenUi::createDesktop(const QUrl& url) { qDebug() << "Desktop already created"; return; } +#ifdef DEBUG + getRootContext()->setContextProperty("DebugQML", QVariant(true)); +#else getRootContext()->setContextProperty("DebugQML", QVariant(false)); +#endif + _desktop = dynamic_cast(load(url)); Q_ASSERT(_desktop); getRootContext()->setContextProperty("desktop", _desktop);