CopperSpice Overview
|
Moc is typically used with an input file containing class declarations similar to the following:
In addition to signals and slots, moc also implements object properties. The Q_PROPERTY() macro declares an object property while Q_ENUMS() declare a list of enumeration types within the class, which is usable inside the Property System.
The Q_FLAGS() macro declares enums that are to be used as flags. Q_CLASSINFO() allows an application to attach additional name/value pairs to the class's meta-object.
If this class declaration is located in the file myclass.h
then the moc output will be put in a file called moc_myclass.cpp
. This cpp file is compiled resulting in an object file named moc_myclass.o
. The object file must be included in the final linking phase of your application.