eden/src/Eden/Interface/MetaObjectHelper.h
2025-09-14 16:00:54 -04:00

22 lines
526 B
C++

#ifndef METAOBJECTHELPER_H
#define METAOBJECTHELPER_H
#include <QMetaObject>
#include <QObject>
#include <QQmlProperty>
class MetaObjectHelper : public QObject {
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
public:
using QObject::QObject;
Q_INVOKABLE QString typeName(QObject* object, const QString& property) const
{
QQmlProperty qmlProperty(object, property);
QMetaProperty metaProperty = qmlProperty.property();
return metaProperty.typeName();
}
};
#endif // METAOBJECTHELPER_H