Ashif
Ashif

Reputation: 1684

How to export all the property/signal of qmlitem?

I have list of QML objects, I would like to populate properties/signals corresponding to each qml item, is there any API to get/parse all the properties of qmlitem?

Example:
qml: QQmlConnections(0xb719e0)
qml: QQmlTimer(0xb70c80)
qml: QQuickLoader(0xb3b780)
qml: QQuickLoader_QML_15(0xb262e0)
qml: QQuickItem(0xe3b3e0)
qml: QQuickLoader(0xe3b410)
qml: QQuickItem_QML_58(0xe41ba0)

Upvotes: 0

Views: 252

Answers (1)

dtech
dtech

Reputation: 49289

You can iterate over an object's members like this:

for (var p in obj) console.log(p + " " + typeof obj[p] + " " + obj[p])

You can do even more from the C++ side, using QMetaObject as illustrated in this answer.

Upvotes: 1

Related Questions