Obsolete Members for QObject

The following members of class QObject are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

(obsolete) void dumpObjectInfo()
(obsolete) void dumpObjectTree()

Macros

(obsolete) Q_ENUMS(...)
(obsolete) Q_FLAGS(...)

Member Function Documentation

void QObject::dumpObjectInfo()

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This is an overloaded function.

Dumps information about signal connections, etc. for this object to the debug output.

See also dumpObjectTree().

void QObject::dumpObjectTree()

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This is an overloaded function.

Dumps a tree of children to the debug output.

See also dumpObjectInfo().

Macro Documentation

QObject::Q_ENUMS(...)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

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

For example:


  class MyClass : public QObject
  {
      Q_OBJECT

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

      enum Priority { High, Low, VeryHigh, VeryLow };
      Q_ENUM(Priority)
      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().

In new code, you should prefer the use of the Q_ENUM() macro, which makes the type available also to the meta type system. For instance, QMetaEnum::fromType() will not work with types declared with Q_ENUMS().

See also Qt's Property System.

QObject::Q_FLAGS(...)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This macro registers one or several flags types with the meta-object system. It is typically used in a class definition to declare that values of a given enum can be used as flags and combined using the bitwise OR operator.

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.

In new code, you should prefer the use of the Q_FLAG() macro, which makes the type available also to the meta type system.

See also Qt's Property System.