This question is actually come from How to scroll to certain row in QML TreeView. Some properties of QtQuick
items are hidden like __listView
in TreeView
.
I understand there are some complex UI components based on some other basic one.
Qt gives the accessibility to use it but didn't mention it in the document, such hidden properties did work well as expected. So why Qt hide the properties? Shall I use it?
That is a convention created at the beginning of QML in Qt4 that we can find in this link, which seems not documented in Qt5:
Private Properties
QML and JavaScript do not enforce private properties like C++. There is a need to hide these private properties, for example, when the properties are part of the implementation. As a convention, private properties begin with two underscore characters. For example, __area, is a property that is accessible but is not meant for public use. Note that QML and JavaScript will grant the user access to these properties.
Item { id: component width: 40; height: 50 property real __area: width * height * 0.5 //not meant for outside use }