Obsolete Members for QQmlEngine

以下成員源於類 QQmlEngine 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

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

成員函數文檔編製

[deprecated in 6.4] 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 采用 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 接口。

注意: 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.