Meshroom/meshroom/ui/qml/GraphEditor/NodeDocumentation.qml
Candice Bentéjac 02383c68b3 [ui] Check that objects accessed by QML properties are not null before accessing them
Some QML properties access exposed Python objects that may or may not
be null upon their access. When these objects are accessed while null,
QML issues "TypeError" warnings. These warnings have no functional
impact as QML correctly handles trying to access null objects, but can
spam the logs.

This commit aims at fixing all these warnings by checking that the
Python objects are not null before being accessed.
2022-12-06 11:04:50 +01:00

38 lines
853 B
QML

import QtQuick 2.11
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Controls 1.0
import "common.js" as Common
/**
* Displays Node documentation
*/
FocusScope {
id: root
property variant node
SystemPalette { id: activePalette }
ScrollView {
width: parent.width
height: parent.height
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
clip: true
TextEdit {
width: parent.parent.width
height: parent.height
padding: 8
textFormat: TextEdit.MarkdownText
selectByMouse: true
selectionColor: activePalette.highlight
color: activePalette.text
text: node ? node.documentation : ""
wrapMode: TextEdit.Wrap
}
}
}