aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qml/doc/src/whatsnew.qdoc2
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index f1c69160b6..9ad8c23a42 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -115,6 +115,8 @@ has now been replaced by the new \l {Qt QML} and \l {Qt Quick} modules. See the
\list
\li Arbitrary functionality may be provided in a namespace through a singleton type. See qmlRegisterSingletonType() for more information.
\li JavaScript (.js) files may now import QML modules and other JavaScript files using the ".import" syntax.
+\li Plugins may now use QQmlExtensionPlugin::baseUrl to get the directory from which the plugin is loaded.
+ This will be useful if the plugin needs to load QML or other assets from the same directory.
\endlist
\section2 Other
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index f77b176404..30eca7b112 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
/*!
- \since 5.0
+ \since Qt 5.0
\inmodule QtQml
\class QQmlExtensionPlugin
\brief The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins.
@@ -156,6 +156,13 @@ QQmlExtensionPlugin::~QQmlExtensionPlugin()
{
}
+/*!
+ \since Qt 5.1
+ \brief Returns the URL of the directory from which the extension is loaded.
+
+ This is useful when the plugin also needs to load QML files or other
+ assets from the same directory.
+*/
QUrl QQmlExtensionPlugin::baseUrl() const
{
Q_D(const QQmlExtensionPlugin);