mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-02 05:32:01 +02:00
Add the url of each qml as on-screen debug info
This commit is contained in:
parent
3f762c7900
commit
109fa1d832
2 changed files with 8 additions and 2 deletions
|
@ -16,10 +16,11 @@ import "../js/Utils.js" as Utils
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: frame
|
id: frame
|
||||||
|
objectName: "Frame"
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
default property var decoration
|
default property var decoration
|
||||||
|
property string qmlFile: "N/A"
|
||||||
property bool gradientsSupported: desktop.gradientsSupported
|
property bool gradientsSupported: desktop.gradientsSupported
|
||||||
|
|
||||||
readonly property int frameMarginLeft: frame.decoration ? frame.decoration.frameMarginLeft : 0
|
readonly property int frameMarginLeft: frame.decoration ? frame.decoration.frameMarginLeft : 0
|
||||||
|
@ -44,7 +45,7 @@ Item {
|
||||||
id: debugZ
|
id: debugZ
|
||||||
visible: DebugQML
|
visible: DebugQML
|
||||||
color: "red"
|
color: "red"
|
||||||
text: (window ? "Z: " + window.z : "")
|
text: (window ? "Z: " + window.z : "") + " " + qmlFile
|
||||||
y: window ? window.height + 4 : 0
|
y: window ? window.height + 4 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -342,6 +342,11 @@ void OffscreenSurface::finishQmlLoad(QQmlComponent* qmlComponent,
|
||||||
// Make sure we make items focusable (critical for
|
// Make sure we make items focusable (critical for
|
||||||
// supporting keyboard shortcuts)
|
// supporting keyboard shortcuts)
|
||||||
newItem->setFlag(QQuickItem::ItemIsFocusScope, true);
|
newItem->setFlag(QQuickItem::ItemIsFocusScope, true);
|
||||||
|
#ifdef DEBUG
|
||||||
|
for (auto frame : newObject->findChildren<QQuickItem *>("Frame")) {
|
||||||
|
frame->setProperty("qmlFile", qmlComponent->url());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rootCreated = getRootItem() != nullptr;
|
bool rootCreated = getRootItem() != nullptr;
|
||||||
|
|
Loading…
Reference in a new issue