- Qt 5.15
- Qt Core
- C++ Classes
- QObject
- Qt 5.15.18 Reference Documentation

# 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()
`(obsolete)` QList<T> | findChildren(const QRegExp &regExp, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const

## Static Public Members

`(obsolete)` QString | trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1)

## Related Non-Members

`(obsolete)` T | qFindChild(const QObject *obj, const QString &name = QString())
`(obsolete)` QList<T> | qFindChildren(const QObject *obj, const QString &name = QString())

## 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().

### template <typename T> QList<T> QObject::findChildren(const QRegExp &regExp, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const

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

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Use the findChildren overload taking a QRegularExpression instead.

### `[static]` QString QObject::trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1)

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

Returns a translated version of sourceText, or QString::fromUtf8(sourceText) if there is no appropriate version. It is otherwise identical to tr(sourceText, disambiguation, n).

Warning: This method is reentrant only if all translators are installed before calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior.

Warning: For portability reasons, we recommend that you use escape sequences for specifying non-ASCII characters in string literals to trUtf8(). For example:

     label->setText(tr("F\374r \310lise"));

See also tr(), QCoreApplication::translate(), and Internationalization with Qt.

## Related Non-Members

### template <typename T> T qFindChild(const QObject *obj, const QString &name = QString())

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

This function overloads qFindChildren().

This function is equivalent to obj->findChild<T>(name).

Note: This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.

See also QObject::findChild().

### template <typename T> QList<T> qFindChildren(const QObject *obj, const QString &name = QString())

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

This function overloads qFindChildren().

This function is equivalent to obj->findChildren<T>(name).

Note: This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.

See also QObject::findChildren().

## Macro Documentation

### Q_ENUMS(...)

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

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().

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

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 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.