summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-02 07:54:21 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-02 07:54:21 (GMT)
commit4b05255a970e33f471345c826cab5a857a3a83f8 (patch)
tree93fd84e4b57ce8074de9b3ce2c598985d32dc886 /src
parent22db0e0eeb9ac703f3d249ca7221a97628a3289f (diff)
parentb22697903a004fa947bae916a152ac3311346510 (diff)
downloadQt-4b05255a970e33f471345c826cab5a857a3a83f8.zip
Qt-4b05255a970e33f471345c826cab5a857a3a83f8.tar.gz
Qt-4b05255a970e33f471345c826cab5a857a3a83f8.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: Don't overflow the unreferenced cost counter Remove extra strings The declarative parser should only save comment text (and not /*,*/,//) Support for qsTrId and meta-data in comments for QML. Flickable ensure internal pressed state is cleared when mouse is released. Fix examples autotest Support JS "in" operator on QML objects Only emit change signal when variant properties actually change Use QApplication in QDeclarativeEngine example. Maintain high score name dialog length, as well as name.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp1
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp8
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp2
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp14
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp16
5 files changed, 26 insertions, 15 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 63a2a77..b302393 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1258,6 +1258,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
d->clearDelayedPress();
d->stealMouse = false;
+ d->pressed = false;
}
return false;
}
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index cd08658..1eb42e4 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -677,9 +677,9 @@ int Lexer::lex()
setDone(Other);
} else
state = Start;
- if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
} else if (current == 0) {
- if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
setDone(Eof);
}
@@ -689,14 +689,14 @@ int Lexer::lex()
setDone(Bad);
err = UnclosedComment;
errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
- if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
} else if (isLineTerminator()) {
shiftWindowsLineBreak();
yylineno++;
} else if (current == '*' && next1 == '/') {
state = Start;
shift(1);
- if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+ if (driver) driver->addComment(startpos+2, tokenLength()-3, startlineno, startcolumn+2);
}
break;
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 3af892d..f439151 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -192,7 +192,7 @@ QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &nam
if (!(hints & ImplicitObject)) {
local.coreIndex = -1;
lastData = &local;
- return QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess;
+ return QScriptClass::HandlesWriteAccess;
}
return 0;
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp
index 689ed92..3e32006 100644
--- a/src/declarative/qml/qdeclarativevmemetaobject.cpp
+++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp
@@ -707,11 +707,19 @@ void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QScriptValue &val
void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QVariant &value)
{
- if (value.userType() == QMetaType::QObjectStar)
+ bool needActivate = false;
+ if (value.userType() == QMetaType::QObjectStar) {
+ QObject *o = qvariant_cast<QObject *>(value);
+ needActivate = (data[id].dataType() != QMetaType::QObjectStar || data[id].asQObject() != o);
data[id].setValue(qvariant_cast<QObject *>(value));
- else
+ } else {
+ needActivate = (data[id].dataType() != qMetaTypeId<QVariant>() ||
+ data[id].asQVariant().userType() != value.userType() ||
+ data[id].asQVariant() != value);
data[id].setValue(value);
- activate(object, methodOffset + id, 0);
+ }
+ if (needActivate)
+ activate(object, methodOffset + id, 0);
}
void QDeclarativeVMEMetaObject::listChanged(int id)
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index de2de21..4fc52f5 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -155,7 +155,7 @@ protected:
private:
friend class QDeclarativePixmapReaderThreadObject;
void processJobs();
- void processJob(QDeclarativePixmapReply *);
+ void processJob(QDeclarativePixmapReply *, const QUrl &, const QSize &);
void networkRequestDone(QNetworkReply *);
QList<QDeclarativePixmapReply*> jobs;
@@ -434,23 +434,24 @@ void QDeclarativePixmapReader::processJobs()
QDeclarativePixmapReply *runningJob = jobs.takeLast();
runningJob->loading = true;
+ QUrl url = runningJob->data->url;
+ QSize requestSize = runningJob->data->requestSize;
locker.unlock();
- processJob(runningJob);
+ processJob(runningJob, url, requestSize);
locker.relock();
}
}
}
-void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob)
+void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, const QUrl &url,
+ const QSize &requestSize)
{
- QUrl url = runningJob->data->url;
-
// fetch
if (url.scheme() == QLatin1String("image")) {
// Use QmlImageProvider
QSize readSize;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
- QImage image = ep->getImageFromProvider(url, &readSize, runningJob->data->requestSize);
+ QImage image = ep->getImageFromProvider(url, &readSize, requestSize);
QDeclarativePixmapReply::ReadError errorCode = QDeclarativePixmapReply::NoError;
QString errorStr;
@@ -472,7 +473,7 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob)
QFile f(lf);
QSize readSize;
if (f.open(QIODevice::ReadOnly)) {
- if (!readImage(url, &f, &image, &errorStr, &readSize, runningJob->data->requestSize))
+ if (!readImage(url, &f, &image, &errorStr, &readSize, requestSize))
errorCode = QDeclarativePixmapReply::Loading;
} else {
errorStr = QDeclarativePixmap::tr("Cannot open: %1").arg(url.toString());
@@ -663,6 +664,7 @@ void QDeclarativePixmapStore::shrinkCache(int remove)
data->prevUnreferenced = 0;
remove -= data->cost();
+ m_unreferencedCost -= data->cost();
data->removeFromCache();
delete data;
}