- Qt 6.6
- Qt QML
- C++ Classes
- QQmlEngine
- Qt 6.6.1 Reference Documentation

# Obsolete Members for QQmlEngine

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

## Public Functions

`(deprecated (6.4))` bool | importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors)

## Macros

`(deprecated (6.7))` | QML_ADDED_IN_MINOR_VERSION(VERSION)
`(deprecated (6.7))` | QML_REMOVED_IN_MINOR_VERSION(VERSION)

## Member Function Documentation

### bool QQmlEngine::importPlugin(const QString &filePath, const QString &uri, QList<QQmlError> *errors)

This function is deprecated since 6.4. We strongly advise against using it in new code.

Import the module from QML with an "import" statement instead.

Imports the plugin named filePath with the uri provided. Returns true if the plugin was successfully imported; otherwise returns false.

On failure and if non-null, the errors list will have any errors which occurred prepended to it.

The plugin has to be a Qt plugin which implements the QQmlEngineExtensionPlugin interface.

Note: Directly loading plugins like this can confuse the module import logic. In order to make the import logic load plugins from a specific place, you can use addPluginPath(). Each plugin should be part of a QML module that you can import using the "import" statement.

## Macro Documentation

### QML_ADDED_IN_MINOR_VERSION(VERSION)

This macro is deprecated since 6.7. We strongly advise against using it in new code.

Use QML_ADDED_IN_VERSION and specify the full version

Declares that the enclosing type or namespace was added in the specified minor VERSION, relative to the module major version. The minor version is assumed to be in line with any revisions given by Q_REVISION() macros on methods, slots, or signals, and any REVISION() attributes on properties declared with Q_PROPERTY().

QML_ADDED_IN_MINOR_VERSION() only takes effect if the type or namespace is available in QML, by having a QML_ELEMENT, QML_NAMED_ELEMENT(), QML_ANONYMOUS, or QML_INTERFACE macro.

If the QML module the type belongs to is imported with a lower version than the one determined this way, the QML type is invisible.

See also QML_ADDED_IN_VERSION, QML_ELEMENT, and QML_NAMED_ELEMENT.

### QML_REMOVED_IN_MINOR_VERSION(VERSION)

This macro is deprecated since 6.7. We strongly advise against using it in new code.

Use QML_REMOVED_IN_VERSION and specify the full version

Declares that the enclosing type or namespace was removed in the specified minor VERSION, relative to the module major version. This is primarily useful when replacing the implementation of a QML type. If a corresponding QML_ADDED_IN_VERSION() is present on a different type or namespace of the same QML name, then the removed type is used when importing versions of the module lower than VERSION, and the added type is used when importing versions of the module greater or equal VERSION.

QML_REMOVED_IN_MINOR_VERSION() only takes effect if type or namespace is available in QML, by having a QML_ELEMENT, QML_NAMED_ELEMENT(), QML_ANONYMOUS, or QML_INTERFACE macro.

See also QML_REMOVED_IN_VERSION, QML_ELEMENT, and QML_NAMED_ELEMENT.