QMetaObject::className() returns the class name as a string at run-time, without requiring native run-time type information (RTTI) support through the C++ compiler.QObject::metaObject() returns the associated meta-object for the class.In addition to providing the signals and slots mechanism for communication between objects (the main reason for introducing the system), the meta-object code provides the following additional features: This generated source file is either #include'd into the class's source file or, more usually, compiled and linked with the class's implementation. If it finds one or more class declarations that contain the Q_OBJECT macro, it produces another C++ source file which contains the meta-object code for each of those classes. The Meta-Object Compiler ( moc) supplies each QObject subclass with the necessary code to implement meta-object features.The Q_OBJECT macro inside the private section of the class declaration is used to enable meta-object features, such as dynamic properties, signals, and slots.The QObject class provides a base class for objects that can take advantage of the meta-object system.The meta-object system is based on three things: Qt's meta-object system provides the signals and slots mechanism for inter-object communication, run-time type information, and the dynamic property system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |