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

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:

        class MyClass : public QObject
        {
            Q_OBJECT
            Q_CLASSINFO("Author", "Pierre Gendron")
            Q_CLASSINFO("URL", "http://www.my-organization.qc.ca")

        public:
            ...
        };

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

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

Example:

tools/plugandpaintplugins/basictools/basictoolsplugin.h class BasicToolsPlugin public: }; };

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 declares a QObject property. The syntax is:

        Q_PROPERTY(type name
                   READ getFunction
                   [WRITE setFunction]
                   [RESET resetFunction]
                   [DESIGNABLE bool]
                   [SCRIPTABLE bool]
                   [STORED bool])

For example:

        Q_PROPERTY(QString title READ title WRITE setTitle)

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

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

For example:

    class MyClass : public QObject
    {
        Q_OBJECT
        Q_ENUMS(Priority)

    public:
        MyClass(QObject *parent = 0);
        ~MyClass();

        enum Priority { High, Low, VeryHigh, VeryLow };
        void setPriority(Priority priority);
        Priority priority() const;
    };

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 "flags" types to the meta-object system.

Example:

        Q_FLAGS(Options Alignment)

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:

snippets/signalsandslots/signalsandslots.h ObjectCounter include <QObject> include class Counter };

See also:
{Meta-Object System}, {Signals and Slots}, {Qt's Property System}
Synonym for QList<QObject *>.


Generated by  Doxygen 1.6.0   Back to index