How to use it ? can any body give simple example for it ?
-
Re: what is benefits of using qmlRegisterSingletonType ?
I want to understand below things :
- qmlRegisterSingletonType
- qmlRegisterUncreatableType
- qmlRegisterType
I want to learn how to use it ? can anybody provide simple application for it ?
-
Re: what is benefits of using qmlRegisterSingletonType ?
I want to understand below things :
- qmlRegisterSingletonType
- qmlRegisterUncreatableType
- qmlRegisterType
I want to learn how to use it ? can anybody provide simple application for it ?
@Qt-embedded-developer Hello,
Warning: I have 2 weeks experience in Qt stuff.
What's the benefit?
It is helpful to expose your C++ objects to QML. For example, you made a class in C++ that holds and do stuff on Student Data. Now you want to display this data. You will create an object. Then QML, which is UI stuff don't know about this object. So, to make it aware of this object you will use these things. Once your object is there you can use it to display data of student.Some readings: (Examples+Syntax)
- For qmlRegisterSingletonType please read https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterSingletonType
- For qmlRegisterUncreatableType please read https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterUncreatableType
- For qmlRegisterType please read https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterType
I hope it helps :)