summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-04-21 07:43:15 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-04-21 07:43:15 (GMT)
commitedc74eecf2967b295c7b881977527474be8e1c80 (patch)
tree3c5ae43a22268ce3295ca97f34d06334bb10ec52
parentc2a551b280546d6c94362b40486fab7a6a5b17a3 (diff)
parent85cd533284175c1c83d538d3bb2f0d02dc2bbf7a (diff)
downloadQt-edc74eecf2967b295c7b881977527474be8e1c80.zip
Qt-edc74eecf2967b295c7b881977527474be8e1c80.tar.gz
Qt-edc74eecf2967b295c7b881977527474be8e1c80.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rw-r--r--doc/src/snippets/declarative/script.js1
-rw-r--r--examples/declarative/listmodel-threaded/dataloader.js5
-rw-r--r--examples/declarative/listmodel-threaded/timedisplay.qml3
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp50
4 files changed, 26 insertions, 33 deletions
diff --git a/doc/src/snippets/declarative/script.js b/doc/src/snippets/declarative/script.js
new file mode 100644
index 0000000..cd67311
--- /dev/null
+++ b/doc/src/snippets/declarative/script.js
@@ -0,0 +1 @@
+# Just here so that workerscript.qml succeeds.
diff --git a/examples/declarative/listmodel-threaded/dataloader.js b/examples/declarative/listmodel-threaded/dataloader.js
index eac7478..d720f09 100644
--- a/examples/declarative/listmodel-threaded/dataloader.js
+++ b/examples/declarative/listmodel-threaded/dataloader.js
@@ -1,14 +1,9 @@
// ![0]
WorkerScript.onMessage = function(msg) {
- console.log("Worker told to", msg.action);
-
if (msg.action == 'appendCurrentTime') {
var data = {'time': new Date().toTimeString()};
msg.model.append(data);
msg.model.sync(); // updates the changes to the list
-
- var msgToSend = {'msg': 'Model updated!'};
- WorkerScript.sendMessage(msgToSend);
}
}
// ![0]
diff --git a/examples/declarative/listmodel-threaded/timedisplay.qml b/examples/declarative/listmodel-threaded/timedisplay.qml
index 80ac9fa..bad7010 100644
--- a/examples/declarative/listmodel-threaded/timedisplay.qml
+++ b/examples/declarative/listmodel-threaded/timedisplay.qml
@@ -15,9 +15,6 @@ ListView {
WorkerScript {
id: worker
source: "dataloader.js"
- onMessage: {
- console.log("Worker said", messageObject.msg);
- }
}
Timer {
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 0dd9368..a41eaa9 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -152,10 +152,10 @@ void QDeclarativeEnginePrivate::defineModule()
}
QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
-: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false),
- outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0),
- objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0),
- inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0),
+: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false),
+ outputWarningsToStdErr(true), contextClass(0), sharedContext(0), sharedScope(0),
+ objectClass(0), valueTypeClass(0), globalClass(0), cleanup(0), erroredBindings(0),
+ inProgressCreations(0), scriptEngine(this), workerScriptEngine(0), componentAttached(0),
inBeginCreate(false), networkAccessManager(0), networkAccessManagerFactory(0),
typeManager(e), uniqueId(1)
{
@@ -353,7 +353,7 @@ void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o)
QObjectPrivate *p = QObjectPrivate::get(o);
Q_ASSERT(p->declarativeData);
QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
- if (d->ownContext)
+ if (d->ownContext)
d->context->destroy();
}
@@ -394,7 +394,7 @@ void QDeclarativeEnginePrivate::init()
QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine()
{
Q_Q(QDeclarativeEngine);
- if (!workerScriptEngine)
+ if (!workerScriptEngine)
workerScriptEngine = new QDeclarativeWorkerScriptEngine(q);
return workerScriptEngine;
}
@@ -419,7 +419,7 @@ QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine
QDeclarativeComponent component(&engine);
component.setData("import Qt 4.7\nText { text: \"Hello world!\" }", QUrl());
QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
-
+
//add item to view, etc
...
\endcode
@@ -648,7 +648,7 @@ void QDeclarativeEngine::setBaseUrl(const QUrl &url)
{
Q_D(QDeclarativeEngine);
d->baseUrl = url;
-}
+}
/*!
Returns true if warning messages will be output to stderr in addition
@@ -667,7 +667,7 @@ bool QDeclarativeEngine::outputWarningsToStandardError() const
If \a enabled is true, any warning messages generated by QML will be
output to stderr and emitted by the warnings() signal. If \a enabled
- is false, on the warnings() signal will be emitted. This allows
+ is false, on the warnings() signal will be emitted. This allows
applications to handle warning output themselves.
The default value is true.
@@ -781,7 +781,7 @@ void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership own
QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject *object)
{
QDeclarativeData *ddata = QDeclarativeData::get(object, false);
- if (!ddata)
+ if (!ddata)
return CppOwnership;
else
return ddata->indestructible?CppOwnership:JavaScriptOwnership;
@@ -803,7 +803,7 @@ void qmlExecuteDeferred(QObject *object)
QDeclarativeComponentPrivate::complete(ep, &state);
- if (!state.errors.isEmpty())
+ if (!state.errors.isEmpty())
ep->warning(state.errors);
}
}
@@ -844,7 +844,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
return rv;
}
-QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
+QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
const QMetaObject *attachedMetaObject, bool create)
{
if (*idCache == -1)
@@ -863,7 +863,7 @@ void QDeclarativeData::destroyed(QObject *object)
if (attachedProperties)
delete attachedProperties;
- if (nextContextObject)
+ if (nextContextObject)
nextContextObject->prevContextObject = prevContextObject;
if (prevContextObject)
*prevContextObject = nextContextObject;
@@ -910,7 +910,7 @@ void QDeclarativeData::parentChanged(QObject *, QObject *parent)
bool QDeclarativeData::hasBindingBit(int bit) const
{
- if (bindingBitsSize > bit)
+ if (bindingBitsSize > bit)
return bindingBits[bit / 32] & (1 << (bit % 32));
else
return false;
@@ -918,7 +918,7 @@ bool QDeclarativeData::hasBindingBit(int bit) const
void QDeclarativeData::clearBindingBit(int bit)
{
- if (bindingBitsSize > bit)
+ if (bindingBitsSize > bit)
bindingBits[bit / 32] &= ~(1 << (bit % 32));
}
@@ -931,10 +931,10 @@ void QDeclarativeData::setBindingBit(QObject *obj, int bit)
int arraySize = (props + 31) / 32;
int oldArraySize = bindingBitsSize / 32;
- bindingBits = (quint32 *)realloc(bindingBits,
+ bindingBits = (quint32 *)realloc(bindingBits,
arraySize * sizeof(quint32));
- memset(bindingBits + oldArraySize,
+ memset(bindingBits + oldArraySize,
0x00,
sizeof(quint32) * (arraySize - oldArraySize));
@@ -1035,7 +1035,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
QScriptValue qmlErrObject = ctxt->engine()->newObject();
qmlErrObject.setProperty("lineNumber", QScriptValue(error.line()));
qmlErrObject.setProperty("columnNumber", QScriptValue(error.column()));
- qmlErrObject.setProperty("fileName", QScriptValue(error.url()));
+ qmlErrObject.setProperty("fileName", QScriptValue(error.url().toString()));
qmlErrObject.setProperty("message", QScriptValue(error.description()));
arr.setProperty(i++, qmlErrObject);
}
@@ -1059,7 +1059,7 @@ QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QS
QScriptValue qmlErrObject = ctxt->engine()->newObject();
qmlErrObject.setProperty("lineNumber", QScriptValue(error.line()));
qmlErrObject.setProperty("columnNumber", QScriptValue(error.column()));
- qmlErrObject.setProperty("fileName", QScriptValue(error.url()));
+ qmlErrObject.setProperty("fileName", QScriptValue(error.url().toString()));
qmlErrObject.setProperty("message", QScriptValue(error.description()));
arr.setProperty(i++, qmlErrObject);
}
@@ -1365,7 +1365,7 @@ void QDeclarativeEnginePrivate::warning(const QList<QDeclarativeError> &errors)
{
Q_Q(QDeclarativeEngine);
q->warnings(errors);
- if (outputWarningsToStdErr)
+ if (outputWarningsToStdErr)
dumpwarning(errors);
}
@@ -1461,7 +1461,7 @@ QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine
QScriptValue QDeclarativeEnginePrivate::scriptValueFromVariant(const QVariant &val)
{
if (val.userType() == qMetaTypeId<QDeclarativeListReference>()) {
- QDeclarativeListReferencePrivate *p =
+ QDeclarativeListReferencePrivate *p =
QDeclarativeListReferencePrivate::get((QDeclarativeListReference*)val.constData());
if (p->object) {
return listClass->newList(p->property, p->propertyType);
@@ -1494,7 +1494,7 @@ QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val
QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(val);
if (dc == objectClass)
return QVariant::fromValue(objectClass->toQObject(val));
- else if (dc == valueTypeClass)
+ else if (dc == valueTypeClass)
return valueTypeClass->toVariant(val);
else if (dc == contextClass)
return QVariant();
@@ -1705,7 +1705,7 @@ public:
if (importType == QDeclarativeScriptParser::Import::Library) {
url.replace(QLatin1Char('.'), QLatin1Char('/'));
bool found = false;
- QString dir;
+ QString dir;
foreach (const QString &p,
@@ -1883,8 +1883,8 @@ static QDeclarativeTypeNameCache *cacheForNamespace(QDeclarativeEngine *engine,
int minor = set.minversions.at(ii);
foreach (QDeclarativeType *type, types) {
- if (type->qmlTypeName().startsWith(base) &&
- type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
+ if (type->qmlTypeName().startsWith(base) &&
+ type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
type->availableInVersion(major,minor))
{
QString name = QString::fromUtf8(type->qmlTypeName().mid(base.length()));