Qt 4.8
Classes | Public Functions | Protected Functions | Private Functions | Properties | List of all members
QDeclarativeTypeData Class Reference

#include <qdeclarativetypeloader_p.h>

Inheritance diagram for QDeclarativeTypeData:
QDeclarativeDataBlob QDeclarativeRefCount

Classes

struct  ScriptReference
 
struct  TypeDataCallback
 
struct  TypeReference
 

Public Functions

QDeclarativeCompiledDatacompiledData () const
 
const QDeclarativeImportsimports () const
 
const QDeclarativeScriptParserparser () const
 
 QDeclarativeTypeData (const QUrl &, QDeclarativeTypeLoader::Options, QDeclarativeTypeLoader *)
 
void registerCallback (TypeDataCallback *)
 
const QList< ScriptReference > & resolvedScripts () const
 
const QList< TypeReference > & resolvedTypes () const
 
QDeclarativeTypeLoadertypeLoader () const
 
void unregisterCallback (TypeDataCallback *)
 
 ~QDeclarativeTypeData ()
 
- Public Functions inherited from QDeclarativeDataBlob
void addDependency (QDeclarativeDataBlob *)
 Wait for blob to become complete or to error. More...
 
QList< QDeclarativeErrorerrors () const
 Return the errors on this blob. More...
 
QUrl finalUrl () const
 Returns the final url of the data. More...
 
bool isComplete () const
 Returns true if the status is Complete. More...
 
bool isCompleteOrError () const
 Returns true if the status is Complete or Error. More...
 
bool isError () const
 Returns true if the status is Error. More...
 
bool isLoading () const
 Returns true if the status is Loading. More...
 
bool isNull () const
 Returns true if the status is Null. More...
 
bool isWaiting () const
 Returns true if the status is WaitingForDependencies. More...
 
qreal progress () const
 Returns the data download progress from 0 to 1. More...
 
 QDeclarativeDataBlob (const QUrl &, Type)
 Create a new QDeclarativeDataBlob for url and of the provided type. More...
 
void setError (const QDeclarativeError &)
 Mark this blob as having errors. More...
 
void setError (const QList< QDeclarativeError > &errors)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
Status status () const
 Returns the blob's status. More...
 
Type type () const
 Returns the type provided to the constructor. More...
 
QUrl url () const
 Returns the blob url passed to the constructor. More...
 
virtual ~QDeclarativeDataBlob ()
 
- Public Functions inherited from QDeclarativeRefCount
void addref ()
 
 QDeclarativeRefCount ()
 
void release ()
 
virtual ~QDeclarativeRefCount ()
 

Protected Functions

virtual void allDependenciesDone ()
 Called when all blobs waited for have completed. More...
 
virtual void dataReceived (const QByteArray &)
 Invoked when data for the blob is received. More...
 
virtual void done ()
 Invoked once data has either been received or a network error occurred, and all dependencies are complete. More...
 
virtual void downloadProgressChanged (qreal)
 Called when the download progress of this blob changes. More...
 
- Protected Functions inherited from QDeclarativeDataBlob
virtual void dependencyComplete (QDeclarativeDataBlob *)
 Called if blob, which was previously waited for, has completed. More...
 
virtual void dependencyError (QDeclarativeDataBlob *)
 Called if blob, which was previously waited for, has an error. More...
 
virtual void networkError (QNetworkReply::NetworkError)
 Invoked if there is a network error while fetching this blob. More...
 

Private Functions

void compile ()
 
QDeclarativeQmldirDataqmldirForUrl (const QUrl &)
 
void resolveTypes ()
 

Properties

QList< TypeDataCallback * > m_callbacks
 
QDeclarativeCompiledDatam_compiledData
 
QDeclarativeImports m_imports
 
QDeclarativeTypeLoader::Options m_options
 
QList< QDeclarativeQmldirData * > m_qmldirs
 
QList< ScriptReferencem_scripts
 
QDeclarativeTypeLoaderm_typeLoader
 
QList< TypeReferencem_types
 
bool m_typesResolved:1
 
QDeclarativeScriptParser scriptParser
 

Additional Inherited Members

- Public Types inherited from QDeclarativeDataBlob
enum  Status {
  Null, Loading, WaitingForDependencies, Complete,
  Error
}
 This enum describes the status of the data blob. More...
 
enum  Type { QmlFile, JavaScriptFile, QmldirFile }
 This enum describes the type of the data blob. More...
 

Detailed Description

Definition at line 224 of file qdeclarativetypeloader_p.h.

Constructors and Destructors

◆ QDeclarativeTypeData()

QDeclarativeTypeData::QDeclarativeTypeData ( const QUrl url,
QDeclarativeTypeLoader::Options  options,
QDeclarativeTypeLoader manager 
)

Definition at line 864 of file qdeclarativetypeloader.cpp.

866 : QDeclarativeDataBlob(url, QmlFile), m_options(options), m_imports(manager), m_typesResolved(false),
867  m_compiledData(0), m_typeLoader(manager)
868 {
869 }
QDeclarativeCompiledData * m_compiledData
QDeclarativeImports m_imports
QDeclarativeTypeLoader::Options m_options
QDeclarativeTypeLoader * m_typeLoader
QDeclarativeDataBlob(const QUrl &, Type)
Create a new QDeclarativeDataBlob for url and of the provided type.

◆ ~QDeclarativeTypeData()

QDeclarativeTypeData::~QDeclarativeTypeData ( )

Definition at line 871 of file qdeclarativetypeloader.cpp.

872 {
873  for (int ii = 0; ii < m_scripts.count(); ++ii)
874  m_scripts.at(ii).script->release();
875  for (int ii = 0; ii < m_qmldirs.count(); ++ii)
876  m_qmldirs.at(ii)->release();
877  for (int ii = 0; ii < m_types.count(); ++ii)
878  if (m_types.at(ii).typeData) m_types.at(ii).typeData->release();
879  if (m_compiledData)
881 }
QDeclarativeCompiledData * m_compiledData
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QDeclarativeQmldirData * > m_qmldirs
QList< TypeReference > m_types
QList< ScriptReference > m_scripts

Functions

◆ allDependenciesDone()

void QDeclarativeTypeData::allDependenciesDone ( )
protectedvirtual

Called when all blobs waited for have completed.

This occurs regardless of whether they are in error, or complete state.

The default implementation does nothing.

Reimplemented from QDeclarativeDataBlob.

Definition at line 1024 of file qdeclarativetypeloader.cpp.

1025 {
1026  if (!m_typesResolved) {
1027  resolveTypes();
1028  m_typesResolved = true;
1029  }
1030 }

◆ compile()

void QDeclarativeTypeData::compile ( )
private

Definition at line 1040 of file qdeclarativetypeloader.cpp.

Referenced by done().

1041 {
1042  Q_ASSERT(m_compiledData == 0);
1044 
1049 
1050  QDeclarativeCompiler compiler;
1051  if (!compiler.compile(typeLoader()->engine(), this, m_compiledData)) {
1052  setError(compiler.errors());
1054  m_compiledData = 0;
1055  }
1057 }
QDeclarativeTypeLoader * typeLoader() const
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
Definition: qurl.cpp:5896
QDeclarativeCompiledData * m_compiledData
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QUrl baseUrl() const
Returns the base URL to be used for all relative file imports added.
QDeclarativeImports m_imports
static void endRange(RangeType)
static void startRange(RangeType)
QList< QDeclarativeError > errors() const
Return the list of errors from the last call to compile(), or an empty list if there were no errors...
void setError(const QDeclarativeError &)
Mark this blob as having errors.
static void rangeData(RangeType, const QString &)
bool compile(QDeclarativeEngine *, QDeclarativeTypeData *, QDeclarativeCompiledData *)
Compile unit, and store the output in out.

◆ compiledData()

QDeclarativeCompiledData * QDeclarativeTypeData::compiledData ( ) const

◆ dataReceived()

void QDeclarativeTypeData::dataReceived ( const QByteArray data)
protectedvirtual

Invoked when data for the blob is received.

Implementors should use this callback to determine a blob's dependencies. Within this callback you may call setError() or addDependency().

Implements QDeclarativeDataBlob.

Definition at line 983 of file qdeclarativetypeloader.cpp.

984 {
985  if (!scriptParser.parse(data, finalUrl())) {
987  return;
988  }
989 
991 
992  foreach (const QDeclarativeScriptParser::Import &import, scriptParser.imports()) {
993  if (import.type == QDeclarativeScriptParser::Import::File && import.qualifier.isEmpty()) {
994  QUrl importUrl = finalUrl().resolved(QUrl(import.uri + QLatin1String("/qmldir")));
996  QDeclarativeQmldirData *data = typeLoader()->getQmldir(importUrl);
997  addDependency(data);
998  m_qmldirs << data;
999  }
1000  } else if (import.type == QDeclarativeScriptParser::Import::Script) {
1001  QUrl scriptUrl = finalUrl().resolved(QUrl(import.uri));
1002  QDeclarativeScriptData *data = typeLoader()->getScript(scriptUrl);
1003  addDependency(data);
1004 
1005  ScriptReference ref;
1006  ref.location = import.location.start;
1007  ref.qualifier = import.qualifier;
1008  ref.script = data;
1009  m_scripts << ref;
1010 
1011  }
1012  }
1013 
1014  if (!finalUrl().scheme().isEmpty()) {
1015  QUrl importUrl = finalUrl().resolved(QUrl(QLatin1String("qmldir")));
1017  QDeclarativeQmldirData *data = typeLoader()->getQmldir(importUrl);
1018  addDependency(data);
1019  m_qmldirs << data;
1020  }
1021  }
1022 }
static QString urlToLocalFileOrQrc(const QUrl &url)
QDeclarativeTypeLoader * typeLoader() const
QDeclarativeQmldirData * getQmldir(const QUrl &)
Returns a QDeclarativeQmldirData for url.
QUrl finalUrl() const
Returns the final url of the data.
void addDependency(QDeclarativeDataBlob *)
Wait for blob to become complete or to error.
QList< QDeclarativeError > errors() const
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
QDeclarativeImports m_imports
static bool isEmpty(const char *str)
static const char * data(const QByteArray &arr)
Type type() const
Returns the type provided to the constructor.
bool parse(const QByteArray &data, const QUrl &url=QUrl())
void setError(const QDeclarativeError &)
Mark this blob as having errors.
QDeclarativeScriptParser scriptParser
void setBaseUrl(const QUrl &url)
Sets the base URL to be used for all relative file imports added.
QList< QDeclarativeQmldirData * > m_qmldirs
QDeclarativeScriptData * getScript(const QUrl &)
Returns a QDeclarativeScriptData for url.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
Definition: qurl.cpp:5819
QList< ScriptReference > m_scripts

◆ done()

void QDeclarativeTypeData::done ( )
protectedvirtual

Invoked once data has either been received or a network error occurred, and all dependencies are complete.

You can set an error in this method, but you cannot add new dependencies. Implementors should use this callback to finalize processing of data.

The default implementation does nothing.

Reimplemented from QDeclarativeDataBlob.

Definition at line 929 of file qdeclarativetypeloader.cpp.

930 {
931  addref();
932 
933  // Check all script dependencies for errors
934  for (int ii = 0; !isError() && ii < m_scripts.count(); ++ii) {
935  const ScriptReference &script = m_scripts.at(ii);
936  Q_ASSERT(script.script->isCompleteOrError());
937  if (script.script->isError()) {
938  QList<QDeclarativeError> errors = script.script->errors();
940  error.setUrl(finalUrl());
941  error.setLine(script.location.line);
942  error.setColumn(script.location.column);
943  error.setDescription(QDeclarativeTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString()));
944  errors.prepend(error);
945  setError(errors);
946  }
947  }
948 
949  // Check all type dependencies for errors
950  for (int ii = 0; !isError() && ii < m_types.count(); ++ii) {
951  const TypeReference &type = m_types.at(ii);
952  Q_ASSERT(!type.typeData || type.typeData->isCompleteOrError());
953  if (type.typeData && type.typeData->isError()) {
954  QString typeName = scriptParser.referencedTypes().at(ii)->name;
955 
956  QList<QDeclarativeError> errors = type.typeData->errors();
958  error.setUrl(finalUrl());
959  error.setLine(type.location.line);
960  error.setColumn(type.location.column);
961  error.setDescription(QDeclarativeTypeLoader::tr("Type %1 unavailable").arg(typeName));
962  errors.prepend(error);
963  setError(errors);
964  }
965  }
966 
967  // Compile component
968  if (!isError())
969  compile();
970 
973 
974  // Notify callbacks
975  while (!m_callbacks.isEmpty()) {
976  TypeDataCallback *callback = m_callbacks.takeFirst();
977  callback->typeDataReady(this);
978  }
979 
980  release();
981 }
bool isError() const
Returns true if the status is Error.
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
void setDescription(const QString &)
Sets the error description.
QUrl finalUrl() const
Returns the final url of the data.
QList< TypeReference * > referencedTypes() const
#define error(msg)
void setColumn(int)
Sets the error column number.
QList< TypeDataCallback * > m_callbacks
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const char * typeName
Definition: qmetatype.cpp:239
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
The QDeclarativeError class encapsulates a QML error.
Type type() const
Returns the type provided to the constructor.
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
void setLine(int)
Sets the error line number.
void setUrl(const QUrl &)
Sets the url for the file that caused this error.
QList< QDeclarativeError > errors() const
Return the errors on this blob.
QDeclarativeTypeLoader::Options m_options
void setError(const QDeclarativeError &)
Mark this blob as having errors.
QDeclarativeScriptParser scriptParser
QList< TypeReference > m_types
QList< ScriptReference > m_scripts

◆ downloadProgressChanged()

void QDeclarativeTypeData::downloadProgressChanged ( qreal  progress)
protectedvirtual

Called when the download progress of this blob changes.

progress goes from 0 to 1.

Reimplemented from QDeclarativeDataBlob.

Definition at line 1032 of file qdeclarativetypeloader.cpp.

1033 {
1034  for (int ii = 0; ii < m_callbacks.count(); ++ii) {
1035  TypeDataCallback *callback = m_callbacks.at(ii);
1036  callback->typeDataProgress(this, p);
1037  }
1038 }
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
QList< TypeDataCallback * > m_callbacks

◆ imports()

const QDeclarativeImports & QDeclarativeTypeData::imports ( ) const

◆ parser()

const QDeclarativeScriptParser & QDeclarativeTypeData::parser ( ) const

Definition at line 893 of file qdeclarativetypeloader.cpp.

Referenced by QDeclarativeCompiler::compile(), and QDeclarativeDomDocument::load().

894 {
895  return scriptParser;
896 }
QDeclarativeScriptParser scriptParser

◆ qmldirForUrl()

QDeclarativeQmldirData * QDeclarativeTypeData::qmldirForUrl ( const QUrl url)
private

Definition at line 1185 of file qdeclarativetypeloader.cpp.

Referenced by resolveTypes().

1186 {
1187  for (int ii = 0; ii < m_qmldirs.count(); ++ii) {
1188  if (m_qmldirs.at(ii)->url() == url)
1189  return m_qmldirs.at(ii);
1190  }
1191  return 0;
1192 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QUrl url() const
Returns the blob url passed to the constructor.
QList< QDeclarativeQmldirData * > m_qmldirs

◆ registerCallback()

void QDeclarativeTypeData::registerCallback ( TypeDataCallback callback)

Definition at line 916 of file qdeclarativetypeloader.cpp.

917 {
918  Q_ASSERT(!m_callbacks.contains(callback));
919  m_callbacks.append(callback);
920 }
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
QList< TypeDataCallback * > m_callbacks
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ resolvedScripts()

const QList< QDeclarativeTypeData::ScriptReference > & QDeclarativeTypeData::resolvedScripts ( ) const

Definition at line 903 of file qdeclarativetypeloader.cpp.

Referenced by QDeclarativeCompiler::compileTree().

904 {
905  return m_scripts;
906 }
QList< ScriptReference > m_scripts

◆ resolvedTypes()

const QList< QDeclarativeTypeData::TypeReference > & QDeclarativeTypeData::resolvedTypes ( ) const

◆ resolveTypes()

void QDeclarativeTypeData::resolveTypes ( )
private

Definition at line 1059 of file qdeclarativetypeloader.cpp.

Referenced by allDependenciesDone().

1060 {
1062  QDeclarativeImportDatabase *importDatabase = &ep->importDatabase;
1063 
1064  foreach (const QDeclarativeScriptParser::Import &import, scriptParser.imports()) {
1065  QDeclarativeDirComponents qmldircomponentsnetwork;
1067  continue;
1068 
1069  if (import.type == QDeclarativeScriptParser::Import::File && import.qualifier.isEmpty()) {
1070  QUrl qmldirUrl = finalUrl().resolved(QUrl(import.uri + QLatin1String("/qmldir")));
1071  if (QDeclarativeQmldirData *qmldir = qmldirForUrl(qmldirUrl))
1072  qmldircomponentsnetwork = qmldir->dirComponents();
1073  }
1074 
1075  int vmaj = -1;
1076  int vmin = -1;
1077 
1078  if (!import.version.isEmpty()) {
1079  int dot = import.version.indexOf(QLatin1Char('.'));
1080  if (dot < 0) {
1081  vmaj = import.version.toInt();
1082  vmin = 0;
1083  } else {
1084  vmaj = import.version.left(dot).toInt();
1085  vmin = import.version.mid(dot+1).toInt();
1086  }
1087  }
1088 
1090  if (!m_imports.addImport(importDatabase, import.uri, import.qualifier,
1091  vmaj, vmin, import.type, qmldircomponentsnetwork, &errorString)) {
1093  error.setUrl(m_imports.baseUrl());
1094  error.setDescription(errorString);
1095  error.setLine(import.location.start.line);
1096  error.setColumn(import.location.start.column);
1097 
1098  setError(error);
1099  return;
1100  }
1101  }
1102 
1103  bool implicitImportLoaded = false;
1105  QByteArray typeName = parserRef->name.toUtf8();
1106 
1107  TypeReference ref;
1108 
1109  QUrl url;
1110  int majorVersion;
1111  int minorVersion;
1112  QDeclarativeImportedNamespace *typeNamespace = 0;
1114 
1115  if (!m_imports.resolveType(typeName, &ref.type, &url, &majorVersion, &minorVersion,
1116  &typeNamespace, &errorString) || typeNamespace) {
1117  // Known to not be a type:
1118  // - known to be a namespace (Namespace {})
1119  // - type with unknown namespace (UnknownNamespace.SomeType {})
1120  bool typeFound = false;
1121 
1122  if (!typeNamespace && !implicitImportLoaded) {
1123  implicitImportLoaded = true;
1124  // For local urls, add an implicit import "." as most overridden lookup.
1125  // This will also trigger the loading of the qmldir and the import of any native
1126  // types from available plugins.
1127  // This is only done if the type is not otherwise found, side effects of plugin loading may be avoided
1128  // ### This should be an acceptable variation because A) It's only side effects (and img providers) B) You shouldn't be doing that in "." anyways!
1129  if (QDeclarativeQmldirData *qmldir = qmldirForUrl(finalUrl().resolved(QUrl(QLatin1String("./qmldir"))))) {
1130  m_imports.addImport(importDatabase, QLatin1String("."),
1132  qmldir->dirComponents(), 0);
1133  } else {
1134  m_imports.addImport(importDatabase, QLatin1String("."),
1137  }
1138  if (m_imports.resolveType(typeName, &ref.type, &url, &majorVersion, &minorVersion,
1139  &typeNamespace, &errorString) || typeNamespace) {
1140  typeFound = true;
1141  }
1142  }
1143 
1144  if (!typeFound) {
1146  error.setUrl(m_imports.baseUrl());
1147  QString userTypeName = parserRef->name;
1148  userTypeName.replace(QLatin1Char('/'),QLatin1Char('.'));
1149  if (typeNamespace)
1150  error.setDescription(QDeclarativeTypeLoader::tr("Namespace %1 cannot be used as a type").arg(userTypeName));
1151  else
1152  error.setDescription(QDeclarativeTypeLoader::tr("%1 %2").arg(userTypeName).arg(errorString));
1153 
1154  if (!parserRef->refObjects.isEmpty()) {
1155  QDeclarativeParser::Object *obj = parserRef->refObjects.first();
1156  error.setLine(obj->location.start.line);
1157  error.setColumn(obj->location.start.column);
1158  }
1159 
1160  setError(error);
1161  return;
1162  }
1163  }
1164 
1165  if (ref.type) {
1166  ref.majorVersion = majorVersion;
1167  ref.minorVersion = minorVersion;
1168  foreach (QDeclarativeParser::Object *obj, parserRef->refObjects) {
1169  // store namespace for DOM
1170  obj->majorVersion = majorVersion;
1171  obj->minorVersion = minorVersion;
1172  }
1173  } else {
1174  ref.typeData = typeLoader()->get(url);
1175  addDependency(ref.typeData);
1176  }
1177 
1178  if (parserRef->refObjects.count())
1179  ref.location = parserRef->refObjects.first()->location.start;
1180 
1181  m_types << ref;
1182  }
1183 }
QDeclarativeTypeLoader * typeLoader() const
void setDescription(const QString &)
Sets the error description.
QUrl finalUrl() const
Returns the final url of the data.
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 ...
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
QList< TypeReference * > referencedTypes() const
#define error(msg)
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void addDependency(QDeclarativeDataBlob *)
Wait for blob to become complete or to error.
void setColumn(int)
Sets the error column number.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
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.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QList< QDeclarativeDirParser::Component > QDeclarativeDirComponents
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
QDeclarativeEngine * engine() const
Return the QDeclarativeEngine associated with this loader.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
Definition: qegl.cpp:743
QUrl baseUrl() const
Returns the base URL to be used for all relative file imports added.
QDeclarativeImports m_imports
const char * typeName
Definition: qmetatype.cpp:239
QList< QDeclarativeParser::Object * > refObjects
The QDeclarativeError class encapsulates a QML error.
QDeclarativeImportDatabase importDatabase
Type type() const
Returns the type provided to the constructor.
QDeclarativeQmldirData * qmldirForUrl(const QUrl &)
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
void setLine(int)
Sets the error line number.
void setUrl(const QUrl &)
Sets the url for the file that caused this error.
QUrl url() const
Returns the blob url passed to the constructor.
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63
void setError(const QDeclarativeError &)
Mark this blob as having errors.
QDeclarativeScriptParser scriptParser
QDeclarativeTypeData * get(const QUrl &url)
Returns a QDeclarativeTypeData for the specified url.
QList< TypeReference > m_types
QDeclarativeTypeLoader * m_typeLoader
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
Definition: qurl.cpp:5819
static qreal dot(const QPointF &a, const QPointF &b)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
The QDeclarativeImportDatabase class manages the QML imports for a QDeclarativeEngine.

◆ typeLoader()

QDeclarativeTypeLoader * QDeclarativeTypeData::typeLoader ( ) const

Definition at line 883 of file qdeclarativetypeloader.cpp.

Referenced by compile(), dataReceived(), and resolveTypes().

884 {
885  return m_typeLoader;
886 }
QDeclarativeTypeLoader * m_typeLoader

◆ unregisterCallback()

void QDeclarativeTypeData::unregisterCallback ( TypeDataCallback callback)

Definition at line 922 of file qdeclarativetypeloader.cpp.

Referenced by QDeclarativeComponentPrivate::clear().

923 {
924  Q_ASSERT(m_callbacks.contains(callback));
925  m_callbacks.removeOne(callback);
926  Q_ASSERT(!m_callbacks.contains(callback));
927 }
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
QList< TypeDataCallback * > m_callbacks
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Properties

◆ m_callbacks

QList<TypeDataCallback *> QDeclarativeTypeData::m_callbacks
private

◆ m_compiledData

QDeclarativeCompiledData* QDeclarativeTypeData::m_compiledData
private

Definition at line 292 of file qdeclarativetypeloader_p.h.

Referenced by compile(), compiledData(), and ~QDeclarativeTypeData().

◆ m_imports

QDeclarativeImports QDeclarativeTypeData::m_imports
private

Definition at line 284 of file qdeclarativetypeloader_p.h.

Referenced by compile(), dataReceived(), imports(), and resolveTypes().

◆ m_options

QDeclarativeTypeLoader::Options QDeclarativeTypeData::m_options
private

Definition at line 279 of file qdeclarativetypeloader_p.h.

Referenced by done().

◆ m_qmldirs

QList<QDeclarativeQmldirData *> QDeclarativeTypeData::m_qmldirs
private

Definition at line 287 of file qdeclarativetypeloader_p.h.

Referenced by dataReceived(), qmldirForUrl(), and ~QDeclarativeTypeData().

◆ m_scripts

QList<ScriptReference> QDeclarativeTypeData::m_scripts
private

◆ m_typeLoader

QDeclarativeTypeLoader* QDeclarativeTypeData::m_typeLoader
private

Definition at line 296 of file qdeclarativetypeloader_p.h.

Referenced by resolveTypes(), and typeLoader().

◆ m_types

QList<TypeReference> QDeclarativeTypeData::m_types
private

◆ m_typesResolved

bool QDeclarativeTypeData::m_typesResolved
private

Definition at line 290 of file qdeclarativetypeloader_p.h.

Referenced by allDependenciesDone().

◆ scriptParser

QDeclarativeScriptParser QDeclarativeTypeData::scriptParser
private

Definition at line 283 of file qdeclarativetypeloader_p.h.

Referenced by dataReceived(), done(), parser(), and resolveTypes().


The documentation for this class was generated from the following files: