summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-29 01:33:08 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-29 01:33:08 (GMT)
commitf3b7cfd52b9a2c5ec4bef5b2b94f89dd83fd705d (patch)
tree29fbf8f999a7f5b9f34b66ba601bfd4cf9216166 /src
parentbe07335e426ef726a219e183d13b4a8f98bd9907 (diff)
downloadQt-f3b7cfd52b9a2c5ec4bef5b2b94f89dd83fd705d.zip
Qt-f3b7cfd52b9a2c5ec4bef5b2b94f89dd83fd705d.tar.gz
Qt-f3b7cfd52b9a2c5ec4bef5b2b94f89dd83fd705d.tar.bz2
Add importPathList, mainly for doc purposes.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp34
-rw-r--r--src/declarative/qml/qdeclarativeengine.h1
2 files changed, 25 insertions, 10 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index dea5a40..a153f8f 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1809,25 +1809,39 @@ QUrl QDeclarativeEnginePrivate::Imports::baseUrl() const
Adds \a path as a directory where installed QML components are
defined in a URL-based directory structure.
- For example, if you add \c /opt/MyApp/lib/imports and then load QML
- that imports \c com.mycompany.Feature, then QDeclarativeEngine will look
+ \sa importPathList()
+*/
+void QDeclarativeEngine::addImportPath(const QString& path)
+{
+ if (qmlImportTrace())
+ qDebug() << "QDeclarativeEngine::addImportPath" << path;
+ Q_D(QDeclarativeEngine);
+ d->fileImportPath.prepend(path);
+}
+
+
+/*!
+ Returns the list of directories with the engine searches for
+ installed modules.
+
+ For example, if \c /opt/MyApp/lib/imports is in the path, then QML that
+ imports \c com.mycompany.Feature will cause the QDeclarativeEngine to look
in \c /opt/MyApp/lib/imports/com/mycompany/Feature/ for the components
- provided by that module. A \c qmldir file is required for definiting the
+ provided by that module. A \c qmldir file is required for defining the
type version mapping and possibly declarative extensions plugins.
- The engine searches in the base directory of the qml file, then
- the paths added via addImportPath(), then in the directory containing the
+ In addition to this list,
+ the engine searches in the directory containing the
application executable (QCoreApplication::applicationDirPath()),
then the paths specified in the \c QML_IMPORT_PATH environment variable, then the
builtin \c ImportsPath from QLibraryInfo.
+ \sa addImportPath()
*/
-void QDeclarativeEngine::addImportPath(const QString& path)
+QStringList QDeclarativeEngine::importPathList() const
{
- if (qmlImportTrace())
- qDebug() << "QDeclarativeEngine::addImportPath" << path;
- Q_D(QDeclarativeEngine);
- d->fileImportPath.prepend(path);
+ Q_D(const QDeclarativeEngine);
+ return d->fileImportPath;
}
/*!
diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h
index 19e81b6..a24962e 100644
--- a/src/declarative/qml/qdeclarativeengine.h
+++ b/src/declarative/qml/qdeclarativeengine.h
@@ -78,6 +78,7 @@ public:
void clearComponentCache();
void addImportPath(const QString& dir);
+ QStringList importPathList() const;
bool importExtension(const QString &fileName, const QString &uri);
void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *);