Qt 4.8
Public Functions | Protected Functions | Properties | List of all members
QDeclarativeQmldirData Class Reference

#include <qdeclarativetypeloader_p.h>

Inheritance diagram for QDeclarativeQmldirData:
QDeclarativeDataBlob QDeclarativeRefCount

Public Functions

const QDeclarativeDirComponentsdirComponents () const
 
 QDeclarativeQmldirData (const QUrl &)
 
- 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 dataReceived (const QByteArray &)
 Invoked when data for the blob is received. More...
 
- Protected Functions inherited from QDeclarativeDataBlob
virtual void allDependenciesDone ()
 Called when all blobs waited for have completed. More...
 
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 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...
 
virtual void networkError (QNetworkReply::NetworkError)
 Invoked if there is a network error while fetching this blob. More...
 

Properties

QDeclarativeDirComponents m_components
 

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 315 of file qdeclarativetypeloader_p.h.

Constructors and Destructors

◆ QDeclarativeQmldirData()

QDeclarativeQmldirData::QDeclarativeQmldirData ( const QUrl url)

Definition at line 1215 of file qdeclarativetypeloader.cpp.

1217 {
1218 }
QDeclarativeDataBlob(const QUrl &, Type)
Create a new QDeclarativeDataBlob for url and of the provided type.

Functions

◆ dataReceived()

void QDeclarativeQmldirData::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 1225 of file qdeclarativetypeloader.cpp.

1226 {
1227  QDeclarativeDirParser parser;
1228  parser.setSource(QString::fromUtf8(data));
1229  parser.parse();
1230  m_components = parser.components();
1231 }
QList< Component > components() const
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
QDeclarativeDirComponents m_components
void setSource(const QString &source)

◆ dirComponents()

const QDeclarativeDirComponents & QDeclarativeQmldirData::dirComponents ( ) const

Definition at line 1220 of file qdeclarativetypeloader.cpp.

1221 {
1222  return m_components;
1223 }
QDeclarativeDirComponents m_components

Properties

◆ m_components

QDeclarativeDirComponents QDeclarativeQmldirData::m_components
private

Definition at line 326 of file qdeclarativetypeloader_p.h.

Referenced by dataReceived(), and dirComponents().


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