42 #include "private/qdeclarativeengine_p.h" 45 #include "private/qdeclarativeboundsignal_p.h" 46 #include "private/qdeclarativecontext_p.h" 47 #include "private/qdeclarativecompiler_p.h" 48 #include "private/qdeclarativeglobalscriptclass_p.h" 53 #include "private/qdeclarativebinding_p_p.h" 54 #include "private/qdeclarativevme_p.h" 55 #include "private/qdeclarativeenginedebugservice_p.h" 56 #include "private/qdeclarativestringconverters_p.h" 57 #include "private/qdeclarativexmlhttprequest_p.h" 58 #include "private/qdeclarativesqldatabase_p.h" 59 #include "private/qdeclarativetypenamescriptclass_p.h" 60 #include "private/qdeclarativelistscriptclass_p.h" 62 #include "private/qdeclarativeglobal_p.h" 63 #include "private/qdeclarativeworkerscript_p.h" 64 #include "private/qdeclarativecomponent_p.h" 67 #include "private/qdeclarativedirparser_p.h" 69 #include "private/qdeclarativelist_p.h" 70 #include "private/qdeclarativetypenamecache_p.h" 71 #include "private/qdeclarativeinclude_p.h" 72 #include "private/qdeclarativenotifier_p.h" 73 #include "private/qdeclarativedebugtrace_p.h" 74 #include "private/qdeclarativeapplication_p.h" 75 #include "private/qjsdebugservice_p.h" 77 #include <QtCore/qmetaobject.h> 78 #include <QScriptClass> 79 #include <QNetworkReply> 80 #include <QNetworkRequest> 81 #include <QNetworkAccessManager> 82 #include <QDesktopServices> 87 #include <QMetaObject> 90 #include <QPluginLoader> 91 #include <QtGui/qapplication.h> 92 #include <QtGui/qfontdatabase.h> 93 #include <QtCore/qlibraryinfo.h> 94 #include <QtCore/qthreadstorage.h> 95 #include <QtCore/qthread.h> 96 #include <QtCore/qcoreapplication.h> 97 #include <QtCore/qdir.h> 98 #include <QtCore/qmutex.h> 99 #include <QtGui/qcolor.h> 100 #include <QtGui/qvector3d.h> 101 #include <QtGui/qsound.h> 102 #include <QtCore/qcryptographichash.h> 104 #include <private/qobject_p.h> 105 #include <private/qscriptdeclarativeclass_p.h> 107 #include <private/qdeclarativeitemsmodule_p.h> 108 #include <private/qdeclarativeutilmodule_p.h> 110 #ifdef Q_OS_WIN // for %APPDATA% 115 #define CSIDL_APPDATA 0x001a // <username>\Application Data 191 qmlRegisterType<QDeclarativeComponent>(
"QtQuick",1,0,
"Component");
192 qmlRegisterType<QObject>(
"QtQuick",1,0,
"QtObject");
193 qmlRegisterType<QDeclarativeWorkerScript>(
"QtQuick",1,0,
"WorkerScript");
195 qmlRegisterType<QDeclarativeBinding>();
200 qmlRegisterType<QDeclarativeComponent>(
"Qt",4,7,
"Component");
201 qmlRegisterType<QObject>(
"Qt",4,7,
"QtObject");
202 qmlRegisterType<QDeclarativeWorkerScript>(
"Qt",4,7,
"WorkerScript");
358 : captureProperties(false), rootContext(0),
isDebugging(false),
359 outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0),
360 objectClass(0), valueTypeClass(0), globalClass(0),
cleanup(0), erroredBindings(0),
361 inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0),
362 inBeginCreate(false), networkAccessManager(0), networkAccessManagerFactory(0),
363 typeLoader(e), importDatabase(e), uniqueId(1)
389 return p->getUrl(context).
resolved(url);
395 : p(priv), sqlQueryClass(0), namedNodeMapClass(0), nodeListClass(0)
400 bool mainthread = priv != 0;
406 #ifndef QT_NO_DESKTOPSERVICES 412 #ifndef QT_NO_XMLSTREAMREADER 442 #ifndef QT_NO_DATESTRING 516 delete valueTypeClass;
518 delete typeNameClass;
541 for (
int ii = 0; ii < pss.
count; ++ii) {
584 qRegisterMetaType<QVariant>(
"QVariant");
585 qRegisterMetaType<QDeclarativeScriptString>(
"QDeclarativeScriptString");
586 qRegisterMetaType<QScriptValue>(
"QScriptValue");
587 qRegisterMetaType<QDeclarativeComponent::Status>(
"QDeclarativeComponent::Status");
612 if (!workerScriptEngine)
614 return workerScriptEngine;
671 if (
d->isDebugging) {
701 d->typeLoader.clearCache();
718 return d->rootContext;
735 d->networkAccessManagerFactory = factory;
746 return d->networkAccessManagerFactory;
785 return d->getNetworkAccessManager();
817 return d->imageProviders.value(providerId).data();
831 d->imageProviders.take(providerId);
852 image = provider->
requestImage(imageId, size, req_size);
883 if (
d->baseUrl.isEmpty()) {
910 return d->outputWarningsToStdErr;
926 d->outputWarningsToStdErr =
enabled;
964 if (!
object || !context)
969 qWarning(
"QDeclarativeEngine::setContextForObject(): Object already has a QDeclarativeContext");
1081 return context?context->
engine():0;
1098 rv = pf(const_cast<QObject *>(
object));
1112 if (*idCache == -1 || !
object)
1120 #ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL 1122 qDebug(
"Qml debugging is enabled. Only use this in a safe environment!");
1168 extendedData->boundSignals.removeAll(signal);
1187 if (deferredComponent)
1188 deferredComponent->release();
1190 if (nextContextObject)
1191 nextContextObject->prevContextObject = prevContextObject;
1192 if (prevContextObject)
1193 *prevContextObject = nextContextObject;
1208 propertyCache->release();
1210 if (ownContext && context)
1216 guard->objectDestroyed(
object);
1223 delete extendedData;
1231 if (!parent && scriptValue) {
delete scriptValue; scriptValue = 0; }
1236 if (extendedData) objectNameNotifier()->notify();
1241 if (bindingBitsSize > bit)
1242 return bindingBits[bit / 32] & (1 << (bit % 32));
1249 if (bindingBitsSize > bit)
1250 bindingBits[bit / 32] &= ~(1 << (bit % 32));
1255 if (bindingBitsSize <= bit) {
1259 int arraySize = (props + 31) / 32;
1260 int oldArraySize = bindingBitsSize / 32;
1263 arraySize *
sizeof(
quint32)));
1265 memset(bindingBits + oldArraySize,
1267 sizeof(
quint32) * (arraySize - oldArraySize));
1269 bindingBitsSize = arraySize * 32;
1272 bindingBits[bit / 32] |= (1 << (bit % 32));
1298 return contextClass->contextFromValue(scopeNode);
1310 return contextClass->urlFromValue(scopeNode);
1476 for (
int ii = 0; ii < functions.
count(); ++ii) {
1525 #ifndef QT_NO_DATESTRING 1529 if(argCount == 0 || argCount > 2)
1534 if (argCount == 2) {
1564 if(argCount == 0 || argCount > 2)
1575 if (argCount == 2) {
1683 if(argCount == 0 || argCount > 2)
1688 if (argCount == 2) {
1701 #endif // QT_NO_DATESTRING 1712 if(argCount < 3 || argCount > 4)
1740 if(argCount < 3 || argCount > 4)
1887 #ifndef QT_NO_DESKTOPSERVICES 1960 if (!msg.
isEmpty()) msg +=
' ';
1976 qWarning(
"Signal QDeclarativeEngine::quit() emitted, but no receivers connected to handle it.");
1987 for (
int ii = 0; ii < errors.
count(); ++ii)
1995 if (outputWarningsToStdErr)
2002 q->warnings(errors);
2003 if (outputWarningsToStdErr)
2113 int a = tintColor.
alpha();
2115 finalColor = tintColor;
2124 tintColor.
blueF() * a + color.
blueF() * inv_a,
2125 a + inv_a * color.
alphaF());
2133 if (val.
userType() == qMetaTypeId<QDeclarativeListReference>()) {
2139 return scriptEngine.nullValue();
2141 }
else if (val.
userType() == qMetaTypeId<QList<QObject *> >()) {
2144 for (
int ii = 0; ii < list.
count(); ++ii) {
2146 rv.
setProperty(ii, objectClass->newQObject(
object));
2150 return valueTypeClass->newObject(val, vt);
2156 return objectClass->newQObject(obj);
2158 return scriptEngine.toScriptValue(val);
2165 if (dc == objectClass)
2167 else if (dc == valueTypeClass)
2168 return valueTypeClass->toVariant(val);
2169 else if (dc == contextClass)
2176 for (
int ii = 0; ii < length; ++ii) {
2199 d->importDatabase.addImportPath(path);
2221 return d->importDatabase.importPathList();
2237 d->importDatabase.setImportPathList(paths);
2255 d->importDatabase.addPluginPath(path);
2271 return d->importDatabase.pluginPathList();
2287 d->importDatabase.setPluginPathList(paths);
2302 return d->importDatabase.importPlugin(filePath, uri, errorString);
2328 d->scriptEngine.offlineStoragePath = dir;
2334 return d->scriptEngine.offlineStoragePath;
2339 void **
ptr = (
void **)v;
2348 return new void*(*(
void **)v);
2358 propertyCache.insert(mo, rv);
2364 propertyCache.insert(mo, rv);
2374 int maxMinorVersion = 0;
2377 while (metaObject) {
2392 typePropertyCache.insert(
qMakePair(type, minorVersion),
c);
2398 bool hasCopied =
false;
2400 for (
int ii = 0; ii < types.
count(); ++ii) {
2406 int moIndex = types.
count() - 1 - ii;
2431 bool overloadError =
false;
2445 while (!overloadError && current) {
2446 current = d->overrideData(current);
2448 overloadError =
true;
2453 if (overloadError) {
2454 if (hasCopied) raw->
release();
2460 if (!hasCopied) raw->
addref();
2461 typePropertyCache.insert(
qMakePair(type, minorVersion), raw);
2463 if (minorVersion != maxMinorVersion) {
2465 typePropertyCache.insert(
qMakePair(type, maxMinorVersion), raw);
2476 QByteArray lst =
"QDeclarativeListProperty<" + name +
'>';
2483 m_qmlLists.insert(lst_type, ptr_type);
2484 m_compositeTypes.insert(ptr_type, data);
2496 if (iter != m_qmlLists.
end())
2520 if (m_compositeTypes.contains(t))
2522 else if (m_qmlLists.contains(t))
2531 if (iter != m_compositeTypes.end()) {
2532 return (*iter)->root;
2542 if (iter != m_compositeTypes.end()) {
2543 return (*iter)->root;
2552 #if defined(Q_OS_MAC) || defined(Q_OS_WIN32) 2557 #if defined(Q_OS_MAC) 2559 #elif defined(Q_OS_WIN32) 2560 wchar_t buffer[1024];
2562 DWORD rv = ::GetShortPathName((
wchar_t*)absolute.
utf16(), buffer, 1024);
2563 if (rv == 0 || rv >= 1024)
return true;
2564 rv = ::GetLongPathName(buffer, buffer, 1024);
2565 if (rv == 0 || rv >= 1024)
return true;
2570 int absoluteLength = absolute.
length();
2571 int canonicalLength = canonical.
length();
2573 int length =
qMin(absoluteLength, canonicalLength);
2574 for (
int ii = 0; ii < length; ++ii) {
2575 const QChar &
a = absolute.
at(absoluteLength - 1 - ii);
2576 const QChar &
c = canonical.
at(canonicalLength - 1 - ii);
QDeclarativeContextData * outerContext
ImageType
Defines the type of image supported by this image provider.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
static QScriptValue isQtObject(QScriptContext *, QScriptEngine *)
QScriptValue newFunction(FunctionSignature signature, int length=0)
Creates a QScriptValue that wraps a native (C++) function.
static QScriptValue rgba(QScriptContext *, QScriptEngine *)
QUrl resolvedUrl(const QUrl &)
static ObjectOwnership objectOwnership(QObject *)
Returns the ownership of object.
static QDeclarativeComponentPrivate * get(QDeclarativeComponent *c)
static QString urlToLocalFileOrQrc(const QUrl &url)
The QColor class provides colors based on RGB, HSV or CMYK values.
void setBindingBit(QObject *obj, int)
The QScriptContext class represents a Qt Script function invocation.
QObject *(* QDeclarativeAttachedPropertiesFunc)(QObject *)
QStringList importPathList() const
Returns the list of directories where the engine searches for installed modules in a URL-based direct...
QDeclarativeContextData * context
void addPluginPath(const QString &dir)
Adds path as a directory where the engine searches for native plugins for imported modules (reference...
virtual QNetworkAccessManager * create(QObject *parent)=0
Creates and returns a network access manager with the specified parent.
qreal alphaF() const
Returns the alpha color component of this color.
The QVector3D class represents a vector or vertex in 3D space.
static QDeclarativeData * get(const QObject *object, bool create=false)
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
QColor Q_DECLARATIVE_PRIVATE_EXPORT colorFromString(const QString &, bool *ok=0)
virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
Implement this method to return the pixmap with id.
QScriptValue property(const QString &name, const ResolveFlags &mode=ResolvePrototype) const
Returns the value of this QScriptValue's property with the given name, using the given mode to resolv...
virtual QNetworkAccessManager * networkAccessManager()
QByteArray module() const
QUrl url() const
Returns the url for the file that caused this error.
static QScriptValue hsla(QScriptContext *, QScriptEngine *)
QNetworkAccessManager * getNetworkAccessManager() const
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
void addEngine(QDeclarativeEngine *)
static mach_timebase_info_data_t info
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
void addEngine(QDeclarativeEngine *)
QDeclarativeParserStatus ** d
void setDescription(const QString &)
Sets the error description.
QDeclarativeGuardedContextData creationContext
const QChar at(int i) const
Returns the character at the given index position in the string.
static void setContextForObject(QObject *, QDeclarativeContext *)
Sets the QDeclarativeContext for the object to context.
qreal greenF() const
Returns the green color component of this color.
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
static QString storageLocation(StandardLocation type)
Returns the default system directory where files of type belong, or an empty string if the location c...
static QScriptValue formatTime(QScriptContext *, QScriptEngine *)
QDateTime toDateTime() const
Returns a QDateTime representation of this value, in local time.
QDeclarativeEngine * engine
void setImplicitDestructible()
static void voidptr_destructor(void *v)
static void rangeLocation(RangeType, const QString &, int)
QScriptClass * namedNodeMapClass
void addImportPath(const QString &dir)
Adds path as a directory where the engine searches for installed modules in a URL-based directory str...
QUrl getUrl(QScriptContext *)
Returns the QUrl associated with the script ctxt for the case that there is no QDeclarativeContext.
The QDeclarativeListReference class allows the manipulation of QDeclarativeListProperty properties...
void removeImageProvider(const QString &id)
Removes the QDeclarativeImageProvider for providerId.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
QUrl baseUrl() const
Return the base URL for this engine.
static QScriptValue include(QScriptContext *ctxt, QScriptEngine *engine)
qint32 toInt32() const
Returns the signed 32-bit integer value of this QScriptValue, using the conversion rules described in...
QString & replace(int i, int len, QChar after)
The QByteArray class provides an array of bytes.
static QScriptValue createQmlObject(QScriptContext *, QScriptEngine *)
QObject * toQObject(const QScriptValue &) const
QScriptValue throwError(Error error, const QString &text)
Throws an error with the given text.
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
QScriptValue toScriptValue(const T &value)
Creates a QScriptValue with the given value.
int length() const
Returns the number of characters in this string.
void setRgbF(qreal r, qreal g, qreal b, qreal a=1.0)
Sets the color channels of this color to r (red), g (green), b (blue) and a (alpha, transparency).
QDeclarativeImageProvider * imageProvider(const QString &id) const
Returns the QDeclarativeImageProvider set for providerId.
The QPointF class defines a point in the plane using floating point precision.
QHash< int, QObject * > * attachedProperties() const
virtual void destroy(DestroyMode mode=DisconnectBinding)
Destroy the binding.
static QScriptValue quit(QScriptContext *, QScriptEngine *)
QString toString() const
Returns the string value of this QScriptValue, as defined in ECMA-262 section 9.8, "ToString".
void unlock()
Unlocks this mutex locker.
QDeclarativeGlobalScriptClass * globalClass
QScriptValue globalObject() const
Returns this engine's Global Object.
QString offlineStoragePath
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
static QScriptValue formatDate(QScriptContext *, QScriptEngine *)
static QScriptValue size(QScriptContext *, QScriptEngine *)
static void setObjectOwnership(QObject *, ObjectOwnership)
Sets the ownership of object.
void addBoundSignal(QDeclarativeAbstractBoundSignal *signal)
static QScriptValue btoa(QScriptContext *, QScriptEngine *)
static QScriptValue tint(QScriptContext *, QScriptEngine *)
bool isReady() const
Returns true if status() == QDeclarativeComponent::Ready.
void setData(const QByteArray &, const QUrl &baseUrl)
Sets the QDeclarativeComponent to use the given QML data.
void removeEngine(QDeclarativeEngine *)
QString absoluteFilePath() const
Returns an absolute path including the file name.
The QDate class provides date functions.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const QMetaObject * baseMetaObject() const
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
QHash< int, QObject * > attachedProperties
void quit()
This signal is emitted when the QML loaded by the engine would like to quit.
QScriptEngine * engine() const
Returns the QScriptEngine that this QScriptContext belongs to.
void setOfflineStoragePath(const QString &dir)
static QScriptValue worker_include(QScriptContext *ctxt, QScriptEngine *engine)
static void defineModule()
QObject * toQObject() const
If this QScriptValue is a QObject, returns the QObject pointer that the QScriptValue represents; othe...
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
static QString currentPath()
Returns the absolute path of the application's current directory.
QString host() const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
The QHash class is a template class that provides a hash-table-based dictionary.
static QScriptValue lighter(QScriptContext *, QScriptEngine *)
QScriptClass * sqlQueryClass
QByteArray toHex() const
Returns a hex encoded copy of the byte array.
The QObject class is the base class of all Qt objects.
virtual ~QDeclarativeScriptEngine()
static QScriptValue createComponent(QScriptContext *, QScriptEngine *)
static QChar separator()
Returns the native directory separator: "/" under Unix (including Mac OS X) and "\\" under Windows...
bool hasBindingBit(int) const
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
void disconnectNotifiers()
static void defineModule()
The QSizeF class defines the size of a two-dimensional object using floating point precision...
static QObjectPrivate * get(QObject *o)
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
The QChar class provides a 16-bit Unicode character.
void clearBindingBit(int)
QString toString(Qt::DateFormat f=Qt::TextDate) const
Returns the datetime as a string in the format given.
static void dumpwarning(const QDeclarativeError &error)
const T value(const Key &key) const
Returns the value associated with the key.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
virtual ~QDeclarativeEngine()
Destroys the QDeclarativeEngine.
QString path() const
Returns the path of the URL.
static QDeclarativeScriptEngine * get(QScriptEngine *e)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
static void objectNameChanged(QAbstractDeclarativeData *, QObject *)
void setParent(QObject *)
Makes the object a child of parent.
QScriptValue newQObject(QObject *, int type=QMetaType::QObjectStar)
QVariant scriptValueToVariant(const QScriptValue &, int hint=QVariant::Invalid)
QDeclarativeCompiledData * deferredComponent
QDeclarativeCleanup ** prev
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
QString toString() const
Returns the error as a human readable string.
static QScriptValue point(QScriptContext *, QScriptEngine *)
void setImportPathList(const QStringList &paths)
Sets paths as the list of directories where the engine searches for installed modules in a URL-based ...
Q_CORE_EXPORT void qDebug(const char *,...)
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
static bool qml_debugging_enabled
void removeBoundSignal(QDeclarativeAbstractBoundSignal *signal)
QObject * qmlAttachedPropertiesObject(int *idCache, const QObject *object, const QMetaObject *attachedMetaObject, bool create)
bool QDeclarative_isFileCaseCorrect(const QString &fileName)
Returns true if the case of fileName is equivalent to the file case of fileName on disk...
static QScriptValue darker(QScriptContext *, QScriptEngine *)
void append(const T &t)
Inserts value at the end of the list.
int metaObjectRevision() const
The QScriptEngine class provides an environment for evaluating Qt Script code.
QDeclarativeDataExtended()
AllowedRevisionCache allowedRevisionCache
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void qt_add_qmlxmlhttprequest(QScriptEngine *engine)
The QRectF class defines a rectangle in the plane using floating point precision. ...
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
The QDeclarativeComponent class encapsulates a QML component definition.
The QFontDatabase class provides information about the fonts available in the underlying window syste...
QStringList families(WritingSystem writingSystem=Any) const
Returns a sorted list of the available font families which support the writingSystem.
static void * voidptr_constructor(const void *v)
QList< QDeclarativeError > errors() const
Return the list of errors that occurred during the last compile or create operation.
QDeclarativeScriptEngine scriptEngine
void setBaseUrl(const QUrl &)
Set the base URL for this engine to url.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString authority() const
Returns the authority of the URL if it is defined; otherwise an empty string is returned.
bool isString() const
Returns true if this QScriptValue is of the primitive type String; otherwise returns false...
QDeclarativeImageProvider::ImageType getImageProviderType(const QUrl &url)
The QDeclarativeParserStatus class provides updates on the QML parser state.
bool importPlugin(const QString &filePath, const QString &uri, QString *errorString)
Imports the plugin named filePath with the uri provided.
void installTranslatorFunctions(const QScriptValue &object=QScriptValue())
Installs translator functions on the given object, or on the Global Object if no object is specified...
const T & at(int i) const
Returns the item at index position i in the list.
QDeclarativeContext * qmlContext(const QObject *obj)
QString description() const
Returns the error description.
QVariant toVariant() const
Returns the QVariant value of this QScriptValue, if it can be converted to a QVariant; otherwise retu...
The QStringList class provides a list of strings.
QDeclarativeMetaType::TypeCategory typeCategory(int) const
static QScriptValue consoleLog(QScriptContext *, QScriptEngine *)
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
QString canonicalFilePath() const
Returns the canonical path including the file name, i.e.
QScriptValue scriptValueFromVariant(const QVariant &)
static QScriptValue qmlScriptObject(QObject *, QDeclarativeEngine *)
Creates a QScriptValue allowing you to use object in QML script.
Q_CORE_EXPORT void qWarning(const char *,...)
static void registerValueTypes()
The QImage class provides a hardware-independent image representation that allows direct access to th...
QDeclarativeContext * rootContext() const
Returns the engine's root context.
ObjectOwnership
Ownership controls whether or not QML automatically destroys the QObject when the object is garbage c...
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static QColor fromHslF(qreal h, qreal s, qreal l, qreal a=1.0)
Static convenience function that returns a QColor constructed from the HSV color values, h (hue), s (saturation), l (lightness), and a (alpha-channel, i.
static void parentChanged(QAbstractDeclarativeData *, QObject *, QObject *)
QScriptValue newObject()
Creates a QtScript object of class Object.
void qt_add_qmlsqldatabase(QScriptEngine *engine)
QDeclarativeScriptEngine(QDeclarativeEnginePrivate *priv)
virtual QObject * beginCreate(QDeclarativeContext *)
This method provides more advanced control over component instance creation.
QByteArray qmlTypeName() const
static QScriptValue md5(QScriptContext *, QScriptEngine *)
The QDeclarativeError class encapsulates a QML error.
quint32 toUInt32() const
Returns the unsigned 32-bit integer value of this QScriptValue, using the conversion rules described ...
QStringList pluginPathList() const
Returns the list of directories where the engine searches for native plugins for imported modules (re...
const T * ptr(const T &t)
QDeclarativeEngine * qmlEngine(const QObject *obj)
QDeclarativeNetworkAccessManagerFactory * networkAccessManagerFactory() const
Returns the current QDeclarativeNetworkAccessManagerFactory.
QList< QDeclarativeAbstractBoundSignal * > boundSignals
static qreal component(const QPointF &point, unsigned int i)
static void complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state)
QDeclarativeAbstractBinding * m_nextBinding
static bool isDebuggingEnabled()
static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a=1.0)
Static convenience function that returns a QColor constructed from the RGB color values, r (red), g (green), b (blue), and a (alpha-channel, i.e.
QDeclarativeListProperty< QObject > property
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
QDeclarativeEngine(QObject *p=0)
Create a new QDeclarativeEngine with the given parent.
static void beginDeferred(QDeclarativeEnginePrivate *enginePriv, QObject *object, ConstructionState *state)
quint32 explicitIndestructibleSet
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
The QNetworkAccessManager class allows the application to send network requests and receive replies...
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
QAbstractDeclarativeData * declarativeData
~QDeclarativeDataExtended()
bool hasExtendedData() const
QScriptClass * nodeListClass
int argumentCount() const
Returns the number of arguments passed to the function in this invocation.
static bool qt_QmlQtModule_registered
int line() const
Returns the error line number.
qsreal toNumber() const
Returns the number value of this QScriptValue, as defined in ECMA-262 section 9.3, "ToNumber".
QUrl resolvedUrl(QScriptContext *context, const QUrl &url)
static void defineModule()
static QScriptValue desktopOpenUrl(QScriptContext *, QScriptEngine *)
QDeclarativeObjectScriptClass * objectClass
static void endRange(RangeType)
QDeclarativeNotifier * objectNameNotifier() const
static void startRange(RangeType)
const char * constData() const
Returns a pointer to the data stored in the byte array.
QDate date() const
Returns the date part of the datetime.
QString toString(Qt::DateFormat f=Qt::TextDate) const
Returns the time as a string.
virtual void disconnect(DisconnectMode disconnectMode)=0
void addObject(QObject *)
The QDeclarativeImageProvider class provides an interface for supporting pixmaps and threaded image r...
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
static QByteArray fromBase64(const QByteArray &base64)
Returns a decoded copy of the Base64 array base64.
static void destroyed(QAbstractDeclarativeData *, QObject *)
const QMetaObject * metaObject() const
QString scheme() const
Returns the scheme of the URL.
bool isNumber() const
Returns true if this QScriptValue is of the primitive type Number; otherwise returns false...
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue's property with the given name to the given value.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
int userType() const
Returns the storage type of the value stored in the variant.
QImage getImageFromProvider(const QUrl &url, QSize *size, const QSize &req_size)
void append(QDeclarativeEngine *, const QMetaObject *, Data::Flag propertyFlags=Data::NoFlags, Data::Flag methodFlags=Data::NoFlags, Data::Flag signalFlags=Data::NoFlags)
int compare(const QString &s) const
static void defineModuleCompat()
The QDateTime class provides date and time functions.
The QDeclarativeNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML e...
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
void remEngine(QDeclarativeEngine *)
ushort alpha
Returns the alpha color component of this color.
bool isAllowedInRevision(Data *) const
The QDeclarativeEngine class provides an environment for instantiating QML components.
int column() const
Returns the error column number.
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
static void clear(SimpleList< QDeclarativeAbstractBinding > &)
void Q_DECLARATIVE_EXPORT qdeclarativeelement_destructor(QObject *)
virtual void disconnect()=0
bool outputWarningsToStandardError() const
Returns true if warning messages will be output to stderr in addition to being emitted by the warning...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Type type() const
Returns the storage type of the value stored in the variant.
static QDeclarativeEngineDebugService * instance()
qreal redF() const
Returns the red color component of this color.
QDeclarativeContext * asQDeclarativeContext()
const QMetaObject * metaObjectForType(int) const
QObject * parent() const
Returns a pointer to the parent object.
static QDeclarativeListReferencePrivate * get(QDeclarativeListReference *ref)
int length() const
This function is identical to count().
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
const void * constData() const
static QScriptValue vector3d(QScriptContext *, QScriptEngine *)
void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *)
Sets the factory to use for creating QNetworkAccessManager(s).
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
QDeclarativeDebuggingEnabler()
QDeclarativeNotifier objectNameNotifier
~QDeclarativeEnginePrivate()
qreal blueF() const
Returns the blue color component of this color.
static QScriptValue rect(QScriptContext *, QScriptEngine *)
static QScriptValue scopeChainValue(QScriptContext *, int index)
#define Q_AUTOTEST_EXPORT
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
QByteArray toBase64() const
Returns a copy of the byte array, encoded as Base64.
static void rangeData(RangeType, const QString &)
static QScriptValue fontFamilies(QScriptContext *, QScriptEngine *)
static const QMetaObject staticQtMetaObject
The QDeclarativeContext class defines a context within a QML engine.
The QPixmap class is an off-screen image representation that can be used as a paint device...
QDeclarativeEngine * engine() const
Return the context's QDeclarativeEngine, or 0 if the context has no QDeclarativeEngine or the QDeclar...
bool isDate() const
Returns true if this QScriptValue is an object of the Date class; otherwise returns false...
QObject * toQObject(const QVariant &, bool *ok=0) const
The QDeclarativeCleanup provides a callback when a QDeclarativeEngine is deleted. ...
The QDeclarativeProperty class abstracts accessing properties on objects created from QML...
void setOutputWarningsToStandardError(bool)
Set whether warning messages will be output to stderr to enabled.
QDeclarativeEnginePrivate * p
#define Q_FOREACH(variable, container)
Same as foreach(variable, container).
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QScriptValue newQMetaObject(const QMetaObject *metaObject, const QScriptValue &ctor=QScriptValue())
Creates a QtScript object that represents a QObject class, using the the given metaObject and constru...
static QScriptDeclarativeClass * scriptClass(const QScriptValue &)
QDeclarativeEnginePrivate(QDeclarativeEngine *)
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
QTime time() const
Returns the time part of the datetime.
QTime toTime() const
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise retu...
static QDeclarativeContext * contextForObject(const QObject *)
Returns the QDeclarativeContext for the object, or 0 if no context has been set.
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
QThread * thread() const
Returns the thread in which the object lives.
QDeclarativeCleanup * next
static QScriptValue atob(QScriptContext *, QScriptEngine *)
void clearComponentCache()
Clears the engine's internal component cache.
QScriptValue newArray(uint length=0)
Creates a QtScript object of class Array with the given length.
QDeclarativeAbstractBinding ** m_prevBinding
bool isArray() const
Returns true if this QScriptValue is an object of the Array class; otherwise returns false...
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
T value() const
Returns the stored value converted to the template type T.
QNetworkAccessManager * networkAccessManager() const
Returns a common QNetworkAccessManager which can be used by any QML element instantiated by this engi...
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
The QFileInfo class provides system-independent file information.
void registerCompositeType(QDeclarativeCompiledData *)
static QJSDebugService * instance()
static QScriptValue formatDateTime(QScriptContext *, QScriptEngine *)
bool isError() const
Returns true if status() == QDeclarativeComponent::Error.
QString offlineStoragePath() const
void warning(const QDeclarativeError &)
QDeclarativeContextData * getContext(QScriptContext *)
Returns the QDeclarativeContext for the executing QScript ctxt.
void setPluginPathList(const QStringList &paths)
Sets the list of directories where the engine searches for native plugins for imported modules (refer...
#define qPrintable(string)
The QScriptValue class acts as a container for the Qt Script data types.
QDeclarativeGuard< QObject > object
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QString toString(Qt::DateFormat f=Qt::TextDate) const
Returns the date as a string.
static QString fileName(const QString &fileUrl)
const QMetaObject * rawMetaObjectForType(int) const
QDeclarativeWorkerScriptEngine * getWorkerScriptEngine()
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
QDeclarativePropertyCache * copy() const
ImageType imageType() const
Returns the image type supported by this provider.
QNetworkAccessManager * createNetworkAccessManager(QObject *parent) const
QScriptValue argument(int index) const
Returns the function argument at the given index.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool isValid() const
Returns true if this QScriptValue is valid; otherwise returns false.
static QByteArray hash(const QByteArray &data, Algorithm method)
Returns the hash of data using method.
virtual QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize)
Implement this method to return the image with id.
QDeclarativePropertyCache * createCache(const QMetaObject *)
Q_DECL_CONSTEXPR int qRound(qreal d)
virtual void completeCreate()
This method provides more advanced control over component instance creation.
QScriptValue newVariant(const QVariant &value)
Creates a QtScript object holding the given variant value.
QScriptValue nullValue()
Returns a QScriptValue of the primitive type Null.
Q_AUTOTEST_EXPORT void qmlExecuteDeferred(QObject *object)
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
QPixmap getPixmapFromProvider(const QUrl &url, QSize *size, const QSize &req_size)
QObject * qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create)
void addImageProvider(const QString &id, QDeclarativeImageProvider *)
Sets the provider to use for images requested via the image: url scheme, with host providerId...
The QList class is a template class that provides lists.
static bool openUrl(const QUrl &url)
Opens the given url in the appropriate Web browser for the user's desktop environment, and returns true if successful; otherwise returns false.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
static QDeclarativeContextData * get(QDeclarativeContext *context)