diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-19 08:48:46 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-19 08:48:46 (GMT) |
commit | 0a2258c3e7b49b7383ef9ace11a4d8a448b7def1 (patch) | |
tree | 9879b8453d9a711db29045d062bd1607f1667bc6 /src/declarative/qml | |
parent | 4871ff0563cf8a9691db8b084dce012aeb5abf47 (diff) | |
parent | 23c781b67c838b120e7fba42bc9008d38f191330 (diff) | |
download | Qt-0a2258c3e7b49b7383ef9ace11a4d8a448b7def1.zip Qt-0a2258c3e7b49b7383ef9ace11a4d8a448b7def1.tar.gz Qt-0a2258c3e7b49b7383ef9ace11a4d8a448b7def1.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml')
21 files changed, 89 insertions, 58 deletions
diff --git a/src/declarative/qml/qmlbindablevalue.h b/src/declarative/qml/qmlbindablevalue.h index c4ef64a..7831177 100644 --- a/src/declarative/qml/qmlbindablevalue.h +++ b/src/declarative/qml/qmlbindablevalue.h @@ -42,10 +42,10 @@ #ifndef QMLBINDABLEVALUE_H #define QMLBINDABLEVALUE_H -#include <QObject> -#include <qfxglobal.h> -#include <qml.h> -#include <qmlpropertyvaluesource.h> +#include <QtCore/QObject> +#include <QtDeclarative/qfxglobal.h> +#include <QtDeclarative/qml.h> +#include <QtDeclarative/qmlpropertyvaluesource.h> #include <QtDeclarative/qmlexpression.h> diff --git a/src/declarative/qml/qmlbindablevalue_p.h b/src/declarative/qml/qmlbindablevalue_p.h index d9af0ef..9973bdc 100644 --- a/src/declarative/qml/qmlbindablevalue_p.h +++ b/src/declarative/qml/qmlbindablevalue_p.h @@ -43,8 +43,8 @@ #define QMLBINDABLEVALUE_P_H #include <private/qobject_p.h> -#include <qmlbindablevalue.h> -#include <qmlmetaproperty.h> +#include <QtDeclarative/qmlbindablevalue.h> +#include <QtDeclarative/qmlmetaproperty.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlboundsignal_p.h b/src/declarative/qml/qmlboundsignal_p.h index e84f0c1..2c05770 100644 --- a/src/declarative/qml/qmlboundsignal_p.h +++ b/src/declarative/qml/qmlboundsignal_p.h @@ -42,7 +42,7 @@ #ifndef QMLBOUNDSIGNAL_P_H #define QMLBOUNDSIGNAL_P_H -#include <qmlexpression.h> +#include <QtDeclarative/qmlexpression.h> #include <private/qobject_p.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlcompiledcomponent_p.h b/src/declarative/qml/qmlcompiledcomponent_p.h index c5e1226..2201423 100644 --- a/src/declarative/qml/qmlcompiledcomponent_p.h +++ b/src/declarative/qml/qmlcompiledcomponent_p.h @@ -42,7 +42,7 @@ #ifndef QMLCOMPILEDCOMPONENT_P_H #define QMLCOMPILEDCOMPONENT_P_H -#include <qml.h> +#include <QtDeclarative/qml.h> #include <private/qmlinstruction_p.h> #include <private/qmlcompiler_p.h> #include <private/qmlrefcount_p.h> diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index 87c1b82..bc04cfa 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -44,8 +44,8 @@ #include <QtCore/qbytearray.h> #include <QtCore/qset.h> -#include <qml.h> -#include <qmlerror.h> +#include <QtDeclarative/qml.h> +#include <QtDeclarative/qmlerror.h> #include <private/qmlinstruction_p.h> #include <private/qmlcompositetypemanager_p.h> #include <private/qmlparser_p.h> diff --git a/src/declarative/qml/qmlcomponent_p.h b/src/declarative/qml/qmlcomponent_p.h index 4de47c6..254d9ba 100644 --- a/src/declarative/qml/qmlcomponent_p.h +++ b/src/declarative/qml/qmlcomponent_p.h @@ -42,21 +42,21 @@ #ifndef QMLCOMPONENT_P_H #define QMLCOMPONENT_P_H -#include <QString> -#include <QStringList> -#include <QList> -#include "private/qobject_p.h" -#include "private/qmlengine_p.h" -#include "private/qmlcompositetypemanager_p.h" -#include <qmlerror.h> -#include "qmlcomponent.h" +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QList> +#include <private/qobject_p.h> +#include <private/qmlengine_p.h> +#include <private/qmlcompositetypemanager_p.h> +#include <QtDeclarative/qmlerror.h> +#include <QtDeclarative/qmlcomponent.h> +#include <QtDeclarative/qml.h> + +QT_BEGIN_NAMESPACE + class QmlComponent; class QmlEngine; class QmlCompiledComponent; -#include "qml.h" - - -QT_BEGIN_NAMESPACE class QmlComponentPrivate : public QObjectPrivate { diff --git a/src/declarative/qml/qmlcompositetypemanager_p.h b/src/declarative/qml/qmlcompositetypemanager_p.h index f03b2cb..9312819 100644 --- a/src/declarative/qml/qmlcompositetypemanager_p.h +++ b/src/declarative/qml/qmlcompositetypemanager_p.h @@ -42,10 +42,10 @@ #ifndef QMLCOMPOSITETYPEMANAGER_P_H #define QMLCOMPOSITETYPEMANAGER_P_H -#include <qglobal.h> +#include <QtCore/qglobal.h> #include <private/qmlscriptparser_p.h> #include <private/qmlrefcount_p.h> -#include <qmlerror.h> +#include <QtDeclarative/qmlerror.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index 6f1e486..4d88fc2 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -42,11 +42,11 @@ #ifndef QMLCONTEXT_P_H #define QMLCONTEXT_P_H -#include <qmlcontext.h> +#include <QtDeclarative/qmlcontext.h> #include <private/qobject_p.h> #include <private/qmldeclarativedata_p.h> -#include <qhash.h> -#include <qscriptvalue.h> +#include <QtCore/qhash.h> +#include <QtScript/qscriptvalue.h> #include <QtCore/qset.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 0209c1d..425cba4 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -615,6 +615,35 @@ QUrl QmlEngine::componentUrl(const QUrl& src, const QUrl& baseUrl) const } /*! + Returns the list of base urls the engine browses to find sub-components. + + The search path consists of the base of the \a url, and, in the case of local files, + the directories imported using the "import" statement in \a qml. + */ +QList<QUrl> QmlEngine::componentSearchPath(const QByteArray &qml, const QUrl &url) const +{ + QList<QUrl> searchPath; + + searchPath << url.resolved(QUrl(QLatin1String("."))); + + if (QFileInfo(url.toLocalFile()).exists()) { + QmlScriptParser parser; + if (parser.parse(qml, url)) { + for (int i = 0; i < parser.imports().size(); ++i) { + QUrl importUrl = QUrl(parser.imports().at(i).uri); + if (importUrl.isRelative()) { + searchPath << url.resolved(importUrl); + } else { + searchPath << importUrl; + } + } + } + } + + return searchPath; +} + +/*! Sets the common QNetworkAccessManager, \a network, used by all QML elements instantiated by this engine. diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h index fde84d4..9382389 100644 --- a/src/declarative/qml/qmlengine.h +++ b/src/declarative/qml/qmlengine.h @@ -78,6 +78,8 @@ public: QMap<QString,QString> nameSpacePaths() const; QUrl componentUrl(const QUrl& src, const QUrl& baseUrl) const; + QList<QUrl> componentSearchPath(const QByteArray &qml, const QUrl &url) const; + void setNetworkAccessManager(QNetworkAccessManager *); QNetworkAccessManager *networkAccessManager() const; diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 7cafb59..0dc4736 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -42,9 +42,9 @@ #ifndef QMLENGINE_P_H #define QMLENGINE_P_H -#include <QScriptClass> -#include <QScriptValue> -#include <QScriptString> +#include <QtScript/QScriptClass> +#include <QtScript/QScriptValue> +#include <QtScript/QScriptString> #include <QtCore/qstring.h> #include <QtCore/qlist.h> #include <QtCore/qpair.h> @@ -52,11 +52,11 @@ #include <private/qobject_p.h> #include <private/qmlclassfactory_p.h> #include <private/qmlcompositetypemanager_p.h> -#include <qml.h> -#include <qmlbasicscript.h> -#include <qmlcontext.h> -#include <qmlengine.h> -#include <qmlexpression.h> +#include <QtDeclarative/qml.h> +#include <QtDeclarative/qmlbasicscript.h> +#include <QtDeclarative/qmlcontext.h> +#include <QtDeclarative/qmlengine.h> +#include <QtDeclarative/qmlexpression.h> #include <QtScript/qscriptengine.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h index 323735b..a21ccee 100644 --- a/src/declarative/qml/qmlinstruction_p.h +++ b/src/declarative/qml/qmlinstruction_p.h @@ -42,7 +42,7 @@ #ifndef QMLINSTRUCTION_P_H #define QMLINSTRUCTION_P_H -#include <qfxglobal.h> +#include <QtDeclarative/qfxglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h index 4e59cf7..9daef59 100644 --- a/src/declarative/qml/qmlmetaproperty.h +++ b/src/declarative/qml/qmlmetaproperty.h @@ -43,7 +43,7 @@ #define QMLMETAPROPERTY_H #include <QtDeclarative/qfxglobal.h> -#include <QMetaProperty> +#include <QtCore/QMetaProperty> QT_BEGIN_HEADER diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 95b21e6..add5773 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -42,10 +42,10 @@ #ifndef QMLPARSER_P_H #define QMLPARSER_P_H -#include <QByteArray> -#include <QList> +#include <QtCore/QByteArray> +#include <QtCore/QList> #include <QtCore/qstring.h> -#include <qml.h> +#include <QtDeclarative/qml.h> #include <private/qmlrefcount_p.h> #include <private/qobject_p.h> diff --git a/src/declarative/qml/qmlpropertyvaluesource.h b/src/declarative/qml/qmlpropertyvaluesource.h index 6ef2e38..736b25f 100644 --- a/src/declarative/qml/qmlpropertyvaluesource.h +++ b/src/declarative/qml/qmlpropertyvaluesource.h @@ -42,9 +42,9 @@ #ifndef QMLPROPERTYVALUESOURCE_H #define QMLPROPERTYVALUESOURCE_H -#include <qfxglobal.h> -#include <qml.h> -#include <QObject> +#include <QtDeclarative/qfxglobal.h> +#include <QtDeclarative/qml.h> +#include <QtCore/QObject> QT_BEGIN_HEADER diff --git a/src/declarative/qml/qmlproxymetaobject_p.h b/src/declarative/qml/qmlproxymetaobject_p.h index 594e7a3..0ffa365 100644 --- a/src/declarative/qml/qmlproxymetaobject_p.h +++ b/src/declarative/qml/qmlproxymetaobject_p.h @@ -42,11 +42,11 @@ #ifndef QMLPROXYMETAOBJECT_P_H #define QMLPROXYMETAOBJECT_P_H -#include <QMetaObject> +#include <QtCore/QMetaObject> +#include <QtCore/QObject> #include <private/qmetaobjectbuilder_p.h> #include <private/qobject_p.h> -#include <QObject> -#include <qml.h> +#include <QtDeclarative/qml.h> QT_BEGIN_HEADER diff --git a/src/declarative/qml/qmlrefcount_p.h b/src/declarative/qml/qmlrefcount_p.h index 90b50a8..1355c86 100644 --- a/src/declarative/qml/qmlrefcount_p.h +++ b/src/declarative/qml/qmlrefcount_p.h @@ -42,7 +42,7 @@ #ifndef QMLREFCOUNT_P_H #define QMLREFCOUNT_P_H -#include <qglobal.h> +#include <QtCore/qglobal.h> QT_BEGIN_HEADER diff --git a/src/declarative/qml/qmlvme_p.h b/src/declarative/qml/qmlvme_p.h index f7e13d6..4e5c6c1 100644 --- a/src/declarative/qml/qmlvme_p.h +++ b/src/declarative/qml/qmlvme_p.h @@ -42,12 +42,12 @@ #ifndef QMLVME_P_H #define QMLVME_P_H -#include <QString> -#include <QStack> -#include <qmlerror.h> -class QObject; +#include <QtCore/QString> +#include <QtCore/QStack> +#include <QtDeclarative/qmlerror.h> QT_BEGIN_NAMESPACE +class QObject; class QmlInstruction; class QmlCompiledComponent; class QmlCompiledData; diff --git a/src/declarative/qml/qmlvmemetaobject_p.h b/src/declarative/qml/qmlvmemetaobject_p.h index d8ed242..6f1e31b 100644 --- a/src/declarative/qml/qmlvmemetaobject_p.h +++ b/src/declarative/qml/qmlvmemetaobject_p.h @@ -42,9 +42,9 @@ #ifndef QMLVMEMETAOBJECT_P_H #define QMLVMEMETAOBJECT_P_H -#include <qml.h> -#include <QMetaObject> -#include <QBitArray> +#include <QtDeclarative/qml.h> +#include <QtCore/QMetaObject> +#include <QtCore/QBitArray> #include <private/qobject_p.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/script/lexer.h b/src/declarative/qml/script/lexer.h index 7781ee8..9de4afd 100644 --- a/src/declarative/qml/script/lexer.h +++ b/src/declarative/qml/script/lexer.h @@ -11,7 +11,7 @@ #ifndef LEXER_H #define LEXER_H -#include <QList> +#include <QtCore/QList> #include "tokens.h" diff --git a/src/declarative/qml/script/qmlbasicscript.h b/src/declarative/qml/script/qmlbasicscript.h index d465f04..5ef2148 100644 --- a/src/declarative/qml/script/qmlbasicscript.h +++ b/src/declarative/qml/script/qmlbasicscript.h @@ -13,10 +13,10 @@ #define QMLBASICSCRIPT_H #include "instructions.h" -#include <QList> -#include <QByteArray> +#include <QtCore/QList> +#include <QtCore/QByteArray> #include "lexer.h" -#include <QVariant> +#include <QtCore/QVariant> QT_BEGIN_HEADER |