summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-09-20 22:00:16 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-09-20 22:00:16 (GMT)
commitbfd810a14f0f262b346132dbbcc9e49070bb2834 (patch)
tree9b1e16b703a9cbc862b221a59ab3f7fbbcb1b153 /src
parente7000e016e82ca9ca64db9246ccbef8fc1efa279 (diff)
parentd5f606f111527516bfe038a4045c8ec92f0499f7 (diff)
downloadQt-bfd810a14f0f262b346132dbbcc9e49070bb2834.zip
Qt-bfd810a14f0f262b346132dbbcc9e49070bb2834.tar.gz
Qt-bfd810a14f0f262b346132dbbcc9e49070bb2834.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src')
-rw-r--r--src/corelib/codecs/qtextcodec_symbian.cpp4
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp3
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice.cpp41
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp191
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h4
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp6
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp431
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p.h12
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p_p.h134
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent.cpp33
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent_p.h4
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp8
-rw-r--r--src/gui/image/qpixmap.cpp8
-rw-r--r--src/gui/image/qpixmapfilter.cpp15
-rw-r--r--src/gui/kernel/qapplication.cpp6
-rw-r--r--src/gui/kernel/qapplication_p.h2
-rw-r--r--src/gui/text/qstatictext.cpp5
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp8
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp4
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker.cpp1
-rw-r--r--src/opengl/qglpixelbuffer.cpp8
-rw-r--r--src/opengl/qglpixelbuffer_win.cpp34
-rw-r--r--src/opengl/qpaintengine_opengl.cpp1
-rw-r--r--src/plugins/graphicssystems/meego/qmeegoextensions.h1
-rw-r--r--src/s60installs/bwins/QtCoreu.def4
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def5
-rw-r--r--src/s60installs/bwins/QtGuiu.def10
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def7
-rw-r--r--src/s60installs/eabi/QtGuiu.def3
29 files changed, 742 insertions, 251 deletions
diff --git a/src/corelib/codecs/qtextcodec_symbian.cpp b/src/corelib/codecs/qtextcodec_symbian.cpp
index d59998f..9d7e856 100644
--- a/src/corelib/codecs/qtextcodec_symbian.cpp
+++ b/src/corelib/codecs/qtextcodec_symbian.cpp
@@ -122,8 +122,8 @@ static const QSymbianCodecInitData codecsData[] = {
{ /*271085624*/ 271085624, 114, "GB18030\0" },
{ /*536929574*/ 536929574, 38, "EUC-KR\0" },
{ /*536936703*/ 536936703, 0, "CP949\0" },
- { /*536936705*/ 536936705, 37, "ISO-2022-KR\0" },
- { /*536941517*/ 536941517, 36, "KS_C_5601-1987\0" }
+ { /*536936705*/ 536936705, 37, "ISO-2022-KR\0csISO2022KR\0" },
+ { /*536941517*/ 536941517, 36, "KS_C_5601-1987\0iso-ir-149\0KS_C_5601-1989\0KSC_5601\0Korean\0csKSC56011987\0" }
};
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 512e193..d3f399b 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2091,7 +2091,8 @@ QStringList QCoreApplication::arguments()
l1arg == "-stylesheet" ||
l1arg == "-widgetcount")
;
- else if (l1arg.startsWith("-style="))
+ else if (l1arg.startsWith("-style=") ||
+ l1arg.startsWith("-qmljsdebugger="))
;
else if (l1arg == "-style" ||
l1arg == "-session" ||
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp
index 1bbfcf4..1f2bf4f 100644
--- a/src/declarative/debugger/qdeclarativedebugservice.cpp
+++ b/src/declarative/debugger/qdeclarativedebugservice.cpp
@@ -49,6 +49,8 @@
#include <QtCore/qstringlist.h>
#include <private/qobject_p.h>
+#include <private/qapplication_p.h>
+#include <QtGui/qapplication.h>
QT_BEGIN_NAMESPACE
@@ -147,24 +149,41 @@ bool QDeclarativeDebugServer::hasDebuggingClient() const
QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
{
- static bool envTested = false;
+ static bool commandLineTested = false;
static QDeclarativeDebugServer *server = 0;
- if (!envTested) {
- envTested = true;
- QByteArray env = qgetenv("QML_DEBUG_SERVER_PORT");
- QByteArray block = qgetenv("QML_DEBUG_SERVER_BLOCK");
+ if (!commandLineTested) {
+ commandLineTested = true;
+#ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL
+ QApplicationPrivate *appD = static_cast<QApplicationPrivate*>(QObjectPrivate::get(qApp));
+ // ### remove port definition when protocol is changed
+ int port = 0;
+ bool block = false;
bool ok = false;
- int port = env.toInt(&ok);
- if (ok && port > 1024) {
- server = new QDeclarativeDebugServer(port);
- server->listen();
- if (!block.isEmpty()) {
- server->waitForConnection();
+ // format: qmljsdebugger=port:3768[,block]
+ if (!appD->qmljsDebugArguments.isEmpty()) {
+
+ if (appD->qmljsDebugArguments.indexOf(QLatin1String("port:")) == 0) {
+ int separatorIndex = appD->qmljsDebugArguments.indexOf(QLatin1Char(','));
+ port = appD->qmljsDebugArguments.mid(5, separatorIndex - 5).toInt(&ok);
+ }
+ block = appD->qmljsDebugArguments.contains(QLatin1String("block"));
+
+ if (ok) {
+ server = new QDeclarativeDebugServer(port);
+ server->listen();
+ if (block) {
+ server->waitForConnection();
+ }
+ } else {
+ qWarning(QString("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "Format is -qmljsdebugger=port:<port>[,block]").arg(
+ appD->qmljsDebugArguments).toAscii().constData());
}
}
+#endif
}
return server;
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index dad547f..d134929 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -141,11 +141,13 @@ void QDeclarativePathViewPrivate::releaseItem(QDeclarativeItem *item)
{
if (!item || !model)
return;
- if (QDeclarativePathViewAttached *att = attached(item))
- att->setOnPath(false);
QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
itemPrivate->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
- model->release(item);
+ if (model->release(item) == 0) {
+ // item was not destroyed, and we no longer reference it.
+ if (QDeclarativePathViewAttached *att = attached(item))
+ att->setOnPath(false);
+ }
}
QDeclarativePathViewAttached *QDeclarativePathViewPrivate::attached(QDeclarativeItem *item)
@@ -1033,103 +1035,138 @@ QPointF QDeclarativePathViewPrivate::pointNear(const QPointF &point, qreal *near
return nearPoint;
}
-
void QDeclarativePathView::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativePathView);
- if (!d->interactive || !d->items.count())
+ if (d->interactive) {
+ d->handleMousePressEvent(event);
+ event->accept();
+ } else {
+ QDeclarativeItem::mousePressEvent(event);
+ }
+}
+
+void QDeclarativePathViewPrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativePathView);
+ if (!interactive || !items.count())
return;
- QPointF scenePoint = mapToScene(event->pos());
+ QPointF scenePoint = q->mapToScene(event->pos());
int idx = 0;
- for (; idx < d->items.count(); ++idx) {
- QRectF rect = d->items.at(idx)->boundingRect();
- rect = d->items.at(idx)->mapToScene(rect).boundingRect();
+ for (; idx < items.count(); ++idx) {
+ QRectF rect = items.at(idx)->boundingRect();
+ rect = items.at(idx)->mapToScene(rect).boundingRect();
if (rect.contains(scenePoint))
break;
}
- if (idx == d->items.count() && d->dragMargin == 0.) // didn't click on an item
+ if (idx == items.count() && dragMargin == 0.) // didn't click on an item
return;
- d->startPoint = d->pointNear(event->pos(), &d->startPc);
- if (idx == d->items.count()) {
- qreal distance = qAbs(event->pos().x() - d->startPoint.x()) + qAbs(event->pos().y() - d->startPoint.y());
- if (distance > d->dragMargin)
+ startPoint = pointNear(event->pos(), &startPc);
+ if (idx == items.count()) {
+ qreal distance = qAbs(event->pos().x() - startPoint.x()) + qAbs(event->pos().y() - startPoint.y());
+ if (distance > dragMargin)
return;
}
- if (d->tl.isActive() && d->flicking)
- d->stealMouse = true; // If we've been flicked then steal the click.
+ if (tl.isActive() && flicking)
+ stealMouse = true; // If we've been flicked then steal the click.
else
- d->stealMouse = false;
+ stealMouse = false;
- d->lastElapsed = 0;
- d->lastDist = 0;
- QDeclarativeItemPrivate::start(d->lastPosTime);
- d->tl.clear();
+ lastElapsed = 0;
+ lastDist = 0;
+ QDeclarativeItemPrivate::start(lastPosTime);
+ tl.clear();
}
void QDeclarativePathView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativePathView);
- if (!d->interactive || !d->lastPosTime.isValid())
+ if (d->interactive) {
+ d->handleMouseMoveEvent(event);
+ if (d->stealMouse)
+ setKeepMouseGrab(true);
+ event->accept();
+ } else {
+ QDeclarativeItem::mouseMoveEvent(event);
+ }
+}
+
+void QDeclarativePathViewPrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_Q(QDeclarativePathView);
+ if (!interactive || !lastPosTime.isValid())
return;
- if (!d->stealMouse) {
- QPointF delta = event->pos() - d->startPoint;
+ if (!stealMouse) {
+ QPointF delta = event->pos() - startPoint;
if (qAbs(delta.x()) > QApplication::startDragDistance() || qAbs(delta.y()) > QApplication::startDragDistance())
- d->stealMouse = true;
+ stealMouse = true;
}
- if (d->stealMouse) {
- d->moveReason = QDeclarativePathViewPrivate::Mouse;
+ if (stealMouse) {
+ moveReason = QDeclarativePathViewPrivate::Mouse;
qreal newPc;
- d->pointNear(event->pos(), &newPc);
- qreal diff = (newPc - d->startPc)*d->modelCount*d->mappedRange;
+ pointNear(event->pos(), &newPc);
+ qreal diff = (newPc - startPc)*modelCount*mappedRange;
if (diff) {
- setOffset(d->offset + diff);
+ setOffset(offset + diff);
- if (diff > d->modelCount/2)
- diff -= d->modelCount;
- else if (diff < -d->modelCount/2)
- diff += d->modelCount;
+ if (diff > modelCount/2)
+ diff -= modelCount;
+ else if (diff < -modelCount/2)
+ diff += modelCount;
- d->lastElapsed = QDeclarativeItemPrivate::restart(d->lastPosTime);
- d->lastDist = diff;
- d->startPc = newPc;
+ lastElapsed = QDeclarativeItemPrivate::restart(lastPosTime);
+ lastDist = diff;
+ startPc = newPc;
}
- if (!d->moving) {
- d->moving = true;
- emit movingChanged();
- emit movementStarted();
+ if (!moving) {
+ moving = true;
+ emit q->movingChanged();
+ emit q->movementStarted();
}
}
}
-void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
+void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativePathView);
- d->stealMouse = false;
- setKeepMouseGrab(false);
- if (!d->interactive || !d->lastPosTime.isValid())
+ if (d->interactive) {
+ d->handleMouseReleaseEvent(event);
+ event->accept();
+ ungrabMouse();
+ } else {
+ QDeclarativeItem::mouseReleaseEvent(event);
+ }
+}
+
+void QDeclarativePathViewPrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *)
+{
+ Q_Q(QDeclarativePathView);
+ stealMouse = false;
+ q->setKeepMouseGrab(false);
+ if (!interactive || !lastPosTime.isValid())
return;
- qreal elapsed = qreal(d->lastElapsed + QDeclarativeItemPrivate::elapsed(d->lastPosTime)) / 1000.;
- qreal velocity = elapsed > 0. ? d->lastDist / elapsed : 0;
- if (d->model && d->modelCount && qAbs(velocity) > 1.) {
- qreal count = d->pathItems == -1 ? d->modelCount : d->pathItems;
+ qreal elapsed = qreal(lastElapsed + QDeclarativeItemPrivate::elapsed(lastPosTime)) / 1000.;
+ qreal velocity = elapsed > 0. ? lastDist / elapsed : 0;
+ if (model && modelCount && qAbs(velocity) > 1.) {
+ qreal count = pathItems == -1 ? modelCount : pathItems;
if (qAbs(velocity) > count * 2) // limit velocity
velocity = (velocity > 0 ? count : -count) * 2;
// Calculate the distance to be travelled
qreal v2 = velocity*velocity;
- qreal accel = d->deceleration/10;
+ qreal accel = deceleration/10;
// + 0.25 to encourage moving at least one item in the flick direction
- qreal dist = qMin(qreal(d->modelCount-1), qreal(v2 / (accel * 2.0) + 0.25));
- if (d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
+ qreal dist = qMin(qreal(modelCount-1), qreal(v2 / (accel * 2.0) + 0.25));
+ if (haveHighlightRange && highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange) {
// round to nearest item.
if (velocity > 0.)
- dist = qRound(dist + d->offset) - d->offset;
+ dist = qRound(dist + offset) - offset;
else
- dist = qRound(dist - d->offset) + d->offset;
+ dist = qRound(dist - offset) + offset;
// Calculate accel required to stop on item boundary
if (dist <= 0.) {
dist = 0.;
@@ -1138,23 +1175,22 @@ void QDeclarativePathView::mouseReleaseEvent(QGraphicsSceneMouseEvent *)
accel = v2 / (2.0f * qAbs(dist));
}
}
- d->offsetAdj = 0.0;
- d->moveOffset.setValue(d->offset);
- d->tl.accel(d->moveOffset, velocity, accel, dist);
- d->tl.callback(QDeclarativeTimeLineCallback(&d->moveOffset, d->fixOffsetCallback, d));
- if (!d->flicking) {
- d->flicking = true;
- emit flickingChanged();
- emit flickStarted();
+ offsetAdj = 0.0;
+ moveOffset.setValue(offset);
+ tl.accel(moveOffset, velocity, accel, dist);
+ tl.callback(QDeclarativeTimeLineCallback(&moveOffset, fixOffsetCallback, this));
+ if (!flicking) {
+ flicking = true;
+ emit q->flickingChanged();
+ emit q->flickStarted();
}
} else {
- d->fixOffset();
+ fixOffset();
}
- d->lastPosTime.invalidate();
- ungrabMouse();
- if (!d->tl.isActive())
- movementEnding();
+ lastPosTime.invalidate();
+ if (!tl.isActive())
+ q->movementEnding();
}
bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
@@ -1164,7 +1200,8 @@ bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
QGraphicsScene *s = scene();
QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
- if ((d->stealMouse || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ bool stealThisEvent = d->stealMouse;
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
mouseEvent.setAccepted(false);
for (int i = 0x1; i <= 0x10; i <<= 1) {
if (event->buttons() & i) {
@@ -1179,25 +1216,28 @@ bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
switch(mouseEvent.type()) {
case QEvent::GraphicsSceneMouseMove:
- mouseMoveEvent(&mouseEvent);
+ d->handleMouseMoveEvent(&mouseEvent);
break;
case QEvent::GraphicsSceneMousePress:
- mousePressEvent(&mouseEvent);
+ d->handleMousePressEvent(&mouseEvent);
+ stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
break;
case QEvent::GraphicsSceneMouseRelease:
- mouseReleaseEvent(&mouseEvent);
+ d->handleMouseReleaseEvent(&mouseEvent);
break;
default:
break;
}
grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
- if (grabber && d->stealMouse && !grabber->keepMouseGrab() && grabber != this)
+ if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
grabMouse();
return d->stealMouse;
} else if (d->lastPosTime.isValid()) {
d->lastPosTime.invalidate();
}
+ if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease)
+ d->stealMouse = false;
return false;
}
@@ -1211,12 +1251,7 @@ bool QDeclarativePathView::sceneEventFilter(QGraphicsItem *i, QEvent *e)
case QEvent::GraphicsSceneMousePress:
case QEvent::GraphicsSceneMouseMove:
case QEvent::GraphicsSceneMouseRelease:
- {
- bool ret = sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
- if (e->type() == QEvent::GraphicsSceneMouseRelease)
- return ret;
- break;
- }
+ return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
default:
break;
}
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
index dfebe35..b217216 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
@@ -123,6 +123,10 @@ public:
return model && model->count() > 0 && model->isValid() && path;
}
+ void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
+ void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *);
+
int calcCurrentIndex();
void updateCurrent();
static void fixOffsetCallback(void*);
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 91588b7..6879494 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -210,11 +210,7 @@ void QDeclarativeFontLoader::setSource(const QUrl &url)
updateFontInfo(QString(), Error);
}
} else {
- QDeclarativeFontObject *fo = d->fonts[d->url];
- d->name = QFontDatabase::applicationFontFamilies(fo->id).at(0);
- emit nameChanged();
- d->status = QDeclarativeFontLoader::Ready;
- emit statusChanged();
+ updateFontInfo(QFontDatabase::applicationFontFamilies(d->fonts[d->url]->id).at(0), Ready);
}
} else
#endif
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index cf2eada..3263238 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -58,6 +58,28 @@ Q_DECLARE_METATYPE(QListModelInterface *)
QT_BEGIN_NAMESPACE
+template<typename T>
+void qdeclarativelistmodel_move(int from, int to, int n, T *items)
+{
+ if (n == 1) {
+ items->move(from, to);
+ } else {
+ T replaced;
+ int i=0;
+ typename T::ConstIterator it=items->begin(); it += from+n;
+ for (; i<to-from; ++i,++it)
+ replaced.append(*it);
+ i=0;
+ it=items->begin(); it += from;
+ for (; i<n; ++i,++it)
+ replaced.append(*it);
+ typename T::ConstIterator f=replaced.begin();
+ typename T::Iterator t=items->begin(); t += from;
+ for (; f != replaced.end(); ++f, ++t)
+ *t = *f;
+ }
+}
+
QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListModelData::instructions() const
{
return (QDeclarativeListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
@@ -154,10 +176,10 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
handler. You must call sync() or else the changes made to the list from the external
thread will not be reflected in the list model in the main thread.
- \section1 Limitations
+ \section1 Restrictions
- If a list model is to be accessed from a WorkerScript, it \bold cannot
- contain list data. So, the following model cannot be used from a WorkerScript
+ If a list model is to be accessed from a WorkerScript, it cannot
+ contain list-type data. So, the following model cannot be used from a WorkerScript
because of the list contained in the "attributes" property:
\code
@@ -174,7 +196,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
}
\endcode
- In addition, the WorkerScript cannot add any list data to the model.
+ In addition, the WorkerScript cannot add list-type data to the model.
\sa {qmlmodels}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtDeclarative
*/
@@ -195,17 +217,25 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
*/
QDeclarativeListModel::QDeclarativeListModel(QObject *parent)
-: QListModelInterface(parent), m_agent(0), m_nested(new NestedListModel(this)), m_flat(0), m_isWorkerCopy(false)
+: QListModelInterface(parent), m_agent(0), m_nested(new NestedListModel(this)), m_flat(0)
{
}
-QDeclarativeListModel::QDeclarativeListModel(bool workerCopy, QObject *parent)
-: QListModelInterface(parent), m_agent(0), m_nested(0), m_flat(0), m_isWorkerCopy(workerCopy)
+QDeclarativeListModel::QDeclarativeListModel(const QDeclarativeListModel *orig, QDeclarativeListModelWorkerAgent *parent)
+: QListModelInterface(parent), m_agent(0), m_nested(0), m_flat(0)
{
- if (workerCopy)
- m_flat = new FlatListModel(this);
- else
- m_nested = new NestedListModel(this);
+ m_flat = new FlatListModel(this);
+ m_flat->m_parentAgent = parent;
+
+ if (orig->m_flat) {
+ m_flat->m_roles = orig->m_flat->m_roles;
+ m_flat->m_strings = orig->m_flat->m_strings;
+ m_flat->m_values = orig->m_flat->m_values;
+
+ m_flat->m_nodeData.reserve(m_flat->m_values.count());
+ for (int i=0; i<m_flat->m_values.count(); i++)
+ m_flat->m_nodeData << 0;
+ }
}
QDeclarativeListModel::~QDeclarativeListModel()
@@ -241,19 +271,28 @@ bool QDeclarativeListModel::flatten()
flat->m_strings.insert(s, roles[i]);
}
+ flat->m_nodeData.reserve(flat->m_values.count());
+ for (int i=0; i<flat->m_values.count(); i++)
+ flat->m_nodeData << 0;
+
m_flat = flat;
delete m_nested;
m_nested = 0;
return true;
}
+bool QDeclarativeListModel::inWorkerThread() const
+{
+ return m_flat && m_flat->m_parentAgent;
+}
+
QDeclarativeListModelWorkerAgent *QDeclarativeListModel::agent()
{
if (m_agent)
return m_agent;
if (!flatten()) {
- qmlInfo(this) << "List contains nested list values and cannot be used from a worker script";
+ qmlInfo(this) << "List contains list-type data and cannot be used from a worker script";
return 0;
}
@@ -311,12 +350,43 @@ void QDeclarativeListModel::clear()
else
m_nested->clear();
- if (!m_isWorkerCopy) {
+ if (!inWorkerThread()) {
emit itemsRemoved(0, cleared);
emit countChanged();
}
}
+QDeclarativeListModel *ModelNode::model(const NestedListModel *model)
+{
+ if (!modelCache) {
+ modelCache = new QDeclarativeListModel;
+ QDeclarativeEngine::setContextForObject(modelCache,QDeclarativeEngine::contextForObject(model->m_listModel));
+ modelCache->m_nested->_root = this; // ListModel defaults to nestable model
+
+ for (int i=0; i<values.count(); ++i) {
+ ModelNode *subNode = qvariant_cast<ModelNode *>(values.at(i));
+ if (subNode)
+ subNode->m_model = modelCache->m_nested;
+ }
+ }
+ return modelCache;
+}
+
+ModelObject *ModelNode::object(const NestedListModel *model)
+{
+ if (!objectCache) {
+ objectCache = new ModelObject(this,
+ const_cast<NestedListModel*>(model),
+ QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(model->m_listModel)));
+ QHash<QString, ModelNode *>::iterator it;
+ for (it = properties.begin(); it != properties.end(); ++it) {
+ objectCache->setValue(it.key().toUtf8(), model->valueForNode(*it));
+ }
+ objectCache->setNodeUpdatesEnabled(true);
+ }
+ return objectCache;
+}
+
/*!
\qmlmethod ListModel::remove(int index)
@@ -336,7 +406,7 @@ void QDeclarativeListModel::remove(int index)
else
m_nested->remove(index);
- if (!m_isWorkerCopy) {
+ if (!inWorkerThread()) {
emit itemsRemoved(index, 1);
emit countChanged();
}
@@ -370,7 +440,7 @@ void QDeclarativeListModel::insert(int index, const QScriptValue& valuemap)
}
bool ok = m_flat ? m_flat->insert(index, valuemap) : m_nested->insert(index, valuemap);
- if (ok && !m_isWorkerCopy) {
+ if (ok && !inWorkerThread()) {
emit itemsInserted(index, 1);
emit countChanged();
}
@@ -394,7 +464,7 @@ void QDeclarativeListModel::move(int from, int to, int n)
{
if (n==0 || from==to)
return;
- if (from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0) {
+ if (!canMove(from, to, n)) {
qmlInfo(this) << tr("move: out of range");
return;
}
@@ -416,7 +486,7 @@ void QDeclarativeListModel::move(int from, int to, int n)
else
m_nested->move(from, to, n);
- if (!m_isWorkerCopy)
+ if (!inWorkerThread())
emit itemsMoved(origfrom, origto, orign);
}
@@ -445,11 +515,15 @@ void QDeclarativeListModel::append(const QScriptValue& valuemap)
/*!
\qmlmethod object ListModel::get(int index)
- Returns the item at \a index in the list model.
+ Returns the item at \a index in the list model. This allows the item
+ data to be accessed or modified from JavaScript:
\code
- fruitModel.append({"cost": 5.95, "name":"Jackfruit"})
- fruitModel.get(0).cost
+ Component.onCompleted: {
+ fruitModel.append({"cost": 5.95, "name":"Jackfruit"});
+ console.log(fruitModel.get(0).cost);
+ fruitModel.get(0).cost = 10.95;
+ }
\endcode
The \a index must be an element in the list.
@@ -464,6 +538,9 @@ void QDeclarativeListModel::append(const QScriptValue& valuemap)
fruitModel.get(0).attributes.get(1).value; // == "green"
\endcode
+ \warning The returned object is not guaranteed to remain valid. It
+ should not be used in \l{Property Binding}{property bindings}.
+
\sa append()
*/
QScriptValue QDeclarativeListModel::get(int index) const
@@ -507,7 +584,7 @@ void QDeclarativeListModel::set(int index, const QScriptValue& valuemap)
else
m_nested->set(index, valuemap, &roles);
- if (!m_isWorkerCopy)
+ if (!inWorkerThread())
emit itemsChanged(index, 1, roles);
}
}
@@ -538,7 +615,7 @@ void QDeclarativeListModel::setProperty(int index, const QString& property, cons
else
m_nested->setProperty(index, property, value, &roles);
- if (!m_isWorkerCopy)
+ if (!inWorkerThread())
emit itemsChanged(index, 1, roles);
}
@@ -705,7 +782,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &
{
QDeclarativeListModel *rv = static_cast<QDeclarativeListModel *>(obj);
- ModelNode *root = new ModelNode;
+ ModelNode *root = new ModelNode(rv->m_nested);
rv->m_nested->_root = root;
QStack<ModelNode *> nodes;
nodes << root;
@@ -722,7 +799,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &
case ListInstruction::Push:
{
ModelNode *n = nodes.top();
- ModelNode *n2 = new ModelNode;
+ ModelNode *n2 = new ModelNode(rv->m_nested);
n->values << qVariantFromValue(n2);
nodes.push(n2);
if (processingSet)
@@ -761,7 +838,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &
case ListInstruction::Set:
{
ModelNode *n = nodes.top();
- ModelNode *n2 = new ModelNode;
+ ModelNode *n2 = new ModelNode(rv->m_nested);
n->properties.insert(QString::fromUtf8(data + instr.dataIdx), n2);
nodes.push(n2);
processingSet = true;
@@ -769,6 +846,13 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &
break;
}
}
+
+ ModelNode *rootNode = rv->m_nested->_root;
+ for (int i=0; i<rootNode->values.count(); ++i) {
+ ModelNode *node = qvariant_cast<ModelNode *>(rootNode->values[i]);
+ node->listIndex = i;
+ node->updateListIndexes();
+ }
}
bool QDeclarativeListModelParser::definesEmptyList(const QString &s)
@@ -783,6 +867,7 @@ bool QDeclarativeListModelParser::definesEmptyList(const QString &s)
return false;
}
+
/*!
\qmlclass ListElement QDeclarativeListElement
\ingroup qml-working-with-data
@@ -826,12 +911,13 @@ bool QDeclarativeListModelParser::definesEmptyList(const QString &s)
*/
FlatListModel::FlatListModel(QDeclarativeListModel *base)
- : m_scriptEngine(0), m_listModel(base)
+ : m_scriptEngine(0), m_listModel(base), m_scriptClass(0), m_parentAgent(0)
{
}
FlatListModel::~FlatListModel()
{
+ qDeleteAll(m_nodeData);
}
QHash<int,QVariant> FlatListModel::data(int index, const QList<int> &roles) const
@@ -875,11 +961,15 @@ int FlatListModel::count() const
void FlatListModel::clear()
{
m_values.clear();
+
+ qDeleteAll(m_nodeData);
+ m_nodeData.clear();
}
void FlatListModel::remove(int index)
{
m_values.removeAt(index);
+ removedNode(index);
}
bool FlatListModel::append(const QScriptValue &value)
@@ -896,6 +986,8 @@ bool FlatListModel::insert(int index, const QScriptValue &value)
return false;
m_values.insert(index, row);
+ insertedNode(index);
+
return true;
}
@@ -909,13 +1001,17 @@ QScriptValue FlatListModel::get(int index) const
if (index < 0 || index >= m_values.count())
return scriptEngine->undefinedValue();
- QScriptValue rv = scriptEngine->newObject();
+ FlatListModel *that = const_cast<FlatListModel*>(this);
+ if (!m_scriptClass)
+ that->m_scriptClass = new FlatListScriptClass(that, scriptEngine);
- QHash<int, QVariant> row = m_values.at(index);
- for (QHash<int, QVariant>::ConstIterator iter = row.begin(); iter != row.end(); ++iter)
- rv.setProperty(m_roles.value(iter.key()), qScriptValueFromValue(scriptEngine, iter.value()));
+ FlatNodeData *data = m_nodeData.value(index);
+ if (!data) {
+ data = new FlatNodeData(index);
+ that->m_nodeData.replace(index, data);
+ }
- return rv;
+ return QScriptDeclarativeClass::newObject(scriptEngine, m_scriptClass, new FlatNodeObjectData(data));
}
void FlatListModel::set(int index, const QScriptValue &value, QList<int> *roles)
@@ -947,23 +1043,8 @@ void FlatListModel::setProperty(int index, const QString& property, const QVaria
void FlatListModel::move(int from, int to, int n)
{
- if (n == 1) {
- m_values.move(from, to);
- } else {
- QList<QHash<int, QVariant> > replaced;
- int i=0;
- QList<QHash<int, QVariant> >::ConstIterator it=m_values.begin(); it += from+n;
- for (; i<to-from; ++i,++it)
- replaced.append(*it);
- i=0;
- it=m_values.begin(); it += from;
- for (; i<n; ++i,++it)
- replaced.append(*it);
- QList<QHash<int, QVariant> >::ConstIterator f=replaced.begin();
- QList<QHash<int, QVariant> >::Iterator t=m_values.begin(); t += from;
- for (; f != replaced.end(); ++f, ++t)
- *t = *f;
- }
+ qdeclarativelistmodel_move<QList<QHash<int, QVariant> > >(from, to, n, &m_values);
+ moveNodes(from, to, n);
}
bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *row, QList<int> *roles)
@@ -973,7 +1054,7 @@ bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *ro
it.next();
QScriptValue value = it.value();
if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) {
- qmlInfo(m_listModel) << "Cannot add nested list values when modifying or after modification from a worker script";
+ qmlInfo(m_listModel) << "Cannot add list-type data when modifying or after modification from a worker script";
return false;
}
@@ -993,6 +1074,139 @@ bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *ro
return true;
}
+void FlatListModel::insertedNode(int index)
+{
+ if (index >= 0 && index <= m_values.count()) {
+ m_nodeData.insert(index, 0);
+
+ for (int i=index + 1; i<m_nodeData.count(); i++) {
+ if (m_nodeData[i])
+ m_nodeData[i]->index = i;
+ }
+ }
+}
+
+void FlatListModel::removedNode(int index)
+{
+ if (index >= 0 && index < m_nodeData.count()) {
+ delete m_nodeData.takeAt(index);
+
+ for (int i=index; i<m_nodeData.count(); i++) {
+ if (m_nodeData[i])
+ m_nodeData[i]->index = i;
+ }
+ }
+}
+
+void FlatListModel::moveNodes(int from, int to, int n)
+{
+ if (!m_listModel->canMove(from, to, n))
+ return;
+
+ qdeclarativelistmodel_move<QList<FlatNodeData *> >(from, to, n, &m_nodeData);
+
+ for (int i=from; i<from + (to-from); i++) {
+ if (m_nodeData[i])
+ m_nodeData[i]->index = i;
+ }
+}
+
+
+
+FlatNodeData::~FlatNodeData()
+{
+ for (QSet<FlatNodeObjectData *>::Iterator iter = objects.begin(); iter != objects.end(); ++iter) {
+ FlatNodeObjectData *data = *iter;
+ data->nodeData = 0;
+ }
+}
+
+void FlatNodeData::addData(FlatNodeObjectData *data)
+{
+ objects.insert(data);
+}
+
+void FlatNodeData::removeData(FlatNodeObjectData *data)
+{
+ objects.remove(data);
+}
+
+
+FlatListScriptClass::FlatListScriptClass(FlatListModel *model, QScriptEngine *seng)
+ : QScriptDeclarativeClass(seng),
+ m_model(model)
+{
+}
+
+QScriptDeclarativeClass::Value FlatListScriptClass::property(Object *obj, const Identifier &name)
+{
+ FlatNodeObjectData *objData = static_cast<FlatNodeObjectData*>(obj);
+ if (!objData->nodeData) // item at this index has been deleted
+ return QScriptDeclarativeClass::Value(engine(), engine()->undefinedValue());
+
+ int index = objData->nodeData->index;
+ QString propName = toString(name);
+ int role = m_model->m_strings.value(propName, -1);
+
+ if (role >= 0 && index >=0 ) {
+ const QHash<int, QVariant> &row = m_model->m_values[index];
+ QScriptValue sv = engine()->toScriptValue<QVariant>(row[role]);
+ return QScriptDeclarativeClass::Value(engine(), sv);
+ }
+
+ return QScriptDeclarativeClass::Value(engine(), engine()->undefinedValue());
+}
+
+void FlatListScriptClass::setProperty(Object *obj, const Identifier &name, const QScriptValue &value)
+{
+ if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) {
+ qmlInfo(m_model->m_listModel) << "Cannot add list-type data when modifying or after modification from a worker script";
+ return;
+ }
+
+ FlatNodeObjectData *objData = static_cast<FlatNodeObjectData*>(obj);
+ if (!objData->nodeData) // item at this index has been deleted
+ return;
+
+ int index = objData->nodeData->index;
+ QString propName = toString(name);
+
+ int role = m_model->m_strings.value(propName, -1);
+ if (role >= 0 && index >= 0) {
+ QHash<int, QVariant> &row = m_model->m_values[index];
+ row[role] = value.toVariant();
+
+ if (m_model->m_parentAgent) {
+ // This is the list in the worker thread, so tell the agent to
+ // emit itemsChanged() later
+ m_model->m_parentAgent->changedData(index, 1);
+ } else {
+ // This is the list in the main thread, so emit itemsChanged()
+ QList<int> roles;
+ roles << role;
+ emit m_model->m_listModel->itemsChanged(index, 1, roles);
+ }
+ }
+}
+
+QScriptClass::QueryFlags FlatListScriptClass::queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags)
+{
+ return (QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess);
+}
+
+bool FlatListScriptClass::compare(Object *obj1, Object *obj2)
+{
+ FlatNodeObjectData *data1 = static_cast<FlatNodeObjectData*>(obj1);
+ FlatNodeObjectData *data2 = static_cast<FlatNodeObjectData*>(obj2);
+
+ if (!data1->nodeData || !data2->nodeData)
+ return false;
+
+ return data1->nodeData->index == data2->nodeData->index;
+}
+
+
+
NestedListModel::NestedListModel(QDeclarativeListModel *base)
: _root(0), m_ownsRoot(false), m_listModel(base), _rolesOk(false)
{
@@ -1118,11 +1332,12 @@ void NestedListModel::remove(int index)
bool NestedListModel::insert(int index, const QScriptValue& valuemap)
{
if (!_root) {
- _root = new ModelNode;
+ _root = new ModelNode(this);
m_ownsRoot = true;
}
- ModelNode *mn = new ModelNode;
+ ModelNode *mn = new ModelNode(this);
+ mn->listIndex = index;
mn->setObjectValue(valuemap);
_root->values.insert(index,qVariantFromValue(mn));
return true;
@@ -1130,34 +1345,19 @@ bool NestedListModel::insert(int index, const QScriptValue& valuemap)
void NestedListModel::move(int from, int to, int n)
{
- if (n==1) {
- _root->values.move(from,to);
- } else {
- QList<QVariant> replaced;
- int i=0;
- QVariantList::const_iterator it=_root->values.begin(); it += from+n;
- for (; i<to-from; ++i,++it)
- replaced.append(*it);
- i=0;
- it=_root->values.begin(); it += from;
- for (; i<n; ++i,++it)
- replaced.append(*it);
- QVariantList::const_iterator f=replaced.begin();
- QVariantList::iterator t=_root->values.begin(); t += from;
- for (; f != replaced.end(); ++f, ++t)
- *t = *f;
- }
+ if (!_root)
+ return;
+ qdeclarativelistmodel_move<QVariantList>(from, to, n, &_root->values);
}
bool NestedListModel::append(const QScriptValue& valuemap)
{
if (!_root) {
- _root = new ModelNode;
+ _root = new ModelNode(this);
m_ownsRoot = true;
}
- ModelNode *mn = new ModelNode;
- mn->setObjectValue(valuemap);
- _root->values << qVariantFromValue(mn);
+
+ insert(count(), valuemap);
return true;
}
@@ -1252,8 +1452,8 @@ QString NestedListModel::toString(int role) const
}
-ModelNode::ModelNode()
-: modelCache(0), objectCache(0), isArray(false)
+ModelNode::ModelNode(NestedListModel *model)
+: modelCache(0), objectCache(0), isArray(false), m_model(model), listIndex(-1)
{
}
@@ -1277,18 +1477,18 @@ void ModelNode::clear()
properties.clear();
}
-void ModelNode::setObjectValue(const QScriptValue& valuemap) {
+void ModelNode::setObjectValue(const QScriptValue& valuemap, bool writeToCache) {
QScriptValueIterator it(valuemap);
while (it.hasNext()) {
it.next();
- ModelNode *value = new ModelNode;
+ ModelNode *value = new ModelNode(m_model);
QScriptValue v = it.value();
if (v.isArray()) {
value->isArray = true;
value->setListValue(v);
} else {
value->values << v.toVariant();
- if (objectCache)
+ if (writeToCache && objectCache)
objectCache->setValue(it.name().toUtf8(), value->values.last());
}
if (properties.contains(it.name()))
@@ -1301,14 +1501,16 @@ void ModelNode::setListValue(const QScriptValue& valuelist) {
values.clear();
int size = valuelist.property(QLatin1String("length")).toInt32();
for (int i=0; i<size; i++) {
- ModelNode *value = new ModelNode;
+ ModelNode *value = new ModelNode(m_model);
QScriptValue v = valuelist.property(i);
if (v.isArray()) {
value->isArray = true;
value->setListValue(v);
} else if (v.isObject()) {
+ value->listIndex = i;
value->setObjectValue(v);
} else {
+ value->listIndex = i;
value->values << v.toVariant();
}
values.append(qVariantFromValue(value));
@@ -1320,7 +1522,7 @@ void ModelNode::setProperty(const QString& prop, const QVariant& val) {
if (it != properties.end()) {
(*it)->values[0] = val;
} else {
- ModelNode *n = new ModelNode;
+ ModelNode *n = new ModelNode(m_model);
n->values << val;
properties.insert(prop,n);
}
@@ -1328,6 +1530,40 @@ void ModelNode::setProperty(const QString& prop, const QVariant& val) {
objectCache->setValue(prop.toUtf8(), val);
}
+void ModelNode::updateListIndexes()
+{
+ for (QHash<QString, ModelNode *>::ConstIterator iter = properties.begin(); iter != properties.end(); ++iter) {
+ ModelNode *node = iter.value();
+ if (node->isArray) {
+ for (int i=0; i<node->values.count(); ++i) {
+ ModelNode *subNode = qvariant_cast<ModelNode *>(node->values.at(i));
+ if (subNode)
+ subNode->listIndex = i;
+ }
+ }
+ node->updateListIndexes();
+ }
+}
+
+/*
+ Need to call this to emit itemsChanged() for modifications outside of set()
+ and setProperty(), i.e. if an item returned from get() is modified
+*/
+void ModelNode::changedProperty(const QString &name) const
+{
+ if (listIndex < 0)
+ return;
+
+ m_model->checkRoles();
+ QList<int> roles;
+ int role = m_model->roleStrings.indexOf(name);
+ if (role < 0)
+ roles = m_model->roles();
+ else
+ roles << role;
+ emit m_model->m_listModel->itemsChanged(listIndex, 1, roles);
+}
+
void ModelNode::dump(ModelNode *node, int ind)
{
QByteArray indentBa(ind * 4, ' ');
@@ -1349,16 +1585,47 @@ void ModelNode::dump(ModelNode *node, int ind)
}
}
-ModelObject::ModelObject()
-: _mo(new QDeclarativeOpenMetaObject(this))
+ModelObject::ModelObject(ModelNode *node, NestedListModel *model, QScriptEngine *seng)
+ : m_model(model),
+ m_node(node),
+ m_meta(new ModelNodeMetaObject(seng, this))
{
}
void ModelObject::setValue(const QByteArray &name, const QVariant &val)
{
- _mo->setValue(name, val);
+ m_meta->setValue(name, val);
setProperty(name.constData(), val);
}
+void ModelObject::setNodeUpdatesEnabled(bool enable)
+{
+ m_meta->m_enabled = enable;
+}
+
+
+ModelNodeMetaObject::ModelNodeMetaObject(QScriptEngine *seng, ModelObject *object)
+ : QDeclarativeOpenMetaObject(object),
+ m_enabled(false),
+ m_seng(seng),
+ m_obj(object)
+{
+}
+
+void ModelNodeMetaObject::propertyWritten(int index)
+{
+ if (!m_enabled)
+ return;
+
+ QString propName = QString::fromUtf8(name(index));
+ QVariant value = operator[](index);
+
+ QScriptValue sv = m_seng->newObject();
+ sv.setProperty(propName, m_seng->newVariant(value));
+ m_obj->m_node->setObjectValue(sv, false);
+
+ m_obj->m_node->changedProperty(propName);
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativelistmodel_p.h b/src/declarative/util/qdeclarativelistmodel_p.h
index 6aff9c6..fe42ef6 100644
--- a/src/declarative/util/qdeclarativelistmodel_p.h
+++ b/src/declarative/util/qdeclarativelistmodel_p.h
@@ -63,6 +63,7 @@ class FlatListModel;
class NestedListModel;
class QDeclarativeListModelWorkerAgent;
struct ModelNode;
+class FlatListScriptClass;
class Q_DECLARATIVE_EXPORT QDeclarativeListModel : public QListModelInterface
{
Q_OBJECT
@@ -96,16 +97,21 @@ Q_SIGNALS:
private:
friend class QDeclarativeListModelParser;
friend class QDeclarativeListModelWorkerAgent;
+ friend class FlatListModel;
+ friend class FlatListScriptClass;
friend struct ModelNode;
- QDeclarativeListModel(bool workerCopy, QObject *parent=0);
+ // Constructs a flat list model for a worker agent
+ QDeclarativeListModel(const QDeclarativeListModel *orig, QDeclarativeListModelWorkerAgent *parent);
+
bool flatten();
- bool modifyCheck();
+ bool inWorkerThread() const;
+
+ inline bool canMove(int from, int to, int n) const { return !(from+n > count() || to+n > count() || from < 0 || to < 0 || n < 0); }
QDeclarativeListModelWorkerAgent *m_agent;
NestedListModel *m_nested;
FlatListModel *m_flat;
- bool m_isWorkerCopy;
};
// ### FIXME
diff --git a/src/declarative/util/qdeclarativelistmodel_p_p.h b/src/declarative/util/qdeclarativelistmodel_p_p.h
index 8231414..d2d40ee 100644
--- a/src/declarative/util/qdeclarativelistmodel_p_p.h
+++ b/src/declarative/util/qdeclarativelistmodel_p_p.h
@@ -54,9 +54,11 @@
//
#include "private/qdeclarativelistmodel_p.h"
-
-#include "qdeclarative.h"
#include "private/qdeclarativeengine_p.h"
+#include "private/qdeclarativeopenmetaobject_p.h"
+#include "qdeclarative.h"
+
+#include <private/qscriptdeclarativeclass_p.h>
QT_BEGIN_HEADER
@@ -68,6 +70,8 @@ class QDeclarativeOpenMetaObject;
class QScriptEngine;
class QDeclarativeListModelWorkerAgent;
struct ModelNode;
+class FlatListScriptClass;
+class FlatNodeData;
class FlatListModel
{
@@ -94,16 +98,82 @@ public:
private:
friend class QDeclarativeListModelWorkerAgent;
friend class QDeclarativeListModel;
+ friend class FlatListScriptClass;
+ friend class FlatNodeData;
bool addValue(const QScriptValue &value, QHash<int, QVariant> *row, QList<int> *roles);
+ void insertedNode(int index);
+ void removedNode(int index);
+ void moveNodes(int from, int to, int n);
QScriptEngine *m_scriptEngine;
QHash<int, QString> m_roles;
QHash<QString, int> m_strings;
QList<QHash<int, QVariant> > m_values;
QDeclarativeListModel *m_listModel;
+
+ FlatListScriptClass *m_scriptClass;
+ QList<FlatNodeData *> m_nodeData;
+ QDeclarativeListModelWorkerAgent *m_parentAgent;
+};
+
+
+/*
+ Created when get() is called on a FlatListModel. This allows changes to the
+ object returned by get() to be tracked, and passed onto the model.
+*/
+class FlatListScriptClass : public QScriptDeclarativeClass
+{
+public:
+ FlatListScriptClass(FlatListModel *model, QScriptEngine *seng);
+
+ Value property(Object *, const Identifier &);
+ void setProperty(Object *, const Identifier &name, const QScriptValue &);
+ QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, QScriptClass::QueryFlags flags);
+ bool compare(Object *, Object *);
+
+private:
+ FlatListModel *m_model;
+};
+
+/*
+ FlatNodeData and FlatNodeObjectData allow objects returned by get() to still
+ point to the correct list index if move(), insert() or remove() are called.
+*/
+struct FlatNodeObjectData;
+class FlatNodeData
+{
+public:
+ FlatNodeData(int i)
+ : index(i) {}
+
+ ~FlatNodeData();
+
+ void addData(FlatNodeObjectData *data);
+ void removeData(FlatNodeObjectData *data);
+
+ int index;
+
+private:
+ QSet<FlatNodeObjectData*> objects;
+};
+
+struct FlatNodeObjectData : public QScriptDeclarativeClass::Object
+{
+ FlatNodeObjectData(FlatNodeData *data) : nodeData(data) {
+ nodeData->addData(this);
+ }
+
+ ~FlatNodeObjectData() {
+ if (nodeData)
+ nodeData->removeData(this);
+ }
+
+ FlatNodeData *nodeData;
};
+
+
class NestedListModel
{
public:
@@ -134,25 +204,50 @@ public:
QDeclarativeListModel *m_listModel;
private:
+ friend struct ModelNode;
mutable QStringList roleStrings;
mutable bool _rolesOk;
};
+class ModelNodeMetaObject;
class ModelObject : public QObject
{
Q_OBJECT
public:
- ModelObject();
+ ModelObject(ModelNode *node, NestedListModel *model, QScriptEngine *seng);
void setValue(const QByteArray &name, const QVariant &val);
+ void setNodeUpdatesEnabled(bool enable);
+
+ NestedListModel *m_model;
+ ModelNode *m_node;
private:
- QDeclarativeOpenMetaObject *_mo;
+ ModelNodeMetaObject *m_meta;
};
+class ModelNodeMetaObject : public QDeclarativeOpenMetaObject
+{
+public:
+ ModelNodeMetaObject(QScriptEngine *seng, ModelObject *object);
+
+ bool m_enabled;
+
+protected:
+ void propertyWritten(int index);
+
+private:
+ QScriptEngine *m_seng;
+ ModelObject *m_obj;
+};
+
+
+/*
+ A ModelNode is created for each item in a NestedListModel.
+*/
struct ModelNode
{
- ModelNode();
+ ModelNode(NestedListModel *model);
~ModelNode();
QList<QVariant> values;
@@ -160,35 +255,22 @@ struct ModelNode
void clear();
- QDeclarativeListModel *model(const NestedListModel *model) {
- if (!modelCache) {
- modelCache = new QDeclarativeListModel;
- QDeclarativeEngine::setContextForObject(modelCache,QDeclarativeEngine::contextForObject(model->m_listModel));
- modelCache->m_nested->_root = this; // ListModel defaults to nestable model
- }
- return modelCache;
- }
-
- ModelObject *object(const NestedListModel *model) {
- if (!objectCache) {
- objectCache = new ModelObject();
- QHash<QString, ModelNode *>::iterator it;
- for (it = properties.begin(); it != properties.end(); ++it) {
- objectCache->setValue(it.key().toUtf8(), model->valueForNode(*it));
- }
- }
- return objectCache;
- }
+ QDeclarativeListModel *model(const NestedListModel *model);
+ ModelObject *object(const NestedListModel *model);
-
- void setObjectValue(const QScriptValue& valuemap);
+ void setObjectValue(const QScriptValue& valuemap, bool writeToCache = true);
void setListValue(const QScriptValue& valuelist);
void setProperty(const QString& prop, const QVariant& val);
+ void changedProperty(const QString &name) const;
+ void updateListIndexes();
static void dump(ModelNode *node, int ind);
QDeclarativeListModel *modelCache;
ModelObject *objectCache;
bool isArray;
+
+ NestedListModel *m_model;
+ int listIndex; // only used for top-level nodes within a list
};
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
index d9df169..6804d4a 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
@@ -83,11 +83,11 @@ void QDeclarativeListModelWorkerAgent::Data::changedChange(int index, int count)
}
QDeclarativeListModelWorkerAgent::QDeclarativeListModelWorkerAgent(QDeclarativeListModel *model)
-: m_engine(0), m_ref(1), m_orig(model), m_copy(new QDeclarativeListModel(true, this))
+ : m_engine(0),
+ m_ref(1),
+ m_orig(model),
+ m_copy(new QDeclarativeListModel(model, this))
{
- m_copy->m_flat->m_roles = m_orig->m_flat->m_roles;
- m_copy->m_flat->m_strings = m_orig->m_flat->m_strings;
- m_copy->m_flat->m_values = m_orig->m_flat->m_values;
}
QDeclarativeListModelWorkerAgent::~QDeclarativeListModelWorkerAgent()
@@ -194,6 +194,11 @@ void QDeclarativeListModelWorkerAgent::sync()
mutex.unlock();
}
+void QDeclarativeListModelWorkerAgent::changedData(int index, int count)
+{
+ data.changedChange(index, count);
+}
+
bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
{
if (e->type() == QEvent::User) {
@@ -216,6 +221,24 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
orig->m_strings = copy->m_strings;
orig->m_values = copy->m_values;
+ // update the orig->m_nodeData list
+ for (int ii = 0; ii < changes.count(); ++ii) {
+ const Change &change = changes.at(ii);
+ switch (change.type) {
+ case Change::Inserted:
+ orig->insertedNode(change.index);
+ break;
+ case Change::Removed:
+ orig->removedNode(change.index);
+ break;
+ case Change::Moved:
+ orig->moveNodes(change.index, change.to, change.count);
+ break;
+ case Change::Changed:
+ break;
+ }
+ }
+
syncDone.wakeAll();
locker.unlock();
@@ -232,7 +255,7 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
emit m_orig->itemsMoved(change.index, change.to, change.count);
break;
case Change::Changed:
- emit m_orig->itemsChanged(change.index, change.to, orig->m_roles.keys());
+ emit m_orig->itemsChanged(change.index, change.count, orig->m_roles.keys());
break;
}
}
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
index 01da374..10c3bca 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
@@ -67,6 +67,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeListModel;
+class FlatListScriptClass;
class QDeclarativeListModelWorkerAgent : public QObject
{
@@ -115,6 +116,7 @@ protected:
private:
friend class QDeclarativeWorkerScriptEnginePrivate;
+ friend class FlatListScriptClass;
QScriptEngine *m_engine;
struct Change {
@@ -141,6 +143,8 @@ private:
QDeclarativeListModel *list;
};
+ void changedData(int index, int count);
+
QAtomicInt m_ref;
QDeclarativeListModel *m_orig;
QDeclarativeListModel *m_copy;
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 47b502d..f0ed80b 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -209,8 +209,9 @@ Q_SIGNALS:
protected:
void run() {
+ m_mutex.lock();
+
while (!m_quit) {
- m_mutex.lock();
if (!m_jobs.isEmpty())
m_currentJob = m_jobs.dequeue();
m_mutex.unlock();
@@ -230,12 +231,13 @@ protected:
m_mutex.lock();
if (m_currentJob.queryId != -1 && m_abortQueryId != m_currentJob.queryId)
emit queryCompleted(r);
- if (m_jobs.isEmpty())
+ if (m_jobs.isEmpty() && !m_quit)
m_condition.wait(&m_mutex);
m_currentJob.queryId = -1;
m_abortQueryId = -1;
- m_mutex.unlock();
}
+
+ m_mutex.unlock();
}
private:
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 66a861d..1e502bd 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1177,8 +1177,12 @@ Qt::HANDLE QPixmap::handle() const
{
#if defined(Q_WS_X11)
const QPixmapData *pd = pixmapData();
- if (pd && pd->classId() == QPixmapData::X11Class)
- return static_cast<const QX11PixmapData*>(pd)->handle();
+ if (pd) {
+ if (pd->classId() == QPixmapData::X11Class)
+ return static_cast<const QX11PixmapData*>(pd)->handle();
+ else
+ qWarning("QPixmap::handle(): Pixmap is not an X11 class pixmap");
+ }
#endif
return 0;
}
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index 70770c4..26bffcc 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -764,10 +764,17 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp
}
if (transposed == 0) {
- qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()),
- temp.width(), temp.height(), temp.bytesPerLine(),
- reinterpret_cast<quint32*>(img.bits()),
- img.bytesPerLine());
+ if (img.depth() == 8) {
+ qt_memrotate90(reinterpret_cast<const quint8*>(temp.bits()),
+ temp.width(), temp.height(), temp.bytesPerLine(),
+ reinterpret_cast<quint8*>(img.bits()),
+ img.bytesPerLine());
+ } else {
+ qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()),
+ temp.width(), temp.height(), temp.bytesPerLine(),
+ reinterpret_cast<quint32*>(img.bits()),
+ img.bytesPerLine());
+ }
} else {
img = temp;
}
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 2fd2f46..43d5772 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -494,6 +494,7 @@ bool QApplicationPrivate::fade_tooltip = false;
bool QApplicationPrivate::animate_toolbox = false;
bool QApplicationPrivate::widgetCount = false;
bool QApplicationPrivate::load_testability = false;
+QString QApplicationPrivate::qmljsDebugArguments;
#ifdef QT_KEYPAD_NAVIGATION
# ifdef Q_OS_SYMBIAN
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional;
@@ -565,6 +566,8 @@ void QApplicationPrivate::process_cmdline()
QString s;
if (arg == "-qdevel" || arg == "-qdebug") {
// obsolete argument
+ } else if (arg.indexOf("-qmljsdebugger=", 0) != -1) {
+ qmljsDebugArguments = QString::fromLocal8Bit(arg.right(arg.length() - 15));
} else if (arg.indexOf("-style=", 0) != -1) {
s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower());
} else if (arg == "-style" && i < argc-1) {
@@ -670,6 +673,9 @@ void QApplicationPrivate::process_cmdline()
Qt::RightToLeft
\o -graphicssystem, sets the backend to be used for on-screen widgets
and QPixmaps. Available options are \c{raster} and \c{opengl}.
+ \o -qmljsdebugger=, activates the QML/JS debugger with a specified port.
+ The value must be of format port:1234[,block], where block is optional
+ and will make the application wait until a debugger connects to it.
\endlist
The X11 version of Qt supports some traditional X11 command line options:
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 8dc16e0..aa3a6d5 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -446,6 +446,8 @@ public:
static bool animate_toolbox;
static bool widgetCount; // Coupled with -widgetcount switch
static bool load_testability; // Coupled with -testability switch
+ static QString qmljsDebugArguments; // a string containing arguments for js/qml debugging.
+
#ifdef Q_WS_MAC
static bool native_modal_dialog_active;
#endif
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 7a5dec4..9506006 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -43,6 +43,7 @@
#include "qstatictext_p.h"
#include <private/qtextengine_p.h>
#include <private/qfontengine_p.h>
+#include <qabstracttextdocumentlayout.h>
#include <QtGui/qapplication.h>
@@ -654,7 +655,9 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
p->save();
p->translate(topLeftPosition);
- document.drawContents(p);
+ QAbstractTextDocumentLayout::PaintContext ctx;
+ ctx.palette.setColor(QPalette::Text, p->pen().color());
+ document.documentLayout()->draw(p, ctx);
p->restore();
if (textWidth >= 0.0)
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index ab2bdea..83ba15a 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -168,11 +168,11 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe
if (action->action->menu()->actions().size() > 0) {
for (int c2= 0; c2 < action->action->menu()->actions().size(); ++c2) {
- QSymbianMenuAction *symbianAction2 = new QSymbianMenuAction;
+ QScopedPointer<QSymbianMenuAction> symbianAction2(new QSymbianMenuAction);
symbianAction2->action = action->action->menu()->actions().at(c2);
QMenu * menu = symbianAction2->action->menu();
symbianAction2->command = qt_symbian_menu_static_cmd_id++;
- qt_symbian_insert_action(symbianAction2, &(menuItem->children));
+ qt_symbian_insert_action(symbianAction2.data(), &(menuItem->children));
}
}
@@ -432,11 +432,11 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a
void QMenuBarPrivate::QSymbianMenuBarPrivate::insertNativeMenuItems(const QList<QAction*> &actions)
{
for (int i = 0; i <actions.size(); ++i) {
- QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction;
+ QScopedPointer<QSymbianMenuAction> symbianActionTopLevel(new QSymbianMenuAction);
symbianActionTopLevel->action = actions.at(i);
symbianActionTopLevel->parent = 0;
symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++;
- qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus);
+ qt_symbian_insert_action(symbianActionTopLevel.data(), &symbianMenus);
}
}
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index ae4d257..ccdbb20 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -743,7 +743,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
return;
// try to get a free AND connected socket
for (int i = 0; i < channelCount; ++i) {
- if (!channels[i].isSocketBusy() && channels[i].socket->state() == QAbstractSocket::ConnectedState) {
+ if (!channels[i].reply && !channels[i].isSocketBusy() && channels[i].socket->state() == QAbstractSocket::ConnectedState) {
dequeueAndSendRequest(channels[i].socket);
}
}
@@ -753,7 +753,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
return;
// try to get a free unconnected socket
for (int i = 0; i < channelCount; ++i) {
- if (!channels[i].isSocketBusy()) {
+ if (!channels[i].reply && !channels[i].isSocketBusy()) {
dequeueAndSendRequest(channels[i].socket);
}
}
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
index 9bc099d..7b0b8a2 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
@@ -509,6 +509,7 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, c
m_dash_stroker.setDashPattern(pen.dashPattern());
m_dash_stroker.setStrokeWidth(cosmetic ? width * m_inv_scale : width);
+ m_dash_stroker.setDashOffset(pen.dashOffset());
m_dash_stroker.setMiterLimit(pen.miterLimit());
m_dash_stroker.setClipRect(clip);
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index 9a8b243..994947b 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -67,7 +67,13 @@
when the pbuffer contents change, eliminating the need for
additional copy operations. This is supported only on Windows
and Mac OS X systems that provide the \c render_texture
- extension.
+ extension. Note that under Windows, a multi-sampled pbuffer
+ can't be used in conjunction with the \c render_texture
+ extension. If a multi-sampled pbuffer is requested under
+ Windows, the \c render_texture extension is turned off for that
+ pbuffer.
+
+
\endlist
Pbuffers are provided by the OpenGL \c pbuffer extension; call
diff --git a/src/opengl/qglpixelbuffer_win.cpp b/src/opengl/qglpixelbuffer_win.cpp
index 8d0d105..b55f383 100644
--- a/src/opengl/qglpixelbuffer_win.cpp
+++ b/src/opengl/qglpixelbuffer_win.cpp
@@ -167,6 +167,11 @@ typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, con
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
#endif
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif
+
QGLFormat pfiToQGLFormat(HDC hdc, int pfi);
static void qt_format_to_attrib_list(bool has_render_texture, const QGLFormat &f, int attribs[])
@@ -226,14 +231,12 @@ static void qt_format_to_attrib_list(bool has_render_texture, const QGLFormat &f
attribs[i++] = WGL_FLOAT_COMPONENTS_NV;
attribs[i++] = TRUE;
}
- // sample buffers doesn't work in conjunction with the render_texture extension
- // so igonre that for now
- // if (f.sampleBuffers()) {
- // attribs[i++] = WGL_SAMPLE_BUFFERS_ARB;
- // attribs[i++] = 1;
- // attribs[i++] = WGL_SAMPLES_ARB;
- // attribs[i++] = f.samples() == -1 ? 16 : f.samples();
- // }
+ if (f.sampleBuffers()) {
+ attribs[i++] = WGL_SAMPLE_BUFFERS_ARB;
+ attribs[i++] = 1;
+ attribs[i++] = WGL_SAMPLES_ARB;
+ attribs[i++] = f.samples() == -1 ? 16 : f.samples();
+ }
attribs[i] = 0;
}
@@ -257,12 +260,17 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge
dc = GetDC(dmy.winId());
Q_ASSERT(dc);
- PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB =
- (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB");
+ // sample buffers doesn't work in conjunction with the render_texture extension
+ if (f.sampleBuffers()) {
+ has_render_texture = false;
+ } else {
+ PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB =
+ (PFNWGLGETEXTENSIONSSTRINGARBPROC) wglGetProcAddress("wglGetExtensionsStringARB");
- if (wglGetExtensionsStringARB) {
- QString extensions(QLatin1String(wglGetExtensionsStringARB(dc)));
- has_render_texture = extensions.contains(QLatin1String("WGL_ARB_render_texture"));
+ if (wglGetExtensionsStringARB) {
+ QString extensions(QLatin1String(wglGetExtensionsStringARB(dc)));
+ has_render_texture = extensions.contains(QLatin1String("WGL_ARB_render_texture"));
+ }
}
int attribs[40];
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 12c487d..a5ec12f 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -921,6 +921,7 @@ static inline QPainterPath strokeForPath(const QPainterPath &path, const QPen &c
stroker.setCapStyle(cpen.capStyle());
stroker.setJoinStyle(cpen.joinStyle());
stroker.setMiterLimit(cpen.miterLimit());
+ stroker.setDashOffset(cpen.dashOffset());
qreal width = cpen.widthF();
if (width == 0)
diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.h b/src/plugins/graphicssystems/meego/qmeegoextensions.h
index 7f219de..f1a74f5 100644
--- a/src/plugins/graphicssystems/meego/qmeegoextensions.h
+++ b/src/plugins/graphicssystems/meego/qmeegoextensions.h
@@ -43,7 +43,6 @@
#define MEXTENSIONS_H
#include <EGL/egl.h>
-#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <private/qgl_p.h>
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index 1a79f63..0f66d72 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -1440,8 +1440,8 @@ EXPORTS
?d_func@QBuffer@@ABEPBVQBufferPrivate@@XZ @ 1439 NONAME ; class QBufferPrivate const * QBuffer::d_func(void) const
?d_func@QCoreApplication@@AAEPAVQCoreApplicationPrivate@@XZ @ 1440 NONAME ; class QCoreApplicationPrivate * QCoreApplication::d_func(void)
?d_func@QCoreApplication@@ABEPBVQCoreApplicationPrivate@@XZ @ 1441 NONAME ; class QCoreApplicationPrivate const * QCoreApplication::d_func(void) const
- ?d_func@QDir@@AAEPAVQDirPrivate@@XZ @ 1442 NONAME ; class QDirPrivate * QDir::d_func(void)
- ?d_func@QDir@@ABEPBVQDirPrivate@@XZ @ 1443 NONAME ; class QDirPrivate const * QDir::d_func(void) const
+ ?d_func@QDir@@AAEPAVQDirPrivate@@XZ @ 1442 NONAME ABSENT ; class QDirPrivate * QDir::d_func(void)
+ ?d_func@QDir@@ABEPBVQDirPrivate@@XZ @ 1443 NONAME ABSENT ; class QDirPrivate const * QDir::d_func(void) const
?d_func@QEventDispatcherSymbian@@AAEPAVQAbstractEventDispatcherPrivate@@XZ @ 1444 NONAME ; class QAbstractEventDispatcherPrivate * QEventDispatcherSymbian::d_func(void)
?d_func@QEventDispatcherSymbian@@ABEPBVQAbstractEventDispatcherPrivate@@XZ @ 1445 NONAME ; class QAbstractEventDispatcherPrivate const * QEventDispatcherSymbian::d_func(void) const
?d_func@QEventLoop@@AAEPAVQEventLoopPrivate@@XZ @ 1446 NONAME ; class QEventLoopPrivate * QEventLoop::d_func(void)
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 0193381..cf2f325 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -215,7 +215,7 @@ EXPORTS
?clear@QDeclarativeListReference@@QBE_NXZ @ 214 NONAME ; bool QDeclarativeListReference::clear(void) const
?parentChanged@QDeclarativeItem@@IAEXPAV1@@Z @ 215 NONAME ; void QDeclarativeItem::parentChanged(class QDeclarativeItem *)
?columnNumber@QDeclarativeDebugFileReference@@QBEHXZ @ 216 NONAME ; int QDeclarativeDebugFileReference::columnNumber(void) const
- ??0QDeclarativeListModel@@AAE@_NPAVQObject@@@Z @ 217 NONAME ; QDeclarativeListModel::QDeclarativeListModel(bool, class QObject *)
+ ??0QDeclarativeListModel@@AAE@_NPAVQObject@@@Z @ 217 NONAME ABSENT ; QDeclarativeListModel::QDeclarativeListModel(bool, class QObject *)
?apply@QDeclarativeState@@QAEXPAVQDeclarativeStateGroup@@PAVQDeclarativeTransition@@PAV1@@Z @ 218 NONAME ; void QDeclarativeState::apply(class QDeclarativeStateGroup *, class QDeclarativeTransition *, class QDeclarativeState *)
?isValid@QDeclarativeDomProperty@@QBE_NXZ @ 219 NONAME ; bool QDeclarativeDomProperty::isValid(void) const
?trUtf8@QDeclarativeDebugExpressionQuery@@SA?AVQString@@PBD0@Z @ 220 NONAME ; class QString QDeclarativeDebugExpressionQuery::trUtf8(char const *, char const *)
@@ -1712,4 +1712,7 @@ EXPORTS
?setScript@QDeclarativeScriptAction@@QAEXABVQDeclarativeScriptString@@@Z @ 1711 NONAME ; void QDeclarativeScriptAction::setScript(class QDeclarativeScriptString const &)
?metaObject@QDeclarativeScriptAction@@UBEPBUQMetaObject@@XZ @ 1712 NONAME ; struct QMetaObject const * QDeclarativeScriptAction::metaObject(void) const
?getPointer@QDeclarativeAbstractBinding@@SA?AV?$QWeakPointer@VQDeclarativeAbstractBinding@@@@PAV1@@Z @ 1713 NONAME ; class QWeakPointer<class QDeclarativeAbstractBinding> QDeclarativeAbstractBinding::getPointer(class QDeclarativeAbstractBinding *)
+ ??0QDeclarativeListModel@@AAE@PBV0@PAVQDeclarativeListModelWorkerAgent@@@Z @ 1714 NONAME ; QDeclarativeListModel::QDeclarativeListModel(class QDeclarativeListModel const *, class QDeclarativeListModelWorkerAgent *)
+ ?inWorkerThread@QDeclarativeListModel@@ABE_NXZ @ 1715 NONAME ; bool QDeclarativeListModel::inWorkerThread(void) const
+ ?canMove@QDeclarativeListModel@@ABE_NHHH@Z @ 1716 NONAME ; bool QDeclarativeListModel::canMove(int, int, int) const
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index f9e88d7..7805dae 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -2645,7 +2645,7 @@ EXPORTS
?childItems@QGraphicsItem@@QBE?AV?$QList@PAVQGraphicsItem@@@@XZ @ 2644 NONAME ; class QList<class QGraphicsItem *> QGraphicsItem::childItems(void) const
?children@QGraphicsItem@@QBE?AV?$QList@PAVQGraphicsItem@@@@XZ @ 2645 NONAME ; class QList<class QGraphicsItem *> QGraphicsItem::children(void) const
?childrenBoundingRect@QGraphicsItem@@QBE?AVQRectF@@XZ @ 2646 NONAME ; class QRectF QGraphicsItem::childrenBoundingRect(void) const
- ?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@@Z @ 2647 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *)
+ ?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@@Z @ 2647 NONAME ABSENT ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *)
?childrenCheckState@QTreeWidgetItem@@ABE?AVQVariant@@H@Z @ 2648 NONAME ; class QVariant QTreeWidgetItem::childrenCheckState(int) const
?childrenClippedToShape@QGraphicsItemPrivate@@QBE_NXZ @ 2649 NONAME ; bool QGraphicsItemPrivate::childrenClippedToShape(void) const
?childrenCollapsible@QSplitter@@QBE_NXZ @ 2650 NONAME ; bool QSplitter::childrenCollapsible(void) const
@@ -4078,7 +4078,7 @@ EXPORTS
?editorEvent@QAbstractItemDelegate@@UAE_NPAVQEvent@@PAVQAbstractItemModel@@ABVQStyleOptionViewItem@@ABVQModelIndex@@@Z @ 4077 NONAME ; bool QAbstractItemDelegate::editorEvent(class QEvent *, class QAbstractItemModel *, class QStyleOptionViewItem const &, class QModelIndex const &)
?editorEvent@QItemDelegate@@MAE_NPAVQEvent@@PAVQAbstractItemModel@@ABVQStyleOptionViewItem@@ABVQModelIndex@@@Z @ 4078 NONAME ; bool QItemDelegate::editorEvent(class QEvent *, class QAbstractItemModel *, class QStyleOptionViewItem const &, class QModelIndex const &)
?editorEvent@QStyledItemDelegate@@MAE_NPAVQEvent@@PAVQAbstractItemModel@@ABVQStyleOptionViewItem@@ABVQModelIndex@@@Z @ 4079 NONAME ; bool QStyledItemDelegate::editorEvent(class QEvent *, class QAbstractItemModel *, class QStyleOptionViewItem const &, class QModelIndex const &)
- ?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@XZ @ 4080 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(void) const
+ ?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@XZ @ 4080 NONAME ABSENT ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(void) const
?effectiveOpacity@QGraphicsItem@@QBEMXZ @ 4081 NONAME ; float QGraphicsItem::effectiveOpacity(void) const
?effectiveOpacity@QGraphicsItemPrivate@@QBEMXZ @ 4082 NONAME ; float QGraphicsItemPrivate::effectiveOpacity(void) const
?effectiveRectFor@QWidgetPrivate@@QBE?AVQRect@@ABV2@@Z @ 4083 NONAME ; class QRect QWidgetPrivate::effectiveRectFor(class QRect const &) const
@@ -12886,4 +12886,10 @@ EXPORTS
?flushDetachedPixmaps@QPixmapCache@@SAXXZ @ 12885 NONAME ; void QPixmapCache::flushDetachedPixmaps(void)
?replayLastMouseEvent@QGraphicsViewPrivate@@QAEXXZ @ 12886 NONAME ; void QGraphicsViewPrivate::replayLastMouseEvent(void)
?children_clear@QGraphicsItemPrivate@@SAXPAV?$QDeclarativeListProperty@VQGraphicsObject@@@@@Z @ 12887 NONAME ; void QGraphicsItemPrivate::children_clear(class QDeclarativeListProperty<class QGraphicsObject> *)
+ ?timeout@QTapAndHoldGesture@@SAHXZ @ 12888 NONAME ; int QTapAndHoldGesture::timeout(void)
+ ?lastRightBearing@QFontEngine@@IAE?AUQFixed@@ABUQGlyphLayout@@_N@Z @ 12889 NONAME ; struct QFixed QFontEngine::lastRightBearing(struct QGlyphLayout const &, bool)
+ ?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@PAVQGraphicsItem@@@Z @ 12890 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, class QGraphicsItem *)
+ ?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12891 NONAME ; void QTapAndHoldGesture::setTimeout(int)
+ ?qmljsDebugArguments@QApplicationPrivate@@2VQString@@A @ 12892 NONAME ; class QString QApplicationPrivate::qmljsDebugArguments
+ ?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@PAVQGraphicsItem@@@Z @ 12893 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(class QGraphicsItem *) const
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 2016ec7..11dee4d 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -552,9 +552,9 @@ EXPORTS
_ZN21QDeclarativeListModel6removeEi @ 551 NONAME
_ZN21QDeclarativeListModel7flattenEv @ 552 NONAME
_ZN21QDeclarativeListModelC1EP7QObject @ 553 NONAME
- _ZN21QDeclarativeListModelC1EbP7QObject @ 554 NONAME
+ _ZN21QDeclarativeListModelC1EbP7QObject @ 554 NONAME ABSENT
_ZN21QDeclarativeListModelC2EP7QObject @ 555 NONAME
- _ZN21QDeclarativeListModelC2EbP7QObject @ 556 NONAME
+ _ZN21QDeclarativeListModelC2EbP7QObject @ 556 NONAME ABSENT
_ZN21QDeclarativeListModelD0Ev @ 557 NONAME
_ZN21QDeclarativeListModelD1Ev @ 558 NONAME
_ZN21QDeclarativeListModelD2Ev @ 559 NONAME
@@ -1744,4 +1744,7 @@ EXPORTS
_ZThn12_N24QDeclarativeScriptActionD1Ev @ 1743 NONAME
_ZThn8_N24QDeclarativeScriptActionD0Ev @ 1744 NONAME
_ZThn8_N24QDeclarativeScriptActionD1Ev @ 1745 NONAME
+ _ZN21QDeclarativeListModelC1EPKS_P32QDeclarativeListModelWorkerAgent @ 1746 NONAME
+ _ZN21QDeclarativeListModelC2EPKS_P32QDeclarativeListModelWorkerAgent @ 1747 NONAME
+ _ZNK21QDeclarativeListModel14inWorkerThreadEv @ 1748 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 47e893b..4442d33 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12094,4 +12094,7 @@ EXPORTS
_ZN18QTapAndHoldGesture7timeoutEv @ 12093 NONAME
_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12094 NONAME ABSENT
_ZN20QGraphicsItemPrivate14children_clearEP24QDeclarativeListPropertyI15QGraphicsObjectE @ 12095 NONAME
+ _ZN19QApplicationPrivate19qmljsDebugArgumentsE @ 12096 NONAME DATA 4
+ _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFP13QGraphicsItem @ 12097 NONAME
+ _ZNK20QGraphicsItemPrivate21effectiveBoundingRectEP13QGraphicsItem @ 12098 NONAME