QtObject QML Type
A basic QML type. More...
|Import Statement:||import QtQml 2.15|
- objectName : string
The QtObject type is a non-visual element which contains only the objectName property.
It can be useful to create a QtObject if you need an extremely lightweight type to enclose a set of custom properties:
objectName : string
This property holds the QObject::objectName for this specific object instance.
This allows a C++ application to locate an item within a QML component using the QObject::findChild() method. For example, the following C++ application locates the child Rectangle item and dynamically changes its
// main.cpp QQuickView view; view.setSource(QUrl::fromLocalFile("MyRect.qml")); view.show(); QQuickItem *item = view.rootObject()->findChild<QQuickItem*>("myRect"); if (item) item->setProperty("color", QColor(Qt::yellow));
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.