Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QObjectList [related, inherited]

Q_CLASSINFO(Name, Value)

This macro associates extra information to the class, which is available using QObject::metaObject(). Except for the ActiveQt extension, Qt doesn't use this information.

The extra information takes the form of a Name string and a Value literal string.

Example:

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 35

See also:
QMetaObject::classInfo()
Q_INTERFACES(...)

This macro tells Qt which interfaces the class implements. This is used when implementing plugins.

Example:

examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h 1 examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h 3

See the {tools/plugandpaintplugins/basictools}{Plug & Paint Basic Tools} example for details.

See also:
Q_DECLARE_INTERFACE(), Q_EXPORT_PLUGIN2(), {How to Create Qt Plugins}
Q_PROPERTY(...)

This macro is used for declaring properties in classes that inherit QObject. Properties behave like class data members, but they have additional features accessible through the {Meta-Object System}.

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 36

The property name and type and the READ function are required. The type can be any type supported by QVariant, or it can be a user-defined type. The other items are optional, but a WRITE function is common. The attributes default to true except USER, which defaults to false.

For example:

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 37

For more details about how to use this macro, and a more detailed example of its use, see the discussion on {Qt's Property System}.

See also:
{Qt's Property System}
Q_ENUMS(...)

This macro registers one or several enum types to the meta-object system.

For example:

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 38

If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class defining it. In addition, the class defining the enum has to inherit QObject as well as declare the enum using Q_ENUMS().

See also:
{Qt's Property System}
Q_FLAGS(...)

This macro registers one or several {QFlags}{flags types} to the meta-object system.

Example:

doc/src/snippets/code/src_corelib_kernel_qobject.cpp 39

Note:
This macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUMS() in addition to this macro.
See also:
{Qt's Property System}
Q_OBJECT

The Q_OBJECT macro must appear in the private section of a class definition that declares its own signals and slots or that uses other services provided by Qt's meta-object system.

For example:

doc/src/snippets/signalsandslots/signalsandslots.h 1 doc/src/snippets/signalsandslots/signalsandslots.h 2 doc/src/snippets/signalsandslots/signalsandslots.h 3

Note:
This macro requires the class to be a subclass of QObject. Use Q_GADGET instead of Q_OBJECT to enable the meta object system's support for enums in a class that is not a QObject subclass. Q_GADGET makes a class member, {staticMetaObject}, available. {staticMetaObject} is of type QMetaObject and provides access to the enums declared with Q_ENUMS. Q_GADGET is provided only for C++.
See also:
{Meta-Object System}, {Signals and Slots}, {Qt's Property System}
Q_SIGNALS

Use this macro to replace the signals keyword in class declarations, when you want to use Qt Signals and Slots with a {3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

Q_SIGNAL

This is an additional macro that allows you to mark a single function as a signal. It can be quite useful, especially when you use a 3rd-party source code parser which doesn't understand a signals or Q_SIGNALS groups.

Use this macro to replace the signals keyword in class declarations, when you want to use Qt Signals and Slots with a {3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

Q_SLOTS

Use this macro to replace the slots keyword in class declarations, when you want to use Qt Signals and Slots with a {3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

Q_SLOT

This is an additional macro that allows you to mark a single function as a slot. It can be quite useful, especially when you use a 3rd-party source code parser which doesn't understand a slots or Q_SLOTS groups.

Use this macro to replace the slots keyword in class declarations, when you want to use Qt Signals and Slots with a {3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

Q_EMIT

Use this macro to replace the emit keyword for emitting signals, when you want to use Qt Signals and Slots with a {3rd Party Signals and Slots} {3rd party signal/slot mechanism}.

The macro is normally used when no_keywords is specified with the CONFIG variable in the .pro file, but it can be used even when no_keywords is not specified.

Q_INVOKABLE

Apply this macro to definitions of member functions to allow them to be invoked via the meta-object system. The macro is written before the return type, as shown in the following example:

snippets/qmetaobject-invokable/window.h Window class with invokable method

The invokableMethod() function is marked up using Q_INVOKABLE, causing it to be registered with the meta-object system and enabling it to be invoked using QMetaObject::invokeMethod(). Since normalMethod() function is not registered in this way, it cannot be invoked using QMetaObject::invokeMethod().

Synonym for QList<QObject *>.


Generated by  Doxygen 1.6.0   Back to index