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

#include <qdeclarativetypeloader_p.h>

Inheritance diagram for QDeclarativeScriptData:
QDeclarativeDataBlob QDeclarativeRefCount

Public Functions

QDeclarativeParser::Object::ScriptBlock::Pragmas pragmas () const
 
 QDeclarativeScriptData (const QUrl &)
 
QString scriptSource () const
 
- 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

QDeclarativeParser::Object::ScriptBlock::Pragmas m_pragmas
 
QString m_source
 

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

Constructors and Destructors

◆ QDeclarativeScriptData()

QDeclarativeScriptData::QDeclarativeScriptData ( const QUrl url)

Definition at line 1194 of file qdeclarativetypeloader.cpp.

1196 {
1197 }
QDeclarativeParser::Object::ScriptBlock::Pragmas m_pragmas
QDeclarativeDataBlob(const QUrl &, Type)
Create a new QDeclarativeDataBlob for url and of the provided type.

Functions

◆ dataReceived()

void QDeclarativeScriptData::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 1209 of file qdeclarativetypeloader.cpp.

1210 {
1211  m_source = QString::fromUtf8(data);
1213 }
QDeclarativeParser::Object::ScriptBlock::Pragmas m_pragmas
static QDeclarativeParser::Object::ScriptBlock::Pragmas extractPragmas(QString &)
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

◆ pragmas()

QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptData::pragmas ( ) const

Definition at line 1199 of file qdeclarativetypeloader.cpp.

Referenced by QDeclarativeCompiler::compileTree().

1200 {
1201  return m_pragmas;
1202 }
QDeclarativeParser::Object::ScriptBlock::Pragmas m_pragmas

◆ scriptSource()

QString QDeclarativeScriptData::scriptSource ( ) const

Definition at line 1204 of file qdeclarativetypeloader.cpp.

Referenced by QDeclarativeCompiler::compileTree().

1205 {
1206  return m_source;
1207 }

Properties

◆ m_pragmas

QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptData::m_pragmas
private

Definition at line 311 of file qdeclarativetypeloader_p.h.

Referenced by dataReceived(), and pragmas().

◆ m_source

QString QDeclarativeScriptData::m_source
private

Definition at line 312 of file qdeclarativetypeloader_p.h.

Referenced by dataReceived(), and scriptSource().


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