summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-24 09:54:46 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-24 09:54:46 (GMT)
commitc6d893bc8ada7ddd3b9896ab43d05f7d764edf51 (patch)
treee5e351346ce9aa3e13ed580d4ec0ef5f02a900da /src
parent2e2ce693e16899dcfd1f39374a78bf2ca3a0e016 (diff)
parent4c975ee19b9671fbf76b546fc8ca2eff5bc69303 (diff)
downloadQt-c6d893bc8ada7ddd3b9896ab43d05f7d764edf51.zip
Qt-c6d893bc8ada7ddd3b9896ab43d05f7d764edf51.tar.gz
Qt-c6d893bc8ada7ddd3b9896ab43d05f7d764edf51.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Compiler warning Remove incorrect ASSERT Be slightly more verbose on assigning undefined in binding. Doc fixes Don't crash when assigning a Behavior to a grouped property. Get rid of 'noise' when using GL and the top-level item is an Item. Fix visual tests after rename of the qml executable. Do not attempt to setParent of object in a different thread Don't polish QDeclarativeItems.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp8
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp8
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp17
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp2
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp14
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp8
7 files changed, 44 insertions, 15 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 9547884..2841ac3 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -2681,7 +2681,13 @@ bool QDeclarativeItem::sceneEvent(QEvent *event)
}
}
-/*! \internal */
+/*!
+ \reimp
+
+ Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is \e not called
+ during initial widget polishing. Items wishing to optimize start-up construction
+ should instead consider using componentComplete().
+*/
QVariant QDeclarativeItem::itemChange(GraphicsItemChange change,
const QVariant &value)
{
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 8230941..882e981 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -191,7 +191,9 @@ void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags)
data->error.setUrl(url);
data->error.setLine(line);
data->error.setColumn(-1);
- data->error.setDescription(QLatin1String("Unable to assign [undefined] to ") + QLatin1String(QMetaType::typeName(data->property.propertyType())));
+ data->error.setDescription(QLatin1String("Unable to assign [undefined] to ")
+ + QLatin1String(QMetaType::typeName(data->property.propertyType()))
+ + QLatin1String(" ") + data->property.name());
} else if (!scriptValue.isRegExp() && scriptValue.isFunction()) {
@@ -353,8 +355,6 @@ void QDeclarativeAbstractBinding::removeFromObject()
if (m_prevBinding) {
int index = propertyIndex();
- Q_ASSERT(m_object);
-
*m_prevBinding = m_nextBinding;
if (m_nextBinding) m_nextBinding->m_prevBinding = m_prevBinding;
m_prevBinding = 0;
@@ -363,7 +363,7 @@ void QDeclarativeAbstractBinding::removeFromObject()
if (index & 0xFF000000) {
// Value type - we don't remove the proxy from the object. It will sit their happily
// doing nothing for ever more.
- } else {
+ } else if (m_object) {
QDeclarativeData *data = QDeclarativeData::get(m_object, false);
if (data) data->clearBindingBit(index);
}
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index b5bf972..d27aced 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -1089,6 +1089,23 @@ void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj)
fetch.line = prop->location.start.line;
output->bytecode << fetch;
+ if (!prop->value->metadata.isEmpty()) {
+ QDeclarativeInstruction meta;
+ meta.type = QDeclarativeInstruction::StoreMetaObject;
+ meta.line = 0;
+ meta.storeMeta.data = output->indexForByteArray(prop->value->metadata);
+ meta.storeMeta.aliasData = output->indexForByteArray(prop->value->synthdata);
+ meta.storeMeta.propertyCache = output->propertyCaches.count();
+ // ### Surely the creation of this property cache could be more efficient
+ QDeclarativePropertyCache *propertyCache =
+ enginePrivate->cache(prop->value->metaObject()->superClass())->copy();
+ propertyCache->append(engine, prop->value->metaObject(), QDeclarativePropertyCache::Data::NoFlags,
+ QDeclarativePropertyCache::Data::IsVMEFunction);
+
+ output->propertyCaches << propertyCache;
+ output->bytecode << meta;
+ }
+
genObjectBody(prop->value);
QDeclarativeInstruction pop;
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 8b64e0e..aca01b2 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -623,7 +623,7 @@ private:
inline void cleanup();
- void *data[4];
+ char data[4 * sizeof(void *)];
int type;
};
}
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp
index 13e9c26..7aea7cb 100644
--- a/src/declarative/qml/qdeclarativevmemetaobject.cpp
+++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp
@@ -381,7 +381,7 @@ QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj,
const QMetaObject *other,
const QDeclarativeVMEMetaData *meta,
QDeclarativeCompiledData *cdata)
-: object(obj), compiledData(cdata), ctxt(QDeclarativeData::get(obj)->outerContext),
+: object(obj), compiledData(cdata), ctxt(QDeclarativeData::get(obj, true)->outerContext),
metaData(meta), data(0), methods(0), parent(0)
{
compiledData->addref();
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 344df30..ae0abf9 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -2545,12 +2545,16 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
return;
}
- if (d->unpolishedItems.isEmpty()) {
- QMetaMethod method = metaObject()->method(d->polishItemsIndex);
- method.invoke(this, Qt::QueuedConnection);
+ // QDeclarativeItems do not rely on initial itemChanged message, as the componentComplete
+ // function allows far more opportunity for delayed-construction optimization.
+ if (!item->d_ptr->isDeclarativeItem) {
+ if (d->unpolishedItems.isEmpty()) {
+ QMetaMethod method = metaObject()->method(d->polishItemsIndex);
+ method.invoke(this, Qt::QueuedConnection);
+ }
+ d->unpolishedItems.append(item);
+ item->d_ptr->pendingPolish = true;
}
- d->unpolishedItems.append(item);
- item->d_ptr->pendingPolish = true;
// Detach this item from its parent if the parent's scene is different
// from this scene.
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 1c7661d..b7539da 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -595,8 +595,9 @@ QNetworkCookieJar *QNetworkAccessManager::cookieJar() const
\note QNetworkAccessManager takes ownership of the \a cookieJar object.
- QNetworkAccessManager will set the parent of the \a cookieJar
- passed to itself, so that the cookie jar is deleted when this
+ If \a cookieJar is in the same thread as this QNetworkAccessManager,
+ it will set the parent of the \a cookieJar
+ so that the cookie jar is deleted when this
object is deleted as well. If you want to share cookie jars
between different QNetworkAccessManager objects, you may want to
set the cookie jar's parent to 0 after calling this function.
@@ -621,7 +622,8 @@ void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)
if (d->cookieJar && d->cookieJar->parent() == this)
delete d->cookieJar;
d->cookieJar = cookieJar;
- d->cookieJar->setParent(this);
+ if (thread() == cookieJar->thread())
+ d->cookieJar->setParent(this);
}
}