2 ms·
Yes, it's still used for several reasons, including: - enumerate the properties, signals, slots and other methods as well as decorations (classinfo) present in
by FigBug 14y ago
Yes, it's still used for several reasons, including:
- enumerate the properties, signals, slots and other methods as well as decorations (classinfo) present in a class (this feature is called “type reflection”, which is common in scripted languages, but is also present in Java)
- get and set properties by name and without knowing th exact type of the property (though technically the latter is a product of the related, but independent Meta Type system)
- place calls to extracted member functions (the “invokable” functions) by name
- the last two features together allow us also to integrate C++ classes easily with other languages and IPC mechanisms without the need to write specialised parsers (D-Bus, EcmaScript, QML, but also the many bindings to Qt like Python or C#)
- instantiate types by simply having access to the meta object