- Qt 6.5
- Qt QML
- C++ Classes
- QQmlEngine
- Qt 6.5.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)

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