Qt 4.8
|
The QDeclarativeImports class encapsulates one QML document's import statements. More...
#include <qdeclarativeimport_p.h>
Public Functions | |
bool | addImport (QDeclarativeImportDatabase *, const QString &uri, const QString &prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, const QDeclarativeDirComponents &qmldircomponentsnetwork, QString *errorString) |
Adds information to imports such that subsequent calls to resolveType() will resolve types qualified by prefix by considering types found at the given uri. More... | |
QUrl | baseUrl () const |
Returns the base URL to be used for all relative file imports added. More... | |
QDeclarativeImports & | operator= (const QDeclarativeImports &) |
void | populateCache (QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const |
QDeclarativeImports () | |
QDeclarativeImports (QDeclarativeTypeLoader *) | |
QDeclarativeImports (const QDeclarativeImports &) | |
bool | resolveType (const QByteArray &type, QDeclarativeType **type_return, QUrl *url_return, int *version_major, int *version_minor, QDeclarativeImportedNamespace **ns_return, QString *errorString=0) const |
The given (namespace qualified) type is resolved to either. More... | |
bool | resolveType (QDeclarativeImportedNamespace *, const QByteArray &type, QDeclarativeType **type_return, QUrl *url_return, int *version_major, int *version_minor) const |
Searching only in the namespace ns (previously returned in a call to resolveType(), type is found and returned to either a QDeclarativeType stored at type_return, or a component located at url_return. More... | |
void | setBaseUrl (const QUrl &url) |
Sets the base URL to be used for all relative file imports added. More... | |
~QDeclarativeImports () | |
Properties | |
QDeclarativeImportsPrivate * | d |
Friends | |
class | QDeclarativeImportDatabase |
The QDeclarativeImports class encapsulates one QML document's import statements.
Definition at line 73 of file qdeclarativeimport_p.h.
QDeclarativeImports::QDeclarativeImports | ( | ) |
Definition at line 142 of file qdeclarativeimport.cpp.
QDeclarativeImports::QDeclarativeImports | ( | QDeclarativeTypeLoader * | typeLoader | ) |
Definition at line 146 of file qdeclarativeimport.cpp.
QDeclarativeImports::QDeclarativeImports | ( | const QDeclarativeImports & | copy | ) |
Definition at line 126 of file qdeclarativeimport.cpp.
QDeclarativeImports::~QDeclarativeImports | ( | ) |
Definition at line 150 of file qdeclarativeimport.cpp.
bool QDeclarativeImports::addImport | ( | QDeclarativeImportDatabase * | importDb, |
const QString & | uri, | ||
const QString & | prefix, | ||
int | vmaj, | ||
int | vmin, | ||
QDeclarativeScriptParser::Import::Type | importType, | ||
const QDeclarativeDirComponents & | qmldircomponentsnetwork, | ||
QString * | errorString | ||
) |
Adds information to imports such that subsequent calls to resolveType() will resolve types qualified by prefix by considering types found at the given uri.
The uri is either a directory (if importType is FileImport), or a URI resolved using paths added via addImportPath() (if importType is LibraryImport).
The prefix may be empty, in which case the import location is considered for unqualified types.
The base URL must already have been set with Import::setBaseUrl().
Definition at line 827 of file qdeclarativeimport.cpp.
Referenced by QDeclarativeTypeData::resolveTypes().
QUrl QDeclarativeImports::baseUrl | ( | ) | const |
Returns the base URL to be used for all relative file imports added.
Definition at line 167 of file qdeclarativeimport.cpp.
Referenced by QDeclarativeTypeData::compile(), resolveType(), and QDeclarativeTypeData::resolveTypes().
QDeclarativeImports & QDeclarativeImports::operator= | ( | const QDeclarativeImports & | copy | ) |
Definition at line 133 of file qdeclarativeimport.cpp.
void QDeclarativeImports::populateCache | ( | QDeclarativeTypeNameCache * | cache, |
QDeclarativeEngine * | engine | ||
) | const |
Definition at line 201 of file qdeclarativeimport.cpp.
Referenced by QDeclarativeCompiler::compileTree().
bool QDeclarativeImports::resolveType | ( | const QByteArray & | type, |
QDeclarativeType ** | type_return, | ||
QUrl * | url_return, | ||
int * | vmaj, | ||
int * | vmin, | ||
QDeclarativeImportedNamespace ** | ns_return, | ||
QString * | errorString = 0 |
||
) | const |
The given (namespace qualified) type is resolved to either.
a component located at url_return.
If any return pointer is 0, the corresponding search is not done.
Definition at line 239 of file qdeclarativeimport.cpp.
Referenced by QDeclarativeCompiler::buildDynamicMeta(), QDeclarativeCompiler::buildProperty(), QDeclarativeCompiler::buildPropertyInNamespace(), QDeclarativeCompiler::evaluateEnum(), QDeclarativeCompiler::resolveType(), QDeclarativeTypeData::resolveTypes(), and QDeclarativeCompiler::testQualifiedEnumAssignment().
bool QDeclarativeImports::resolveType | ( | QDeclarativeImportedNamespace * | ns, |
const QByteArray & | type, | ||
QDeclarativeType ** | type_return, | ||
QUrl * | url_return, | ||
int * | vmaj, | ||
int * | vmin | ||
) | const |
Searching only in the namespace ns (previously returned in a call to resolveType(), type is found and returned to either a QDeclarativeType stored at type_return, or a component located at url_return.
If either return pointer is 0, the corresponding search is not done.
Definition at line 281 of file qdeclarativeimport.cpp.
void QDeclarativeImports::setBaseUrl | ( | const QUrl & | url | ) |
Sets the base URL to be used for all relative file imports added.
Definition at line 159 of file qdeclarativeimport.cpp.
Referenced by QDeclarativeTypeData::dataReceived().
|
friend |
Definition at line 104 of file qdeclarativeimport_p.h.
|
private |
Definition at line 105 of file qdeclarativeimport_p.h.
Referenced by baseUrl(), operator=(), populateCache(), QDeclarativeImports(), resolveType(), setBaseUrl(), and ~QDeclarativeImports().