From 0948de26bca9a68a354b436895bdf9e2db9c4288 Mon Sep 17 00:00:00 2001
From: Lorn Potter <lorn.potter@nokia.com>
Date: Tue, 8 Jun 2010 04:40:42 +1000
Subject: initial connman bearer backend.

still needs work, debugging, additional threading support, and probably
refactoring.

This includes a connman dbus service wrapper that has more functionality
than is needed by the bearer backend but still missing some
'set' functionality for a complete connman wrapper.

Developed with wifi/desktop on 'lucid' kubuntu, using the connman available at
http://ppa.launchpad.net/indicator-network-developers/ppa/ubuntu
---
 src/plugins/bearer/bearer.pro                      |    3 +-
 src/plugins/bearer/connman/connman.pro             |   19 +
 src/plugins/bearer/connman/main.cpp                |   93 ++
 src/plugins/bearer/connman/qconnmanengine.cpp      |  651 ++++++++++++
 src/plugins/bearer/connman/qconnmanengine.h        |  144 +++
 .../bearer/connman/qconnmanservice_linux.cpp       | 1038 ++++++++++++++++++++
 .../bearer/connman/qconnmanservice_linux_p.h       |  377 +++++++
 7 files changed, 2324 insertions(+), 1 deletion(-)
 create mode 100644 src/plugins/bearer/connman/connman.pro
 create mode 100644 src/plugins/bearer/connman/main.cpp
 create mode 100644 src/plugins/bearer/connman/qconnmanengine.cpp
 create mode 100644 src/plugins/bearer/connman/qconnmanengine.h
 create mode 100644 src/plugins/bearer/connman/qconnmanservice_linux.cpp
 create mode 100644 src/plugins/bearer/connman/qconnmanservice_linux_p.h

diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index f95e8af..6d8f7f2 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -4,7 +4,8 @@ contains(QT_CONFIG, dbus) {
     contains(QT_CONFIG, icd) {
         SUBDIRS += icd
     } else {
-        SUBDIRS += networkmanager generic
+        SUBDIRS += generic
+        !mac:SUBDIRS += connman networkmanager 
     }
 }
 
diff --git a/src/plugins/bearer/connman/connman.pro b/src/plugins/bearer/connman/connman.pro
new file mode 100644
index 0000000..4be752b
--- /dev/null
+++ b/src/plugins/bearer/connman/connman.pro
@@ -0,0 +1,19 @@
+TARGET = qconnmanbearer
+include(../../qpluginbase.pri)
+
+QT = core network dbus
+
+HEADERS += qconnmanservice_linux_p.h \
+           qconnmanengine.h \
+           ../qnetworksession_impl.h \
+           ../qbearerengine_impl.h
+
+SOURCES += main.cpp \
+           qconnmanservice_linux.cpp \
+           qconnmanengine.cpp \
+           ../qnetworksession_impl.cpp
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer
+target.path += $$[QT_INSTALL_PLUGINS]/bearer
+INSTALLS += target
+
diff --git a/src/plugins/bearer/connman/main.cpp b/src/plugins/bearer/connman/main.cpp
new file mode 100644
index 0000000..d483cf0
--- /dev/null
+++ b/src/plugins/bearer/connman/main.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qconnmanengine.h"
+
+#include <QtNetwork/private/qbearerplugin_p.h>
+
+#include <QtCore/qdebug.h>
+
+#ifndef QT_NO_BEARERMANAGEMENT
+#ifndef QT_NO_DBUS
+
+QT_BEGIN_NAMESPACE
+
+class QConnmanEnginePlugin : public QBearerEnginePlugin
+{
+public:
+    QConnmanEnginePlugin();
+    ~QConnmanEnginePlugin();
+
+    QStringList keys() const;
+    QBearerEngine *create(const QString &key) const;
+};
+
+QConnmanEnginePlugin::QConnmanEnginePlugin()
+{
+}
+
+QConnmanEnginePlugin::~QConnmanEnginePlugin()
+{
+}
+
+QStringList QConnmanEnginePlugin::keys() const
+{
+    return QStringList() << QLatin1String("connman");
+}
+
+QBearerEngine *QConnmanEnginePlugin::create(const QString &key) const
+{
+    if (key == QLatin1String("connman")) {
+        QConnmanEngine *engine = new QConnmanEngine;
+        if (engine->connmanAvailable())
+            return engine;
+        else
+            delete engine;
+    }
+    return 0;
+}
+
+Q_EXPORT_STATIC_PLUGIN(QConnmanEnginePlugin)
+Q_EXPORT_PLUGIN2(qconnmanbearer, QConnmanEnginePlugin)
+
+QT_END_NAMESPACE
+
+#endif
+#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
new file mode 100644
index 0000000..e4cab92
--- /dev/null
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -0,0 +1,651 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qconnmanengine.h"
+#include "qconnmanservice_linux_p.h"
+#include "../qnetworksession_impl.h"
+
+#include <QtNetwork/private/qnetworkconfiguration_p.h>
+
+#include <QtNetwork/qnetworksession.h>
+
+#include <QtCore/qdebug.h>
+
+#include <QtDBus/QtDBus>
+#include <QtDBus/QDBusConnection>
+//#include <QtDBus/QDBusError>
+#include <QtDBus/QDBusInterface>
+#include <QtDBus/QDBusMessage>
+#include <QtDBus/QDBusReply>
+
+#ifndef QT_NO_BEARERMANAGEMENT
+#ifndef QT_NO_DBUS
+
+QT_BEGIN_NAMESPACE
+
+QConnmanEngine::QConnmanEngine(QObject *parent)
+:   QBearerEngineImpl(parent),
+    connmanManager(new QConnmanManagerInterface(this))
+{
+//    qWarning() << Q_FUNC_INFO;
+}
+
+QConnmanEngine::~QConnmanEngine()
+{
+}
+
+bool QConnmanEngine::connmanAvailable() const
+{
+    QMutexLocker locker(&mutex);
+    return connmanManager->isValid();
+}
+
+void QConnmanEngine::initialize()
+{
+    connect(connmanManager,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+            this,SLOT(propertyChangedContext(QString,QString,QDBusVariant)));
+
+    foreach(const QString techPath, connmanManager->getTechnologies()) {
+        QConnmanTechnologyInterface *tech;
+        tech = new QConnmanTechnologyInterface(techPath, this);
+
+        connect(tech,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                this,SLOT(technologyPropertyChangedContext(QString,QString,QDBusVariant)));
+
+        foreach(const QString devicePath,tech->getDevices()) {
+            QConnmanDeviceInterface *dev;
+            dev = new QConnmanDeviceInterface(devicePath);
+            connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                    this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
+            deviceMap.insert(techPath,QStringList() << devicePath);
+        }
+    }
+    // Get current list of access points.
+    getConfigurations();
+}
+
+QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
+{
+    QMutexLocker locker(&mutex);
+    foundConfigurations.clear();
+    getNetworkListing();
+    return foundConfigurations;
+}
+
+void QConnmanEngine::getNetworkListing()
+{
+    QMutexLocker locker(&mutex);
+
+    QMapIterator<QString,QStringList> i(deviceMap);
+    while(i.hasNext()) {
+        i.next();
+        QConnmanDeviceInterface dev(i.value().at(0));
+        if(dev.isValid()) {
+            foreach(const QString network,dev.getNetworks()) {
+                addNetworkConfiguration(network);
+            }
+        }
+    }
+}
+
+void QConnmanEngine::doRequestUpdate()
+{
+    getConfigurations();
+    emit updateCompleted();
+}
+
+QString QConnmanEngine::getInterfaceFromId(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+
+    QString servicePath = serviceFromId(id);
+    QString netPath = getNetworkForService(servicePath);
+
+    QMapIterator<QString,QStringList> i(deviceMap);
+    while(i.hasNext()) {
+     i.next();
+     if(i.value().count() > 0) {
+         QConnmanDeviceInterface dev(i.value().at(0));
+         foreach(const QString network, dev.getNetworks()) {
+             if(network == netPath) {
+                 return dev.getInterface();
+             }
+         }
+     }
+ }
+    return QString();
+}
+
+bool QConnmanEngine::hasIdentifier(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    return accessPointConfigurations.contains(id);
+}
+
+QString QConnmanEngine::bearerName(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    QConnmanServiceInterface serv(serviceFromId(id));
+    QString connectionType = serv.getType();
+
+    if (connectionType == "ethernet")
+        return QLatin1String("Ethernet");
+    else if (connectionType == "wifi")
+        return QLatin1String("WLAN");
+    else if (connectionType == "cellular") {
+        QString mode = serv.getMode();
+        if(mode == "gprs" || mode == "edge") {
+            return QLatin1String("2G");
+        } else if(mode == "umts") {
+            return QLatin1String("WCDMA");
+        }
+    }
+    else if (connectionType == "wimax")
+        return QLatin1String("WIMAX");
+
+    return QString();
+}
+
+void QConnmanEngine::connectToId(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    QConnmanServiceInterface serv(serviceFromId(id));
+    if(!serv.isValid()) {
+        emit connectionError(id, InterfaceLookupError);
+    } else {
+        serv.connect();
+    }
+}
+
+void QConnmanEngine::disconnectFromId(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    QConnmanServiceInterface serv(serviceFromId(id));
+    if(!serv.isValid()) {
+        emit connectionError(id, DisconnectionError);
+    } else {
+        serv.disconnect();
+    }
+}
+
+void QConnmanEngine::requestUpdate()
+{
+    QMutexLocker locker(&mutex);
+    QTimer::singleShot(0, this, SLOT(doRequestUpdate()));
+}
+
+QString QConnmanEngine::serviceFromId(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    foreach(QString service, connmanManager->getServices()) {
+        if (id == QString::number(qHash(service)))
+            return service;
+    }
+
+    return QString();
+}
+
+QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+
+    QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
+
+    if (!ptr)
+        return QNetworkSession::Invalid;
+
+    if (!ptr->isValid) {
+        return QNetworkSession::Invalid;
+    } else if ((ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
+        return QNetworkSession::Connected;
+    } else if ((ptr->state & QNetworkConfiguration::Discovered) ==
+                QNetworkConfiguration::Discovered) {
+        return QNetworkSession::Disconnected;
+    } else if ((ptr->state & QNetworkConfiguration::Defined) == QNetworkConfiguration::Defined) {
+        return QNetworkSession::NotAvailable;
+    } else if ((ptr->state & QNetworkConfiguration::Undefined) ==
+                QNetworkConfiguration::Undefined) {
+        return QNetworkSession::NotAvailable;
+    }
+
+    return QNetworkSession::Invalid;
+}
+
+quint64 QConnmanEngine::bytesWritten(const QString &id)
+{//TODO use connman counter API
+    QMutexLocker locker(&mutex);
+    quint64 result = 0;
+    QString devFile = getInterfaceFromId(id);
+    QFile tx("/sys/class/net/"+devFile+"/statistics/tx_bytes");
+    if(tx.exists() && tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
+        QTextStream in(&tx);
+        in >> result;
+        tx.close();
+    }
+    return result;
+}
+
+quint64 QConnmanEngine::bytesReceived(const QString &id)
+{//TODO use connman counter API
+    QMutexLocker locker(&mutex);
+    quint64 result = 0;
+    QString devFile = getInterfaceFromId(id);
+    QFile rx("/sys/class/net/"+devFile+"/statistics/rx_bytes");
+    if(rx.exists() && rx.open(QIODevice::ReadOnly | QIODevice::Text)) {
+        QTextStream in(&rx);
+        in >> result;
+        rx.close();
+    }
+    return result;
+}
+
+quint64 QConnmanEngine::startTime(const QString &/*id*/)
+{
+    // TODO
+    QMutexLocker locker(&mutex);
+    if (activeTime.isNull()) {
+        return 0;
+    }
+    return activeTime.secsTo(QDateTime::currentDateTime());
+}
+
+QNetworkConfigurationManager::Capabilities QConnmanEngine::capabilities() const
+{
+    return QNetworkConfigurationManager::ForcedRoaming |
+            QNetworkConfigurationManager::DataStatistics |
+           QNetworkConfigurationManager::CanStartAndStopInterfaces;
+}
+
+QNetworkSessionPrivate *QConnmanEngine::createSessionBackend()
+{
+     return new QNetworkSessionPrivateImpl;
+}
+
+QNetworkConfigurationPrivatePointer QConnmanEngine::defaultConfiguration()
+{
+    return QNetworkConfigurationPrivatePointer();
+}
+
+
+QString QConnmanEngine::getServiceForNetwork(const QString &netPath)
+{
+    QMutexLocker locker(&mutex);
+    QConnmanNetworkInterface network(netPath, this);
+    foreach(QString service,connmanManager->getServices()) {
+        QConnmanServiceInterface serv(service,this);
+        if(serv.getName() == network.getName()
+            && network.getSignalStrength() == serv.getSignalStrength()) {
+            return service;
+        }
+    }
+    return QString();
+}
+
+QString QConnmanEngine::getNetworkForService(const QString &servPath)
+{
+    QMutexLocker locker(&mutex);
+    QMap<QString,QString> map;
+
+    QMapIterator<QString,QStringList> i(deviceMap);
+    while(i.hasNext()) {
+        i.next();
+        if(i.value().count() > 0) {
+            QConnmanDeviceInterface device(i.value().at(0));
+            QMap<QString,int> netMapStrength;
+
+            foreach(const QString netPath, knownNetworks[device.getType()]) {
+                QConnmanNetworkInterface network1(netPath, this);
+                QString netname = network1.getName();
+                qint32 sigStrength = network1.getSignalStrength();
+
+                if(netMapStrength.contains(netname)
+                    && netMapStrength.value(netname) < sigStrength) {
+                    netMapStrength.remove(netname);
+                    map.remove(netname);
+                }
+                netMapStrength.insert(netname, sigStrength);
+                map.insert(netname,netPath);
+            }
+        }
+    }
+
+    QConnmanServiceInterface *serv;
+    serv = new QConnmanServiceInterface(servPath);
+    if(map.contains(serv->getName())) {
+        return map.value(serv->getName());
+    }
+    return QString();
+}
+
+void QConnmanEngine::propertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
+{
+//    qDebug() << __FUNCTION__ << path << item;
+    QMutexLocker locker(&mutex);
+
+    if(item == "Technologies") {
+        QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
+        QStringList newlist = qdbus_cast<QStringList>(arg);
+        if(newlist.count() > 0) {
+            QMap<QString,QConnmanTechnologyInterface *> oldtech = technologies;
+
+            foreach(const QString listPath, newlist) {
+                if(!oldtech.contains(listPath)) {
+                    QConnmanTechnologyInterface *tech;
+                    tech = new QConnmanTechnologyInterface(listPath,this);
+                    connect(tech,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                            this,SLOT(technologyPropertyChangedContext(QString,QString,QDBusVariant)));
+                    technologies.insert(listPath, tech);
+                }
+            }
+
+            foreach(const QString old, oldtech.keys()) {
+                if(!newlist.contains(old)) {
+                    QConnmanTechnologyInterface *tech = oldtech.value(old);
+                    disconnect(tech,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                               this,SLOT(technologyPropertyChangedContext(QString,QString,QDBusVariant)));
+
+                    technologies.remove(old);
+                    getNetworkListing();
+                }
+            }
+        }
+    }
+}
+
+void QConnmanEngine::servicePropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
+{
+//    qDebug() << __FUNCTION__ << path << item;
+    QMutexLocker locker(&mutex);
+     if(item == "State") {
+        configurationChange(QString::number(qHash(path)));
+        if(value.variant().toString() == "failure") {
+            QConnmanServiceInterface serv(path);
+            qDebug() <<__FUNCTION__ <<"Error" << serv.getError();
+              emit connectionError(QString::number(qHash(path)), ConnectError);
+        }
+    }
+}
+
+void QConnmanEngine::networkPropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &/*value*/)
+{
+//    qDebug() << __FUNCTION__ << path << item;
+    QMutexLocker locker(&mutex);
+}
+
+void QConnmanEngine::devicePropertyChangedContext(const QString &path,const QString &item,const QDBusVariant &value)
+{
+//    qDebug() << __FUNCTION__ << path << item << value.variant();
+    QMutexLocker locker(&mutex);
+    if(item == "Networks") {
+        QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
+        QStringList remainingNetworks = qdbus_cast<QStringList>(arg);
+
+        QConnmanDeviceInterface dev(path);
+        QStringList oldnetworks = knownNetworks[dev.getType()];
+        if(remainingNetworks.count() != oldnetworks.count()) {
+
+            foreach(const QString netPath, remainingNetworks) {
+                if(!oldnetworks.contains(netPath)) {
+                    addNetworkConfiguration(netPath);
+                }
+            }
+
+            foreach(const QString netPath, oldnetworks) {
+                QString servicePath = getServiceForNetwork(netPath);
+                if(!remainingNetworks.contains(netPath)) {
+                    if(servicePath.isEmpty()) {
+                        removeConfiguration(netPath);
+                    }  else {
+                        if(!remainingNetworks.contains(servicePath)) {
+                            removeConfiguration(QString::number(qHash(servicePath)));
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+void QConnmanEngine::technologyPropertyChangedContext(const QString & path, const QString &item, const QDBusVariant &value)
+{
+//  qWarning() << __FUNCTION__ << path << item << value.variant();
+//  if(item == "Devices") {
+//      QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
+//      QStringList list = qdbus_cast<QStringList>(arg);
+//  }
+  if(item == "State") {
+      if(value.variant().toString() == "enabled") {
+      }
+      if(value.variant().toString() == "offline") {
+          deviceMap.remove(path);
+      }
+      if(value.variant().toString() == "available") {
+          QConnmanTechnologyInterface tech(connmanManager->getPathForTechnology(path));
+          foreach(const QString devPath, tech.getDevices()) {
+              QConnmanDeviceInterface *dev;
+              dev = new QConnmanDeviceInterface(devPath,this);
+              connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                      this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
+
+              deviceMap.insert(path,QStringList() << devPath);
+          }
+      }
+  }
+}
+
+void QConnmanEngine::configurationChange(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    bool changed = false;
+
+    if (accessPointConfigurations.contains(id)) {
+        QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
+
+        QString servicePath = serviceFromId(id);
+        QConnmanServiceInterface *serv;
+        serv = new QConnmanServiceInterface(servicePath);
+        QString networkName = serv->getName();
+        QNetworkConfiguration::StateFlags curState = getStateForService(servicePath);
+
+        ptr->mutex.lock();
+
+        if (!ptr->isValid) {
+            ptr->isValid = true;
+            changed = true;
+        }
+
+        if (ptr->name != networkName) {
+            ptr->name = networkName;
+            changed = true;
+        }
+
+        if (ptr->state != curState) {
+            ptr->state = curState;
+            changed = true;
+        }
+
+        ptr->mutex.unlock();
+
+        if (changed) {
+            locker.unlock();
+            emit configurationChanged(ptr);
+            locker.relock();
+        }
+
+    }
+     locker.unlock();
+     emit updateCompleted();
+}
+
+QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QString &service)
+{
+    qWarning() << __FUNCTION__;
+    QMutexLocker locker(&mutex);
+    QConnmanServiceInterface serv(service);
+    QNetworkConfiguration::StateFlags flag = QNetworkConfiguration::Defined;
+    if(serv.isFavorite()) {
+        flag = ( flag | QNetworkConfiguration::Discovered);
+    } else {
+        flag = QNetworkConfiguration::Undefined;
+    }
+
+    if(serv.getState() == "ready" || serv.getState() == "online") {
+        flag = ( flag | QNetworkConfiguration::Active);
+    }
+
+    return flag;
+}
+
+QString QConnmanEngine::typeToBearer(const QString &type)
+{
+    QMutexLocker locker(&mutex);
+    if(type == "wifi")
+        return "WLAN";
+    if(type == "ethernet")
+        return "Ethernet";
+    if(type == "bluetooth")
+        return "Bluetooth";
+    if(type == "cellular") {
+        return "Cellular";
+        // not handled: CDMA2000 HSPA
+    }
+    if(type == "wimax")
+        return "WiMax";
+//    if(type == "gps")
+//    if(type == "vpn")
+
+    return "Unknown";
+}
+
+void QConnmanEngine::removeConfiguration(const QString &netpath)
+{
+    QMutexLocker locker(&mutex);
+    const QString id = QString::number(qHash(netpath));
+    if (accessPointConfigurations.contains(id)) {
+        QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(id);
+        QConnmanDeviceInterface device(netpath.section("/",0,5),this);
+        locker.unlock();
+        knownNetworks[device.getType()].removeAll(netpath);
+        emit configurationRemoved(ptr);
+        locker.relock();
+    }
+}
+
+void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
+{
+//    qWarning() << __FUNCTION__ << networkPath;
+    QMutexLocker locker(&mutex);
+
+    QConnmanNetworkInterface *network;
+    network = new QConnmanNetworkInterface(networkPath, this);
+    QString servicePath = getServiceForNetwork(networkPath);
+    QConnmanServiceInterface *serv;
+
+    QString id;
+    if(servicePath.isEmpty()) {
+        id = QString::number(qHash(networkPath));
+    } else {
+        id = QString::number(qHash(servicePath));
+    }
+    if (!accessPointConfigurations.contains(id)) {
+        connect(network,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                this,SLOT(networkPropertyChangedContext(QString,QString, QDBusVariant)));
+
+        QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate();
+
+        QString networkName = network->getName();
+
+        if(networkName.isEmpty())
+            networkName = "Hidden Network";
+
+        QString bearerName;
+
+        QConnmanDeviceInterface device(networkPath.section("/",0,5),this);
+        if(servicePath.isEmpty()) {
+            bearerName = typeToBearer(device.getType());
+        } else {
+            serv = new QConnmanServiceInterface(servicePath,this);
+            bearerName = typeToBearer(serv->getType());
+            connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                    this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
+        }
+        knownNetworks[device.getType()]<< networkPath;
+
+        if(bearerName == "Cellular") {
+            QString mode = serv->getMode();
+            if(mode == "gprs" || mode == "edge") {
+                bearerName = "2G";
+            } else if(mode == "umts") {
+                bearerName = "WCDMA";
+            }
+            networkName = serv->getAPN();
+        }
+
+        cpPriv->name = networkName;
+        cpPriv->isValid = true;
+        cpPriv->id = id;
+        cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
+        cpPriv->bearer = bearerName;
+
+        if(network->getWifiSecurity() == "none") {
+            cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
+        } else {
+            cpPriv->purpose = QNetworkConfiguration::PrivatePurpose;
+        }
+
+        if(servicePath.isEmpty())
+            cpPriv->state = QNetworkConfiguration::Undefined;
+        else
+            cpPriv->state = getStateForService(servicePath);
+
+        QNetworkConfigurationPrivatePointer ptr(cpPriv);
+        accessPointConfigurations.insert(ptr->id, ptr);
+        foundConfigurations.append(cpPriv);
+        locker.unlock();
+        emit configurationAdded(ptr);
+        locker.relock();
+    }
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_DBUS
+#endif // QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
new file mode 100644
index 0000000..849d8c9
--- /dev/null
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCONNMANENGINE_P_H
+#define QCONNMANENGINE_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists for the convenience
+// of the QLibrary class.  This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "../qbearerengine_impl.h"
+
+#include "qconnmanservice_linux_p.h"
+
+#include <QMap>
+#include <QVariant>
+
+#ifndef QT_NO_BEARERMANAGEMENT
+#ifndef QT_NO_DBUS
+
+QT_BEGIN_NAMESPACE
+
+class QConnmanEngine : public QBearerEngineImpl
+{
+    Q_OBJECT
+
+public:
+    QConnmanEngine(QObject *parent = 0);
+    ~QConnmanEngine();
+
+    bool connmanAvailable() const;
+
+    virtual QString getInterfaceFromId(const QString &id);
+    bool hasIdentifier(const QString &id);
+
+    virtual QString bearerName(const QString &id);
+
+    virtual void connectToId(const QString &id);
+    virtual void disconnectFromId(const QString &id);
+
+    Q_INVOKABLE void initialize();
+    Q_INVOKABLE void requestUpdate();
+
+    QNetworkSession::State sessionStateForId(const QString &id);
+    QNetworkSessionPrivate *createSessionBackend();
+
+    virtual quint64 bytesWritten(const QString &id);
+    virtual quint64 bytesReceived(const QString &id);
+    virtual quint64 startTime(const QString &id);
+
+
+    virtual QNetworkConfigurationManager::Capabilities capabilities() const;
+    virtual QNetworkConfigurationPrivatePointer defaultConfiguration();
+
+    void configurationChange(const QString &id);
+    QList<QNetworkConfigurationPrivate *> getConfigurations();
+
+
+private Q_SLOTS:
+
+    void doRequestUpdate();
+    void servicePropertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+    void networkPropertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+    void devicePropertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+    void technologyPropertyChangedContext(const QString &,const QString &, const QDBusVariant &);
+
+private:
+    QConnmanManagerInterface *connmanManager;
+
+    QList<QNetworkConfigurationPrivate *> foundConfigurations;
+    void getNetworkListing();
+
+    QString getServiceForNetwork(const QString &network);
+    QString getNetworkForService(const QString &network);
+
+    QString serviceFromId(const QString &id);
+    QString networkFromId(const QString &id);
+
+    QNetworkConfiguration::StateFlags getStateForService(const QString &service);
+    QString typeToBearer(const QString &type);
+
+    void removeConfiguration(const QString &path);
+    void addNetworkConfiguration(const QString &worknetPath);
+    QDateTime activeTime;
+
+
+    QMap<QString,QConnmanTechnologyInterface *> technologies;
+    QMap<QString,QStringList> knownNetworks;
+    QMap<QString,QStringList> deviceMap;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_DBUS
+#endif // QT_NO_BEARERMANAGEMENT
+
+#endif
+
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
new file mode 100644
index 0000000..ca76ffd
--- /dev/null
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -0,0 +1,1038 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QObject>
+#include <QList>
+#include <QtDBus/QtDBus>
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusError>
+#include <QtDBus/QDBusInterface>
+#include <QtDBus/QDBusMessage>
+#include <QtDBus/QDBusReply>
+#include <QtDBus/QDBusPendingCallWatcher>
+#include <QtDBus/QDBusObjectPath>
+#include <QtDBus/QDBusPendingCall>
+
+#include "qconnmanservice_linux_p.h"
+
+
+QT_BEGIN_NAMESPACE
+static QDBusConnection dbusConnection = QDBusConnection::systemBus();
+
+
+QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent)
+        : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                                 QLatin1String(CONNMAN_MANAGER_PATH),
+                                 CONNMAN_MANAGER_INTERFACE,
+                                 QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanManagerInterface::~QConnmanManagerInterface()
+{
+}
+
+void QConnmanManagerInterface::connectNotify(const char *signal)
+{
+if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+        if(!connection().connect(QLatin1String(CONNMAN_SERVICE),
+                               QLatin1String(CONNMAN_MANAGER_PATH),
+                               QLatin1String(CONNMAN_MANAGER_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               this,SIGNAL(propertyChanged(const QString &, const QDBusVariant & )))) {
+            qWarning() << "PropertyCHanged not connected";
+        }
+    }
+
+    if (QLatin1String(signal) == SIGNAL(stateChanged(QString))) {
+        if (!connection().connect(QLatin1String(CONNMAN_SERVICE),
+                                    QLatin1String(CONNMAN_MANAGER_PATH),
+                                    QLatin1String(CONNMAN_MANAGER_INTERFACE),
+                                    QLatin1String("StateChanged"),
+                                    this,SIGNAL(stateChanged(const QString&)))) {
+            qWarning() << "StateChanged not connected";
+
+        }
+    }
+    if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) {
+        QConnmanDBusHelper *helper;
+        helper = new QConnmanDBusHelper(this);
+
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               QLatin1String(CONNMAN_MANAGER_PATH),
+                               QLatin1String(CONNMAN_MANAGER_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               helper,SLOT(propertyChanged(QString,QDBusVariant)));
+
+
+        QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
+                this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+    }
+}
+
+void QConnmanManagerInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) {
+
+    }
+}
+
+QVariant QConnmanManagerInterface::getProperty(const QString &property)
+{
+    QVariant var;
+    QVariantMap map = getProperties();
+    if (map.contains(property)) {
+        var = map.value(property);
+    } else {
+        qDebug() << "does not contain" << property;
+    }
+    return var;
+}
+
+QVariantMap QConnmanManagerInterface::getProperties()
+{
+    QDBusReply<QVariantMap > reply =  this->call(QLatin1String("GetProperties"));
+    return reply.value();
+}
+
+QString QConnmanManagerInterface::getState()
+{
+    QDBusReply<QString > reply =  this->call("GetState");
+    return reply.value();
+}
+
+bool QConnmanManagerInterface::setProperty(const QString &name, const QDBusVariant &value)
+{
+    Q_UNUSED(name);
+    Q_UNUSED(value);
+    return false;
+}
+
+QDBusObjectPath QConnmanManagerInterface::createProfile(const QString &/*name*/)
+{
+    return QDBusObjectPath();
+}
+
+bool QConnmanManagerInterface::removeProfile(QDBusObjectPath /*path*/)
+{
+    return false;
+}
+
+bool QConnmanManagerInterface::requestScan(const QString &type)
+{
+    QDBusReply<QString> reply =  this->call(QLatin1String("RequestScan"), QVariant::fromValue(type));
+
+    bool ok = true;
+    if(reply.error().type() == QDBusError::InvalidArgs) {
+        qWarning() << reply.error().message();
+        ok = false;
+    }
+    return ok;
+}
+
+bool QConnmanManagerInterface::enableTechnology(const QString &type)
+{
+    QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("EnableTechnology"), QVariant::fromValue(type));
+    bool ok = true;
+    if(reply.error().type() == QDBusError::InvalidArgs) {
+        qWarning() << reply.error().message();
+        ok = false;
+    }
+    return ok;
+}
+
+bool QConnmanManagerInterface::disableTechnology(const QString &type)
+{
+    QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("DisableTechnology"), QVariant::fromValue(type));
+    bool ok = true;
+    if(reply.error().type() == QDBusError::InvalidArgs) {
+        qWarning() << reply.error().message();
+        ok = false;
+    }
+    return ok;
+}
+
+QDBusObjectPath QConnmanManagerInterface::connectService(QVariantMap &map)
+{
+    QDBusReply<QDBusObjectPath > reply =  this->call(QLatin1String("ConnectService"), QVariant::fromValue(map));
+    if(!reply.isValid()) {
+        qDebug() << reply.error().message();
+
+    }
+    return reply;
+}
+
+void QConnmanManagerInterface::registerAgent(QDBusObjectPath &/*path*/)
+{
+}
+
+void QConnmanManagerInterface::unregisterAgent(QDBusObjectPath /*path*/)
+{
+}
+
+void QConnmanManagerInterface::registerCounter(QDBusObjectPath /*path*/, quint32 /*interval*/)
+{
+}
+
+void QConnmanManagerInterface::unregisterCounter(QDBusObjectPath /*path*/)
+{
+}
+
+QString QConnmanManagerInterface::requestSession(const QString &bearerName)
+{
+    QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("RequestSession"), QVariant::fromValue(bearerName));
+    return QString();
+}
+
+void QConnmanManagerInterface::releaseSession()
+{
+    QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("ReleaseSession"));
+}
+
+
+QDBusObjectPath QConnmanManagerInterface::lookupService(const QString &service)
+{
+    QDBusReply<QDBusObjectPath > reply =  this->call(QLatin1String("LookupService"), QVariant::fromValue(service));
+    if(!reply.isValid()) {
+        qDebug() << reply.error().message();
+    }
+    return reply;
+}
+
+// properties
+
+QStringList QConnmanManagerInterface::getAvailableTechnologies()
+{
+    QVariant var = getProperty("AvailableTechnologies");
+    return qdbus_cast<QStringList>(var);
+}
+
+QStringList QConnmanManagerInterface::getEnabledTechnologies()
+{
+    QVariant var = getProperty("EnabledTechnologies");
+    return qdbus_cast<QStringList>(var);
+}
+
+QStringList QConnmanManagerInterface::getConnectedTechnologies()
+{
+    QVariant var = getProperty("ConnectedTechnologies");
+    return qdbus_cast<QStringList>(var);
+}
+
+QString QConnmanManagerInterface::getDefaultTechnology()
+{
+    QVariant var = getProperty("DefaultTechnology");
+    return qdbus_cast<QString>(var);
+}
+
+bool QConnmanManagerInterface::getOfflineMode()
+{
+    QVariant var = getProperty("OfflineMode");
+    return qdbus_cast<bool>(var);
+}
+
+QString QConnmanManagerInterface::getActiveProfile()
+{
+    QVariant var = getProperty("ActiveProfile");
+    return qdbus_cast<QString>(var);
+}
+
+QStringList QConnmanManagerInterface::getProfiles()
+{
+    QVariant var = getProperty("Profiles");
+    return qdbus_cast<QStringList>(var);
+}
+
+QStringList QConnmanManagerInterface::getTechnologies()
+{
+    QVariant var = getProperty("Technologies");
+    return qdbus_cast<QStringList >(var);
+}
+
+QStringList QConnmanManagerInterface::getServices()
+{
+    QVariant var = getProperty("Services");
+    return qdbus_cast<QStringList >(var);
+}
+
+QString QConnmanManagerInterface::getPathForTechnology(const QString &name)
+{
+    foreach(const QString path, getTechnologies()) {
+        if(path.contains(name)) {
+            return path;
+        }
+    }
+    return "";
+}
+
+QConnmanNetworkInterface::QConnmanNetworkInterface(const QString &dbusPathName, QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_NETWORK_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanNetworkInterface::~QConnmanNetworkInterface()
+{
+}
+
+void QConnmanNetworkInterface::connectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+        if(!connection().connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_NETWORK_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               this,SIGNAL(propertyChanged(QString,QDBusVariant))) ) {
+            qWarning() << "network properties not connected";
+        }
+    }
+    if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) {
+        QConnmanDBusHelper *helper;
+        helper = new QConnmanDBusHelper(this);
+
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_NETWORK_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               helper,SLOT(propertyChanged(QString,QDBusVariant)));
+
+        QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
+                this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+    }
+}
+
+void QConnmanNetworkInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+
+    }
+}
+
+QVariantMap QConnmanNetworkInterface::getProperties()
+{
+    QDBusReply<QVariantMap > reply = this->call(QLatin1String("GetProperties"));
+    return reply.value();
+}
+
+QVariant QConnmanNetworkInterface::getProperty(const QString &property)
+{
+    QVariant var;
+    QVariantMap map = getProperties();
+    if (map.contains(property)) {
+        var = map.value(property);
+    }
+    return var;
+}
+
+//properties
+
+QString QConnmanNetworkInterface::getAddress()
+{
+    QVariant var = getProperty("Address");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanNetworkInterface::getName()
+{
+    QVariant var = getProperty("Name");
+    return qdbus_cast<QString>(var);
+}
+
+bool QConnmanNetworkInterface::isConnected()
+{
+    QVariant var = getProperty("Connected");
+    return qdbus_cast<bool>(var);
+}
+
+quint8 QConnmanNetworkInterface::getSignalStrength()
+{
+    QVariant var = getProperty("Strength");
+    return qdbus_cast<quint8>(var);
+}
+
+QString QConnmanNetworkInterface::getDevice()
+{
+    QVariant var = getProperty("Device");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanNetworkInterface::getWifiSsid()
+{
+    QVariant var = getProperty("WiFi.SSID");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanNetworkInterface::getWifiMode()
+{
+    QVariant var = getProperty("WiFi.Mode");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanNetworkInterface::getWifiSecurity()
+{
+    QVariant var = getProperty("WiFi.Security");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanNetworkInterface::getWifiPassphrase()
+{
+    QVariant var = getProperty("WiFi.Passphrase");
+    return qdbus_cast<QString>(var);
+}
+
+
+//////////////////////////
+
+QConnmanProfileInterface::QConnmanProfileInterface(const QString &dbusPathName,QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_PROFILE_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanProfileInterface::~QConnmanProfileInterface()
+{
+}
+
+void QConnmanProfileInterface::connectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_PROFILE_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               this,SIGNAL(propertyChanged(QString,QDBusVariant)));
+    }
+}
+
+void QConnmanProfileInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString, QVariant))) {
+
+    }
+}
+
+QVariantMap QConnmanProfileInterface::getProperties()
+{
+    QDBusReply<QVariantMap > reply =  this->call(QLatin1String("GetProperties"));
+    return reply.value();
+}
+
+QVariant QConnmanProfileInterface::getProperty(const QString &property)
+{
+    QVariant var;
+    QVariantMap map = getProperties();
+    if (map.contains(property)) {
+        var = map.value(property);
+    } else {
+        qDebug() <<__FUNCTION__<< "Could not find" << property;
+    }
+    return var;
+}
+
+// properties
+QString QConnmanProfileInterface::getName()
+{
+
+    QVariant var = getProperty("Name");
+    return qdbus_cast<QString>(var);
+}
+
+bool QConnmanProfileInterface::isOfflineMode()
+{
+    QVariant var = getProperty("OfflineMode");
+    return qdbus_cast<bool>(var);
+}
+
+QStringList QConnmanProfileInterface::getServices()
+{
+    QVariant var = getProperty("Services");
+    return qdbus_cast<QStringList>(var);
+}
+
+///////////////////////////
+QConnmanServiceInterface::QConnmanServiceInterface(const QString &dbusPathName,QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_SERVICE_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanServiceInterface::~QConnmanServiceInterface()
+{
+}
+
+void QConnmanServiceInterface::connectNotify(const char *signal)
+{
+//    qWarning() << __FUNCTION__ << signal << this->path();
+
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_SERVICE_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               this,SIGNAL(propertyChanged(QString,QDBusVariant)));
+    }
+    if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) {
+        QConnmanDBusHelper *helper;
+        helper = new QConnmanDBusHelper(this);
+
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_SERVICE_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               helper,SLOT(propertyChanged(QString,QDBusVariant)));
+
+        QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
+                this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+    }
+}
+
+void QConnmanServiceInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) {
+
+    }
+}
+
+QVariantMap QConnmanServiceInterface::getProperties()
+{
+    QDBusReply<QVariantMap> reply =  this->call(QLatin1String("GetProperties"));
+    return reply.value();
+}
+
+QVariant QConnmanServiceInterface::getProperty(const QString &property)
+{
+    QVariant var;
+    QVariantMap map = getProperties();
+    if (map.contains(property)) {
+        var = map.value(property);
+    } else {
+//        qDebug() <<__FUNCTION__<< "Could not find" << property;
+    }
+    return var;
+}
+
+// clearProperty
+void QConnmanServiceInterface::connect()
+{
+    QDBusReply<QVariantMap> reply = this->call(QLatin1String("Connect"));
+}
+
+void QConnmanServiceInterface::disconnect()
+{
+    QDBusReply<QVariantMap> reply = this->call(QLatin1String("Disconnect"));
+}
+
+void QConnmanServiceInterface::remove()
+{
+    QDBusReply<QVariantMap> reply = this->call(QLatin1String("Remove"));
+}
+
+// void moveBefore(QDBusObjectPath &service);
+// void moveAfter(QDBusObjectPath &service);
+
+// properties
+QString QConnmanServiceInterface::getState()
+{
+    QVariant var = getProperty("State");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getError()
+{
+    QVariant var = getProperty("Error");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getName()
+{
+    QVariant var = getProperty("Name");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getType()
+{
+    QVariant var = getProperty("Type");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getMode()
+{
+    QVariant var = getProperty("Mode");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getSecurity()
+{
+    QVariant var = getProperty("Security");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getPassphrase()
+{
+    QVariant var = getProperty("Passphrase");
+    return qdbus_cast<QString>(var);
+}
+
+bool QConnmanServiceInterface::isPassphraseRequired()
+{
+    QVariant var = getProperty("PassphraseRequired");
+    return qdbus_cast<bool>(var);
+}
+
+quint8 QConnmanServiceInterface::getSignalStrength()
+{
+    QVariant var = getProperty("Strength");
+    return qdbus_cast<quint8>(var);
+}
+
+bool QConnmanServiceInterface::isFavorite()
+{
+    QVariant var = getProperty("Favorite");
+    return qdbus_cast<bool>(var);
+}
+
+bool QConnmanServiceInterface::isImmutable()
+{
+    QVariant var = getProperty("Immutable");
+    return qdbus_cast<bool>(var);
+}
+
+bool QConnmanServiceInterface::isAutoConnect()
+{
+    QVariant var = getProperty("AutoConnect");
+    return qdbus_cast<bool>(var);
+}
+
+bool QConnmanServiceInterface::isSetupRequired()
+{
+    QVariant var = getProperty("SetupRequired");
+    return qdbus_cast<bool>(var);
+}
+
+QString QConnmanServiceInterface::getAPN()
+{
+    QVariant var = getProperty("APN");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getMCC()
+{
+    QVariant var = getProperty("MCC");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanServiceInterface::getMNC()
+{
+    QVariant var = getProperty("MNC");
+    return qdbus_cast<QString>(var);
+}
+
+bool QConnmanServiceInterface::isRoaming()
+{
+    QVariant var = getProperty("Roaming");
+    return qdbus_cast<bool>(var);
+}
+
+QStringList QConnmanServiceInterface::getNameservers()
+{
+    QVariant var = getProperty("NameServers");
+    return qdbus_cast<QStringList>(var);
+}
+
+QStringList QConnmanServiceInterface::getDomains()
+{
+    QVariant var = getProperty("Domains");
+    return qdbus_cast<QStringList>(var);
+}
+
+QVariantMap QConnmanServiceInterface::getIPv4()
+{
+    QVariant var = getProperty("IPv4");
+    return qdbus_cast<QVariantMap >(var);
+}
+
+QVariantMap QConnmanServiceInterface::getIPv4Configuration()
+{
+    QVariant var = getProperty("IPv4.Configuration");
+    return qdbus_cast<QVariantMap >(var);
+}
+
+QVariantMap QConnmanServiceInterface::getProxy()
+{
+    QVariant var = getProperty("Proxy");
+    return qdbus_cast<QVariantMap >(var);
+}
+
+QVariantMap QConnmanServiceInterface::getEthernet()
+{
+    QVariant var = getProperty("Ethernet");
+    return qdbus_cast<QVariantMap >(var);
+}
+
+bool QConnmanServiceInterface::isOfflineMode()
+{
+    QVariant var = getProperty("OfflineMode");
+    return qdbus_cast<bool>(var);
+}
+
+QStringList QConnmanServiceInterface::getServices()
+{
+    QVariant var = getProperty("Services");
+    return qdbus_cast<QStringList>(var);
+}
+
+
+//////////////////////////
+QConnmanTechnologyInterface::QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_TECHNOLOGY_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanTechnologyInterface::~QConnmanTechnologyInterface()
+{
+}
+
+void QConnmanTechnologyInterface::connectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               this,SIGNAL(propertyChanged(QString,QDBusVariant)));
+    }
+    if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) {
+        QConnmanDBusHelper *helper;
+        helper = new QConnmanDBusHelper(this);
+
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               helper,SLOT(propertyChanged(QString,QDBusVariant)));
+
+        QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
+                this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+    }
+}
+
+void QConnmanTechnologyInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) {
+
+    }
+}
+
+QVariantMap QConnmanTechnologyInterface::getProperties()
+{
+    QDBusReply<QVariantMap> reply =  this->call(QLatin1String("GetProperties"));
+    return reply.value();
+}
+
+QVariant QConnmanTechnologyInterface::getProperty(const QString &property)
+{
+    QVariant var;
+    QVariantMap map = getProperties();
+    if (map.contains(property)) {
+        var = map.value(property);
+    }
+    return var;
+}
+
+// properties
+QString QConnmanTechnologyInterface::getState()
+{
+    QVariant var = getProperty("State");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanTechnologyInterface::getName()
+{
+    QVariant var = getProperty("Name");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanTechnologyInterface::getType()
+{
+    QVariant var = getProperty("Type");
+    return qdbus_cast<QString>(var);
+}
+
+
+QStringList QConnmanTechnologyInterface::getDevices()
+{
+    QVariant var = getProperty("Devices");
+    return qdbus_cast<QStringList>(var);
+}
+
+
+//////////////////////////////////
+QConnmanAgentInterface::QConnmanAgentInterface(const QString &dbusPathName, QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_AGENT_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanAgentInterface::~QConnmanAgentInterface()
+{
+}
+
+void QConnmanAgentInterface::connectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+//        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+//                               this->path(),
+//                               QLatin1String(CONNMAN_NETWORK_INTERFACE),
+//                               QLatin1String("PropertyChanged"),
+//                               this,SIGNAL(propertyChanged(const QString &, QVariant &)));
+    }
+}
+
+void QConnmanAgentInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString, QDBusVariant))) {
+
+    }
+}
+
+
+void QConnmanAgentInterface::release()
+{
+}
+
+void QConnmanAgentInterface::reportError(QDBusObjectPath &/*path*/, const QString &/*error*/)
+{
+}
+
+//dict QConnmanAgentInterface::requestInput(QDBusObjectPath &path, dict fields)
+//{
+//}
+
+void QConnmanAgentInterface::cancel()
+{
+}
+
+
+/////////////////////////////////////////
+
+QConnmanDeviceInterface::QConnmanDeviceInterface(const QString &dbusPathName,QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_DEVICE_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanDeviceInterface::~QConnmanDeviceInterface()
+{
+}
+
+void QConnmanDeviceInterface::connectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_DEVICE_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               this,SIGNAL(propertyChanged(QString,QDBusVariant)));
+
+    }
+    if (QLatin1String(signal) == SIGNAL(propertyChangedContext(QString,QString,QDBusVariant))) {
+        QConnmanDBusHelper *helper;
+        helper = new QConnmanDBusHelper(this);
+
+        dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+                               this->path(),
+                               QLatin1String(CONNMAN_DEVICE_INTERFACE),
+                               QLatin1String("PropertyChanged"),
+                               helper,SLOT(propertyChanged(QString,QDBusVariant)));
+
+        QObject::connect(helper,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)),
+                this,SIGNAL(propertyChangedContext(const QString &,const QString &,const QDBusVariant &)));
+    }
+}
+
+void QConnmanDeviceInterface::disconnectNotify(const char *signal)
+{
+    if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) {
+
+    }
+}
+
+QVariantMap QConnmanDeviceInterface::getProperties()
+{
+    QDBusReply<QVariantMap> reply =  this->call(QLatin1String("GetProperties"));
+    return reply.value();
+}
+
+bool QConnmanDeviceInterface::setProperty(const QString &name, const QDBusVariant &value)
+{
+
+//    QList<QVariant> args;
+    qWarning() << __FUNCTION__ << name << value.variant();
+//    args << qVariantFromValue(name);
+//    args << qVariantFromValue(value);
+
+    QDBusMessage reply = this->call(QLatin1String("SetProperty"),name, qVariantFromValue(value));
+qWarning() << reply.errorMessage();
+
+    return true;
+}
+
+void QConnmanDeviceInterface::scan()
+{
+    QDBusReply<QVariantMap> reply = this->call(QLatin1String("ProposeScan"));
+    if(!reply.isValid()) {
+        qDebug() << reply.error().message();
+    }
+}
+
+QVariant QConnmanDeviceInterface::getProperty(const QString &property)
+{
+    QVariant var;
+    QVariantMap map = getProperties();
+    if (map.contains(property)) {
+        var = map.value(property);
+    }
+    return var;
+}
+
+//properties
+QString QConnmanDeviceInterface::getAddress()
+{
+    QVariant var = getProperty("Address");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanDeviceInterface::getName()
+{
+    QVariant var = getProperty("Name");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanDeviceInterface::getType()
+{
+    QVariant var = getProperty("Type");
+    return qdbus_cast<QString>(var);
+}
+
+QString QConnmanDeviceInterface::getInterface()
+{
+    QVariant var = getProperty("Interface");
+    return qdbus_cast<QString>(var);
+}
+
+bool QConnmanDeviceInterface::isPowered()
+{
+    QVariant var = getProperty("Powered");
+    return qdbus_cast<bool>(var);
+}
+
+quint16 QConnmanDeviceInterface::getScanInterval()
+{
+    QVariant var = getProperty("ScanInterval");
+    return qdbus_cast<quint16>(var);
+}
+
+bool QConnmanDeviceInterface::setScanInterval(const QString & interval)
+{
+//    QList<QVariant> args;
+//    args << qVariantFromValue(name)
+//    << value.variant();
+
+//    QDBusMessage reply = this->callWithArgumentList(QDBus::AutoDetect,QLatin1String("SetProperty"),args);
+
+    return setProperty("ScanInterval", QDBusVariant(interval));
+}
+
+bool QConnmanDeviceInterface::isScanning()
+{
+    QVariant var = getProperty("Scanning");
+     return qdbus_cast<bool>(var);
+}
+
+QStringList QConnmanDeviceInterface::getNetworks()
+{
+    QVariant var = getProperty("Networks");
+    return qdbus_cast<QStringList>(var);
+}
+
+bool QConnmanDeviceInterface::setEnabled(bool powered)
+{
+    QList<QVariant> args;
+    args << qVariantFromValue(QString("Powered"))
+    << qVariantFromValue(QDBusVariant(powered));
+
+    QDBusMessage reply = this->callWithArgumentList(QDBus::AutoDetect,QLatin1String("SetProperty"),args);
+    qWarning() << reply.errorMessage() << reply.errorName();
+    return true;
+}
+
+QConnmanDBusHelper::QConnmanDBusHelper(QObject * parent)
+        : QObject(parent)
+{
+}
+
+QConnmanDBusHelper::~QConnmanDBusHelper()
+{
+}
+
+void QConnmanDBusHelper::propertyChanged(const QString &item, const QDBusVariant &var)
+{
+    QDBusMessage msg = this->message();
+//    qWarning() << sender();
+ //   qWarning()  << msg.interface() << msg.path() << item << var.variant() <<"\n";
+    Q_EMIT propertyChangedContext(msg.path() ,item, var);
+}
+
+/////////////////
+QT_END_NAMESPACE
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
new file mode 100644
index 0000000..9475296
--- /dev/null
+++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
@@ -0,0 +1,377 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCONNMANSERVICE_H
+#define QCONNMANSERVICE_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtDBus/QtDBus>
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusError>
+#include <QtDBus/QDBusInterface>
+#include <QtDBus/QDBusMessage>
+#include <QtDBus/QDBusReply>
+
+#include <QtDBus/QDBusPendingCallWatcher>
+#include <QtDBus/QDBusObjectPath>
+#include <QtDBus/QDBusContext>
+#include <QMap>
+
+#ifndef __CONNMAN_DBUS_H
+
+#define	CONNMAN_SERVICE     "org.moblin.connman"
+#define	CONNMAN_PATH        "/org/moblin/connman"
+
+#define CONNMAN_DEBUG_INTERFACE		CONNMAN_SERVICE ".Debug"
+#define CONNMAN_ERROR_INTERFACE		CONNMAN_SERVICE ".Error"
+#define CONNMAN_AGENT_INTERFACE		CONNMAN_SERVICE ".Agent"
+#define CONNMAN_COUNTER_INTERFACE	CONNMAN_SERVICE ".Counter"
+
+#define CONNMAN_MANAGER_INTERFACE	CONNMAN_SERVICE ".Manager"
+#define CONNMAN_MANAGER_PATH		"/"
+
+#define CONNMAN_TASK_INTERFACE		CONNMAN_SERVICE ".Task"
+#define CONNMAN_PROFILE_INTERFACE	CONNMAN_SERVICE ".Profile"
+#define CONNMAN_SERVICE_INTERFACE	CONNMAN_SERVICE ".Service"
+#define CONNMAN_DEVICE_INTERFACE	CONNMAN_SERVICE ".Device"
+#define CONNMAN_NETWORK_INTERFACE	CONNMAN_SERVICE ".Network"
+#define CONNMAN_PROVIDER_INTERFACE	CONNMAN_SERVICE ".Provider"
+#define CONNMAN_TECHNOLOGY_INTERFACE	CONNMAN_SERVICE ".Technology"
+#endif
+
+QT_BEGIN_NAMESPACE
+
+QT_END_NAMESPACE
+
+
+QT_BEGIN_NAMESPACE
+
+class QConnmanManagerInterface : public  QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanManagerInterface( QObject *parent = 0);
+    ~QConnmanManagerInterface();
+
+     QDBusObjectPath path() const;
+
+    QVariantMap getProperties();
+    bool setProperty(const QString &name, const QDBusVariant &value);
+    QDBusObjectPath createProfile(const QString &name);
+    bool removeProfile(QDBusObjectPath path);
+    bool requestScan(const QString &type);
+    bool enableTechnology(const QString &type);
+    bool disableTechnology(const QString &type);
+    QDBusObjectPath connectService(QVariantMap &map);
+    void registerAgent(QDBusObjectPath &path);
+    void unregisterAgent(QDBusObjectPath path);
+    void registerCounter(QDBusObjectPath path, quint32 interval);
+    void unregisterCounter(QDBusObjectPath path);
+
+    QString requestSession(const QString &bearerName);
+    void releaseSession();
+    
+      // properties
+    QString getState();
+    QStringList getAvailableTechnologies();
+    QStringList getEnabledTechnologies();
+    QStringList getConnectedTechnologies();
+    QString getDefaultTechnology();
+    bool getOfflineMode();
+    QString getActiveProfile();
+    QStringList getProfiles();
+    QStringList  getTechnologies();
+    QStringList getServices();
+    QDBusObjectPath lookupService(const QString &);
+
+    QString getPathForTechnology(const QString &tech);
+
+
+Q_SIGNALS:
+    void propertyChanged(const QString &, const QDBusVariant &value);
+    void stateChanged(const QString &);
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+    QVariant getProperty(const QString &);
+};
+
+
+class QConnmanNetworkInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanNetworkInterface(const QString &dbusPathName, QObject *parent = 0);
+    ~QConnmanNetworkInterface();
+
+    QVariantMap getProperties();
+
+    //properties
+    QString getAddress();
+    QString getName();
+    bool isConnected();
+    quint8 getSignalStrength();
+    QString getDevice();
+    QString getWifiSsid();
+    QString getWifiMode();
+    QString getWifiSecurity();
+    QString getWifiPassphrase();
+
+Q_SIGNALS:
+    void propertyChanged(const QString &, const QDBusVariant &value);
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+    QVariant getProperty(const QString &);
+};
+
+class QConnmanProfileInterfacePrivate;
+class QConnmanProfileInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanProfileInterface(const QString &dbusPathName,QObject *parent = 0);
+    ~QConnmanProfileInterface();
+
+    QVariantMap getProperties();
+// properties
+    QString getName();
+    bool isOfflineMode();
+    QStringList getServices();
+
+Q_SIGNALS:
+    void propertyChanged(const QString &, const QDBusVariant &value);
+private:
+    QConnmanProfileInterfacePrivate *d;
+
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+    QVariant getProperty(const QString &);
+};
+
+class QConnmanServiceInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
+    ~QConnmanServiceInterface();
+
+    QVariantMap getProperties();
+      // clearProperty
+    void connect();
+    void disconnect();
+    void remove();
+      // void moveBefore(QDBusObjectPath &service);
+      // void moveAfter(QDBusObjectPath &service);
+
+// properties
+    QString getState();
+    QString getError();
+    QString getName();
+    QString getType();
+    QString getMode();
+    QString getSecurity();
+    QString getPassphrase();
+    bool isPassphraseRequired();
+    quint8 getSignalStrength();
+    bool isFavorite();
+    bool isImmutable();
+    bool isAutoConnect();
+    bool isSetupRequired();
+    QString getAPN();
+    QString getMCC();
+    QString getMNC();
+    bool isRoaming();
+    QStringList getNameservers();
+    QStringList getDomains();
+    QVariantMap getIPv4();
+    QVariantMap getIPv4Configuration();
+    QVariantMap getProxy();
+    QVariantMap getEthernet();
+
+    bool isOfflineMode();
+    QStringList getServices();
+
+Q_SIGNALS:
+    void propertyChanged(const QString &, const QDBusVariant &value);
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+    QVariant getProperty(const QString &);
+};
+
+class QConnmanTechnologyInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
+    ~QConnmanTechnologyInterface();
+
+    QVariantMap getProperties();
+// properties
+    QString getState();
+    QString getName();
+    QString getType();
+
+    QStringList getDevices();
+
+Q_SIGNALS:
+    void propertyChanged(const QString &, const QDBusVariant &value);
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+    QVariant getProperty(const QString &);
+
+};
+
+class QConnmanAgentInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanAgentInterface(const QString &dbusPathName,QObject *parent = 0);
+    ~QConnmanAgentInterface();
+
+    void release();
+    void reportError(QDBusObjectPath &path, const QString &error);
+//    dict requestInput(QDBusObjectPath &path, dict fields);
+    void cancel();
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+};
+
+//class QConnmanCounterInterfacePrivate;
+//class QConnmanCounterInterface : public QDBusAbstractInterface
+//{
+//    Q_OBJECT
+//
+//public:
+//
+//    QConnmanCounterInterface(QObject *parent = 0);
+//    ~QConnmanCounterInterface();
+//
+//    void release();
+//private:
+//    QConnmanCounterInterfacePrivate *d;
+//};
+
+class QConnmanDeviceInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanDeviceInterface(const QString &dbusPathName,QObject *parent = 0);
+    ~QConnmanDeviceInterface();
+
+    QVariantMap getProperties();
+    void scan();
+
+//properties
+    QString getAddress();
+    QString getName();
+    QString getType();
+    QString getInterface();
+    bool isPowered();
+    quint16 getScanInterval();
+    bool setScanInterval(const QString &interval);
+
+    bool isScanning();
+    QStringList getNetworks();
+    bool setEnabled(bool powered);
+    bool setProperty(const QString &name, const QDBusVariant &value);
+
+Q_SIGNALS:
+    void propertyChanged(const QString &, const QDBusVariant &value);
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+protected:
+    void connectNotify(const char *signal);
+    void disconnectNotify(const char *signal);
+    QVariant getProperty(const QString &);
+
+};
+
+class QConnmanDBusHelper: public QObject, protected QDBusContext
+ {
+     Q_OBJECT
+ public:
+    QConnmanDBusHelper(QObject *parent = 0);
+    ~QConnmanDBusHelper();
+
+ public slots:
+    void propertyChanged(const QString &, const QDBusVariant &);
+
+Q_SIGNALS:
+    void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
+};
+
+QT_END_NAMESPACE
+
+#endif //QCONNMANSERVICE_H
-- 
cgit v0.12


From 54e3221555997d26d59b880e3e153f1fc979505d Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jens.bache-wiig@nokia.com>
Date: Fri, 18 Jun 2010 13:01:18 +0200
Subject: Fix QWizard icon and metrics on Windows 7 and Vista

This patch takes care of missing icon on Windows Vista+7.
It also updates the metrics to look more native in both
versions.

Task-number: QTBUG-9873, QTBUG-11974, QTBUG-6120
Reviewed-by: prasanth
---
 src/gui/dialogs/qwizard_win.cpp | 42 +++++++++++++++++++++++++++--------------
 src/gui/dialogs/qwizard_win_p.h | 21 +++++++++++++++------
 2 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp
index e406cba..ad8801a 100644
--- a/src/gui/dialogs/qwizard_win.cpp
+++ b/src/gui/dialogs/qwizard_win.cpp
@@ -180,7 +180,8 @@ QVistaBackButton::QVistaBackButton(QWidget *widget)
 QSize QVistaBackButton::sizeHint() const
 {
     ensurePolished();
-    int width = 32, height = 32;
+    int size = int(QStyleHelper::dpiScaled(32));
+    int width = size, height = size;
 /*
     HANDLE theme = pOpenThemeData(0, L"Navigation");
     SIZE size;
@@ -213,8 +214,8 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
     HANDLE theme = pOpenThemeData(0, L"Navigation");
     //RECT rect;
     RECT clipRect;
-    int xoffset = QWidget::mapToParent(r.topLeft()).x();
-    int yoffset = QWidget::mapToParent(r.topLeft()).y();
+    int xoffset = QWidget::mapToParent(r.topLeft()).x() - 1;
+    int yoffset = QWidget::mapToParent(r.topLeft()).y() - 1;
 
     clipRect.top = r.top() + yoffset;
     clipRect.bottom = r.bottom() + yoffset;
@@ -245,6 +246,11 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
     is_vista = resolveSymbols();
     if (is_vista)
         backButton_ = new QVistaBackButton(wizard);
+
+    // Handle diff between Windows 7 and Vista
+    iconSpacing = QStyleHelper::dpiScaled(7);
+    textSpacing = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ?
+                  iconSpacing : QStyleHelper::dpiScaled(20);
 }
 
 QVistaHelper::~QVistaHelper()
@@ -308,18 +314,15 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
 
 void QVistaHelper::drawTitleBar(QPainter *painter)
 {
-    if (vistaState() == VistaAero)
-        drawBlackRect(
-            QRect(0, 0, wizard->width(), titleBarSize() + topOffset()),
-            painter->paintEngine()->getDC());
+    HDC hdc = painter->paintEngine()->getDC();
 
+    if (vistaState() == VistaAero)
+        drawBlackRect(QRect(0, 0, wizard->width(),
+                            titleBarSize() + topOffset()), hdc);
     Q_ASSERT(backButton_);
     const int btnTop = backButton_->mapToParent(QPoint()).y();
     const int btnHeight = backButton_->size().height();
-    const int verticalCenter = (btnTop + btnHeight / 2);
-
-    wizard->windowIcon().paint(
-        painter, QRect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize()));
+    const int verticalCenter = (btnTop + btnHeight / 2) - 1;
 
     const QString text = wizard->window()->windowTitle();
     const QFont font = QApplication::font("QWorkspaceTitleBar");
@@ -327,14 +330,25 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
     const QRect brect = fontMetrics.boundingRect(text);
     int textHeight = brect.height();
     int textWidth = brect.width();
+    int glowOffset = 0;
+
     if (vistaState() == VistaAero) {
         textHeight += 2 * glowSize();
         textWidth += 2 * glowSize();
+        glowOffset = glowSize();
     }
+
     drawTitleText(
         painter, text,
-        QRect(titleOffset(), verticalCenter - textHeight / 2, textWidth, textHeight),
-        painter->paintEngine()->getDC());
+        QRect(titleOffset() - glowOffset, verticalCenter - textHeight / 2, textWidth, textHeight),
+        hdc);
+
+    if (!wizard->windowIcon().isNull()) {
+        QRect rect(leftMargin(), verticalCenter - iconSize() / 2, iconSize(), iconSize());
+        HICON hIcon = wizard->windowIcon().pixmap(iconSize()).toWinHICON();
+        DrawIconEx(hdc, rect.left(), rect.top(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT);
+        DestroyIcon(hIcon);
+    }
 }
 
 void QVistaHelper::setTitleBarIconAndCaptionVisible(bool visible)
@@ -734,7 +748,7 @@ bool QVistaHelper::resolveSymbols()
 
 int QVistaHelper::titleOffset()
 {
-    int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + padding();
+    int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing;
     return leftMargin() + iconOffset;
 }
 
diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h
index 5f3b6c2..caf018d 100644
--- a/src/gui/dialogs/qwizard_win_p.h
+++ b/src/gui/dialogs/qwizard_win_p.h
@@ -61,6 +61,7 @@
 #include <qwidget.h>
 #include <qabstractbutton.h>
 #include <QtGui/private/qwidget_p.h>
+#include <QtGui/private/qstylehelper_p.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -100,9 +101,14 @@ public:
     enum VistaState { VistaAero, VistaBasic, Classic, Dirty };
     static VistaState vistaState();
     static int titleBarSize() { return frameSize() + captionSize(); }
-    static int topPadding() { return 8; }
-    static int topOffset() { return titleBarSize() + (vistaState() == VistaAero ? 13 : 3); }
-
+    static int topPadding() { // padding under text
+        return int(QStyleHelper::dpiScaled(
+                QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ? 4 : 6));
+    }
+    static int topOffset() {
+        static int aeroOffset = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ?
+                                QStyleHelper::dpiScaled(4) : QStyleHelper::dpiScaled(13);
+        return (titleBarSize() + (vistaState() == VistaAero ? aeroOffset : 3)); }
 private:
     static HFONT getCaptionFont(HANDLE hTheme);
     bool drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc);
@@ -111,11 +117,10 @@ private:
     static int frameSize() { return GetSystemMetrics(SM_CYSIZEFRAME); }
     static int captionSize() { return GetSystemMetrics(SM_CYCAPTION); }
 
-    static int backButtonSize() { return 31; } // ### should be queried from back button itself
+    static int backButtonSize() { return int(QStyleHelper::dpiScaled(30)); }
     static int iconSize() { return 16; } // Standard Aero
-    static int padding() { return 7; } // Standard Aero
-    static int leftMargin() { return backButtonSize() + padding(); }
     static int glowSize() { return 10; }
+    int leftMargin() { return backButton_->isVisible() ? backButtonSize() + iconSpacing : 0; }
 
     int titleOffset();
     bool resolveSymbols();
@@ -139,6 +144,10 @@ private:
     QRect rtTitle;
     QWizard *wizard;
     QVistaBackButton *backButton_;
+
+    int titleBarOffset;  // Extra spacing above the text
+    int iconSpacing;    // Space between button and icon
+    int textSpacing;    // Space between icon and text
 };
 
 
-- 
cgit v0.12


From 066fe8ab70508af6310c49e6eb9cdd74962b6401 Mon Sep 17 00:00:00 2001
From: Lorn Potter <lorn.potter@nokia.com>
Date: Tue, 22 Jun 2010 04:14:21 +1000
Subject: fix ghost ap issue, and dont block on connect

---
 src/plugins/bearer/connman/qconnmanengine.cpp | 276 ++++++++++++++++++--------
 src/plugins/bearer/connman/qconnmanengine.h   |  41 +++-
 2 files changed, 235 insertions(+), 82 deletions(-)

diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index e4cab92..c1df710 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -51,7 +51,6 @@
 
 #include <QtDBus/QtDBus>
 #include <QtDBus/QDBusConnection>
-//#include <QtDBus/QDBusError>
 #include <QtDBus/QDBusInterface>
 #include <QtDBus/QDBusMessage>
 #include <QtDBus/QDBusReply>
@@ -65,7 +64,6 @@ QConnmanEngine::QConnmanEngine(QObject *parent)
 :   QBearerEngineImpl(parent),
     connmanManager(new QConnmanManagerInterface(this))
 {
-//    qWarning() << Q_FUNC_INFO;
 }
 
 QConnmanEngine::~QConnmanEngine()
@@ -98,6 +96,7 @@ void QConnmanEngine::initialize()
             deviceMap.insert(techPath,QStringList() << devicePath);
         }
     }
+
     // Get current list of access points.
     getConfigurations();
 }
@@ -113,7 +112,6 @@ QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
 void QConnmanEngine::getNetworkListing()
 {
     QMutexLocker locker(&mutex);
-
     QMapIterator<QString,QStringList> i(deviceMap);
     while(i.hasNext()) {
         i.next();
@@ -126,6 +124,8 @@ void QConnmanEngine::getNetworkListing()
     }
 }
 
+
+
 void QConnmanEngine::doRequestUpdate()
 {
     getConfigurations();
@@ -141,16 +141,16 @@ QString QConnmanEngine::getInterfaceFromId(const QString &id)
 
     QMapIterator<QString,QStringList> i(deviceMap);
     while(i.hasNext()) {
-     i.next();
-     if(i.value().count() > 0) {
-         QConnmanDeviceInterface dev(i.value().at(0));
-         foreach(const QString network, dev.getNetworks()) {
-             if(network == netPath) {
-                 return dev.getInterface();
-             }
-         }
-     }
- }
+        i.next();
+        if(i.value().count() > 0) {
+            QConnmanDeviceInterface dev(i.value().at(0));
+            foreach(const QString network, dev.getNetworks()) {
+                if(network == netPath) {
+                    return dev.getInterface();
+                }
+            }
+        }
+    }
     return QString();
 }
 
@@ -187,12 +187,13 @@ QString QConnmanEngine::bearerName(const QString &id)
 void QConnmanEngine::connectToId(const QString &id)
 {
     QMutexLocker locker(&mutex);
-    QConnmanServiceInterface serv(serviceFromId(id));
-    if(!serv.isValid()) {
-        emit connectionError(id, InterfaceLookupError);
-    } else {
-        serv.connect();
-    }
+    QConnmanConnectThread *thread;
+    thread = new QConnmanConnectThread(this);
+    thread->setServicePath(serviceFromId(id));
+    thread->setIdentifier(id);
+    connect(thread,SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)),
+            this,SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)));
+    thread->start();
 }
 
 void QConnmanEngine::disconnectFromId(const QString &id)
@@ -234,9 +235,24 @@ QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
 
     if (!ptr->isValid) {
         return QNetworkSession::Invalid;
-    } else if ((ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
+
+    }
+    QString service = serviceFromId(id);
+    QConnmanServiceInterface serv(service);
+    QString servState = serv.getState();
+
+    if(servState == "idle" || servState == "failure") {
+        return QNetworkSession::Disconnected;
+    }
+
+    if(servState == "association" || servState == "configuration" || servState == "login") {
+        return QNetworkSession::Connecting;
+    }
+    if(servState == "ready" || servState == "online") {
         return QNetworkSession::Connected;
-    } else if ((ptr->state & QNetworkConfiguration::Discovered) ==
+    }
+
+    if ((ptr->state & QNetworkConfiguration::Discovered) ==
                 QNetworkConfiguration::Discovered) {
         return QNetworkSession::Disconnected;
     } else if ((ptr->state & QNetworkConfiguration::Defined) == QNetworkConfiguration::Defined) {
@@ -324,14 +340,14 @@ QString QConnmanEngine::getNetworkForService(const QString &servPath)
     QMutexLocker locker(&mutex);
     QMap<QString,QString> map;
 
-    QMapIterator<QString,QStringList> i(deviceMap);
-    while(i.hasNext()) {
-        i.next();
-        if(i.value().count() > 0) {
-            QConnmanDeviceInterface device(i.value().at(0));
-            QMap<QString,int> netMapStrength;
+     QMapIterator<QString,QStringList> i(deviceMap);
+     while(i.hasNext()) {
+         i.next();
+         if(i.value().count() > 0) {
+             QConnmanDeviceInterface device(i.value().at(0));
+        QMap<QString,int> netMapStrength;
+        foreach(const QString netPath, knownNetworks[device.getType()]) {
 
-            foreach(const QString netPath, knownNetworks[device.getType()]) {
                 QConnmanNetworkInterface network1(netPath, this);
                 QString netname = network1.getName();
                 qint32 sigStrength = network1.getSignalStrength();
@@ -355,10 +371,19 @@ QString QConnmanEngine::getNetworkForService(const QString &servPath)
     return QString();
 }
 
-void QConnmanEngine::propertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
+void QConnmanEngine::propertyChangedContext(const QString &/*path*/,const QString &item, const QDBusVariant &value)
 {
-//    qDebug() << __FUNCTION__ << path << item;
     QMutexLocker locker(&mutex);
+    if(item == "Services") {
+        QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
+        QStringList list = qdbus_cast<QStringList>(arg);
+
+        if(list.count() > accessPointConfigurations.count()) {
+            foreach(const QString service, list) {
+                addServiceConfiguration(service);
+            }
+        }
+    }
 
     if(item == "Technologies") {
         QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
@@ -392,52 +417,47 @@ void QConnmanEngine::propertyChangedContext(const QString &path,const QString &i
 
 void QConnmanEngine::servicePropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
 {
-//    qDebug() << __FUNCTION__ << path << item;
+//    qWarning() << __FUNCTION__ << path << item << value.variant();
     QMutexLocker locker(&mutex);
-     if(item == "State") {
+    if(item == "State") {
         configurationChange(QString::number(qHash(path)));
         if(value.variant().toString() == "failure") {
             QConnmanServiceInterface serv(path);
-            qDebug() <<__FUNCTION__ <<"Error" << serv.getError();
-              emit connectionError(QString::number(qHash(path)), ConnectError);
+            emit connectionError(QString::number(qHash(path)), ConnectError);
         }
     }
 }
 
-void QConnmanEngine::networkPropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &/*value*/)
+void QConnmanEngine::networkPropertyChangedContext(const QString &/*path*/,const QString &/*item*/, const QDBusVariant &/*value*/)
 {
-//    qDebug() << __FUNCTION__ << path << item;
     QMutexLocker locker(&mutex);
 }
 
-void QConnmanEngine::devicePropertyChangedContext(const QString &path,const QString &item,const QDBusVariant &value)
+void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const QString &item,const QDBusVariant &value)
 {
-//    qDebug() << __FUNCTION__ << path << item << value.variant();
     QMutexLocker locker(&mutex);
     if(item == "Networks") {
         QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
-        QStringList remainingNetworks = qdbus_cast<QStringList>(arg);
-
-        QConnmanDeviceInterface dev(path);
-        QStringList oldnetworks = knownNetworks[dev.getType()];
-        if(remainingNetworks.count() != oldnetworks.count()) {
+        QStringList remainingNetworks  = qdbus_cast<QStringList>(arg);
+        QConnmanDeviceInterface device(devpath);
+        QStringList oldnetworks = knownNetworks[device.getType()];
 
+        if(remainingNetworks.count() > oldnetworks.count()) {
             foreach(const QString netPath, remainingNetworks) {
                 if(!oldnetworks.contains(netPath)) {
                     addNetworkConfiguration(netPath);
                 }
             }
-
+        } else {
             foreach(const QString netPath, oldnetworks) {
                 QString servicePath = getServiceForNetwork(netPath);
                 if(!remainingNetworks.contains(netPath)) {
                     if(servicePath.isEmpty()) {
-                        removeConfiguration(netPath);
+                        removeConfiguration(QString::number(qHash(netPath)));
                     }  else {
-                        if(!remainingNetworks.contains(servicePath)) {
-                            removeConfiguration(QString::number(qHash(servicePath)));
-                        }
+                        removeConfiguration(QString::number(qHash(servicePath)));
                     }
+                    knownNetworks[device.getType()].removeAll(netPath);
                 }
             }
         }
@@ -446,17 +466,11 @@ void QConnmanEngine::devicePropertyChangedContext(const QString &path,const QStr
 
 void QConnmanEngine::technologyPropertyChangedContext(const QString & path, const QString &item, const QDBusVariant &value)
 {
-//  qWarning() << __FUNCTION__ << path << item << value.variant();
-//  if(item == "Devices") {
-//      QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
-//      QStringList list = qdbus_cast<QStringList>(arg);
-//  }
+  if(item == "Devices") {
+      QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
+      QStringList list = qdbus_cast<QStringList>(arg);
+  }
   if(item == "State") {
-      if(value.variant().toString() == "enabled") {
-      }
-      if(value.variant().toString() == "offline") {
-          deviceMap.remove(path);
-      }
       if(value.variant().toString() == "available") {
           QConnmanTechnologyInterface tech(connmanManager->getPathForTechnology(path));
           foreach(const QString devPath, tech.getDevices()) {
@@ -464,51 +478,49 @@ void QConnmanEngine::technologyPropertyChangedContext(const QString & path, cons
               dev = new QConnmanDeviceInterface(devPath,this);
               connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
                       this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
-
               deviceMap.insert(path,QStringList() << devPath);
           }
       }
+      if(value.variant().toString() == "offline") {
+          deviceMap.remove(path);
+      }
   }
 }
 
 void QConnmanEngine::configurationChange(const QString &id)
 {
     QMutexLocker locker(&mutex);
-    bool changed = false;
 
     if (accessPointConfigurations.contains(id)) {
+
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
 
         QString servicePath = serviceFromId(id);
         QConnmanServiceInterface *serv;
         serv = new QConnmanServiceInterface(servicePath);
         QString networkName = serv->getName();
+
         QNetworkConfiguration::StateFlags curState = getStateForService(servicePath);
 
         ptr->mutex.lock();
 
         if (!ptr->isValid) {
             ptr->isValid = true;
-            changed = true;
         }
 
         if (ptr->name != networkName) {
             ptr->name = networkName;
-            changed = true;
         }
 
         if (ptr->state != curState) {
             ptr->state = curState;
-            changed = true;
         }
 
         ptr->mutex.unlock();
 
-        if (changed) {
-            locker.unlock();
-            emit configurationChanged(ptr);
-            locker.relock();
-        }
+        locker.unlock();
+        emit configurationChanged(ptr);
+        locker.relock();
 
     }
      locker.unlock();
@@ -517,7 +529,6 @@ void QConnmanEngine::configurationChange(const QString &id)
 
 QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QString &service)
 {
-    qWarning() << __FUNCTION__;
     QMutexLocker locker(&mutex);
     QConnmanServiceInterface serv(service);
     QNetworkConfiguration::StateFlags flag = QNetworkConfiguration::Defined;
@@ -555,23 +566,76 @@ QString QConnmanEngine::typeToBearer(const QString &type)
     return "Unknown";
 }
 
-void QConnmanEngine::removeConfiguration(const QString &netpath)
+void QConnmanEngine::removeConfiguration(const QString &id)
 {
     QMutexLocker locker(&mutex);
-    const QString id = QString::number(qHash(netpath));
+
     if (accessPointConfigurations.contains(id)) {
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(id);
-        QConnmanDeviceInterface device(netpath.section("/",0,5),this);
         locker.unlock();
-        knownNetworks[device.getType()].removeAll(netpath);
         emit configurationRemoved(ptr);
         locker.relock();
     }
 }
 
+void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
+{
+
+    QMutexLocker locker(&mutex);
+    QConnmanServiceInterface *serv;
+    serv = new QConnmanServiceInterface(servicePath);
+    const QString netPath = getNetworkForService(servicePath);
+
+    QConnmanNetworkInterface *network;
+    network = new QConnmanNetworkInterface(netPath, this);
+
+    const QString id = QString::number(qHash(servicePath));
+
+    if (!accessPointConfigurations.contains(id)) {
+        QConnmanDeviceInterface device(netPath.section("/",0,5),this);
+        knownNetworks[device.getType()]<< netPath;
+//        knownNetworks << servicePath;
+        connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
+
+        QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate();
+
+        QString networkName = serv->getName();
+
+        if(serv->getType() == "Cellular") {
+            networkName = serv->getAPN();
+        }
+
+        cpPriv->name = networkName;
+        cpPriv->isValid = true;
+        cpPriv->id = id;
+        cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
+        cpPriv->bearer = bearerName(id);
+
+        if(serv->getSecurity() == "none") {
+            cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
+        } else {
+            cpPriv->purpose = QNetworkConfiguration::PrivatePurpose;
+        }
+
+        connect(network,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                this,SLOT(networkPropertyChangedContext(QString,QString, QDBusVariant)));
+
+        cpPriv->state = getStateForService(servicePath);
+
+        QNetworkConfigurationPrivatePointer ptr(cpPriv);
+        accessPointConfigurations.insert(ptr->id, ptr);
+        foundConfigurations.append(cpPriv);
+
+        locker.unlock();
+        emit configurationAdded(ptr);
+        locker.relock();
+        emit updateCompleted();
+    }
+}
+
 void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
 {
-//    qWarning() << __FUNCTION__ << networkPath;
     QMutexLocker locker(&mutex);
 
     QConnmanNetworkInterface *network;
@@ -580,11 +644,18 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
     QConnmanServiceInterface *serv;
 
     QString id;
+    QConnmanDeviceInterface device(networkPath.section("/",0,5),this);
+
     if(servicePath.isEmpty()) {
         id = QString::number(qHash(networkPath));
     } else {
         id = QString::number(qHash(servicePath));
+        serv = new QConnmanServiceInterface(servicePath,this);
+        connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
     }
+    knownNetworks[device.getType()]<< networkPath;
+
     if (!accessPointConfigurations.contains(id)) {
         connect(network,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
                 this,SLOT(networkPropertyChangedContext(QString,QString, QDBusVariant)));
@@ -598,16 +669,13 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
 
         QString bearerName;
 
-        QConnmanDeviceInterface device(networkPath.section("/",0,5),this);
         if(servicePath.isEmpty()) {
+            QString devicePath = networkPath.section("/",0,5);
+            QConnmanDeviceInterface device(devicePath,this);
             bearerName = typeToBearer(device.getType());
         } else {
-            serv = new QConnmanServiceInterface(servicePath,this);
             bearerName = typeToBearer(serv->getType());
-            connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
-                    this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
         }
-        knownNetworks[device.getType()]<< networkPath;
 
         if(bearerName == "Cellular") {
             QString mode = serv->getMode();
@@ -642,7 +710,57 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
         locker.unlock();
         emit configurationAdded(ptr);
         locker.relock();
+        emit updateCompleted();
+    }
+}
+
+bool QConnmanEngine::requiresPolling() const
+{
+    return false;
+}
+
+
+QConnmanConnectThread::QConnmanConnectThread(QObject *parent)
+    :QThread(parent),
+    servicePath(), identifier()
+{
+}
+
+QConnmanConnectThread::~QConnmanConnectThread()
+{
+}
+
+void QConnmanConnectThread::stop()
+{
+    if(currentThread() != this) {
+        QMetaObject::invokeMethod(this, "quit",
+                                  Qt::QueuedConnection);
+    } else {
+        quit();
     }
+    wait();
+}
+
+void QConnmanConnectThread::run()
+{
+    QConnmanServiceInterface serv(servicePath);
+    if(!serv.isValid()) {
+        emit connectionError(identifier, QBearerEngineImpl::InterfaceLookupError);
+    } else {
+        serv.connect();
+    }
+}
+
+void QConnmanConnectThread::setServicePath(const QString &path)
+{
+    QMutexLocker locker(&mutex);
+    servicePath = path;
+}
+
+void QConnmanConnectThread::setIdentifier(const QString &id)
+{
+    QMutexLocker locker(&mutex);
+    identifier = id;
 }
 
 QT_END_NAMESPACE
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index 849d8c9..b5f1488 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -59,12 +59,14 @@
 
 #include <QMap>
 #include <QVariant>
+#include <QtCore/qthread.h>
 
 #ifndef QT_NO_BEARERMANAGEMENT
 #ifndef QT_NO_DBUS
 
 QT_BEGIN_NAMESPACE
 
+class QConnmanConnectThread;
 class QConnmanEngine : public QBearerEngineImpl
 {
     Q_OBJECT
@@ -114,6 +116,7 @@ private:
     QConnmanManagerInterface *connmanManager;
 
     QList<QNetworkConfigurationPrivate *> foundConfigurations;
+
     void getNetworkListing();
 
     QString getServiceForNetwork(const QString &network);
@@ -125,14 +128,46 @@ private:
     QNetworkConfiguration::StateFlags getStateForService(const QString &service);
     QString typeToBearer(const QString &type);
 
-    void removeConfiguration(const QString &path);
+    void removeConfiguration(const QString &servicePath);
+    void addServiceConfiguration(const QString &servicePath);
     void addNetworkConfiguration(const QString &worknetPath);
     QDateTime activeTime;
 
 
     QMap<QString,QConnmanTechnologyInterface *> technologies;
-    QMap<QString,QStringList> knownNetworks;
-    QMap<QString,QStringList> deviceMap;
+ //   QStringList knownNetworks;
+
+   QMap<QString,QStringList> knownNetworks;
+   QMap<QString,QStringList> deviceMap;
+
+protected:
+    bool requiresPolling() const;
+    QConnmanConnectThread *connThread;
+};
+
+class QConnmanConnectThread : public QThread
+{
+    Q_OBJECT
+
+public:
+    QConnmanConnectThread(QObject *parent = 0);
+    ~QConnmanConnectThread();
+    bool keepRunning;
+    void stop();
+    void setServicePath(const QString &path);
+    void setIdentifier(const QString &id);
+
+Q_SIGNALS:
+    void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error);
+
+protected:
+    void run();
+    QString servicePath;
+    QString identifier;
+
+private:
+    QMutex mutex;
+
 };
 
 QT_END_NAMESPACE
-- 
cgit v0.12


From 5aa3b45acf810f444487d0904a9c84be8687623d Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Thu, 24 Jun 2010 12:23:34 +1000
Subject: Added surround sound support to win32 low-level audio backend.

Task-number:QTBUG-11586
Reviewed-by:Andrew den Exter
---
 src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp |  5 +++
 src/multimedia/audio/qaudiooutput_win32_p.cpp     | 54 +++++++++++++++++++----
 2 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
index 465bc98..4e6b2df 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
@@ -374,6 +374,11 @@ void QAudioDeviceInfoInternal::updateLists()
 #endif
 	channelz.append(1);
 	channelz.append(2);
+        if (mode == QAudio::AudioOutput) {
+            channelz.append(4);
+            channelz.append(6);
+            channelz.append(8);
+        }
 
 	byteOrderz.append(QAudioFormat::LittleEndian);
 
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index 533583a..513c16c 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -52,6 +52,10 @@
 
 #include "qaudiooutput_win32_p.h"
 
+#include <audiodefs.h>
+
+#define _KSDATAFORMAT_SUBTYPE_PCM (GUID) {0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}
+
 //#define DEBUG_AUDIO 1
 
 QT_BEGIN_NAMESPACE
@@ -258,15 +262,47 @@ bool QAudioOutputPrivate::open()
 	}
     }
 
-    if(waveOutOpen(&hWaveOut, devId, &wfx,
-                (DWORD_PTR)&waveOutProc,
-                (DWORD_PTR) this,
-                CALLBACK_FUNCTION) != MMSYSERR_NOERROR) {
-        errorState = QAudio::OpenError;
-        deviceState = QAudio::StoppedState;
-        emit stateChanged(deviceState);
-        qWarning("QAudioOutput: open error");
-        return false;
+    if ( settings.channels() <= 2) {
+        if(waveOutOpen(&hWaveOut, devId, &wfx,
+                    (DWORD_PTR)&waveOutProc,
+                    (DWORD_PTR) this,
+                    CALLBACK_FUNCTION) != MMSYSERR_NOERROR) {
+            errorState = QAudio::OpenError;
+            deviceState = QAudio::StoppedState;
+            emit stateChanged(deviceState);
+            qWarning("QAudioOutput: open error");
+            return false;
+        }
+    } else {
+        WAVEFORMATEXTENSIBLE wfex;
+        wfex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
+        wfex.Format.nChannels = settings.channels();
+        wfex.Format.wBitsPerSample = settings.sampleSize();
+        wfex.Format.nSamplesPerSec = settings.frequency();
+        wfex.Format.nBlockAlign = wfex.Format.nChannels*wfex.Format.wBitsPerSample/8;
+        wfex.Format.nAvgBytesPerSec=wfex.Format.nSamplesPerSec*wfex.Format.nBlockAlign;
+        wfex.Samples.wValidBitsPerSample=wfex.Format.wBitsPerSample;
+        wfex.SubFormat=_KSDATAFORMAT_SUBTYPE_PCM;
+        wfex.Format.cbSize=22;
+
+        wfex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
+        if (settings.channels() >= 4)
+            wfex.dwChannelMask |= SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT;
+        if (settings.channels() >= 6)
+            wfex.dwChannelMask |= SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY;
+        if (settings.channels() == 8)
+            wfex.dwChannelMask |= SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT;
+
+        if(waveOutOpen(&hWaveOut, devId, &wfex.Format,
+                    (DWORD_PTR)&waveOutProc,
+                    (DWORD_PTR) this,
+                    CALLBACK_FUNCTION) != MMSYSERR_NOERROR) {
+            errorState = QAudio::OpenError;
+            deviceState = QAudio::StoppedState;
+            emit stateChanged(deviceState);
+            qWarning("QAudioOutput: open error");
+            return false;
+        }
     }
 
     totalTimeValue = 0;
-- 
cgit v0.12


From c2cc288a3acb9493a13449fd36fcc9ebce40807b Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Thu, 24 Jun 2010 13:18:37 +1000
Subject: Added surround sound support to alsa low-level audio backend.

Task-number:QTBUG-11586
Reviewed-by:Derick Hawcroft
---
 src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 46 ++++++++++++++++++++++++
 src/multimedia/audio/qaudiodeviceinfo_alsa_p.h   |  5 +++
 2 files changed, 51 insertions(+)

diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index 36270a7..f663dd2 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -62,6 +62,8 @@ QAudioDeviceInfoInternal::QAudioDeviceInfoInternal(QByteArray dev, QAudio::Mode
 
     device = QLatin1String(dev);
     this->mode = mode;
+
+    checkSurround();
 }
 
 QAudioDeviceInfoInternal::~QAudioDeviceInfoInternal()
@@ -389,6 +391,9 @@ void QAudioDeviceInfoInternal::updateLists()
     }
     channelz.append(1);
     channelz.append(2);
+    if (surround40) channelz.append(4);
+    if (surround51) channelz.append(6);
+    if (surround71) channelz.append(8);
     sizez.append(8);
     sizez.append(16);
     sizez.append(32);
@@ -483,4 +488,45 @@ QByteArray QAudioDeviceInfoInternal::defaultOutputDevice()
     return devices.first();
 }
 
+void QAudioDeviceInfoInternal::checkSurround()
+{
+    QList<QByteArray> devices;
+    surround40 = false;
+    surround51 = false;
+    surround71 = false;
+
+    void **hints, **n;
+    char *name, *descr, *io;
+
+    if(snd_device_name_hint(-1, "pcm", &hints) < 0)
+        return;
+
+    n = hints;
+
+    while (*n != NULL) {
+        name = snd_device_name_get_hint(*n, "NAME");
+        descr = snd_device_name_get_hint(*n, "DESC");
+        io = snd_device_name_get_hint(*n, "IOID");
+        if((name != NULL) && (descr != NULL)) {
+            QString deviceName = QLatin1String(name);
+            if (mode == QAudio::AudioOutput) {
+                if(deviceName.contains(QLatin1String("surround40")))
+                    surround40 = true;
+                if(deviceName.contains(QLatin1String("surround51")))
+                    surround51 = true;
+                if(deviceName.contains(QLatin1String("surround71")))
+                    surround71 = true;
+            }
+        }
+        if(name != NULL)
+            free(name);
+        if(descr != NULL)
+            free(descr);
+        if(io != NULL)
+            free(io);
+        ++n;
+    }
+    snd_device_name_free_hint(hints);
+}
+
 QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
index 6f9a459..8525980 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
@@ -98,6 +98,11 @@ private:
     bool open();
     void close();
 
+    void checkSurround();
+    bool surround40;
+    bool surround51;
+    bool surround71;
+
     QString device;
     QAudio::Mode mode;
     QAudioFormat nearest;
-- 
cgit v0.12


From 19ef773e1308b2bdce8ec2efd700d5754c01f6d3 Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Thu, 24 Jun 2010 14:19:26 +1000
Subject: Fixed compile error introduced by win32 surround sound support
 change.

Reviewed-by:Andrew den Exter
---
 src/multimedia/audio/qaudiooutput_win32_p.cpp | 43 ++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index 513c16c..56de4ee 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -52,7 +52,48 @@
 
 #include "qaudiooutput_win32_p.h"
 
-#include <audiodefs.h>
+#ifndef SPEAKER_FRONT_LEFT
+    #define SPEAKER_FRONT_LEFT            0x00000001
+    #define SPEAKER_FRONT_RIGHT           0x00000002
+    #define SPEAKER_FRONT_CENTER          0x00000004
+    #define SPEAKER_LOW_FREQUENCY         0x00000008
+    #define SPEAKER_BACK_LEFT             0x00000010
+    #define SPEAKER_BACK_RIGHT            0x00000020
+    #define SPEAKER_FRONT_LEFT_OF_CENTER  0x00000040
+    #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
+    #define SPEAKER_BACK_CENTER           0x00000100
+    #define SPEAKER_SIDE_LEFT             0x00000200
+    #define SPEAKER_SIDE_RIGHT            0x00000400
+    #define SPEAKER_TOP_CENTER            0x00000800
+    #define SPEAKER_TOP_FRONT_LEFT        0x00001000
+    #define SPEAKER_TOP_FRONT_CENTER      0x00002000
+    #define SPEAKER_TOP_FRONT_RIGHT       0x00004000
+    #define SPEAKER_TOP_BACK_LEFT         0x00008000
+    #define SPEAKER_TOP_BACK_CENTER       0x00010000
+    #define SPEAKER_TOP_BACK_RIGHT        0x00020000
+    #define SPEAKER_RESERVED              0x7FFC0000
+    #define SPEAKER_ALL                   0x80000000
+#endif
+
+#ifndef _WAVEFORMATEXTENSIBLE_
+
+    #define _WAVEFORMATEXTENSIBLE_
+    typedef struct
+    {
+        WAVEFORMATEX Format;          // Base WAVEFORMATEX data
+        union
+        {
+            WORD wValidBitsPerSample; // Valid bits in each sample container
+            WORD wSamplesPerBlock;    // Samples per block of audio data; valid
+                                      // if wBitsPerSample=0 (but rarely used).
+            WORD wReserved;           // Zero if neither case above applies.
+        } Samples;
+        DWORD dwChannelMask;          // Positions of the audio channels
+        GUID SubFormat;               // Format identifier GUID
+    } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE, *LPPWAVEFORMATEXTENSIBLE;
+    typedef const WAVEFORMATEXTENSIBLE* LPCWAVEFORMATEXTENSIBLE;
+
+#endif
 
 #define _KSDATAFORMAT_SUBTYPE_PCM (GUID) {0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}
 
-- 
cgit v0.12


From a67e9a9a0d0e335db2f7b7232c6c7ec42750533c Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Fri, 25 Jun 2010 08:41:04 +1000
Subject: Fixed compile error in multimedia module WAVE_FORMAT_EXTENSIBLE not
 in v6.0 ms SDK only in v6.1's

Reviewed-by:TrustMe
---
 src/multimedia/audio/qaudiooutput_win32_p.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index 56de4ee..d0f1791 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -95,6 +95,10 @@
 
 #endif
 
+#if !defined(WAVE_FORMAT_EXTENSIBLE)
+#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
+#endif
+
 #define _KSDATAFORMAT_SUBTYPE_PCM (GUID) {0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}
 
 //#define DEBUG_AUDIO 1
-- 
cgit v0.12


From 473eb62791f2e489aacd4be88df101ce26fe92ea Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Fri, 25 Jun 2010 10:47:40 +1000
Subject: Fix compile err with win2005 compiler for multimedia lib.

Reviewed-by:TrustMe
---
 src/multimedia/audio/qaudiooutput_win32_p.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index d0f1791..f26198f 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -99,7 +99,8 @@
 #define WAVE_FORMAT_EXTENSIBLE 0xFFFE
 #endif
 
-#define _KSDATAFORMAT_SUBTYPE_PCM (GUID) {0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}}
+DEFINE_GUID(_KSDATAFORMAT_SUBTYPE_PCM,
+0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
 
 //#define DEBUG_AUDIO 1
 
-- 
cgit v0.12


From 0ad9edf26daf78d697cd9e83c639c65879461b0f Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Fri, 25 Jun 2010 12:40:38 +1000
Subject: Fix compile error on win32 with multimedia lib.

Reviewed-by:TrustMe
---
 src/multimedia/audio/qaudiooutput_win32_p.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index f26198f..075d100 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -99,9 +99,6 @@
 #define WAVE_FORMAT_EXTENSIBLE 0xFFFE
 #endif
 
-DEFINE_GUID(_KSDATAFORMAT_SUBTYPE_PCM,
-0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
-
 //#define DEBUG_AUDIO 1
 
 QT_BEGIN_NAMESPACE
@@ -328,6 +325,8 @@ bool QAudioOutputPrivate::open()
         wfex.Format.nBlockAlign = wfex.Format.nChannels*wfex.Format.wBitsPerSample/8;
         wfex.Format.nAvgBytesPerSec=wfex.Format.nSamplesPerSec*wfex.Format.nBlockAlign;
         wfex.Samples.wValidBitsPerSample=wfex.Format.wBitsPerSample;
+        static const GUID _KSDATAFORMAT_SUBTYPE_PCM = {
+             0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
         wfex.SubFormat=_KSDATAFORMAT_SUBTYPE_PCM;
         wfex.Format.cbSize=22;
 
-- 
cgit v0.12


From c049aff3ce283b9ba9a17a63aedaa70efb51ad09 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 25 Jun 2010 10:32:47 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 4b88f595ab62b7c5f703a286c4f5f13f8784a936

* Fix crash/regression in thai line word breaking when libthai is installed:
  Commit 4b88f595ab62b7c5f703a286c4f5f13f8784a936 upstream ensures the zero
  termination of the string passed to libthai.
---
 src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index fc2bdbf..e153ba9 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -53,6 +53,8 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr)
         else
             result[i] = '?';
     }
+
+    result[len] = 0;
 }
 
 static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes)
@@ -70,8 +72,8 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
     if (!th_brk)
         return;
 
-    if (len > 128)
-        cstr = (char *)malloc(len*sizeof(char));
+    if (len >= 128)
+        cstr = (char *)malloc(len*sizeof(char) + 1);
 
     to_tis620(string, len, cstr);
 
@@ -96,7 +98,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
     if (break_positions != brp)
         free(break_positions);
 
-    if (len > 128)
+    if (len >= 128)
         free(cstr);
 }
 
-- 
cgit v0.12


From 63e3ded08cc619993598462ca0f839b2239dd2c5 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Sun, 27 Jun 2010 00:00:16 +0200
Subject: Updated WebKit from /home/shausman/src/webkit/trunk to
 qtwebkit/qtwebkit-4.6 ( fc13f9b396e1448cd71266f56ba7a93de5cf6ed9 )

Changes in WebKit/qt since the last update:

* Benjamin's update/fixes to the backport of https://bugs.webkit.org/show_bug.cgi?id=33150
---
 src/3rdparty/webkit/VERSION                        |  2 +-
 src/3rdparty/webkit/WebCore/page/FrameView.cpp     | 30 ++++++++++++++--------
 src/3rdparty/webkit/WebCore/page/FrameView.h       |  6 +++--
 .../webkit/WebCore/platform/ScrollView.cpp         |  7 +++--
 src/3rdparty/webkit/WebCore/platform/ScrollView.h  |  5 +++-
 .../webkit/WebCore/rendering/RenderLayer.cpp       | 24 +++++++++++++++++
 .../webkit/WebCore/rendering/RenderLayer.h         |  2 ++
 .../WebKit/qt/tests/qwebview/tst_qwebview.cpp      | 26 ++++++++++++++++++-
 8 files changed, 84 insertions(+), 18 deletions(-)

diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 1b8e789..354e21d 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
 
 and has the sha1 checksum
 
-        be1a105be93d7fcbe36d93d0827dc6e98b55de0c
+        fc13f9b396e1448cd71266f56ba7a93de5cf6ed9
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index cc7d171..1ea166f 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -780,7 +780,7 @@ void FrameView::removeFixedObject()
         setCanBlitOnScroll(!useSlowRepaints());
 }
 
-void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
 {
     const size_t fixedObjectThreshold = 5;
 
@@ -790,7 +790,7 @@ void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
 
     if (!positionedObjects || positionedObjects->isEmpty()) {
         hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
-        return;
+        return true;
     }
 
     // Get the rects of the fixed objects visible in the rectToScroll
@@ -801,9 +801,9 @@ void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
         RenderBox* renderBox = *it;
         if (renderBox->style()->position() != FixedPosition)
             continue;
-        IntRect topLevelRect;
-        IntRect updateRect = renderBox->paintingRootRect(topLevelRect);
-        updateRect.move(-scrollX(), -scrollY());
+        IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
+        updateRect = contentsToWindow(updateRect);
+
         updateRect.intersect(rectToScroll);
         if (!updateRect.isEmpty()) {
             if (subRectToUpdate.size() >= fixedObjectThreshold) {
@@ -819,7 +819,7 @@ void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
         // 1) scroll
         hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
 
-        // 2) update the area of fixed objets that has been invalidated
+        // 2) update the area of fixed objects that has been invalidated
         size_t fixObjectsCount = subRectToUpdate.size();
         for (size_t i = 0; i < fixObjectsCount; ++i) {
             IntRect updateRect = subRectToUpdate[i];
@@ -829,12 +829,11 @@ void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
             updateRect.intersect(rectToScroll);
             hostWindow()->repaint(updateRect, true, false, true);
         }
-    } else {
-        // the number of fixed objects exceed the threshold, so we repaint everything.
-        IntRect updateRect = clipRect;
-        updateRect.intersect(rectToScroll);
-        hostWindow()->repaint(updateRect, true, false, true);
+        return true;
     }
+
+    // the number of fixed objects exceed the threshold, we cannot use the fast path
+    return false;
 }
 
 void FrameView::setIsOverlapped(bool isOverlapped)
@@ -964,6 +963,15 @@ void FrameView::scrollPositionChanged()
 {
     frame()->eventHandler()->sendScrollEvent();
 
+    // For fixed position elements, update widget positions and compositing layers after scrolling,
+    // but only if we're not inside of layout.
+    if (!m_nestedLayoutCount && hasFixedObjects()) {
+        if (RenderView* root = m_frame->contentRenderer()) {
+            root->updateWidgetPositions();
+            root->layer()->updateRepaintRectsAfterScroll();
+        }
+    }
+
 #if USE(ACCELERATED_COMPOSITING)
     // We need to update layer positions after scrolling to account for position:fixed layers.
     Document* document = m_frame->document();
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h
index ed1e6c6..6350a2a 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.h
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.h
@@ -131,7 +131,7 @@ public:
 
     virtual void scrollRectIntoViewRecursively(const IntRect&);
     virtual void setScrollPosition(const IntPoint&);
-    void scrollPositionChanged();
+    virtual void scrollPositionChanged();
 
     String mediaType() const;
     void setMediaType(const String&);
@@ -200,7 +200,7 @@ public:
     void invalidateScrollCorner();
 
 protected:
-    virtual void scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
 
 private:
     FrameView(Frame*);
@@ -214,6 +214,8 @@ private:
     bool useSlowRepaints() const;
     bool useSlowRepaintsIfNotOverlapped() const;
 
+    bool hasFixedObjects() const { return m_fixedObjectCount > 0; }
+
     void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
 
     void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
index 9e15c43..518c454 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
@@ -259,6 +259,7 @@ void ScrollView::valueChanged(Scrollbar* scrollbar)
     if (scrollbarsSuppressed())
         return;
 
+    scrollPositionChanged();
     scrollContents(scrollDelta);
 }
 
@@ -509,7 +510,8 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
 
     if (canBlitOnScroll()) { // The main frame can just blit the WebView window
        // FIXME: Find a way to blit subframes without blitting overlapping content
-       scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect);
+       if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
+           hostWindow()->repaint(updateRect, true, false, true);
     } else { 
        // We need to go ahead and repaint the entire backing store.  Do it now before moving the
        // windowed plugins.
@@ -524,9 +526,10 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
     hostWindow()->paint();
 }
 
-void ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
 {
     hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+    return true;
 }
 
 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
index 7060d07..0e40334 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
@@ -246,7 +246,7 @@ protected:
     virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
 
     // Scroll the content by blitting the pixels
-    virtual void scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
     
 private:
     RefPtr<Scrollbar> m_horizontalScrollbar;
@@ -281,6 +281,9 @@ private:
     // Called to update the scrollbars to accurately reflect the state of the view.
     void updateScrollbars(const IntSize& desiredOffset);
 
+    // Called when the scroll position within this view changes.  FrameView overrides this to generate repaint invalidations.
+    virtual void scrollPositionChanged() {}
+
     void platformInit();
     void platformDestroy();
     void platformAddChild(Widget*);
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
index fea61c9..6c73114 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
@@ -331,6 +331,14 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
         m_marquee->updateMarqueePosition();
 }
 
+IntRect RenderLayer::repaintRectIncludingDescendants() const
+{
+    IntRect repaintRect = m_repaintRect;
+    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+        repaintRect.unite(child->repaintRectIncludingDescendants());
+    return repaintRect;
+}
+
 void RenderLayer::computeRepaintRects()
 {
     RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
@@ -338,6 +346,22 @@ void RenderLayer::computeRepaintRects()
     m_outlineBox = renderer()->outlineBoundsForRepaint(repaintContainer);
 }
 
+void RenderLayer::updateRepaintRectsAfterScroll(bool fixed)
+{
+    if (fixed || renderer()->style()->position() == FixedPosition) {
+        computeRepaintRects();
+        fixed = true;
+    } else if (renderer()->hasTransform()) {
+        // Transforms act as fixed position containers, so nothing inside a
+        // transformed element can be fixed relative to the viewport if the
+        // transformed element is not fixed itself or child of a fixed element.
+        return;
+    }
+
+    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+        child->updateRepaintRectsAfterScroll(fixed);
+}
+
 void RenderLayer::updateTransform()
 {
     // hasTransform() on the renderer is also true when there is transform-style: preserve-3d or perspective set,
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
index a274638..ac51d9d 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
@@ -384,7 +384,9 @@ public:
 
     // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
     IntRect repaintRect() const { return m_repaintRect; }
+    IntRect repaintRectIncludingDescendants() const;
     void computeRepaintRects();
+    void updateRepaintRectsAfterScroll(bool fixed = false);
     void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
     
     int staticX() const { return m_staticX; }
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index d466ab5..5e8e8a9 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -29,7 +29,31 @@
 #include <qdiriterator.h>
 #include <qwebkitversion.h>
 #include <qwebframe.h>
-
+#include <qtimer.h>
+#include <qsignalspy.h>
+
+/**
+ * Starts an event loop that runs until the given signal is received.
+ Optionally the event loop
+ * can return earlier on a timeout.
+ *
+ * \return \p true if the requested signal was received
+ *         \p false on timeout
+ */
+static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
+{
+    QEventLoop loop;
+    QObject::connect(obj, signal, &loop, SLOT(quit()));
+    QTimer timer;
+    QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
+    if (timeout > 0) {
+        QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
+        timer.setSingleShot(true);
+        timer.start(timeout);
+    }
+    loop.exec();
+    return timeoutSpy.isEmpty();
+}
 class tst_QWebView : public QObject
 {
     Q_OBJECT
-- 
cgit v0.12


From 361f409d513b7360b1a6f919799cc1948835aef3 Mon Sep 17 00:00:00 2001
From: Lorn Potter <lorn.potter@nokia.com>
Date: Mon, 28 Jun 2010 09:30:53 +1000
Subject: fix actions regarding  removal of connman. make tests pass on desktop

---
 src/plugins/bearer/connman/qconnmanengine.cpp | 162 ++++++++++++++------------
 src/plugins/bearer/connman/qconnmanengine.h   |  10 +-
 2 files changed, 91 insertions(+), 81 deletions(-)

diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index c1df710..bdff815 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -91,9 +91,14 @@ void QConnmanEngine::initialize()
         foreach(const QString devicePath,tech->getDevices()) {
             QConnmanDeviceInterface *dev;
             dev = new QConnmanDeviceInterface(devicePath);
-            connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
-                    this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
-            deviceMap.insert(techPath,QStringList() << devicePath);
+            if(!deviceMap.value(techPath).contains(devicePath)) {
+                connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                        this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
+                deviceMap.insert(techPath,QStringList() << devicePath);
+                foreach(const QString network,dev->getNetworks()) {
+                    serviceNetworks.insert(getServiceForNetwork(network),network);
+                }
+            }
         }
     }
 
@@ -104,9 +109,28 @@ void QConnmanEngine::initialize()
 QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
 {
     QMutexLocker locker(&mutex);
-    foundConfigurations.clear();
+  //  foundConfigurations.clear();
     getNetworkListing();
-    return foundConfigurations;
+    QList<QNetworkConfigurationPrivate *> fetchedConfigurations;
+    QNetworkConfigurationPrivate* cpPriv = 0;
+
+    for (int i = 0; i < foundConfigurations.count(); ++i) {
+        QNetworkConfigurationPrivate *config = new QNetworkConfigurationPrivate;
+        cpPriv = foundConfigurations.at(i);
+
+        config->name = cpPriv->name;
+        config->isValid = cpPriv->isValid;
+        config->id = cpPriv->id;
+        config->state = cpPriv->state;
+        config->type = cpPriv->type;
+        config->roamingSupported = cpPriv->roamingSupported;
+        config->purpose = cpPriv->purpose;
+        config->bearer = cpPriv->bearer;
+
+        fetchedConfigurations.append(config);
+    }
+    return fetchedConfigurations;
+//    return foundConfigurations;
 }
 
 void QConnmanEngine::getNetworkListing()
@@ -128,6 +152,7 @@ void QConnmanEngine::getNetworkListing()
 
 void QConnmanEngine::doRequestUpdate()
 {
+    connmanManager->requestScan("");
     getConfigurations();
     emit updateCompleted();
 }
@@ -135,23 +160,7 @@ void QConnmanEngine::doRequestUpdate()
 QString QConnmanEngine::getInterfaceFromId(const QString &id)
 {
     QMutexLocker locker(&mutex);
-
-    QString servicePath = serviceFromId(id);
-    QString netPath = getNetworkForService(servicePath);
-
-    QMapIterator<QString,QStringList> i(deviceMap);
-    while(i.hasNext()) {
-        i.next();
-        if(i.value().count() > 0) {
-            QConnmanDeviceInterface dev(i.value().at(0));
-            foreach(const QString network, dev.getNetworks()) {
-                if(network == netPath) {
-                    return dev.getInterface();
-                }
-            }
-        }
-    }
-    return QString();
+    return configInterfaces.value(id);
 }
 
 bool QConnmanEngine::hasIdentifier(const QString &id)
@@ -216,7 +225,7 @@ void QConnmanEngine::requestUpdate()
 QString QConnmanEngine::serviceFromId(const QString &id)
 {
     QMutexLocker locker(&mutex);
-    foreach(QString service, connmanManager->getServices()) {
+    foreach(const QString service, serviceNetworks.keys()) {
         if (id == QString::number(qHash(service)))
             return service;
     }
@@ -241,7 +250,7 @@ QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
     QConnmanServiceInterface serv(service);
     QString servState = serv.getState();
 
-    if(servState == "idle" || servState == "failure") {
+    if(serv.isFavorite() && servState == "idle" || servState == "failure") {
         return QNetworkSession::Disconnected;
     }
 
@@ -335,43 +344,8 @@ QString QConnmanEngine::getServiceForNetwork(const QString &netPath)
     return QString();
 }
 
-QString QConnmanEngine::getNetworkForService(const QString &servPath)
-{
-    QMutexLocker locker(&mutex);
-    QMap<QString,QString> map;
-
-     QMapIterator<QString,QStringList> i(deviceMap);
-     while(i.hasNext()) {
-         i.next();
-         if(i.value().count() > 0) {
-             QConnmanDeviceInterface device(i.value().at(0));
-        QMap<QString,int> netMapStrength;
-        foreach(const QString netPath, knownNetworks[device.getType()]) {
-
-                QConnmanNetworkInterface network1(netPath, this);
-                QString netname = network1.getName();
-                qint32 sigStrength = network1.getSignalStrength();
-
-                if(netMapStrength.contains(netname)
-                    && netMapStrength.value(netname) < sigStrength) {
-                    netMapStrength.remove(netname);
-                    map.remove(netname);
-                }
-                netMapStrength.insert(netname, sigStrength);
-                map.insert(netname,netPath);
-            }
-        }
-    }
 
-    QConnmanServiceInterface *serv;
-    serv = new QConnmanServiceInterface(servPath);
-    if(map.contains(serv->getName())) {
-        return map.value(serv->getName());
-    }
-    return QString();
-}
-
-void QConnmanEngine::propertyChangedContext(const QString &/*path*/,const QString &item, const QDBusVariant &value)
+void QConnmanEngine::propertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
 {
     QMutexLocker locker(&mutex);
     if(item == "Services") {
@@ -413,14 +387,17 @@ void QConnmanEngine::propertyChangedContext(const QString &/*path*/,const QStrin
             }
         }
     }
+    if(item == "State") {
+// qDebug() << value.variant();
+    }
 }
 
 void QConnmanEngine::servicePropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
 {
-//    qWarning() << __FUNCTION__ << path << item << value.variant();
     QMutexLocker locker(&mutex);
     if(item == "State") {
         configurationChange(QString::number(qHash(path)));
+
         if(value.variant().toString() == "failure") {
             QConnmanServiceInterface serv(path);
             emit connectionError(QString::number(qHash(path)), ConnectError);
@@ -439,8 +416,17 @@ void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const Q
     if(item == "Networks") {
         QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
         QStringList remainingNetworks  = qdbus_cast<QStringList>(arg);
-        QConnmanDeviceInterface device(devpath);
-        QStringList oldnetworks = knownNetworks[device.getType()];
+        QString devicetype;
+        QMapIterator<QString,QStringList> i(deviceMap);
+        while(i.hasNext()) {
+            i.next();
+            if(i.value().contains(devpath)) {
+                devicetype = i.key();
+            }
+        }
+
+
+        QStringList oldnetworks = knownNetworks[devicetype];
 
         if(remainingNetworks.count() > oldnetworks.count()) {
             foreach(const QString netPath, remainingNetworks) {
@@ -450,14 +436,14 @@ void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const Q
             }
         } else {
             foreach(const QString netPath, oldnetworks) {
-                QString servicePath = getServiceForNetwork(netPath);
+                QString servicePath = serviceNetworks.key(netPath);
                 if(!remainingNetworks.contains(netPath)) {
                     if(servicePath.isEmpty()) {
                         removeConfiguration(QString::number(qHash(netPath)));
                     }  else {
                         removeConfiguration(QString::number(qHash(servicePath)));
                     }
-                    knownNetworks[device.getType()].removeAll(netPath);
+                    knownNetworks[devicetype].removeAll(netPath);
                 }
             }
         }
@@ -471,14 +457,18 @@ void QConnmanEngine::technologyPropertyChangedContext(const QString & path, cons
       QStringList list = qdbus_cast<QStringList>(arg);
   }
   if(item == "State") {
+
       if(value.variant().toString() == "available") {
           QConnmanTechnologyInterface tech(connmanManager->getPathForTechnology(path));
           foreach(const QString devPath, tech.getDevices()) {
-              QConnmanDeviceInterface *dev;
-              dev = new QConnmanDeviceInterface(devPath,this);
-              connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
-                      this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
-              deviceMap.insert(path,QStringList() << devPath);
+
+              if(!deviceMap.value(path).contains(devPath)) {
+                  QConnmanDeviceInterface *dev;
+                  dev = new QConnmanDeviceInterface(devPath,this);
+                  connect(dev,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                          this,SLOT(devicePropertyChangedContext(QString,QString,QDBusVariant)));
+                  deviceMap.insert(path,QStringList() << devPath);
+              }
           }
       }
       if(value.variant().toString() == "offline") {
@@ -571,6 +561,20 @@ void QConnmanEngine::removeConfiguration(const QString &id)
     QMutexLocker locker(&mutex);
 
     if (accessPointConfigurations.contains(id)) {
+
+        QString service = serviceFromId(id);
+        QConnmanServiceInterface serv(service);
+
+        disconnect(&serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                   this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
+
+        QString netPath = serviceNetworks.value(service);
+        serviceNetworks.remove(service);
+
+        QConnmanServiceInterface network(netPath);
+        disconnect(&network,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                   this,SLOT(networkPropertyChangedContext(QString,QString, QDBusVariant)));
+
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(id);
         locker.unlock();
         emit configurationRemoved(ptr);
@@ -584,20 +588,21 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
     QMutexLocker locker(&mutex);
     QConnmanServiceInterface *serv;
     serv = new QConnmanServiceInterface(servicePath);
-    const QString netPath = getNetworkForService(servicePath);
+    const QString netPath = serviceNetworks.value(servicePath);
 
     QConnmanNetworkInterface *network;
     network = new QConnmanNetworkInterface(netPath, this);
 
+    serviceNetworks.insert(servicePath,netPath);
+
     const QString id = QString::number(qHash(servicePath));
 
     if (!accessPointConfigurations.contains(id)) {
+
         QConnmanDeviceInterface device(netPath.section("/",0,5),this);
         knownNetworks[device.getType()]<< netPath;
-//        knownNetworks << servicePath;
         connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
                 this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
-
         QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate();
 
         QString networkName = serv->getName();
@@ -626,6 +631,8 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
         QNetworkConfigurationPrivatePointer ptr(cpPriv);
         accessPointConfigurations.insert(ptr->id, ptr);
         foundConfigurations.append(cpPriv);
+        configInterfaces[cpPriv->id] = device.getInterface();
+
 
         locker.unlock();
         emit configurationAdded(ptr);
@@ -650,11 +657,12 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
         id = QString::number(qHash(networkPath));
     } else {
         id = QString::number(qHash(servicePath));
-        serv = new QConnmanServiceInterface(servicePath,this);
-        connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
-                this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
+            serv = new QConnmanServiceInterface(servicePath,this);
+            connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
+                    this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
     }
     knownNetworks[device.getType()]<< networkPath;
+    serviceNetworks.insert(servicePath,networkPath);
 
     if (!accessPointConfigurations.contains(id)) {
         connect(network,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
@@ -707,6 +715,8 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
         QNetworkConfigurationPrivatePointer ptr(cpPriv);
         accessPointConfigurations.insert(ptr->id, ptr);
         foundConfigurations.append(cpPriv);
+        configInterfaces[cpPriv->id] = device.getInterface();
+
         locker.unlock();
         emit configurationAdded(ptr);
         locker.relock();
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index b5f1488..0f6dc1c 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -120,7 +120,6 @@ private:
     void getNetworkListing();
 
     QString getServiceForNetwork(const QString &network);
-    QString getNetworkForService(const QString &network);
 
     QString serviceFromId(const QString &id);
     QString networkFromId(const QString &id);
@@ -134,11 +133,12 @@ private:
     QDateTime activeTime;
 
 
-    QMap<QString,QConnmanTechnologyInterface *> technologies;
- //   QStringList knownNetworks;
+    QMap<QString,QConnmanTechnologyInterface *> technologies; // techpath, tech interface
+    QMap<QString,QString> configInterfaces; // id, interface name
+    QMap<QString,QStringList> knownNetworks; //device path, net paths list
+    QMap<QString,QStringList> deviceMap; //tech path,  device path
+    QMap<QString, QString> serviceNetworks; //service, network
 
-   QMap<QString,QStringList> knownNetworks;
-   QMap<QString,QStringList> deviceMap;
 
 protected:
     bool requiresPolling() const;
-- 
cgit v0.12


From e620e6626454f0ee10655033841baa6e3b2f4990 Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Tue, 29 Jun 2010 12:54:11 +1000
Subject: QAudioInput push mode does not work

Task-number:QTBUG-11755
Reviewed-by:Derick Hawcroft
---
 src/multimedia/audio/qaudioinput_alsa_p.cpp | 54 +++++++++++++++++++++--------
 src/multimedia/audio/qaudioinput_alsa_p.h   |  1 +
 2 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp
index c9a8b71..58669b3 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp
@@ -120,7 +120,7 @@ int QAudioInputPrivate::xrun_recovery(int err)
         if(err < 0)
             reset = true;
         else {
-            bytesAvailable = bytesReady();
+            bytesAvailable = checkBytesReady();
             if (bytesAvailable <= 0)
                 reset = true;
         }
@@ -408,7 +408,7 @@ bool QAudioInputPrivate::open()
     snd_pcm_start(handle);
 
     // Step 5: Setup timer
-    bytesAvailable = bytesReady();
+    bytesAvailable = checkBytesReady();
 
     if(pullMode)
         connect(audioSource,SIGNAL(readyRead()),this,SLOT(userFeed()));
@@ -437,19 +437,29 @@ void QAudioInputPrivate::close()
     }
 }
 
-int QAudioInputPrivate::bytesReady() const
+int QAudioInputPrivate::checkBytesReady()
 {
     if(resuming)
-        return period_size;
-
-    if(deviceState != QAudio::ActiveState && deviceState != QAudio::IdleState)
-        return 0;
-    int frames = snd_pcm_avail_update(handle);
-    if (frames < 0) return frames;
-    if((int)frames > (int)buffer_frames)
-        frames = buffer_frames;
+        bytesAvailable = period_size;
+    else if(deviceState != QAudio::ActiveState
+            && deviceState != QAudio::IdleState)
+        bytesAvailable = 0;
+    else {
+        int frames = snd_pcm_avail_update(handle);
+        if (frames < 0) {
+            bytesAvailable = frames;
+        } else {
+            if((int)frames > (int)buffer_frames)
+                frames = buffer_frames;
+            bytesAvailable = snd_pcm_frames_to_bytes(handle, frames);
+        }
+    }
+    return bytesAvailable;
+}
 
-    return snd_pcm_frames_to_bytes(handle, frames);
+int QAudioInputPrivate::bytesReady() const
+{
+    return qMax(bytesAvailable, 0);
 }
 
 qint64 QAudioInputPrivate::read(char* data, qint64 len)
@@ -460,12 +470,12 @@ qint64 QAudioInputPrivate::read(char* data, qint64 len)
     if ( !handle )
         return 0;
 
-    bytesAvailable = bytesReady();
+    bytesAvailable = checkBytesReady();
 
     if (bytesAvailable < 0) {
         // bytesAvailable as negative is error code, try to recover from it.
         xrun_recovery(bytesAvailable);
-        bytesAvailable = bytesReady();
+        bytesAvailable = checkBytesReady();
         if (bytesAvailable < 0) {
             // recovery failed must stop and set error.
             close();
@@ -639,11 +649,25 @@ bool QAudioInputPrivate::deviceReady()
         InputPrivate* a = qobject_cast<InputPrivate*>(audioSource);
         a->trigger();
     }
-    bytesAvailable = bytesReady();
+    bytesAvailable = checkBytesReady();
 
     if(deviceState != QAudio::ActiveState)
         return true;
 
+    if (bytesAvailable < 0) {
+        // bytesAvailable as negative is error code, try to recover from it.
+        xrun_recovery(bytesAvailable);
+        bytesAvailable = checkBytesReady();
+        if (bytesAvailable < 0) {
+            // recovery failed must stop and set error.
+            close();
+            errorState = QAudio::IOError;
+            deviceState = QAudio::StoppedState;
+            emit stateChanged(deviceState);
+            return 0;
+        }
+    }
+
     if(intervalTime && (timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) {
         emit notify();
         elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime;
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.h b/src/multimedia/audio/qaudioinput_alsa_p.h
index 92cef83..191235e 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.h
+++ b/src/multimedia/audio/qaudioinput_alsa_p.h
@@ -109,6 +109,7 @@ private slots:
     bool deviceReady();
 
 private:
+    int checkBytesReady();
     int xrun_recovery(int err);
     int setFormat();
     bool open();
-- 
cgit v0.12


From d198186cdb18bbb9428ca51e8771cc4fd9563452 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Date: Tue, 29 Jun 2010 10:24:44 +0200
Subject: Layout direction change by key should change alignment of QLineEdit

When QLineControl was split out of QLineEdit, a regression was
introduced. When the layout direction was altered by a key press,
the layout direction of the QLineControl would be set, but not the
QLineEdit. This would in turn mean that QLineEdit would use the wrong
layout direction for its visual alignment. Patch is a small hack to
read back the layout direction from the control after it has been
set.

Task-number: QTBUG-11204
Reviewed-by: Trond
---
 src/gui/widgets/qlineedit.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index f041a36..6e8daee 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1665,8 +1665,11 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
     }
 #endif
     d->control->processKeyEvent(event);
-    if (event->isAccepted())
+    if (event->isAccepted()) {
+        if (layoutDirection() != d->control->layoutDirection())
+            setLayoutDirection(d->control->layoutDirection());
         d->control->setCursorBlinkPeriod(0);
+    }
 }
 
 /*!
-- 
cgit v0.12


From 5a6d8c40791da2e8751965d05ae2d5ef69bed301 Mon Sep 17 00:00:00 2001
From: Lorn Potter <lorn.potter@nokia.com>
Date: Wed, 30 Jun 2010 12:20:14 +1000
Subject: make sure ap's are removed when the device is removed

---
 src/plugins/bearer/connman/qconnmanengine.cpp      | 24 ++++++++----
 .../bearer/connman/qconnmanservice_linux.cpp       | 44 +++++++++++++++++++---
 .../bearer/connman/qconnmanservice_linux_p.h       | 34 +++++++++--------
 3 files changed, 74 insertions(+), 28 deletions(-)

diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index bdff815..8775623 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -250,7 +250,7 @@ QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
     QConnmanServiceInterface serv(service);
     QString servState = serv.getState();
 
-    if(serv.isFavorite() && servState == "idle" || servState == "failure") {
+    if(serv.isFavorite() && (servState == "idle" || servState == "failure")) {
         return QNetworkSession::Disconnected;
     }
 
@@ -285,6 +285,7 @@ quint64 QConnmanEngine::bytesWritten(const QString &id)
         in >> result;
         tx.close();
     }
+
     return result;
 }
 
@@ -347,6 +348,9 @@ QString QConnmanEngine::getServiceForNetwork(const QString &netPath)
 
 void QConnmanEngine::propertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
 {
+    Q_UNUSED(path);
+//    qDebug() << __FUNCTION__ << path << item << value.variant();
+
     QMutexLocker locker(&mutex);
     if(item == "Services") {
         QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
@@ -421,11 +425,10 @@ void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const Q
         while(i.hasNext()) {
             i.next();
             if(i.value().contains(devpath)) {
-                devicetype = i.key();
+                devicetype = i.key().section("/",-1);
             }
         }
 
-
         QStringList oldnetworks = knownNetworks[devicetype];
 
         if(remainingNetworks.count() > oldnetworks.count()) {
@@ -593,14 +596,16 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
     QConnmanNetworkInterface *network;
     network = new QConnmanNetworkInterface(netPath, this);
 
-    serviceNetworks.insert(servicePath,netPath);
 
     const QString id = QString::number(qHash(servicePath));
 
     if (!accessPointConfigurations.contains(id)) {
-
         QConnmanDeviceInterface device(netPath.section("/",0,5),this);
-        knownNetworks[device.getType()]<< netPath;
+
+        serviceNetworks.insert(servicePath,netPath);
+
+        knownNetworks[device.getType()].append(netPath);
+
         connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
                 this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
         QNetworkConfigurationPrivate* cpPriv = new QNetworkConfigurationPrivate();
@@ -661,10 +666,13 @@ void QConnmanEngine::addNetworkConfiguration(const QString &networkPath)
             connect(serv,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
                     this,SLOT(servicePropertyChangedContext(QString,QString, QDBusVariant)));
     }
-    knownNetworks[device.getType()]<< networkPath;
-    serviceNetworks.insert(servicePath,networkPath);
 
     if (!accessPointConfigurations.contains(id)) {
+
+        knownNetworks[device.getType()].append(networkPath);
+
+        serviceNetworks.insert(servicePath,networkPath);
+
         connect(network,SIGNAL(propertyChangedContext(QString,QString,QDBusVariant)),
                 this,SLOT(networkPropertyChangedContext(QString,QString, QDBusVariant)));
 
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index ca76ffd..b20e7c1 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -208,17 +208,29 @@ void QConnmanManagerInterface::unregisterAgent(QDBusObjectPath /*path*/)
 {
 }
 
-void QConnmanManagerInterface::registerCounter(QDBusObjectPath /*path*/, quint32 /*interval*/)
-{
+void QConnmanManagerInterface::registerCounter(const QString &path, quint32 interval)
+{   QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("RegisterCounter"),
+                                                            QVariant::fromValue(path),
+                                                            QVariant::fromValue(interval));
+    bool ok = true;
+    if(reply.error().type() == QDBusError::InvalidArgs) {
+        qWarning() << reply.error().message();
+    }
 }
 
-void QConnmanManagerInterface::unregisterCounter(QDBusObjectPath /*path*/)
-{
+void QConnmanManagerInterface::unregisterCounter(const QString &path)
+{   QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("UnregisterCounter"),
+                                                            QVariant::fromValue(path));
+    bool ok = true;
+    if(reply.error().type() == QDBusError::InvalidArgs) {
+        qWarning() << reply.error().message();
+    }
 }
 
 QString QConnmanManagerInterface::requestSession(const QString &bearerName)
 {
-    QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("RequestSession"), QVariant::fromValue(bearerName));
+    QDBusReply<QList<QDBusObjectPath> > reply =  this->call(QLatin1String("RequestSession"),
+                                                            QVariant::fromValue(bearerName));
     return QString();
 }
 
@@ -863,7 +875,29 @@ void QConnmanAgentInterface::cancel()
 
 
 /////////////////////////////////////////
+QConnmanCounterInterface::QConnmanCounterInterface(const QString &dbusPathName,QObject *parent)
+    : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
+                             dbusPathName,
+                             CONNMAN_COUNTER_INTERFACE,
+                             QDBusConnection::systemBus(), parent)
+{
+}
+
+QConnmanCounterInterface::~QConnmanCounterInterface()
+{
+}
+
+quint32 QConnmanCounterInterface::getReceivedByteCount()
+{
+return 0;
+}
+
+quint32 QConnmanCounterInterface::getTransmittedByteCount()
+{
+return 0;
+}
 
+/////////////////////////////////////////
 QConnmanDeviceInterface::QConnmanDeviceInterface(const QString &dbusPathName,QObject *parent)
     : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
                              dbusPathName,
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
index 9475296..35e3f3d 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux_p.h
+++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
@@ -115,8 +115,8 @@ public:
     QDBusObjectPath connectService(QVariantMap &map);
     void registerAgent(QDBusObjectPath &path);
     void unregisterAgent(QDBusObjectPath path);
-    void registerCounter(QDBusObjectPath path, quint32 interval);
-    void unregisterCounter(QDBusObjectPath path);
+    void registerCounter(const QString &path, quint32 interval);
+    void unregisterCounter(const QString &path);
 
     QString requestSession(const QString &bearerName);
     void releaseSession();
@@ -307,20 +307,24 @@ protected:
     void disconnectNotify(const char *signal);
 };
 
-//class QConnmanCounterInterfacePrivate;
-//class QConnmanCounterInterface : public QDBusAbstractInterface
-//{
-//    Q_OBJECT
-//
-//public:
-//
-//    QConnmanCounterInterface(QObject *parent = 0);
-//    ~QConnmanCounterInterface();
-//
+class QConnmanCounterInterfacePrivate;
+class QConnmanCounterInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+
+    QConnmanCounterInterface(const QString &dbusPathName, QObject *parent = 0);
+    ~QConnmanCounterInterface();
+
 //    void release();
-//private:
-//    QConnmanCounterInterfacePrivate *d;
-//};
+    QString getInterface();
+    quint32 getReceivedByteCount();
+    quint32 getTransmittedByteCount();
+
+private:
+    QConnmanCounterInterfacePrivate *d;
+};
 
 class QConnmanDeviceInterface : public QDBusAbstractInterface
 {
-- 
cgit v0.12


From b0bbabe728fedb8531fc2837403856bd5ed44e1b Mon Sep 17 00:00:00 2001
From: Alessandro Portale <alessandro.portale@nokia.com>
Date: Wed, 30 Jun 2010 14:31:49 +0200
Subject: Avoid blurry text with OpenVG on Symbian

Qt's graphics system uses qreal as measurement unit.

The established paint engines (such as "raster") implicitly
round textitem coordinates for technical reasons, e.g. for
optimized blitting.

Some Qt based Ui libraries (such as QWidgets) can in some
cases cause textitems to be drawn on non-integer coordinates.
In particular, this happens when centering text.

Since these libraries have been developed against the
established paint engines with implicit rounding, these
non-integer coordinates were never an issue.

The new OpenVG paintengine took these coordinates seriously
without rounding them. On some OpenVG implementations (e.g.
that of some Symbian phones), this led to blurry text
rendering.

This patch adds coordinate rounding for unscaled, unrotated
textitems to the OpenVG paintengine. So that it does the
same as the raster paint engine.

Task-number: QT-3071
Reviewed-By: Jason Barron
---
 src/openvg/qpaintengine_vg.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index cfc481e..515197a 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3424,7 +3424,13 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
 
     // Set the transformation to use for drawing the current glyphs.
     QTransform glyphTransform(d->pathTransform);
-    glyphTransform.translate(p.x(), p.y());
+    if (d->transform.type() <= QTransform::TxTranslate) {
+        // Prevent blurriness of unscaled, unrotated text by using integer coordinates.
+        // Using ceil(x-0.5) instead of qRound() or int-cast, behave like other paint engines.
+        glyphTransform.translate(ceil(p.x() - 0.5), ceil(p.y() - 0.5));
+    } else {
+        glyphTransform.translate(p.x(), p.y());
+    }
 #if defined(QVG_NO_IMAGE_GLYPHS)
     glyphTransform.scale(glyphCache->scaleX, glyphCache->scaleY);
 #endif
-- 
cgit v0.12


From 76274d40569f45cec50ad5df8646e09e40117007 Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Thu, 1 Jul 2010 10:12:58 +0100
Subject: Fix QXmlQuery autotest on Symbian

Deployment of the test files to ../xmlpatterns resolves to
c:/private/xmlpatterns, which is an illegal location to deploy to on
symbian.
Changed the deployment and test to put the xmlpatterns directory inside
the app's private directory on symbian

Regression tested on windows build.

Reviewed-by: mread
---
 tests/auto/qxmlquery/qxmlquery.pro     |  7 ++++++-
 tests/auto/qxmlquery/tst_qxmlquery.cpp | 25 ++++++++++++++-----------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index cfab564..c9429ed 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -23,7 +23,12 @@ wince*|symbian*: {
    addFiles.path    = .
 
    patternistFiles.sources = ../xmlpatterns/queries
-   patternistFiles.path    = ../xmlpatterns
+   symbian: {
+       #../xmlpatterns resolves to an illegal path for deployment
+       patternistFiles.path    = xmlpatterns
+   } else {
+       patternistFiles.path    = ../xmlpatterns
+   }
 
    DEPLOYMENT += addFiles patternistFiles
 }
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index be0d708..9a3d65d 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -67,6 +67,9 @@
 
 #if defined(Q_OS_SYMBIAN)
 #define SRCDIR ""
+#define XMLPATTERNSDIR "xmlpatterns"
+#else
+#define XMLPATTERNSDIR SRCDIR "../xmlpatterns"
 #endif
 
 /*!
@@ -264,7 +267,7 @@ void tst_QXmlQuery::checkBaseURI(const QUrl &baseURI, const QString &candidate)
     QVERIFY(QDir(baseURI.toLocalFile()).relativeFilePath(QFileInfo(candidate).canonicalFilePath()).startsWith("../"));
 }
 
-const char *const tst_QXmlQuery::queriesDirectory = SRCDIR "../xmlpatterns/queries/";
+const char *const tst_QXmlQuery::queriesDirectory = XMLPATTERNSDIR "/queries/";
 
 QStringList tst_QXmlQuery::queries()
 {
@@ -857,7 +860,7 @@ void tst_QXmlQuery::bindVariableXSLTSuccess() const
     stylesheet.bindVariable(QLatin1String("paramSelectWithTypeIntBoundWithBindVariableRequired"),
                                           QVariant(QLatin1String("param5")));
 
-    stylesheet.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/parameters.xsl"))));
+    stylesheet.setQuery(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/parameters.xsl"))));
 
     QVERIFY(stylesheet.isValid());
 
@@ -1798,11 +1801,11 @@ void tst_QXmlQuery::setFocusQUrl() const
     {
         QXmlQuery query(QXmlQuery::XSLT20);
 
-        const TestURIResolver resolver(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+        const TestURIResolver resolver(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
         query.setUriResolver(&resolver);
 
         QVERIFY(query.setFocus(QUrl(QLatin1String("arbitraryURI"))));
-        query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/copyWholeDocument.xsl"))));
+        query.setQuery(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/copyWholeDocument.xsl"))));
         QVERIFY(query.isValid());
 
         QBuffer result;
@@ -2997,7 +3000,7 @@ void tst_QXmlQuery::setInitialTemplateNameQXmlName() const
 
     QCOMPARE(query.initialTemplateName(), name);
 
-    query.setQuery(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/namedTemplate.xsl"))));
+    query.setQuery(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/namedTemplate.xsl"))));
     QVERIFY(query.isValid());
 
     QBuffer result;
@@ -3059,7 +3062,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
     /* Ensure fn:doc() picks up the right QNetworkAccessManager. */
     {
         NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
-                                          QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml"))));
+                                          QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml"))));
 
         QXmlQuery query;
         query.setNetworkAccessManager(&networkOverrider);
@@ -3075,7 +3078,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
     /* Ensure setQuery() is using the right network manager. */
     {
         NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
-                                          QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/concat.xq"))));
+                                          QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/queries/concat.xq"))));
 
         QXmlQuery query;
         query.setNetworkAccessManager(&networkOverrider);
@@ -3133,9 +3136,9 @@ void tst_QXmlQuery::multipleDocsAndFocus() const
     /* We use string concatenation, since variable bindings might disturb what
      * we're testing. */
     query.setQuery(QLatin1String("string(doc('") +
-                   inputFile(QLatin1String(SRCDIR "../xmlpatterns/queries/simpleDocument.xml")) +
+                   inputFile(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml")) +
                    QLatin1String("'))"));
-    query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+    query.setFocus(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
     query.setQuery(QLatin1String("string(.)"));
 
     QStringList result;
@@ -3159,11 +3162,11 @@ void tst_QXmlQuery::multipleEvaluationsWithDifferentFocus() const
     QXmlQuery query;
     QStringList result;
 
-    query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+    query.setFocus(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
     query.setQuery(QLatin1String("string(.)"));
     QVERIFY(query.evaluateTo(&result));
 
-    query.setFocus(QUrl(inputFile(QLatin1String(SRCDIR "../xmlpatterns/stylesheets/documentElement.xml"))));
+    query.setFocus(QUrl(inputFile(QLatin1String(XMLPATTERNSDIR "/stylesheets/documentElement.xml"))));
     QVERIFY(query.evaluateTo(&result));
 }
 
-- 
cgit v0.12


From 47589ccc85c4aa2f40d7ceb5f0363b76b782198a Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Thu, 1 Jul 2010 10:17:57 +0100
Subject: Fix RVCT compile error in QGraphicsSceneIndex autotest

The test code used the 'using' keyword to try and change access control
of a base class method from protected to public.
With the RVCT 2.2 compiler, 'using' imports the function(s) from the base
class, but they retain their existing access control.

Used an inline public function to call the base class as a workaround

Reviewed-by: mread
---
 tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
index 6396e44..dba8a64 100644
--- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
+++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
@@ -224,7 +224,18 @@ void tst_QGraphicsSceneIndex::connectedToSceneRectChanged()
 {
 
     class MyScene : public QGraphicsScene
-    { public: using QGraphicsScene::receivers; };
+    {
+    public:
+#ifdef Q_CC_RVCT
+        //using keyword doesn't change visibility to public in RVCT2.2 compiler
+        inline int receivers(const char* signal) const
+        {
+            return QGraphicsScene::receivers(signal);
+        }
+#else
+        using QGraphicsScene::receivers;
+#endif
+    };
 
     MyScene scene; // Uses QGraphicsSceneBspTreeIndex by default.
     QCOMPARE(scene.receivers(SIGNAL(sceneRectChanged(const QRectF&))), 1);
-- 
cgit v0.12


From cb3309b28b9d81af33b0ef92f2ae727d0d91b939 Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Tue, 20 Apr 2010 15:42:16 +0200
Subject: Fix compile error in QFileDialog autotest

Reviewed-by: Trust Me
---
 tests/auto/qfiledialog/tst_qfiledialog.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 9adb4fc..38a1ee7 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -548,7 +548,7 @@ void tst_QFiledialog::completer()
     // ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel
     // are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel.
 #if defined(Q_OS_SYMBIAN)
-    QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths")
+    QSKIP("This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel are fixed to properly capitalize paths", SkipAll);
 #endif
     QTRY_COMPARE(cModel->rowCount(), expected);
     } QT_CATCH(...) {
-- 
cgit v0.12


From 3475453895ff5fb393d375202581e3236c0340e8 Mon Sep 17 00:00:00 2001
From: Liang Qi <liang.qi@nokia.com>
Date: Thu, 1 Jul 2010 15:32:20 +0200
Subject: Using the remaining valid data to construct the QTime object when
 msec parsing failed.

It's relevant with QTBUG-11623, but not a fix for it.

Reviewed-by: Aleksandar Sasha Babic
---
 src/corelib/tools/qdatetime.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index c1027ed..347de0c 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1914,7 +1914,7 @@ QTime QTime::fromString(const QString& s, Qt::DateFormat f)
             const QString msec_s(QLatin1String("0.") + s.mid(9, 4));
             const float msec(msec_s.toFloat(&ok));
             if (!ok)
-                return QTime();
+                return QTime(hour, minute, second, 0);
             return QTime(hour, minute, second, qMin(qRound(msec * 1000.0), 999));
         }
     }
-- 
cgit v0.12


From 6d5e561be6f013f7cb5c77e15ee6b7640cad7563 Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Fri, 2 Jul 2010 10:12:47 +1000
Subject: Segmentation Fault in QAudioOutputPrivate::freeBlocks() caused by
 wrong pointer increment

Task-number:QTBUG-11883
Reviewed-by:Andrew den Exter
---
 src/multimedia/audio/qaudioinput_win32_p.cpp  | 2 +-
 src/multimedia/audio/qaudiooutput_win32_p.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp
index 8240047..3f6e778 100644
--- a/src/multimedia/audio/qaudioinput_win32_p.cpp
+++ b/src/multimedia/audio/qaudioinput_win32_p.cpp
@@ -148,7 +148,7 @@ void QAudioInputPrivate::freeBlocks(WAVEHDR* blockArray)
 
     for(int i = 0; i < count; i++) {
         waveInUnprepareHeader(hWaveIn,blocks, sizeof(WAVEHDR));
-        blocks+=sizeof(WAVEHDR);
+        blocks++;
     }
     HeapFree(GetProcessHeap(), 0, blockArray);
 }
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index 075d100..09771b3 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -193,7 +193,7 @@ void QAudioOutputPrivate::freeBlocks(WAVEHDR* blockArray)
 
     for(int i = 0; i < count; i++) {
         waveOutUnprepareHeader(hWaveOut,blocks, sizeof(WAVEHDR));
-        blocks+=sizeof(WAVEHDR);
+        blocks++;
     }
     HeapFree(GetProcessHeap(), 0, blockArray);
 }
-- 
cgit v0.12


From f5c5e20ab20f016c07351330d03432e4912f20b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
Date: Mon, 28 Jun 2010 15:56:33 +0200
Subject: Fixed missing clip when computing the graphics item effect source
 rect.

If item clips children to shape we should take that into account when
computing the source rect, to avoid creating unnecessary large source
pixmaps which might have a significant performance impact.

Task-number: QT-3551
Reviewed-by: Gunnar
Reviewed-by: Trond
---
 src/gui/graphicsview/qgraphicsitem.cpp             | 27 +++++++++++++++++++---
 src/gui/graphicsview/qgraphicsitem_p.h             | 14 +++++++----
 .../tst_qgraphicseffectsource.cpp                  | 15 ++++++++++++
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 074e571..88e9952 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1205,8 +1205,14 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
 
     Returns the bounding rect of this item's children (excluding itself).
 */
-void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect)
+void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, bool doClip)
 {
+    Q_Q(QGraphicsItem);
+
+    QRectF childrenRect;
+    QRectF *result = rect;
+    rect = &childrenRect;
+
     for (int i = 0; i < children.size(); ++i) {
         QGraphicsItem *child = children.at(i);
         QGraphicsItemPrivate *childd = child->d_ptr.data();
@@ -1228,6 +1234,15 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec
                 childd->childrenBoundingRectHelper(x, rect);
         }
     }
+
+    if (doClip && (flags & QGraphicsItem::ItemClipsChildrenToShape)){
+        if (x)
+            *rect &= x->mapRect(q->boundingRect());
+        else
+            *rect &= q->boundingRect();
+    }
+
+    *result |= *rect;
 }
 
 void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
@@ -10816,8 +10831,14 @@ QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem syste
     }
 
     QRectF rect = item->boundingRect();
-    if (!item->d_ptr->children.isEmpty())
-        rect |= item->childrenBoundingRect();
+    if (!item->d_ptr->children.isEmpty()) {
+        if (dirtyChildrenBoundingRect) {
+            childrenBoundingRect = QRectF();
+            item->d_ptr->childrenBoundingRectHelper(0, &childrenBoundingRect, true);
+            dirtyChildrenBoundingRect = false;
+        }
+        rect |= childrenBoundingRect;
+    }
 
     if (deviceCoordinates) {
         Q_ASSERT(info->painter);
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index e737773..ead240b 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -239,7 +239,7 @@ public:
     void removeChild(QGraphicsItem *child);
     void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
                              const QVariant *thisPointerVariant);
-    void childrenBoundingRectHelper(QTransform *x, QRectF *rect);
+    void childrenBoundingRectHelper(QTransform *x, QRectF *rect, bool doClip = true);
     void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
                          const QRegion &exposedRegion, bool allItems = false) const;
     QRectF effectiveBoundingRect() const;
@@ -580,7 +580,7 @@ class QGraphicsItemEffectSourcePrivate : public QGraphicsEffectSourcePrivate
 {
 public:
     QGraphicsItemEffectSourcePrivate(QGraphicsItem *i)
-        : QGraphicsEffectSourcePrivate(), item(i), info(0)
+        : QGraphicsEffectSourcePrivate(), dirtyChildrenBoundingRect(true), item(i), info(0)
     {}
 
     inline void detach()
@@ -631,6 +631,9 @@ public:
                    QGraphicsEffect::PixmapPadMode mode) const;
     QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const;
 
+    mutable bool dirtyChildrenBoundingRect;
+    mutable QRectF childrenBoundingRect;
+
     QGraphicsItem *item;
     QGraphicsItemPaintInfo *info;
     QTransform lastEffectTransform;
@@ -788,9 +791,12 @@ inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
 #ifndef QT_NO_GRAPHICSEFFECT
         if (parentp->graphicsEffect) {
             if (updateBoundingRect) {
+                QGraphicsItemEffectSourcePrivate *sourcep =
+                    static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
+                                                                    ->source->d_func());
+                parentp->dirtyChildrenBoundingRect = 1;
                 parentp->notifyInvalidated = 1;
-                static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
-                                                                ->source->d_func())->invalidateCache();
+                sourcep->invalidateCache();
             }
             if (parentp->graphicsEffect->isEnabled()) {
                 parentp->dirty = 1;
diff --git a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
index 49f110e..49a76fa 100644
--- a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
+++ b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
@@ -161,6 +161,7 @@ private slots:
     void draw();
     void update();
     void boundingRect();
+    void clippedBoundingRect();
     void deviceRect();
     void pixmap();
 
@@ -282,6 +283,20 @@ void tst_QGraphicsEffectSource::boundingRect()
     QTRY_COMPARE(effect->source()->boundingRect(), itemBoundingRect);
 }
 
+void tst_QGraphicsEffectSource::clippedBoundingRect()
+{
+    QRectF itemBoundingRect = item->boundingRect();
+    item->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+
+    QGraphicsRectItem *child = new QGraphicsRectItem(-1000, -1000, 2000, 2000);
+    child->setBrush(Qt::red);
+    child->setParentItem(item);
+
+    effect->storeDeviceDependentStuff = true;
+    effect->source()->update();
+    QTRY_COMPARE(effect->source()->boundingRect(Qt::LogicalCoordinates), itemBoundingRect);
+}
+
 void tst_QGraphicsEffectSource::deviceRect()
 {
     effect->storeDeviceDependentStuff = true;
-- 
cgit v0.12


From ce4ed8fa50a72927d68c4c68c04a28d783546c07 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Fri, 2 Jul 2010 16:55:00 +0200
Subject: Removed missing symbols from DEF files.

RevBy:    Jason Barron
---
 src/s60installs/bwins/QtGuiu.def | 2 +-
 src/s60installs/eabi/QtGuiu.def  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 3368e4c..cde0b60 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
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index cfe2630..4c57c03 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -4675,7 +4675,7 @@ EXPORTS
 	_ZN20QGraphicsItemPrivate20removeExtraItemCacheEv @ 4674 NONAME
 	_ZN20QGraphicsItemPrivate23appendGraphicsTransformEP18QGraphicsTransform @ 4675 NONAME
 	_ZN20QGraphicsItemPrivate25movableAncestorIsSelectedEPK13QGraphicsItem @ 4676 NONAME
-	_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectF @ 4677 NONAME
+	_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectF @ 4677 NONAME ABSENT
 	_ZN20QGraphicsItemPrivate26invalidateDepthRecursivelyEv @ 4678 NONAME
 	_ZN20QGraphicsItemPrivate28ensureSequentialSiblingIndexEv @ 4679 NONAME
 	_ZN20QGraphicsItemPrivate29ensureSceneTransformRecursiveEPP13QGraphicsItem @ 4680 NONAME
-- 
cgit v0.12


From 46ff093e22f95aa5e634e7edc6484ee717054625 Mon Sep 17 00:00:00 2001
From: Rhys Weatherley <rhys.weatherley@nokia.com>
Date: Mon, 5 Jul 2010 14:46:09 +1000
Subject: Include qmath.h to get the definition of ceil()

Reviewed-by: Julian de Bhal
---
 src/openvg/qpaintengine_vg.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 515197a..7a050f6 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -54,6 +54,7 @@
 #include <QtGui/private/qtextengine_p.h>
 #include <QtGui/private/qfontengine_p.h>
 #include <QtGui/private/qpainterpath_p.h>
+#include <QtCore/qmath.h>
 #include <QDebug>
 #include <QSet>
 
-- 
cgit v0.12


From 752d46c90ee0fc5f06f01feedd8e0659178b15d4 Mon Sep 17 00:00:00 2001
From: Liang Qi <liang.qi@nokia.com>
Date: Mon, 5 Jul 2010 15:35:51 +0200
Subject: Support time zone designator in QDateTime::fromString() based on ISO
 8601-2004 standard.

Task-number: QTBUG-11623

Reviewed-by: Denis Dzyubenko
Reviewed-by: David Boddie
---
 doc/src/external-resources.qdoc        |  5 +++++
 src/corelib/global/qnamespace.qdoc     |  5 +++--
 src/corelib/tools/qdatetime.cpp        | 27 ++++++++++++++++++++++++++-
 tests/auto/qdatetime/tst_qdatetime.cpp |  6 ++++++
 4 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc
index 3ca50b4..b4324af 100644
--- a/doc/src/external-resources.qdoc
+++ b/doc/src/external-resources.qdoc
@@ -422,3 +422,8 @@
     \externalpage http://www.w3.org/XML/Schema
     \title XML Schema
 */
+
+/*!
+    \externalpage http://www.iso.org/iso/date_and_time_format
+    \title ISO 8601
+*/
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index a756565..15c4efc 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -577,8 +577,9 @@
     be short, localized names. This is basically equivalent to using the date format
     string, "ddd MMM d yyyy". See QDate::toString() for more information.
 
-    \value ISODate ISO 8601 extended format: either \c{YYYY-MM-DD} for dates or
-    \c{YYYY-MM-DDTHH:MM:SS} for combined dates and times.
+    \value ISODate \l{ISO 8601} extended format: either \c{YYYY-MM-DD} for dates or
+    \c{YYYY-MM-DDTHH:MM:SS}, \c{YYYY-MM-DDTHH:MM:SSTZD} (e.g., 1997-07-16T19:20:30+01:00)
+    for combined dates and times.
 
     \value SystemLocaleShortDate The \l{QLocale::ShortFormat}{short format} used
     by the \l{QLocale::system()}{operating system}.
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 347de0c..c6ab4e4 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3044,12 +3044,37 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
         if (tmp.size() == 10)
             return QDateTime(date);
 
+        tmp = tmp.mid(11);
+
         // Recognize UTC specifications
         if (tmp.endsWith(QLatin1Char('Z'))) {
             ts = Qt::UTC;
             tmp.chop(1);
         }
-        return QDateTime(date, QTime::fromString(tmp.mid(11), Qt::ISODate), ts);
+
+        // Recognize timezone specifications
+        QRegExp rx(QLatin1String("[+-]"));
+        if (tmp.contains(rx)) {
+            int idx = tmp.indexOf(rx);
+            QString tmp2 = tmp.mid(idx);
+            tmp = tmp.left(idx);
+            bool ok = true;
+            int ntzhour = 1;
+            int ntzminute = 3;
+            if ( tmp2.indexOf(QLatin1Char(':')) == 3 )
+               ntzminute = 4;
+            const int tzhour(tmp2.mid(ntzhour, 2).toInt(&ok));
+            const int tzminute(tmp2.mid(ntzminute, 2).toInt(&ok));
+            QTime tzt(tzhour, tzminute);
+            int utcOffset = (tzt.hour() * 60 + tzt.minute()) * 60;
+            if ( utcOffset != 0 ) {
+                ts = Qt::OffsetFromUTC;
+                QDateTime dt(date, QTime::fromString(tmp, Qt::ISODate), ts);
+                dt.setUtcOffset( utcOffset * (tmp2.startsWith(QLatin1Char('-')) ? -1 : 1) );
+                return dt;
+            }
+        }
+        return QDateTime(date, QTime::fromString(tmp, Qt::ISODate), ts);
     }
     case Qt::SystemLocaleDate:
     case Qt::SystemLocaleShortDate:
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 86a4c80..d23133d 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -1286,6 +1286,12 @@ void tst_QDateTime::fromString()
     dt = QDateTime::fromString("2002-10-01", Qt::ISODate);
     QCOMPARE(dt, QDateTime(QDate(2002, 10, 1), QTime(0, 0, 0, 0)));
 
+    dt = QDateTime::fromString("1987-02-13T13:24:51+01:00", Qt::ISODate);
+    QCOMPARE(dt, QDateTime(QDate(1987, 2, 13), QTime(12, 24, 51), Qt::UTC));
+
+    dt = QDateTime::fromString("1987-02-13T13:24:51-01:00", Qt::ISODate);
+    QCOMPARE(dt, QDateTime(QDate(1987, 2, 13), QTime(14, 24, 51), Qt::UTC));
+
     dt = QDateTime::fromString("Thu Jan 1 00:12:34 1970 GMT");
     QCOMPARE(dt.toUTC(), QDateTime(QDate(1970, 1, 1), QTime(0, 12, 34), Qt::UTC));
 
-- 
cgit v0.12


From 8ef60f0791c1fb7fa649214238db6db3e2d975c6 Mon Sep 17 00:00:00 2001
From: Liang Qi <liang.qi@nokia.com>
Date: Mon, 5 Jul 2010 16:42:44 +0200
Subject: Revert "Support time zone designator in QDateTime::fromString() based
 on ISO 8601-2004 standard."

This reverts commit 752d46c90ee0fc5f06f01feedd8e0659178b15d4.
---
 doc/src/external-resources.qdoc        |  5 -----
 src/corelib/global/qnamespace.qdoc     |  5 ++---
 src/corelib/tools/qdatetime.cpp        | 27 +--------------------------
 tests/auto/qdatetime/tst_qdatetime.cpp |  6 ------
 4 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc
index b4324af..3ca50b4 100644
--- a/doc/src/external-resources.qdoc
+++ b/doc/src/external-resources.qdoc
@@ -422,8 +422,3 @@
     \externalpage http://www.w3.org/XML/Schema
     \title XML Schema
 */
-
-/*!
-    \externalpage http://www.iso.org/iso/date_and_time_format
-    \title ISO 8601
-*/
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 15c4efc..a756565 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -577,9 +577,8 @@
     be short, localized names. This is basically equivalent to using the date format
     string, "ddd MMM d yyyy". See QDate::toString() for more information.
 
-    \value ISODate \l{ISO 8601} extended format: either \c{YYYY-MM-DD} for dates or
-    \c{YYYY-MM-DDTHH:MM:SS}, \c{YYYY-MM-DDTHH:MM:SSTZD} (e.g., 1997-07-16T19:20:30+01:00)
-    for combined dates and times.
+    \value ISODate ISO 8601 extended format: either \c{YYYY-MM-DD} for dates or
+    \c{YYYY-MM-DDTHH:MM:SS} for combined dates and times.
 
     \value SystemLocaleShortDate The \l{QLocale::ShortFormat}{short format} used
     by the \l{QLocale::system()}{operating system}.
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index c6ab4e4..347de0c 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3044,37 +3044,12 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f)
         if (tmp.size() == 10)
             return QDateTime(date);
 
-        tmp = tmp.mid(11);
-
         // Recognize UTC specifications
         if (tmp.endsWith(QLatin1Char('Z'))) {
             ts = Qt::UTC;
             tmp.chop(1);
         }
-
-        // Recognize timezone specifications
-        QRegExp rx(QLatin1String("[+-]"));
-        if (tmp.contains(rx)) {
-            int idx = tmp.indexOf(rx);
-            QString tmp2 = tmp.mid(idx);
-            tmp = tmp.left(idx);
-            bool ok = true;
-            int ntzhour = 1;
-            int ntzminute = 3;
-            if ( tmp2.indexOf(QLatin1Char(':')) == 3 )
-               ntzminute = 4;
-            const int tzhour(tmp2.mid(ntzhour, 2).toInt(&ok));
-            const int tzminute(tmp2.mid(ntzminute, 2).toInt(&ok));
-            QTime tzt(tzhour, tzminute);
-            int utcOffset = (tzt.hour() * 60 + tzt.minute()) * 60;
-            if ( utcOffset != 0 ) {
-                ts = Qt::OffsetFromUTC;
-                QDateTime dt(date, QTime::fromString(tmp, Qt::ISODate), ts);
-                dt.setUtcOffset( utcOffset * (tmp2.startsWith(QLatin1Char('-')) ? -1 : 1) );
-                return dt;
-            }
-        }
-        return QDateTime(date, QTime::fromString(tmp, Qt::ISODate), ts);
+        return QDateTime(date, QTime::fromString(tmp.mid(11), Qt::ISODate), ts);
     }
     case Qt::SystemLocaleDate:
     case Qt::SystemLocaleShortDate:
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index d23133d..86a4c80 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -1286,12 +1286,6 @@ void tst_QDateTime::fromString()
     dt = QDateTime::fromString("2002-10-01", Qt::ISODate);
     QCOMPARE(dt, QDateTime(QDate(2002, 10, 1), QTime(0, 0, 0, 0)));
 
-    dt = QDateTime::fromString("1987-02-13T13:24:51+01:00", Qt::ISODate);
-    QCOMPARE(dt, QDateTime(QDate(1987, 2, 13), QTime(12, 24, 51), Qt::UTC));
-
-    dt = QDateTime::fromString("1987-02-13T13:24:51-01:00", Qt::ISODate);
-    QCOMPARE(dt, QDateTime(QDate(1987, 2, 13), QTime(14, 24, 51), Qt::UTC));
-
     dt = QDateTime::fromString("Thu Jan 1 00:12:34 1970 GMT");
     QCOMPARE(dt.toUTC(), QDateTime(QDate(1970, 1, 1), QTime(0, 12, 34), Qt::UTC));
 
-- 
cgit v0.12


From 919dc2dca2ceff3848f6c91819845819f91fb68e Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Mon, 5 Jul 2010 07:22:42 -0700
Subject: Spectrum build: fixed DLL rpath

Rather than explicitly modifying LD_LIBRARY_PATH using a shell script
when the application is launched, the relative path from the
application binary to the FFT library is encoded in the application
using an --rpath flag.

Task-number: QTBUG-11756
Reviewed-by: Andy Shaw
---
 demos/spectrum/app/app.pro     | 13 +++--------
 demos/spectrum/app/spectrum.sh | 50 ------------------------------------------
 2 files changed, 3 insertions(+), 60 deletions(-)
 delete mode 100644 demos/spectrum/app/spectrum.sh

diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro
index 22ee3b1..5410b2b 100644
--- a/demos/spectrum/app/app.pro
+++ b/demos/spectrum/app/app.pro
@@ -3,7 +3,6 @@ include(../spectrum.pri)
 TEMPLATE = app
 
 TARGET = spectrum
-unix: !macx: !symbian: TARGET = spectrum.bin
 
 QT       += multimedia
 
@@ -112,15 +111,9 @@ symbian {
         # Specify directory in which to create spectrum application
         DESTDIR = ../bin
 
-        unix: !symbian {
-            # On unices other than Mac OSX, we copy a shell script into the bin directory.
-            # This script takes care of correctly setting the LD_LIBRARY_PATH so that
-            # the dynamic library can be located.
-            copy_launch_script.target = copy_launch_script
-            copy_launch_script.commands = \
-                install -m 0555 $$QT_SOURCE_TREE/demos/spectrum/app/spectrum.sh ../bin/spectrum
-            QMAKE_EXTRA_TARGETS += copy_launch_script
-            POST_TARGETDEPS += copy_launch_script
+        unix: {
+            # Provide relative path from application to fftreal library
+            QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN
         }
     }
 }
diff --git a/demos/spectrum/app/spectrum.sh b/demos/spectrum/app/spectrum.sh
deleted file mode 100644
index 2a230ed..0000000
--- a/demos/spectrum/app/spectrum.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-#############################################################################
-##
-## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-## All rights reserved.
-## Contact: Nokia Corporation (qt-info@nokia.com)
-##
-## This file is part of the examples of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:LGPL$
-## No Commercial Usage
-## This file contains pre-release code and may not be distributed.
-## You may use this file in accordance with the terms and conditions
-## contained in the Technology Preview License Agreement accompanying
-## this package.
-##
-## GNU Lesser General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU Lesser
-## General Public License version 2.1 as published by the Free Software
-## Foundation and appearing in the file LICENSE.LGPL included in the
-## packaging of this file.  Please review the following information to
-## ensure the GNU Lesser General Public License version 2.1 requirements
-## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-##
-## In addition, as a special exception, Nokia gives you certain additional
-## rights.  These rights are described in the Nokia Qt LGPL Exception
-## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-##
-## If you have questions regarding the use of this file, please contact
-## Nokia at qt-info@nokia.com.
-##
-##
-##
-##
-##
-##
-##
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-
-# Shell script for launching spectrum application on Unix systems other than Mac OSX
-
-bindir=`dirname "$0"`
-LD_LIBRARY_PATH="${bindir}:${LD_LIBRARY_PATH}"
-export LD_LIBRARY_PATH
-exec "${bindir}/spectrum.bin" ${1+"$@"}
-
-- 
cgit v0.12


From e7f6c2d9625bda1d063b9ec3acd7eb5f79f30ba7 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Mon, 5 Jul 2010 11:39:37 +0100
Subject: Spectrum demo: fixed installation

All binaries must be written into $$QT_BUILD_DIR/demos/spectrum in
order for them to be correctly installed.

Task-number: QTBUG-11572
Task-number: QTBUG-11756
Reviewed-by: Andy Shaw
---
 demos/spectrum/3rdparty/fftreal/fftreal.pro | 14 ++++++++------
 demos/spectrum/app/app.pro                  |  5 ++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/demos/spectrum/3rdparty/fftreal/fftreal.pro b/demos/spectrum/3rdparty/fftreal/fftreal.pro
index 6801b42..c9da205 100644
--- a/demos/spectrum/3rdparty/fftreal/fftreal.pro
+++ b/demos/spectrum/3rdparty/fftreal/fftreal.pro
@@ -1,3 +1,5 @@
+include(../../spectrum.pri)
+
 TEMPLATE = lib
 TARGET   = fftreal
 
@@ -31,13 +33,13 @@ symbian {
     # Provide unique ID for the generated binary, required by Symbian OS
     TARGET.UID3 = 0xA000E403
     TARGET.CAPABILITY = UserEnvironment
+}
+
+macx {
+    CONFIG += lib_bundle
 } else {
-    macx {
-        CONFIG += lib_bundle
-    } else {
-        DESTDIR = ../../bin
-    }
-} 
+    !symbian: DESTDIR = ../..
+}
 
 # Install
 
diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro
index 5410b2b..6c74b27 100644
--- a/demos/spectrum/app/app.pro
+++ b/demos/spectrum/app/app.pro
@@ -62,8 +62,7 @@ symbian {
             LIBS += -F$${fftreal_dir}
             LIBS += -framework fftreal
         } else {
-            # Link to dynamic library which is written to ../bin
-            LIBS += -L../bin
+            LIBS += -L..
             LIBS += -lfftreal
         }
     }
@@ -109,7 +108,7 @@ symbian {
         }
     } else {
         # Specify directory in which to create spectrum application
-        DESTDIR = ../bin
+        DESTDIR = ..
 
         unix: {
             # Provide relative path from application to fftreal library
-- 
cgit v0.12


From 2de46daf6568c85d976a1e784c0bafbea89adb3a Mon Sep 17 00:00:00 2001
From: Justin McPherson <justin.mcpherson@nokia.com>
Date: Wed, 7 Jul 2010 15:21:48 +1000
Subject: Don't try and use QFactoryLoader when relevant features are turned
 off.

Task-number: QTBUG-11900
Reviewed-by: Andrew den Exter
---
 src/multimedia/audio/qaudiodevicefactory.cpp | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/audio/qaudiodevicefactory.cpp
index 4f45110..523075c 100644
--- a/src/multimedia/audio/qaudiodevicefactory.cpp
+++ b/src/multimedia/audio/qaudiodevicefactory.cpp
@@ -67,8 +67,11 @@
 
 QT_BEGIN_NAMESPACE
 
+
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
 Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
         (QAudioEngineFactoryInterface_iid, QLatin1String("/audio"), Qt::CaseInsensitive))
+#endif
 
 
 class QNullDeviceInfo : public QAbstractAudioDeviceInfo
@@ -137,6 +140,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode)
         devices << QAudioDeviceInfo(QLatin1String("builtin"), handle, mode);
 #endif
 #endif
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QFactoryLoader* l = loader();
 
     foreach (QString const& key, l->keys()) {
@@ -148,12 +152,13 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode)
 
         delete plugin;
     }
-
+#endif
     return devices;
 }
 
 QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
 {
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default")));
 
     if (plugin) {
@@ -161,6 +166,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
         if (list.size() > 0)
             return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput);
     }
+#endif
 #ifndef QT_NO_AUDIO_BACKEND
 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
     return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput);
@@ -171,6 +177,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
 
 QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
 {
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default")));
 
     if (plugin) {
@@ -178,6 +185,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
         if (list.size() > 0)
             return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput);
     }
+#endif
 #ifndef QT_NO_AUDIO_BACKEND
 #if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
     return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput);
@@ -196,12 +204,13 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re
         return new QAudioDeviceInfoInternal(handle, mode);
 #endif
 #endif
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin =
         qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(realm));
 
     if (plugin)
         rc = plugin->createDeviceInfo(handle, mode);
-
+#endif
     return rc == 0 ? new QNullDeviceInfo() : rc;
 }
 
@@ -225,12 +234,13 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con
         return new QAudioInputPrivate(deviceInfo.handle(), format);
 #endif
 #endif
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin =
         qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
 
     if (plugin)
         return plugin->createInput(deviceInfo.handle(), format);
-
+#endif
     return new QNullInputDevice();
 }
 
@@ -244,12 +254,13 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c
         return new QAudioOutputPrivate(deviceInfo.handle(), format);
 #endif
 #endif
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
     QAudioEngineFactoryInterface* plugin =
         qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
 
     if (plugin)
         return plugin->createOutput(deviceInfo.handle(), format);
-
+#endif
     return new QNullOutputDevice();
 }
 
-- 
cgit v0.12


From f14b644004498dc6fb1a9437b81e3164e89bfdb5 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Wed, 7 Jul 2010 09:51:34 +0200
Subject: qdoc: Fixed the case where the property and type names are the same.

Also simplified some code.

Task-number: QTBUG-6340
---
 tools/qdoc3/codemarker.cpp      |  8 ++++++++
 tools/qdoc3/codemarker.h        |  9 +++++----
 tools/qdoc3/cppcodemarker.cpp   | 15 +++++++++------
 tools/qdoc3/cppcodemarker.h     |  7 ++++---
 tools/qdoc3/htmlgenerator.cpp   |  8 +++++---
 tools/qdoc3/htmlgenerator.h     |  7 ++++---
 tools/qdoc3/javacodemarker.cpp  |  6 ++++--
 tools/qdoc3/javacodemarker.h    |  5 ++++-
 tools/qdoc3/plaincodemarker.cpp |  7 -------
 tools/qdoc3/plaincodemarker.h   |  1 -
 tools/qdoc3/qscodemarker.cpp    |  7 -------
 tools/qdoc3/qscodemarker.h      |  1 -
 tools/qdoc3/tree.cpp            | 10 ++++++----
 tools/qdoc3/tree.h              | 20 ++++++++++++--------
 14 files changed, 61 insertions(+), 50 deletions(-)

diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 33ceaf5..7130d61 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -630,4 +630,12 @@ QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle )
 }
 #endif
 
+const Node* CodeMarker::resolveTarget(const QString& , 
+                                      const Tree* ,
+		                      const Node* ,
+                                      const Node* )
+{
+    return 0;
+}
+
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h
index aab8a9c..53ad4a8 100644
--- a/tools/qdoc3/codemarker.h
+++ b/tools/qdoc3/codemarker.h
@@ -155,10 +155,11 @@ class CodeMarker
     virtual QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
                                        SynopsisStyle style);
 #endif
-    virtual const Node *resolveTarget(const QString& target, 
-                                      const Tree *tree,
-		                      const Node *relative) = 0;
-    virtual QStringList macRefsForNode(const Node *node);
+    virtual const Node* resolveTarget(const QString& target, 
+                                      const Tree* tree,
+		                      const Node* relative,
+                                      const Node* self = 0);
+    virtual QStringList macRefsForNode(const Node* node);
 
     static void initialize(const Config& config);
     static void terminate();
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index c4ee054..562e92b 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -825,9 +825,10 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
     return sections;
 }
 
-const Node *CppCodeMarker::resolveTarget(const QString &target,
-                                         const Tree *tree,
-                                         const Node *relative)
+const Node *CppCodeMarker::resolveTarget(const QString& target,
+                                         const Tree* tree,
+                                         const Node* relative,
+                                         const Node* self)
 {
     if (target.endsWith("()")) {
         const FunctionNode *func;
@@ -869,11 +870,13 @@ const Node *CppCodeMarker::resolveTarget(const QString &target,
     else {
         QStringList path = target.split("::");
         const Node *node;
+        int flags = Tree::SearchBaseClasses |
+            Tree::SearchEnumValues |
+            Tree::NonFunction;
         if ((node = tree->findNode(path,
                                    relative,
-                                   Tree::SearchBaseClasses |
-                                   Tree::SearchEnumValues |
-                                   Tree::NonFunction)))
+                                   flags,
+                                   self)))
             return node;
     }
     return 0;
diff --git a/tools/qdoc3/cppcodemarker.h b/tools/qdoc3/cppcodemarker.h
index 2dcf400..eca3936 100644
--- a/tools/qdoc3/cppcodemarker.h
+++ b/tools/qdoc3/cppcodemarker.h
@@ -81,9 +81,10 @@ class CppCodeMarker : public CodeMarker
                             Status status);
     QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
                                SynopsisStyle style);
-    const Node *resolveTarget(const QString& target, 
-                              const Tree *tree, 
-                              const Node *relative);
+    const Node* resolveTarget(const QString& target, 
+                              const Tree* tree, 
+                              const Node* relative,
+                              const Node* self = 0);
 
 private:
     QString addMarkUp(const QString& protectedCode, 
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 89b1e98..4461b48 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -2676,7 +2676,7 @@ void HtmlGenerator::generateQmlItem(const Node *node,
             }
         }
     }
-    out() << highlightedCode(marked, marker, relative);
+    out() << highlightedCode(marked, marker, relative, false, node);
     debugging_on = false;
 }
 #endif
@@ -2988,7 +2988,8 @@ void HtmlGenerator::generateSynopsis(const Node *node,
 QString HtmlGenerator::highlightedCode(const QString& markedCode,
                                        CodeMarker* marker,
                                        const Node* relative,
-                                       bool alignNames)
+                                       bool alignNames,
+                                       const Node* self)
 {
     QString src = markedCode;
     QString html;
@@ -3067,8 +3068,9 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
             bool handled = false;
             if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) {
                 par1 = QStringRef();
-                const Node* n = marker->resolveTarget(arg.toString(), myTree, relative);
+                const Node* n = marker->resolveTarget(arg.toString(), myTree, relative, self);
                 if (HtmlGenerator::debugging_on) {
+                    qDebug() << "arg.toString()" << arg.toString();
                     if (n) {
                         qDebug() << "  " << n->name() << n->type() << n->subType();
                         qDebug() << "  " << relative->name() << relative->type() << relative->subType();
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index 80341de..a2fadf6 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -210,9 +210,10 @@ class HtmlGenerator : public PageGenerator
                                       const Node *relative,
                                       CodeMarker *marker);
     QString highlightedCode(const QString& markedCode, 
-                            CodeMarker *marker, 
-                            const Node *relative,
-                            bool alignNames = false);
+                            CodeMarker* marker, 
+                            const Node* relative,
+                            bool alignNames = false,
+                            const Node* self = 0);
 
     void generateFullName(const Node *apparentNode, 
                           const Node *relative, 
diff --git a/tools/qdoc3/javacodemarker.cpp b/tools/qdoc3/javacodemarker.cpp
index 1918cd8..c9a8f60 100644
--- a/tools/qdoc3/javacodemarker.cpp
+++ b/tools/qdoc3/javacodemarker.cpp
@@ -155,8 +155,10 @@ QList<Section> JavaCodeMarker::sections(const InnerNode * /* inner */, SynopsisS
     return QList<Section>();
 }
 
-const Node *JavaCodeMarker::resolveTarget(const QString &target, const Tree *tree,
-					  const Node *relative)
+const Node *JavaCodeMarker::resolveTarget(const QString &target,
+                                          const Tree *tree,
+					  const Node *relative,
+                                          const Node* /* self */)
 {
     if (target.endsWith("()")) {
         const FunctionNode *func;
diff --git a/tools/qdoc3/javacodemarker.h b/tools/qdoc3/javacodemarker.h
index a2d04dd..c2aabc0 100644
--- a/tools/qdoc3/javacodemarker.h
+++ b/tools/qdoc3/javacodemarker.h
@@ -72,7 +72,10 @@ public:
     QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
     QString functionBeginRegExp( const QString& funcName );
     QString functionEndRegExp( const QString& funcName );
-    const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );
+    const Node* resolveTarget( const QString& target, 
+                               const Tree* tree, 
+                               const Node* relative,
+                               const Node* self = 0 );
 };
 
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/plaincodemarker.cpp b/tools/qdoc3/plaincodemarker.cpp
index 4abfd2b..d825c13 100644
--- a/tools/qdoc3/plaincodemarker.cpp
+++ b/tools/qdoc3/plaincodemarker.cpp
@@ -129,11 +129,4 @@ QList<Section> PlainCodeMarker::sections(const InnerNode * /* innerNode */,
      return QList<Section>();
 }
 
-const Node *PlainCodeMarker::resolveTarget( const QString& /* target */,
-                                            const Tree * /* tree */,
-					    const Node * /* relative */ )
-{
-    return 0;
-}
-
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/plaincodemarker.h b/tools/qdoc3/plaincodemarker.h
index e9cc40d..7afb88e 100644
--- a/tools/qdoc3/plaincodemarker.h
+++ b/tools/qdoc3/plaincodemarker.h
@@ -71,7 +71,6 @@ public:
     QString functionBeginRegExp( const QString& funcName );
     QString functionEndRegExp( const QString& funcName );
     QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
-    const Node *resolveTarget(const QString &target, const Tree *tree, const Node *relative);
 };
 
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/qscodemarker.cpp b/tools/qdoc3/qscodemarker.cpp
index d4b8e80..2ee5d99 100644
--- a/tools/qdoc3/qscodemarker.cpp
+++ b/tools/qdoc3/qscodemarker.cpp
@@ -375,11 +375,4 @@ QList<Section> QsCodeMarker::sections( const InnerNode *inner, SynopsisStyle sty
     return sections;
 }
 
-const Node *QsCodeMarker::resolveTarget( const QString& /* target */,
-                                         const Tree * /* tree */,
-					 const Node * /* relative */ )
-{
-    return 0;
-}
-
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/qscodemarker.h b/tools/qdoc3/qscodemarker.h
index 1590009..c6a177f 100644
--- a/tools/qdoc3/qscodemarker.h
+++ b/tools/qdoc3/qscodemarker.h
@@ -72,7 +72,6 @@ public:
     QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
     QString functionBeginRegExp( const QString& funcName );
     QString functionEndRegExp( const QString& funcName );
-    const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );
 };
 
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 70b998f..022e1c2 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -125,18 +125,20 @@ Tree::~Tree()
 
 /*!
  */
-Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags)
+Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags, const Node* self)
 {
     return const_cast<Node*>(const_cast<const Tree*>(this)->findNode(path,
                                                                      relative,
-                                                                     findFlags));
+                                                                     findFlags,
+                                                                     self));
 }
 
 /*!
  */
 const Node* Tree::findNode(const QStringList &path,
                            const Node* start,
-                           int findFlags) const
+                           int findFlags,
+                           const Node* self) const
 {
     const Node* current = start;
     if (!current)
@@ -172,7 +174,7 @@ const Node* Tree::findNode(const QStringList &path,
         if (node && i == path.size()
                 && (!(findFlags & NonFunction) || node->type() != Node::Function
                     || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams))
-            if ((node != start) && (node->subType() != Node::QmlPropertyGroup))
+            if ((node != self) && (node->subType() != Node::QmlPropertyGroup))
                 return node;
         current = current->parent();
     } while (current);
diff --git a/tools/qdoc3/tree.h b/tools/qdoc3/tree.h
index 0865847..b34c3a8 100644
--- a/tools/qdoc3/tree.h
+++ b/tools/qdoc3/tree.h
@@ -65,10 +65,13 @@ class Tree
     Tree();
     ~Tree();
 
-    Node *findNode(const QStringList &path, Node *relative=0, int findFlags=0);
-    Node *findNode(const QStringList &path, 
+    Node* findNode(const QStringList &path, 
+                   Node* relative=0, 
+                   int findFlags=0, 
+                   const Node* self=0);
+    Node* findNode(const QStringList &path, 
                    Node::Type type, 
-                   Node *relative = 0,
+                   Node* relative = 0,
                    int findFlags = 0);
     FunctionNode *findFunctionNode(const QStringList &path, 
                                    Node *relative = 0,
@@ -98,12 +101,13 @@ class Tree
     NamespaceNode *root() { return &roo; }
 
     QString version() const { return vers; }
-    const Node *findNode(const QStringList &path, 
-                         const Node *relative = 0, 
-                         int findFlags = 0) const;
-    const Node *findNode(const QStringList &path, 
+    const Node* findNode(const QStringList &path, 
+                         const Node* relative = 0, 
+                         int findFlags = 0,
+                         const Node* self=0) const;
+    const Node* findNode(const QStringList &path, 
                          Node::Type type, const 
-                         Node *relative = 0,
+                         Node* relative = 0,
                          int findFlags = 0) const;
     const FunctionNode *findFunctionNode(const QStringList &path, 
                                          const Node *relative = 0,
-- 
cgit v0.12


From 401a6552f2601e5ca5b2e00a274baa6dcd83c96e Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Wed, 7 Jul 2010 10:27:38 +0200
Subject: I18n: Complete German translation for 4.7.0

---
 translations/qt_de.ts | 46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index 7d32ead..74bd048 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -2024,6 +2024,11 @@ nach
         <translation>Signalnamen dürfen nicht mit einem Großbuchstaben beginnen</translation>
     </message>
     <message>
+        <location line="+2"/>
+        <source>Illegal signal name</source>
+        <translation>Ungültiger Name für Signal</translation>
+    </message>
+    <message>
         <location line="+6"/>
         <source>Duplicate method name</source>
         <translation>Mehrfaches Auftreten eines Methodennamens</translation>
@@ -2034,6 +2039,11 @@ nach
         <translation>Methodennamen dürfen nicht mit einem Großbuchstaben beginnen</translation>
     </message>
     <message>
+        <location line="+2"/>
+        <source>Illegal method name</source>
+        <translation>Ungültiger Name für Methode</translation>
+    </message>
+    <message>
         <location line="+21"/>
         <source>Property value set multiple times</source>
         <translation>Mehrfache Zuweisung eines Wertes an eine Eigenschaft</translation>
@@ -7713,21 +7723,53 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
         <translation>Kontext4</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+2"/>
         <source>Call</source>
+        <extracomment>Button to start a call (note: a separate button is used to end the call)</extracomment>
         <translation>Anruf</translation>
     </message>
     <message>
-        <location line="+1"/>
+        <location line="+2"/>
         <source>Hangup</source>
+        <extracomment>Button to end a call (note: a separate button is used to start the call)</extracomment>
         <translation>Auflegen</translation>
     </message>
     <message>
+        <location line="+2"/>
+        <source>Toggle Call/Hangup</source>
+        <extracomment>Button that will hang up if we&apos;re in call, or make a call if we&apos;re not.</extracomment>
+        <translation>Anrufen/Aufhängen</translation>
+    </message>
+    <message>
         <location line="+1"/>
         <source>Flip</source>
         <translation>Umdrehen</translation>
     </message>
     <message>
+        <location line="+2"/>
+        <source>Voice Dial</source>
+        <extracomment>Button to trigger voice dialling</extracomment>
+        <translation>Sprachwahl</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Last Number Redial</source>
+        <extracomment>Button to redial the last number called</extracomment>
+        <translation>Wahlwiederholung</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Camera Shutter</source>
+        <extracomment>Button to trigger the camera shutter (take a picture)</extracomment>
+        <translation>Auslöser</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Camera Focus</source>
+        <extracomment>Button to focus the camera</extracomment>
+        <translation>Scharfstellen</translation>
+    </message>
+    <message>
         <location line="+4"/>
         <source>Kanji</source>
         <translation>Kanji</translation>
-- 
cgit v0.12


From 1350f26569a4ab802ba93dc23e5dcb964a0cd3a5 Mon Sep 17 00:00:00 2001
From: Kent Hansen <kent.hansen@nokia.com>
Date: Wed, 7 Jul 2010 10:24:53 +0200
Subject: Add missing API shims

There were still a couple of functions that didn't have them. This
could cause said functions to crash if multiple script engines were
being used.

Reviewed-by: Jedrzej Nowacki
---
 src/script/api/qscriptvalue.cpp                |  6 ++++++
 tests/auto/qscriptengine/tst_qscriptengine.cpp | 29 ++++++++++++++++++++++++++
 tests/auto/qscriptvalue/tst_qscriptvalue.cpp   |  4 ++++
 3 files changed, 39 insertions(+)

diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 451d1b0..f6390bb 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -1268,6 +1268,7 @@ QDateTime QScriptValue::toDateTime() const
     Q_D(const QScriptValue);
     if (!d || !d->engine)
         return QDateTime();
+    QScript::APIShim shim(d->engine);
     return QScriptEnginePrivate::toDateTime(d->engine->currentFrame, d->jscValue);
 }
 
@@ -1284,6 +1285,7 @@ QRegExp QScriptValue::toRegExp() const
     Q_D(const QScriptValue);
     if (!d || !d->engine)
          return QRegExp();
+    QScript::APIShim shim(d->engine);
     return QScriptEnginePrivate::toRegExp(d->engine->currentFrame, d->jscValue);
 }
 #endif // QT_NO_REGEXP
@@ -1303,6 +1305,7 @@ QObject *QScriptValue::toQObject() const
     Q_D(const QScriptValue);
     if (!d || !d->engine)
         return 0;
+    QScript::APIShim shim(d->engine);
     return QScriptEnginePrivate::toQObject(d->engine->currentFrame, d->jscValue);
 }
 
@@ -1317,6 +1320,7 @@ const QMetaObject *QScriptValue::toQMetaObject() const
     Q_D(const QScriptValue);
     if (!d || !d->engine)
         return 0;
+    QScript::APIShim shim(d->engine);
     return QScriptEnginePrivate::toQMetaObject(d->engine->currentFrame, d->jscValue);
 }
 
@@ -1407,6 +1411,7 @@ QScriptValue QScriptValue::property(quint32 arrayIndex,
     Q_D(const QScriptValue);
     if (!d || !d->isObject())
         return QScriptValue();
+    QScript::APIShim shim(d->engine);
     return d->engine->scriptValueFromJSCValue(d->property(arrayIndex, mode));
 }
 
@@ -1434,6 +1439,7 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value,
                  "cannot set value created in a different engine");
         return;
     }
+    QScript::APIShim shim(d->engine);
     JSC::JSValue jsValue = d->engine->scriptValueToJSCValue(value);
     d->setProperty(arrayIndex, jsValue, flags);
 }
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 6885adf..7a732cc 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -4265,6 +4265,35 @@ void tst_QScriptEngine::reentrancy()
         QScriptEngine eng;
         QCOMPARE(eng.evaluate("Array()").toString(), QString());
     }
+
+    {
+        QScriptEngine eng1;
+        QScriptEngine eng2;
+        {
+            QScriptValue d1 = eng1.newDate(0);
+            QScriptValue d2 = eng2.newDate(0);
+            QCOMPARE(d1.toDateTime(), d2.toDateTime());
+            QCOMPARE(d2.toDateTime(), d1.toDateTime());
+        }
+        {
+            QScriptValue r1 = eng1.newRegExp("foo", "gim");
+            QScriptValue r2 = eng2.newRegExp("foo", "gim");
+            QCOMPARE(r1.toRegExp(), r2.toRegExp());
+            QCOMPARE(r2.toRegExp(), r1.toRegExp());
+        }
+        {
+            QScriptValue o1 = eng1.newQObject(this);
+            QScriptValue o2 = eng2.newQObject(this);
+            QCOMPARE(o1.toQObject(), o2.toQObject());
+            QCOMPARE(o2.toQObject(), o1.toQObject());
+        }
+        {
+            QScriptValue mo1 = eng1.newQMetaObject(&staticMetaObject);
+            QScriptValue mo2 = eng2.newQMetaObject(&staticMetaObject);
+            QCOMPARE(mo1.toQMetaObject(), mo2.toQMetaObject());
+            QCOMPARE(mo2.toQMetaObject(), mo1.toQMetaObject());
+        }
+    }
 }
 
 void tst_QScriptEngine:: incDecNonObjectProperty()
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 8aa4e711..83a3388 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2123,6 +2123,10 @@ void tst_QScriptValue::getSetProperty()
     QVERIFY(object.property(foo).strictlyEquals(num));
     QVERIFY(object.property("foo").strictlyEquals(num));
     QVERIFY(object.propertyFlags(foo) == 0);
+
+    // Setting index property on non-Array
+    object.setProperty(13, num);
+    QVERIFY(object.property(13).equals(num));
 }
 
 void tst_QScriptValue::arrayElementGetterSetter()
-- 
cgit v0.12


From 0ad74254d0810459bc08fdf9c0898a0d73f596b0 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Wed, 7 Jul 2010 10:50:58 +0200
Subject: qdoc: Removed a lot of dead code to minimize confusion.

---
 tools/qdoc3/htmlgenerator.cpp | 229 +-----------------------------------------
 tools/qdoc3/htmlgenerator.h   |   6 --
 2 files changed, 1 insertion(+), 234 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 4461b48..b7ab4d6 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -346,17 +346,6 @@ QString HtmlGenerator::format()
  */
 void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
 {
-#if 0    
-    // Copy the stylesheets from the directory containing the qdocconf file.
-    // ### This should be changed to use a special directory in doc/src.
-    QStringList::ConstIterator styleIter = stylesheets.begin();
-    QDir configPath = QDir::current();
-    while (styleIter != stylesheets.end()) {
-        QString filePath = configPath.absoluteFilePath(*styleIter);
-        Config::copyFile(Location(), filePath, filePath, outputDir());
-        ++styleIter;
-    }
-#endif
     myTree = tree;
     nonCompatClasses.clear();
     mainClasses.clear();
@@ -371,9 +360,6 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
     findAllFunctions(tree->root());
     findAllLegaleseTexts(tree->root());
     findAllNamespaces(tree->root());
-#ifdef ZZZ_QDOC_QML
-    findAllQmlClasses(tree->root());
-#endif
     findAllSince(tree->root());
 
     PageGenerator::generateTree(tree, marker);
@@ -1259,30 +1245,6 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
         subtitleText << "(" << Atom(Atom::AutoLink, fullTitle) << ")"
                      << Atom(Atom::LineBreak);
 
-#if 0
-    // No longer used because the modeule name is a breadcrumb.
-    QString fixedModule = inner->moduleName();
-    if (fixedModule == "Qt3SupportLight")
-        fixedModule = "Qt3Support";
-    if (!fixedModule.isEmpty())
-        subtitleText << "[" << Atom(Atom::AutoLink, fixedModule) << " module]";
-
-    if (fixedModule.isEmpty()) {
-        QMultiMap<QString, QString> publicGroups = myTree->publicGroups();
-        QList<QString> groupNames = publicGroups.values(inner->name());
-        if (!groupNames.isEmpty()) {
-            qSort(groupNames.begin(), groupNames.end());
-            subtitleText << "[";
-            for (int j=0; j<groupNames.count(); j++) {
-                subtitleText <<  Atom(Atom::AutoLink, groupNames[j]);
-                if (j<groupNames.count()-1)
-                    subtitleText <<", ";
-            }
-            subtitleText << "]";
-        }
-    }
-#endif    
-
     generateHeader(title, inner, marker);
     sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
     generateTableOfContents(inner,marker,&sections);
@@ -1853,7 +1815,7 @@ void HtmlGenerator::generateHeader(const QString& title,
     generateBreadCrumbs(title,node,marker);
     out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
 
-#if 0 // Removed for new docf format. MWS
+#if 0 // Removed for new doc format. MWS
     if (node && !node->links().empty())
         out() << "<p>\n" << navigationLinks << "</p>\n";
 #endif    
@@ -2665,19 +2627,7 @@ void HtmlGenerator::generateQmlItem(const Node *node,
         marked.replace("<@type>", "");
         marked.replace("</@type>", "");
     }
-    if (node->type() == Node::QmlProperty) {
-        const QmlPropertyNode* qpn = static_cast<const QmlPropertyNode*>(node);
-        if (!summary && qpn->name() == "color" && qpn->dataType() == "color") {
-            if (relative && relative->name() == "GradientStop") {
-                qDebug() << "color : color";
-                debugging_on = true;
-                qDebug() << "  " << relative->name() << relative->type() << relative->subType();
-                qDebug() << marked;
-            }
-        }
-    }
     out() << highlightedCode(marked, marker, relative, false, node);
-    debugging_on = false;
 }
 #endif
 
@@ -3069,13 +3019,6 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
             if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) {
                 par1 = QStringRef();
                 const Node* n = marker->resolveTarget(arg.toString(), myTree, relative, self);
-                if (HtmlGenerator::debugging_on) {
-                    qDebug() << "arg.toString()" << arg.toString();
-                    if (n) {
-                        qDebug() << "  " << n->name() << n->type() << n->subType();
-                        qDebug() << "  " << relative->name() << relative->type() << relative->subType();
-                    }
-                }
                 addLink(linkForNode(n,relative), arg, &html);
                 handled = true;
             }
@@ -3681,13 +3624,6 @@ void HtmlGenerator::findAllSince(const InnerNode *node)
     }
 }
 
-#if 0
-    const QRegExp versionSeparator("[\\-\\.]");
-    const int minorIndex = version.indexOf(versionSeparator);
-    const int patchIndex = version.indexOf(versionSeparator, minorIndex+1);
-    version = version.left(patchIndex);
-#endif
-
 void HtmlGenerator::findAllFunctions(const InnerNode *node)
 {
     NodeList::ConstIterator c = node->childNodes().begin();
@@ -3751,29 +3687,6 @@ void HtmlGenerator::findAllNamespaces(const InnerNode *node)
     }
 }
 
-#ifdef ZZZ_QDOC_QML
-/*!
-  This function finds all the qml element nodes and
-  stores them in a map for later use.
- */
-void HtmlGenerator::findAllQmlClasses(const InnerNode *node)
-{
-    NodeList::const_iterator c = node->childNodes().constBegin();
-    while (c != node->childNodes().constEnd()) {
-        if ((*c)->type() == Node::Fake) {
-            const FakeNode* fakeNode = static_cast<const FakeNode *>(*c);
-            if (fakeNode->subType() == Node::QmlClass) {
-                const QmlClassNode* qmlNode =
-                    static_cast<const QmlClassNode*>(fakeNode);
-                const Node* n = qmlNode->classNode();
-            }
-            qmlClasses.insert(fakeNode->name(),*c);
-        }
-        ++c;
-    }
-}
-#endif
-
 int HtmlGenerator::hOffset(const Node *node)
 {
     switch (node->type()) {
@@ -3782,12 +3695,6 @@ int HtmlGenerator::hOffset(const Node *node)
         return 2;
     case Node::Fake:
         return 1;
-#if 0        
-        if (node->doc().briefText().isEmpty())
-            return 1;
-        else
-            return 2;
-#endif        
     case Node::Enum:
     case Node::Typedef:
     case Node::Function:
@@ -4461,138 +4368,4 @@ void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marke
 
 #endif
 
-#if 0 // fossil removed for new doc format MWS 19/04/2010
-    out() << "<!DOCTYPE html\n"
-             "    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n";
-    out() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage);
-
-    QString shortVersion;
-    if ((project != "Qtopia") && (project != "Qt Extended")) {
-        shortVersion = project + " " + shortVersion + ": ";
-        if (node && !node->doc().location().isEmpty())
-            out() << "<!-- " << node->doc().location().fileName() << " -->\n";
-
-        shortVersion = myTree->version();
-        if (shortVersion.count(QChar('.')) == 2)
-            shortVersion.truncate(shortVersion.lastIndexOf(QChar('.')));
-        if (!shortVersion.isEmpty()) {
-            if (project == "QSA")
-                shortVersion = "QSA " + shortVersion + ": ";
-            else
-                shortVersion = "Qt " + shortVersion + ": ";
-        }
-    }
-
-    out() << "<head>\n"
-             "  <title>" << shortVersion << protectEnc(title) << "</title>\n";
-    out() << QString("<meta http-equiv=\"Content-type\" content=\"text/html; charset=%1\" />").arg(outputEncoding);
-
-    if (!style.isEmpty())
-        out() << "    <style type=\"text/css\">" << style << "</style>\n";
-
-    const QMap<QString, QString> &metaMap = node->doc().metaTagMap();
-    if (!metaMap.isEmpty()) {
-        QMapIterator<QString, QString> i(metaMap);
-        while (i.hasNext()) {
-            i.next();
-            out() << "    <meta name=\"" << protectEnc(i.key()) << "\" contents=\""
-                  << protectEnc(i.value()) << "\" />\n";
-        }
-    }
-
-    navigationLinks.clear();
-
-    if (node && !node->links().empty()) {
-        QPair<QString,QString> linkPair;
-        QPair<QString,QString> anchorPair;
-        const Node *linkNode;
-
-        if (node->links().contains(Node::PreviousLink)) {
-            linkPair = node->links()[Node::PreviousLink];
-            linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (!linkNode || linkNode == node)
-                anchorPair = linkPair;
-            else
-                anchorPair = anchorForNode(linkNode);
-
-            out() << "  <link rel=\"prev\" href=\""
-                  << anchorPair.first << "\" />\n";
-
-            navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">";
-            if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
-                navigationLinks += protectEnc(anchorPair.second);
-            else
-                navigationLinks += protectEnc(linkPair.second);
-            navigationLinks += "</a>]\n";
-        }
-        if (node->links().contains(Node::ContentsLink)) {
-            linkPair = node->links()[Node::ContentsLink];
-            linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (!linkNode || linkNode == node)
-                anchorPair = linkPair;
-            else
-                anchorPair = anchorForNode(linkNode);
-
-            out() << "  <link rel=\"contents\" href=\""
-                  << anchorPair.first << "\" />\n";
-
-            navigationLinks += "[<a href=\"" + anchorPair.first + "\">";
-            if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
-                navigationLinks += protectEnc(anchorPair.second);
-            else
-                navigationLinks += protectEnc(linkPair.second);
-            navigationLinks += "</a>]\n";
-        }
-        if (node->links().contains(Node::NextLink)) {
-            linkPair = node->links()[Node::NextLink];
-            linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (!linkNode || linkNode == node)
-                anchorPair = linkPair;
-            else
-                anchorPair = anchorForNode(linkNode);
-
-            out() << "  <link rel=\"next\" href=\""
-                  << anchorPair.first << "\" />\n";
-
-            navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">";
-            if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
-                navigationLinks += protectEnc(anchorPair.second);
-            else
-                navigationLinks += protectEnc(linkPair.second);
-            navigationLinks += "</a>]\n";
-        }
-        if (node->links().contains(Node::IndexLink)) {
-            linkPair = node->links()[Node::IndexLink];
-            linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (!linkNode || linkNode == node)
-                anchorPair = linkPair;
-            else
-                anchorPair = anchorForNode(linkNode);
-            out() << "  <link rel=\"index\" href=\""
-                  << anchorPair.first << "\" />\n";
-        }
-        if (node->links().contains(Node::StartLink)) {
-            linkPair = node->links()[Node::StartLink];
-            linkNode = findNodeForTarget(linkPair.first, node, marker);
-            if (!linkNode || linkNode == node)
-                anchorPair = linkPair;
-            else
-                anchorPair = anchorForNode(linkNode);
-            out() << "  <link rel=\"start\" href=\""
-                  << anchorPair.first << "\" />\n";
-        }
-    }
-
-    foreach (const QString &stylesheet, stylesheets) {
-        out() << "  <link href=\"" << stylesheet << "\" rel=\"stylesheet\" "
-              << "type=\"text/css\" />\n";
-    }
-
-    foreach (const QString &customHeadElement, customHeadElements) {
-        out() << "  " << customHeadElement << "\n";
-    }
-
-    out() << "</head>\n"
- #endif       
-
  QT_END_NAMESPACE
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index a2fadf6..9c5be15 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -237,9 +237,6 @@ class HtmlGenerator : public PageGenerator
     void findAllFunctions(const InnerNode *node);
     void findAllLegaleseTexts(const InnerNode *node);
     void findAllNamespaces(const InnerNode *node);
-#ifdef ZZZ_QDOC_QML    
-    void findAllQmlClasses(const InnerNode *node);
-#endif
     void findAllSince(const InnerNode *node);
     static int hOffset(const Node *node);
     static bool isThreeColumnEnumValueTable(const Atom *atom);
@@ -317,9 +314,6 @@ class HtmlGenerator : public PageGenerator
     NodeMap obsoleteClasses;
     NodeMap namespaceIndex;
     NodeMap serviceClasses;
-#ifdef QDOC_QML    
-    NodeMap qmlClasses;
-#endif
     QMap<QString, NodeMap > funcIndex;
     QMap<Text, const Node *> legaleseTexts;
     NewSinceMaps newSinceMaps;
-- 
cgit v0.12


From b139e7e96e5c47b412c4f0bbc4ae11d5cca99e61 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 6 Jul 2010 19:39:52 +0200
Subject: run dep commands in build dir

the file names are given relative to the build directory, so the command
needs to be run in it as well. this is a more expected (and simpler) fix
than the alternative, which would be giving file names relative to the
source directory.

reasons not to fix:
- due to some other bug, the problem really affects only builds where
  the build dir is not at the same level as the source dir - otherwise,
  absolute paths would be passed anyway
- it has some breakage potential for the cases where the commands
  actually expect being run in the source dir
- it can be worked around by manually injecting the cd statement into
  the command

reasons why i still fixed it:
- it doesn't affect in-source builds, and it seems that most complex
  build systems (which would define custom compilers with
  depend_command) don't support shadow builds anyway
- people who needed things to work probably already used $$OUT_PWD somehow
  (either a "cd" at the start, or prepending it to each path), so this
  change will be practically a no-op
- "it's just dependencies, and these are known to be broken in qmake
  anyway"

Reviewed-by: joerg
Task-number: QTBUG-1918
---
 qmake/generators/makefile.cpp                       |  8 ++++++--
 tests/auto/qmake/testdata/simple_app/build/README   |  1 +
 tests/auto/qmake/testdata/simple_app/simple_app.pro |  1 +
 tests/auto/qmake/testdata/simple_app/test.qrc       |  5 +++++
 tests/auto/qmake/tst_qmake.cpp                      | 16 ++++++++++++++++
 5 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 tests/auto/qmake/testdata/simple_app/build/README
 create mode 100644 tests/auto/qmake/testdata/simple_app/test.qrc

diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index d6b3e09..45a96f5 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1756,6 +1756,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
         }
         QStringList tmp_dep = project->values((*it) + ".depends");
         QString tmp_dep_cmd;
+        QString dep_cd_cmd;
         if(!project->isEmpty((*it) + ".depend_command")) {
             int argv0 = -1;
             QStringList cmdline = project->values((*it) + ".depend_command");
@@ -1774,6 +1775,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
                     cmdline[argv0] = escapeFilePath(cmdline.at(argv0));
                 }
             }
+            dep_cd_cmd = QLatin1String("cd ")
+                 + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+                 + QLatin1String(" && ");
         }
         QStringList &vars = project->values((*it) + ".variables");
         if(tmp_out.isEmpty() || tmp_cmd.isEmpty())
@@ -1875,7 +1879,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
                     char buff[256];
                     QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
                                                                     tmp_out);
-                    dep_cmd = fixEnvVariables(dep_cmd);
+                    dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
                     if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
                         QString indeps;
                         while(!feof(proc)) {
@@ -1973,7 +1977,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
             if(!tmp_dep_cmd.isEmpty() && doDepends()) {
                 char buff[256];
                 QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
-                dep_cmd = fixEnvVariables(dep_cmd);
+                dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
                 if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
                     QString indeps;
                     while(!feof(proc)) {
diff --git a/tests/auto/qmake/testdata/simple_app/build/README b/tests/auto/qmake/testdata/simple_app/build/README
new file mode 100644
index 0000000..acfd9d9
--- /dev/null
+++ b/tests/auto/qmake/testdata/simple_app/build/README
@@ -0,0 +1 @@
+Here to ensure build/ exists, used by the simple_app_shadowbuild2 test.
diff --git a/tests/auto/qmake/testdata/simple_app/simple_app.pro b/tests/auto/qmake/testdata/simple_app/simple_app.pro
index f496d5b..a8c4ad6 100644
--- a/tests/auto/qmake/testdata/simple_app/simple_app.pro
+++ b/tests/auto/qmake/testdata/simple_app/simple_app.pro
@@ -3,6 +3,7 @@ CONFIG		+= qt warn_on
 HEADERS		= test_file.h
 SOURCES		= test_file.cpp \
 		  	main.cpp
+RESOURCES = test.qrc
 TARGET		= simple_app
 DESTDIR		= ./
 
diff --git a/tests/auto/qmake/testdata/simple_app/test.qrc b/tests/auto/qmake/testdata/simple_app/test.qrc
new file mode 100644
index 0000000..decde3d
--- /dev/null
+++ b/tests/auto/qmake/testdata/simple_app/test.qrc
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>test.qrc</file>
+    </qresource>
+</RCC>
diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp
index 03054e7..5efe714 100644
--- a/tests/auto/qmake/tst_qmake.cpp
+++ b/tests/auto/qmake/tst_qmake.cpp
@@ -65,6 +65,7 @@ public slots:
 private slots:
     void simple_app();
     void simple_app_shadowbuild();
+    void simple_app_shadowbuild2();
     void simple_lib();
     void simple_dll();
     void subdirs();
@@ -163,6 +164,21 @@ void tst_qmake::simple_app_shadowbuild()
     QVERIFY( test_compiler.removeMakefile( buildDir ) );
 }
 
+void tst_qmake::simple_app_shadowbuild2()
+{
+    QString workDir = base_path + "/testdata/simple_app";
+    QString buildDir = base_path + "/testdata/simple_app/build";
+
+    QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir ));
+    QVERIFY( test_compiler.make( buildDir ));
+    QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" ));
+    QVERIFY( test_compiler.makeClean( buildDir ));
+    QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean
+    QVERIFY( test_compiler.makeDistClean( buildDir ));
+    QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean
+    QVERIFY( test_compiler.removeMakefile( buildDir ) );
+}
+
 void tst_qmake::simple_dll()
 {
     QString workDir = base_path + "/testdata/simple_dll";
-- 
cgit v0.12


From 42fe2bfb65c85fc630efe32aa1d62d66f2caab2a Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Wed, 7 Jul 2010 12:05:35 +0200
Subject: Fixed whitespace formatting

Merge-request: 715
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 src/plugins/sqldrivers/db2/db2.pro         | 2 +-
 src/plugins/sqldrivers/ibase/ibase.pro     | 2 +-
 src/plugins/sqldrivers/mysql/mysql.pro     | 2 +-
 src/plugins/sqldrivers/oci/oci.pro         | 2 +-
 src/plugins/sqldrivers/odbc/odbc.pro       | 2 +-
 src/plugins/sqldrivers/psql/psql.pro       | 2 +-
 src/plugins/sqldrivers/sqlite/sqlite.pro   | 2 +-
 src/plugins/sqldrivers/sqlite2/sqlite2.pro | 2 +-
 src/plugins/sqldrivers/tds/tds.pro         | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro
index 5223beb..25ca499 100644
--- a/src/plugins/sqldrivers/db2/db2.pro
+++ b/src/plugins/sqldrivers/db2/db2.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqldb2
+TARGET = qsqldb2
 
 HEADERS		= ../../../sql/drivers/db2/qsql_db2.h
 SOURCES		= main.cpp \
diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro
index ec2bc7b..bb73adb 100644
--- a/src/plugins/sqldrivers/ibase/ibase.pro
+++ b/src/plugins/sqldrivers/ibase/ibase.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqlibase
+TARGET = qsqlibase
 
 HEADERS		= ../../../sql/drivers/ibase/qsql_ibase.h
 SOURCES		= main.cpp \
diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro
index 9f5c619..b808c8e 100644
--- a/src/plugins/sqldrivers/mysql/mysql.pro
+++ b/src/plugins/sqldrivers/mysql/mysql.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqlmysql
+TARGET = qsqlmysql
 
 HEADERS		= ../../../sql/drivers/mysql/qsql_mysql.h
 SOURCES		= main.cpp \
diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro
index 3bf70a1..d75827e 100644
--- a/src/plugins/sqldrivers/oci/oci.pro
+++ b/src/plugins/sqldrivers/oci/oci.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqloci
+TARGET = qsqloci
 
 HEADERS		= ../../../sql/drivers/oci/qsql_oci.h
 SOURCES		= main.cpp \
diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro
index 2bf85f1..70070db 100644
--- a/src/plugins/sqldrivers/odbc/odbc.pro
+++ b/src/plugins/sqldrivers/odbc/odbc.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqlodbc
+TARGET = qsqlodbc
 
 HEADERS		= ../../../sql/drivers/odbc/qsql_odbc.h
 SOURCES		= main.cpp \
diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro
index 80a5348..9586695 100644
--- a/src/plugins/sqldrivers/psql/psql.pro
+++ b/src/plugins/sqldrivers/psql/psql.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqlpsql
+TARGET = qsqlpsql
 
 HEADERS		= ../../../sql/drivers/psql/qsql_psql.h
 SOURCES		= main.cpp \
diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro
index fb31233..75f04b9 100644
--- a/src/plugins/sqldrivers/sqlite/sqlite.pro
+++ b/src/plugins/sqldrivers/sqlite/sqlite.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqlite
+TARGET = qsqlite
 
 HEADERS		= ../../../sql/drivers/sqlite/qsql_sqlite.h
 SOURCES		= smain.cpp \
diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
index 88db22a..0f6c19a 100644
--- a/src/plugins/sqldrivers/sqlite2/sqlite2.pro
+++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqlite2
+TARGET = qsqlite2
 
 HEADERS		= ../../../sql/drivers/sqlite2/qsql_sqlite2.h
 SOURCES		= smain.cpp \
diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro
index 08a166b..ba40be5 100644
--- a/src/plugins/sqldrivers/tds/tds.pro
+++ b/src/plugins/sqldrivers/tds/tds.pro
@@ -1,4 +1,4 @@
-TARGET	 = qsqltds
+TARGET = qsqltds
 
 HEADERS		= ../../../sql/drivers/tds/qsql_tds.h
 
-- 
cgit v0.12


From d7557de99b38031906c17c54496cb76a13dec5f7 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Wed, 7 Jul 2010 12:05:36 +0200
Subject: Consolidate sql driver configuration redundancy

Previously sql driver recipes each appeared in both the plugin
pro file and src/sql/drivers/drivers.pri for building into QtSql.

Split driver recipes into shared pri files.
Also split bundled 3rd party sqlite code recipe into a shared pri.

Merge-request: 715
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 src/3rdparty/sqlite.pri                    |   4 +
 src/plugins/sqldrivers/db2/db2.pro         |   8 +-
 src/plugins/sqldrivers/ibase/ibase.pro     |  12 +--
 src/plugins/sqldrivers/mysql/mysql.pro     |  21 +----
 src/plugins/sqldrivers/oci/oci.pro         |  11 +--
 src/plugins/sqldrivers/odbc/odbc.pro       |  17 +---
 src/plugins/sqldrivers/psql/psql.pro       |  16 +---
 src/plugins/sqldrivers/sqlite/sqlite.pro   |  15 +---
 src/plugins/sqldrivers/sqlite2/sqlite2.pro |   7 +-
 src/plugins/sqldrivers/tds/tds.pro         |  13 +--
 src/sql/drivers/db2/qsql_db2.pri           |   8 ++
 src/sql/drivers/drivers.pri                | 130 +++--------------------------
 src/sql/drivers/ibase/qsql_ibase.pri       |  11 +++
 src/sql/drivers/mysql/qsql_mysql.pri       |  16 ++++
 src/sql/drivers/oci/qsql_oci.pri           |   9 ++
 src/sql/drivers/odbc/qsql_odbc.pri         |  13 +++
 src/sql/drivers/psql/qsql_psql.pri         |  13 +++
 src/sql/drivers/sqlite/qsql_sqlite.pri     |   9 ++
 src/sql/drivers/sqlite2/qsql_sqlite2.pri   |   4 +
 src/sql/drivers/tds/qsql_tds.pri           |  10 +++
 20 files changed, 126 insertions(+), 221 deletions(-)
 create mode 100644 src/3rdparty/sqlite.pri
 create mode 100644 src/sql/drivers/db2/qsql_db2.pri
 create mode 100644 src/sql/drivers/ibase/qsql_ibase.pri
 create mode 100644 src/sql/drivers/mysql/qsql_mysql.pri
 create mode 100644 src/sql/drivers/oci/qsql_oci.pri
 create mode 100644 src/sql/drivers/odbc/qsql_odbc.pri
 create mode 100644 src/sql/drivers/psql/qsql_psql.pri
 create mode 100644 src/sql/drivers/sqlite/qsql_sqlite.pri
 create mode 100644 src/sql/drivers/sqlite2/qsql_sqlite2.pri
 create mode 100644 src/sql/drivers/tds/qsql_tds.pri

diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri
new file mode 100644
index 0000000..575412d
--- /dev/null
+++ b/src/3rdparty/sqlite.pri
@@ -0,0 +1,4 @@
+CONFIG(release, debug|release):DEFINES *= NDEBUG
+DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
+INCLUDEPATH +=  $$PWD/sqlite
+SOURCES +=      $$PWD/sqlite/sqlite3.c
diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro
index 25ca499..e053f37 100644
--- a/src/plugins/sqldrivers/db2/db2.pro
+++ b/src/plugins/sqldrivers/db2/db2.pro
@@ -1,10 +1,6 @@
 TARGET = qsqldb2
 
-HEADERS		= ../../../sql/drivers/db2/qsql_db2.h
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/db2/qsql_db2.cpp
-
-unix:!contains( LIBS, .*db2.* ):LIBS 	*= -ldb2
-win32:!contains( LIBS, .*db2.* ):LIBS   *= -ldb2cli
+SOURCES = main.cpp
+include(../../../sql/drivers/db2/qsql_db2.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro
index bb73adb..7870ec8 100644
--- a/src/plugins/sqldrivers/ibase/ibase.pro
+++ b/src/plugins/sqldrivers/ibase/ibase.pro
@@ -1,14 +1,6 @@
 TARGET = qsqlibase
 
-HEADERS		= ../../../sql/drivers/ibase/qsql_ibase.h
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/ibase/qsql_ibase.cpp
-
-unix:!contains( LIBS, .*gds.* ):!contains( LIBS, .*libfb.* ):LIBS    *= -lgds
-
-win32:!contains( LIBS, .*gds.* ):!contains( LIBS, .*fbclient.* ) {
-	!win32-borland:LIBS *= -lgds32_ms
-	win32-borland:LIBS  += gds32.lib
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/ibase/qsql_ibase.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro
index b808c8e..b6d42ff 100644
--- a/src/plugins/sqldrivers/mysql/mysql.pro
+++ b/src/plugins/sqldrivers/mysql/mysql.pro
@@ -1,23 +1,6 @@
 TARGET = qsqlmysql
 
-HEADERS		= ../../../sql/drivers/mysql/qsql_mysql.h
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/mysql/qsql_mysql.cpp
-
-unix: {
-    isEmpty(QT_LFLAGS_MYSQL) {
-        !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
-            use_libmysqlclient_r:LIBS *= -lmysqlclient_r
-            else:LIBS *= -lmysqlclient
-        }
-    } else {
-        LIBS *= $$QT_LFLAGS_MYSQL
-        QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
-    }
-}
-
-win32:!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*) {
-    LIBS     *= -llibmysql    
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/mysql/qsql_mysql.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro
index d75827e..d7dcce9 100644
--- a/src/plugins/sqldrivers/oci/oci.pro
+++ b/src/plugins/sqldrivers/oci/oci.pro
@@ -1,13 +1,6 @@
 TARGET = qsqloci
 
-HEADERS		= ../../../sql/drivers/oci/qsql_oci.h
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/oci/qsql_oci.cpp
-
-win32:LIBS	*= -loci
-
-unix:!contains( LIBS, .*clnts.* ):LIBS	*= -lclntsh
-
-macx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
+SOURCES = main.cpp
+include(../../../sql/drivers/oci/qsql_oci.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro
index 70070db..677eb6e 100644
--- a/src/plugins/sqldrivers/odbc/odbc.pro
+++ b/src/plugins/sqldrivers/odbc/odbc.pro
@@ -1,19 +1,6 @@
 TARGET = qsqlodbc
 
-HEADERS		= ../../../sql/drivers/odbc/qsql_odbc.h
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/odbc/qsql_odbc.cpp
-
-unix {
-	!contains( LIBS, .*odbc.* ) {
-	    LIBS 	*= $$QT_LFLAGS_ODBC
-	}
-        DEFINES += UNICODE
-}
-
-win32 {
-	!win32-borland:LIBS	*= -lodbc32
-    	win32-borland:LIBS	*= $(BCB)/lib/PSDK/odbc32.lib
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/odbc/qsql_odbc.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro
index 9586695..8276c0a 100644
--- a/src/plugins/sqldrivers/psql/psql.pro
+++ b/src/plugins/sqldrivers/psql/psql.pro
@@ -1,18 +1,6 @@
 TARGET = qsqlpsql
 
-HEADERS		= ../../../sql/drivers/psql/qsql_psql.h
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/psql/qsql_psql.cpp
-
-unix|win32-g++*: {
-    !isEmpty(QT_LFLAGS_PSQL) {
-        !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
-        !static:LIBS *= $$QT_LFLAGS_PSQL
-        QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
-    }
-    !contains(LIBS, .*pq.*):LIBS *= -lpq
-}
-
-win32:!win32-g++*:!contains(LIBS, .*pq.* ) LIBS *= -llibpq -lws2_32 -ladvapi32
+SOURCES = main.cpp
+include(../../../sql/drivers/psql/qsql_psql.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro
index 75f04b9..f4c1671 100644
--- a/src/plugins/sqldrivers/sqlite/sqlite.pro
+++ b/src/plugins/sqldrivers/sqlite/sqlite.pro
@@ -1,18 +1,7 @@
 TARGET = qsqlite
 
-HEADERS		= ../../../sql/drivers/sqlite/qsql_sqlite.h
-SOURCES		= smain.cpp \
-		  ../../../sql/drivers/sqlite/qsql_sqlite.cpp
-
-!system-sqlite:!contains( LIBS, .*sqlite.* ) {
-    CONFIG(release, debug|release):DEFINES *= NDEBUG
-    DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE 
-    INCLUDEPATH += ../../../3rdparty/sqlite
-    SOURCES += ../../../3rdparty/sqlite/sqlite3.c
-} else {
-    LIBS *= $$QT_LFLAGS_SQLITE
-    QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
-}
+SOURCES = smain.cpp
+include(../../../sql/drivers/sqlite/qsql_sqlite.pri)
 
 wince*: DEFINES += HAVE_LOCALTIME_S=0
 
diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
index 0f6c19a..e6197b9 100644
--- a/src/plugins/sqldrivers/sqlite2/sqlite2.pro
+++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
@@ -1,9 +1,6 @@
 TARGET = qsqlite2
 
-HEADERS		= ../../../sql/drivers/sqlite2/qsql_sqlite2.h
-SOURCES		= smain.cpp \
-		  ../../../sql/drivers/sqlite2/qsql_sqlite2.cpp
-
-!contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
+SOURCES = smain.cpp
+include(../../../sql/drivers/sqlite2/qsql_sqlite2.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro
index ba40be5..b8e8ded 100644
--- a/src/plugins/sqldrivers/tds/tds.pro
+++ b/src/plugins/sqldrivers/tds/tds.pro
@@ -1,15 +1,6 @@
 TARGET = qsqltds
 
-HEADERS		= ../../../sql/drivers/tds/qsql_tds.h
-
-SOURCES		= main.cpp \
-		  ../../../sql/drivers/tds/qsql_tds.cpp
-
-unix:!contains( LIBS, .*sybdb.* ):LIBS 	*= -lsybdb
-
-win32 {
-    !win32-borland:LIBS *= -lNTWDBLIB
-    win32-borland:LIBS 	*= $(BCB)/lib/PSDK/NTWDBLIB.LIB
-}
+SOURCES = main.cpp
+include(../../../sql/drivers/tds/qsql_tds.pri)
 
 include(../qsqldriverbase.pri)
diff --git a/src/sql/drivers/db2/qsql_db2.pri b/src/sql/drivers/db2/qsql_db2.pri
new file mode 100644
index 0000000..e53a8a0
--- /dev/null
+++ b/src/sql/drivers/db2/qsql_db2.pri
@@ -0,0 +1,8 @@
+HEADERS += $$PWD/qsql_db2.h
+SOURCES += $$PWD/qsql_db2.cpp
+
+unix {
+    !contains(LIBS, .*db2.*):LIBS *= -ldb2
+} else:!win32-borland {
+    !contains(LIBS, .*db2.*):LIBS *= -ldb2cli
+}
diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri
index 05e7265..3af5525 100644
--- a/src/sql/drivers/drivers.pri
+++ b/src/sql/drivers/drivers.pri
@@ -1,119 +1,11 @@
-contains(sql-drivers, all ) {
-    sql-driver +=   psql mysql odbc oci tds db2 sqlite ibase
-}
-
-contains(sql-drivers, psql) {
-    HEADERS +=      drivers/psql/qsql_psql.h
-    SOURCES +=      drivers/psql/qsql_psql.cpp
-
-    unix|win32-g++* {
-        !static:!isEmpty(QT_LFLAGS_PSQL) {
-            !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
-            !static:LIBS *= $$QT_LFLAGS_PSQL
-            QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
-        }
-        !contains(LIBS, .*pq.*):LIBS *= -lpq
-    } else:win32:!contains(LIBS, .*pq.* ) LIBS *= -llibpq -lws2_32 -ladvapi32
-}
-
-contains(sql-drivers, mysql) {
-    HEADERS +=      drivers/mysql/qsql_mysql.h
-    SOURCES +=      drivers/mysql/qsql_mysql.cpp
-
-    unix {
-        isEmpty(QT_LFLAGS_MYSQL) {
-            !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
-                use_libmysqlclient_r:LIBS *= -lmysqlclient_r
-                else:LIBS *= -lmysqlclient
-            }
-        } else {
-            LIBS *= $$QT_LFLAGS_MYSQL
-            QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
-        }
-    }
-
-    win32:!contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*) {
-        !win32-g++*:LIBS *= -llibmysql
-        else:LIBS        *= -lmysql
-    }    
-}
-
-contains(sql-drivers, odbc) {
-     HEADERS += drivers/odbc/qsql_odbc.h
-     SOURCES += drivers/odbc/qsql_odbc.cpp
-
-     mac:!contains( LIBS, .*odbc.* ):LIBS        *= -liodbc
-     unix:!contains( LIBS, .*odbc.* ):LIBS       *= -lodbc
-     unix:DEFINES += UNICODE
-
-     win32 {
-         !win32-borland:LIBS *= -lodbc32
-         else:LIBS           *= $(BCB)/lib/PSDK/odbc32.lib
-     }
-}
-
-contains(sql-drivers, oci) {
-    HEADERS += drivers/oci/qsql_oci.h
-    SOURCES += drivers/oci/qsql_oci.cpp
-
-    unix:!contains( LIBS, .*clnts.* ):LIBS += -lclntsh
-
-    win32:LIBS += -loci
-}
-
-contains(sql-drivers, tds) {
-    HEADERS += drivers/tds/qsql_tds.h
-    SOURCES += drivers/tds/qsql_tds.cpp
-
-    unix:LIBS += -L$SYBASE/lib -lsybdb
-
-    win32 {
-        !win32-borland:LIBS += -lNTWDBLIB
-        else:LIBS           += $(BCB)/lib/PSDK/NTWDBLIB.LIB
-    }
-}
-
-contains(sql-drivers, db2) {
-    HEADERS += drivers/db2/qsql_db2.h
-    SOURCES += drivers/db2/qsql_db2.cpp
-    
-    unix:LIBS += -ldb2
-    
-    win32 {
-        !win32-borland:LIBS += -ldb2cli
-#        else:LIBS          += $(BCB)/lib/PSDK/db2cli.lib
-    }
-}
-
-contains(sql-drivers, ibase) {
-    HEADERS += drivers/ibase/qsql_ibase.h
-    SOURCES += drivers/ibase/qsql_ibase.cpp
-    
-    unix:LIBS *= -lgds  
-    
-    win32 {
-        !win32-borland:LIBS *= -lgds32_ms
-        else:LIBS           += gds32.lib
-    }
-}
-
-contains(sql-drivers, sqlite2) {
-    HEADERS += drivers/sqlite2/qsql_sqlite2.h
-    SOURCES += drivers/sqlite2/qsql_sqlite2.cpp
-    !contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
-}
-
-contains(sql-drivers, sqlite) {
-    !system-sqlite:!contains( LIBS, .*sqlite3.* ) {
-        CONFIG(release, debug|release):DEFINES *= NDEBUG
-        DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE 
-        INCLUDEPATH +=  ../3rdparty/sqlite
-        SOURCES +=      ../3rdparty/sqlite/sqlite3.c
-    } else {
-        LIBS *= $$QT_LFLAGS_SQLITE
-        QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
-    }
-
-    HEADERS +=      drivers/sqlite/qsql_sqlite.h
-    SOURCES +=      drivers/sqlite/qsql_sqlite.cpp
-}
+contains(sql-drivers, all):sql-driver += psql mysql odbc oci tds db2 sqlite ibase
+
+contains(sql-drivers, psql):include($$PWD/sqlite/qsql_psql.pri)
+contains(sql-drivers, mysql):include($$PWD/mysql/qsql_mysql.pri)
+contains(sql-drivers, odbc):include($$PWD/odbc/qsql_odbc.pri)
+contains(sql-drivers, oci):include($$PWD/oci/qsql_oci.pri)
+contains(sql-drivers, tds):include($$PWD/tds/qsql_tds.pri)
+contains(sql-drivers, db2):include($$PWD/db2/qsql_db2.pri)
+contains(sql-drivers, ibase):include($$PWD/db2/qsql_ibase.pri)
+contains(sql-drivers, sqlite2):include($$PWD/sqlite2/qsql_sqlite2.pri)
+contains(sql-drivers, sqlite):include($$PWD/sqlite/qsql_sqlite.pri)
diff --git a/src/sql/drivers/ibase/qsql_ibase.pri b/src/sql/drivers/ibase/qsql_ibase.pri
new file mode 100644
index 0000000..ebcd18a
--- /dev/null
+++ b/src/sql/drivers/ibase/qsql_ibase.pri
@@ -0,0 +1,11 @@
+HEADERS += $$PWD/qsql_ibase.h
+SOURCES += $$PWD/qsql_ibase.cpp
+
+unix {
+    !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS *= -lgds
+} else {
+    !contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
+        win32-borland:LIBS += gds32.lib
+        else:LIBS *= -lgds32_ms
+    }
+}
diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
new file mode 100644
index 0000000..801b891
--- /dev/null
+++ b/src/sql/drivers/mysql/qsql_mysql.pri
@@ -0,0 +1,16 @@
+HEADERS += $$PWD/qsql_mysql.h
+SOURCES += $$PWD/qsql_mysql.cpp
+
+unix {
+    isEmpty(QT_LFLAGS_MYSQL) {
+        !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
+            use_libmysqlclient_r:LIBS *= -lmysqlclient_r
+            else:LIBS *= -lmysqlclient
+        }
+    } else {
+        LIBS *= $$QT_LFLAGS_MYSQL
+        QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
+    }
+} else {
+    !contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS *= -llibmysql
+}
diff --git a/src/sql/drivers/oci/qsql_oci.pri b/src/sql/drivers/oci/qsql_oci.pri
new file mode 100644
index 0000000..6859156
--- /dev/null
+++ b/src/sql/drivers/oci/qsql_oci.pri
@@ -0,0 +1,9 @@
+HEADERS += $$PWD/qsql_oci.h
+SOURCES += $$PWD/qsql_oci.cpp
+
+unix {
+    !contains(LIBS, .*clnts.*):LIBS *= -lclntsh
+} else {
+    LIBS *= -loci
+}
+macx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
diff --git a/src/sql/drivers/odbc/qsql_odbc.pri b/src/sql/drivers/odbc/qsql_odbc.pri
new file mode 100644
index 0000000..c4c92be
--- /dev/null
+++ b/src/sql/drivers/odbc/qsql_odbc.pri
@@ -0,0 +1,13 @@
+HEADERS += $$PWD/qsql_odbc.h
+SOURCES += $$PWD/qsql_odbc.cpp
+
+mac {
+    !contains(LIBS, .*odbc.*):LIBS *= -liodbc
+} else:unix {
+    DEFINES += UNICODE
+    !contains(LIBS, .*odbc.*):LIBS *= $$QT_LFLAGS_ODBC
+} else:win32-borland {
+    LIBS *= $(BCB)/lib/PSDK/odbc32.lib
+} else {
+    LIBS *= -lodbc32
+}
diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri
new file mode 100644
index 0000000..c282d57
--- /dev/null
+++ b/src/sql/drivers/psql/qsql_psql.pri
@@ -0,0 +1,13 @@
+HEADERS += $$PWD/qsql_psql.h
+SOURCES += $$PWD/qsql_psql.cpp
+
+unix|win32-g++* {
+    !static:!isEmpty(QT_LFLAGS_PSQL) {
+        !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
+        LIBS *= $$QT_LFLAGS_PSQL
+        QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
+    }
+    !contains(LIBS, .*pq.*):LIBS *= -lpq
+} else {
+    !contains(LIBS, .*pq.*):LIBS *= -llibpq -lws2_32 -ladvapi32
+}
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri
new file mode 100644
index 0000000..7ad5936
--- /dev/null
+++ b/src/sql/drivers/sqlite/qsql_sqlite.pri
@@ -0,0 +1,9 @@
+HEADERS += $$PWD/qsql_sqlite.h
+SOURCES += $$PWD/qsql_sqlite.cpp
+
+!system-sqlite:!contains(LIBS, .*sqlite3.*) {
+    include($$PWD/../../../3rdparty/sqlite.pri)
+} else {
+    LIBS *= $$QT_LFLAGS_SQLITE
+    QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
+}
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.pri b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
new file mode 100644
index 0000000..9f0e807
--- /dev/null
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
@@ -0,0 +1,4 @@
+HEADERS += $PWD/qsql_sqlite2.h
+SOURCES += $PWD/qsql_sqlite2.cpp
+
+!contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri
new file mode 100644
index 0000000..e2662ca
--- /dev/null
+++ b/src/sql/drivers/tds/qsql_tds.pri
@@ -0,0 +1,10 @@
+HEADERS += $$PWD/qsql_tds.h
+SOURCES += $$PWD/qsql_tds.cpp
+
+unix {
+    !contains(LIBS, .*sybdb.*):LIBS *= -lsybdb
+} else:win32-borland {
+    LIBS *= $(BCB)/lib/PSDK/NTWDBLIB.LIB
+} else {
+    LIBS *= -lNTWDBLIB
+}
-- 
cgit v0.12


From 484c05ef374ef1c1043836b074693838d6b30adb Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Wed, 7 Jul 2010 12:05:37 +0200
Subject: Simplify *= to += after contains() test

Merge-request: 715
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 src/sql/drivers/db2/qsql_db2.pri         | 4 ++--
 src/sql/drivers/ibase/qsql_ibase.pri     | 4 ++--
 src/sql/drivers/mysql/qsql_mysql.pri     | 6 +++---
 src/sql/drivers/oci/qsql_oci.pri         | 2 +-
 src/sql/drivers/odbc/qsql_odbc.pri       | 4 ++--
 src/sql/drivers/psql/qsql_psql.pri       | 4 ++--
 src/sql/drivers/sqlite2/qsql_sqlite2.pri | 2 +-
 src/sql/drivers/tds/qsql_tds.pri         | 2 +-
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/sql/drivers/db2/qsql_db2.pri b/src/sql/drivers/db2/qsql_db2.pri
index e53a8a0..16557f0 100644
--- a/src/sql/drivers/db2/qsql_db2.pri
+++ b/src/sql/drivers/db2/qsql_db2.pri
@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_db2.h
 SOURCES += $$PWD/qsql_db2.cpp
 
 unix {
-    !contains(LIBS, .*db2.*):LIBS *= -ldb2
+    !contains(LIBS, .*db2.*):LIBS += -ldb2
 } else:!win32-borland {
-    !contains(LIBS, .*db2.*):LIBS *= -ldb2cli
+    !contains(LIBS, .*db2.*):LIBS += -ldb2cli
 }
diff --git a/src/sql/drivers/ibase/qsql_ibase.pri b/src/sql/drivers/ibase/qsql_ibase.pri
index ebcd18a..33fbb0d 100644
--- a/src/sql/drivers/ibase/qsql_ibase.pri
+++ b/src/sql/drivers/ibase/qsql_ibase.pri
@@ -2,10 +2,10 @@ HEADERS += $$PWD/qsql_ibase.h
 SOURCES += $$PWD/qsql_ibase.cpp
 
 unix {
-    !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS *= -lgds
+    !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
 } else {
     !contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
         win32-borland:LIBS += gds32.lib
-        else:LIBS *= -lgds32_ms
+        else:LIBS += -lgds32_ms
     }
 }
diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
index 801b891..1b9c3dd 100644
--- a/src/sql/drivers/mysql/qsql_mysql.pri
+++ b/src/sql/drivers/mysql/qsql_mysql.pri
@@ -4,13 +4,13 @@ SOURCES += $$PWD/qsql_mysql.cpp
 unix {
     isEmpty(QT_LFLAGS_MYSQL) {
         !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
-            use_libmysqlclient_r:LIBS *= -lmysqlclient_r
-            else:LIBS *= -lmysqlclient
+            use_libmysqlclient_r:LIBS += -lmysqlclient_r
+            else:LIBS += -lmysqlclient
         }
     } else {
         LIBS *= $$QT_LFLAGS_MYSQL
         QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
     }
 } else {
-    !contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS *= -llibmysql
+    !contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS += -llibmysql
 }
diff --git a/src/sql/drivers/oci/qsql_oci.pri b/src/sql/drivers/oci/qsql_oci.pri
index 6859156..60ccc4c 100644
--- a/src/sql/drivers/oci/qsql_oci.pri
+++ b/src/sql/drivers/oci/qsql_oci.pri
@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_oci.h
 SOURCES += $$PWD/qsql_oci.cpp
 
 unix {
-    !contains(LIBS, .*clnts.*):LIBS *= -lclntsh
+    !contains(LIBS, .*clnts.*):LIBS += -lclntsh
 } else {
     LIBS *= -loci
 }
diff --git a/src/sql/drivers/odbc/qsql_odbc.pri b/src/sql/drivers/odbc/qsql_odbc.pri
index c4c92be..8394012 100644
--- a/src/sql/drivers/odbc/qsql_odbc.pri
+++ b/src/sql/drivers/odbc/qsql_odbc.pri
@@ -2,10 +2,10 @@ HEADERS += $$PWD/qsql_odbc.h
 SOURCES += $$PWD/qsql_odbc.cpp
 
 mac {
-    !contains(LIBS, .*odbc.*):LIBS *= -liodbc
+    !contains(LIBS, .*odbc.*):LIBS += -liodbc
 } else:unix {
     DEFINES += UNICODE
-    !contains(LIBS, .*odbc.*):LIBS *= $$QT_LFLAGS_ODBC
+    !contains(LIBS, .*odbc.*):LIBS += $$QT_LFLAGS_ODBC
 } else:win32-borland {
     LIBS *= $(BCB)/lib/PSDK/odbc32.lib
 } else {
diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri
index c282d57..97db4be 100644
--- a/src/sql/drivers/psql/qsql_psql.pri
+++ b/src/sql/drivers/psql/qsql_psql.pri
@@ -7,7 +7,7 @@ unix|win32-g++* {
         LIBS *= $$QT_LFLAGS_PSQL
         QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
     }
-    !contains(LIBS, .*pq.*):LIBS *= -lpq
+    !contains(LIBS, .*pq.*):LIBS += -lpq
 } else {
-    !contains(LIBS, .*pq.*):LIBS *= -llibpq -lws2_32 -ladvapi32
+    !contains(LIBS, .*pq.*):LIBS += -llibpq -lws2_32 -ladvapi32
 }
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.pri b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
index 9f0e807..76fe255 100644
--- a/src/sql/drivers/sqlite2/qsql_sqlite2.pri
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
@@ -1,4 +1,4 @@
 HEADERS += $PWD/qsql_sqlite2.h
 SOURCES += $PWD/qsql_sqlite2.cpp
 
-!contains(LIBS, .*sqlite.*):LIBS *= -lsqlite
+!contains(LIBS, .*sqlite.*):LIBS += -lsqlite
diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri
index e2662ca..c552ead 100644
--- a/src/sql/drivers/tds/qsql_tds.pri
+++ b/src/sql/drivers/tds/qsql_tds.pri
@@ -2,7 +2,7 @@ HEADERS += $$PWD/qsql_tds.h
 SOURCES += $$PWD/qsql_tds.cpp
 
 unix {
-    !contains(LIBS, .*sybdb.*):LIBS *= -lsybdb
+    !contains(LIBS, .*sybdb.*):LIBS += -lsybdb
 } else:win32-borland {
     LIBS *= $(BCB)/lib/PSDK/NTWDBLIB.LIB
 } else {
-- 
cgit v0.12


From 0c71b098965ce4779a7da785249497c15b9d1d14 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Tue, 8 Jun 2010 11:30:05 +0100
Subject: Prevent crash when video is played without a VideoWidget

The Phonon API allows video to be played via a Phonon::MediaObject,
even if no Phonon::VideoWidget has been connected to it.  This
patch prevents the Phonon MMF backend crashing in this scenario
due to dereferencing a null pointer.

Reviewed-by: Thierry Bastian
---
 src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 10 ++++++++--
 src/3rdparty/phonon/mmf/videoplayer_dsa.cpp     |  7 ++++++-
 src/3rdparty/phonon/mmf/videoplayer_surface.cpp |  5 ++++-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
index 2e0ab1c..ecfce9e 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
@@ -211,7 +211,8 @@ void MMF::AbstractVideoPlayer::aspectRatioChanged()
     TRACE_CONTEXT(AbstractVideoPlayer::aspectRatioChanged, EVideoInternal);
     TRACE_ENTRY("state %d aspectRatio %d", state());
 
-    updateScaleFactors(m_videoOutput->videoWindowSize());
+    if (m_videoOutput)
+        updateScaleFactors(m_videoOutput->videoWindowSize());
 
     TRACE_EXIT_0();
 }
@@ -221,7 +222,8 @@ void MMF::AbstractVideoPlayer::scaleModeChanged()
     TRACE_CONTEXT(AbstractVideoPlayer::scaleModeChanged, EVideoInternal);
     TRACE_ENTRY("state %d", state());
 
-    updateScaleFactors(m_videoOutput->videoWindowSize());
+    if (m_videoOutput)
+        updateScaleFactors(m_videoOutput->videoWindowSize());
 
     TRACE_EXIT_0();
 }
@@ -357,6 +359,8 @@ void MMF::AbstractVideoPlayer::videoOutputChanged()
 
 void MMF::AbstractVideoPlayer::initVideoOutput()
 {
+    Q_ASSERT(m_videoOutput);
+
     bool connected = connect(
         m_videoOutput, SIGNAL(videoWindowChanged()),
         this, SLOT(videoWindowChanged())
@@ -400,6 +404,8 @@ QSize scaleToAspect(const QSize &srcRect, int aspectWidth, int aspectHeight)
 
 void MMF::AbstractVideoPlayer::updateScaleFactors(const QSize &windowSize, bool apply)
 {
+    Q_ASSERT(m_videoOutput);
+
     if (m_videoFrameSize.isValid()) {
         QRect videoRect;
 
diff --git a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
index 1925471..f0255b1 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
@@ -61,6 +61,8 @@ DsaVideoPlayer::~DsaVideoPlayer()
 
 void MMF::DsaVideoPlayer::videoWindowScreenRectChanged()
 {
+    Q_ASSERT(m_videoOutput);
+
     QRect windowRect = static_cast<DsaVideoOutput *>(m_videoOutput)->videoWindowScreenRect();
 
     // Clip to physical window size
@@ -130,6 +132,8 @@ void MMF::DsaVideoPlayer::createPlayer()
 
 void MMF::DsaVideoPlayer::initVideoOutput()
 {
+    Q_ASSERT(m_videoOutput);
+
     bool connected = connect(
         m_videoOutput, SIGNAL(videoWindowScreenRectChanged()),
         this, SLOT(videoWindowScreenRectChanged())
@@ -156,7 +160,8 @@ void MMF::DsaVideoPlayer::initVideoOutput()
 
 void MMF::DsaVideoPlayer::prepareCompleted()
 {
-    videoWindowScreenRectChanged();
+    if (m_videoOutput)
+        videoWindowScreenRectChanged();
 }
 
 void MMF::DsaVideoPlayer::handleVideoWindowChanged()
diff --git a/src/3rdparty/phonon/mmf/videoplayer_surface.cpp b/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
index fda7342..5d8db26 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
@@ -59,7 +59,8 @@ SurfaceVideoPlayer::~SurfaceVideoPlayer()
 
 void MMF::SurfaceVideoPlayer::videoWindowSizeChanged()
 {
-    updateScaleFactors(m_videoOutput->videoWindowSize());
+    if (m_videoOutput)
+        updateScaleFactors(m_videoOutput->videoWindowSize());
 }
 
 
@@ -80,6 +81,8 @@ void MMF::SurfaceVideoPlayer::createPlayer()
 
 void MMF::SurfaceVideoPlayer::initVideoOutput()
 {
+    Q_ASSERT(m_videoOutput);
+
     bool connected = connect(
         m_videoOutput, SIGNAL(videoWindowSizeChanged()),
         this, SLOT(videoWindowSizeChanged())
-- 
cgit v0.12


From 80af9a7b09b531a849b863695b244dd1df7dfb1d Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Tue, 8 Jun 2010 14:56:31 +0100
Subject: Enable bufferStatus signal during video clip loading on NGA platforms

CVideoPlayerUtility::RegisterForVideoLoadingNotification() was only
called in the DSA, not the NGA, variant of the Phonon MMF backend.

Task-number: QTBUG-11378
Reviewed-by: Thierry Bastian
---
 src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 2 ++
 src/3rdparty/phonon/mmf/videoplayer_dsa.cpp     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
index ecfce9e..c45ed98 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
@@ -66,6 +66,8 @@ void MMF::AbstractVideoPlayer::construct()
 
     createPlayer();
 
+    m_player->RegisterForVideoLoadingNotification(*this);
+
     TRACE_EXIT_0();
 }
 
diff --git a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
index f0255b1..deb9774 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer_dsa.cpp
@@ -126,8 +126,6 @@ void MMF::DsaVideoPlayer::createPlayer()
 
     // CVideoPlayerUtility::NewL starts DSA
     m_dsaActive = true;
-
-    m_player->RegisterForVideoLoadingNotification(*this);
 }
 
 void MMF::DsaVideoPlayer::initVideoOutput()
-- 
cgit v0.12


From 50fbb9d19b3f524361c146de8ff0fb2fe6abacc9 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Tue, 8 Jun 2010 14:37:21 +0100
Subject: Close media clip before creating new player object

Failure to Close() an existing MMF player utility object before
creating a new one - which happens in the MMF backend's implementation
of Phonon::MediaObject::setCurrentSource() - causes intialization of the
newly-created utility to fail later on.

Task-number: QTBUG-11377
Reviewed-by: Thierry Bastian
---
 src/3rdparty/phonon/mmf/abstractmediaplayer.h | 1 -
 src/3rdparty/phonon/mmf/abstractplayer.h      | 1 +
 src/3rdparty/phonon/mmf/dummyplayer.cpp       | 4 ++++
 src/3rdparty/phonon/mmf/dummyplayer.h         | 1 +
 src/3rdparty/phonon/mmf/mediaobject.cpp       | 3 +++
 5 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index 23a8233..7d28caf 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -71,7 +71,6 @@ protected:
     virtual int openFile(RFile& file) = 0;
     virtual int openUrl(const QString& url) = 0;
     virtual int bufferStatus() const = 0;
-    virtual void close() = 0;
 
     void updateMetaData();
     virtual int numberOfMetaDataEntries() const = 0;
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index ab892f5..30d5243 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -55,6 +55,7 @@ public:
     AbstractPlayer(const AbstractPlayer *player);
 
     virtual void open(const Phonon::MediaSource&, RFile&) = 0;
+    virtual void close() = 0;
 
     // MediaObjectInterface (implemented)
     qint32 tickInterval() const;
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp
index 6970088..d39ef76 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.cpp
+++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp
@@ -97,6 +97,10 @@ void MMF::DummyPlayer::open(const Phonon::MediaSource &, RFile &)
 
 }
 
+void MMF::DummyPlayer::close()
+{
+
+}
 
 //-----------------------------------------------------------------------------
 // AbstractPlayer
diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h
index 6841b5d..9d45696 100644
--- a/src/3rdparty/phonon/mmf/dummyplayer.h
+++ b/src/3rdparty/phonon/mmf/dummyplayer.h
@@ -58,6 +58,7 @@ public:
 
     // AbstractPlayer
     virtual void open(const Phonon::MediaSource&, RFile&);
+    virtual void close();
     virtual void doSetTickInterval(qint32 interval);
 };
 }
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index e1b921b..d264377 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -281,6 +281,9 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
         break;
     }
 
+    if (oldPlayer)
+        oldPlayer->close();
+
     AbstractPlayer* newPlayer = 0;
 
     // Construct newPlayer using oldPlayer (if not 0) in order to copy
-- 
cgit v0.12


From 896de79554060aadf4963d8285ef3f5d8740428b Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Wed, 7 Jul 2010 14:21:55 +0200
Subject: qdoc: Fixed a few links to QtObject (QML:QtObject)

---
 doc/src/declarative/elements.qdoc          |  2 +-
 src/declarative/qml/qdeclarativeengine.cpp |  6 +++---
 tools/qdoc3/cppcodeparser.cpp              | 15 ++-------------
 tools/qdoc3/htmlgenerator.cpp              |  5 ++++-
 tools/qdoc3/tree.cpp                       |  6 ++++--
 5 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index 48eb09f..349a8ed 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -114,7 +114,7 @@ The following table lists the QML elements provided by the \l {QtDeclarative}{Qt
 \row \o \l {Connections} \o Explicitly connects signals and signal handlers
 \row \o \l {Component} \o Encapsulate QML items as a component
 \row \o \l {Timer} \o Provides timed triggers 
-\row \o \l {QtObject} \o Basic element containing only the objectName property
+\row \o \l {QML:QtObject} {QtObject} \o Basic element containing only the objectName property
 \row \o \l {WorkerScript} \o Enables the use of threads in QML
 \row \o \l {Loader} \o Controls the loading of items or components
 \row \o \l {Repeater} \o Uses a model to create multiples of components
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 8b15ae9..036c854 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -125,7 +125,7 @@ QT_BEGIN_NAMESPACE
   QObject. See the QObject documentation for further details.
 */
 /*!
-  \qmlproperty string QtObject::objectName
+  \qmlproperty string QML:QtObject::objectName
   This property allows you to give a name to this specific object instance.
 
   See \l{scripting.html#accessing-child-qobjects}{Accessing Child QObjects}
@@ -236,8 +236,8 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
 }
 
 /*!
-\qmlmethod url Qt::resolvedUrl(url)
-Returns \c url resolved relative to the URL of the caller.
+  \qmlmethod url Qt::resolvedUrl(url)
+  Returns \c url resolved relative to the URL of the caller.
 */
 QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
 {
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index e4870e3..d5108fd 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -728,23 +728,12 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
             if (n)
                 classNode = static_cast<const ClassNode*>(n);
         }
-        if (names[0].startsWith("Q"))
+        if (names[0].startsWith("Qt"))
             return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode);
         else
             return new QmlClassNode(tre->root(), names[0], classNode);
     }
     else if (command == COMMAND_QMLBASICTYPE) {
-#if 0
-        QStringList parts = arg.split(" ");
-        qDebug() << command << parts;
-        if (parts.size() > 1) {
-            FakeNode* pageNode = static_cast<FakeNode*>(tre->root()->findNode(parts[1], Node::Fake));
-            if (pageNode) {
-                qDebug() << "FOUND";
-                return new QmlBasicTypeNode(pageNode, parts[0]);
-            }
-        }
-#endif
         return new QmlBasicTypeNode(tre->root(), arg);
     }
     else if ((command == COMMAND_QMLSIGNAL) ||
@@ -755,7 +744,7 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
         QString type;
         QmlClassNode* qmlClass = 0;
         if (splitQmlMethodArg(doc,arg,type,element)) {
-            if (element.startsWith(QLatin1String("Q")))
+            if (element.startsWith(QLatin1String("Qt")))
                 element = QLatin1String("QML:") + element;
             Node* n = tre->findNode(QStringList(element),Node::Fake);
             if (n && n->subType() == Node::QmlClass) {
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index b7ab4d6..441cfc6 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4197,7 +4197,10 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
         text << "[";
         text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
         text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
-        text << Atom(Atom::String, qcn->name());
+        QString name = qcn->name();
+        if (name.startsWith(QLatin1String("QML:")))
+            name = name.mid(4); // remove the "QML:" prefix
+        text << Atom(Atom::String, name);
         text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
         text << " instantiates the C++ class ";
         text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 022e1c2..d22a09a 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -173,9 +173,11 @@ const Node* Tree::findNode(const QStringList &path,
         }
         if (node && i == path.size()
                 && (!(findFlags & NonFunction) || node->type() != Node::Function
-                    || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams))
-            if ((node != self) && (node->subType() != Node::QmlPropertyGroup))
+                    || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams)) {
+            if ((node != self) && (node->subType() != Node::QmlPropertyGroup)) {
                 return node;
+            }
+        }
         current = current->parent();
     } while (current);
 
-- 
cgit v0.12


From 31d4037ad8e07fc4302a846271b28965f3e11069 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Tue, 8 Jun 2010 16:06:37 +0100
Subject: Fixed crash which occurs when switching between video clips

When Phonon::MediaObject::setCurrentSource() is called when the
MediaObject is connected to a Phonon::VideoWidget, the
MMF::AbstractVideoOutput pointer is propagated inside the backend
from the first MMF::AbstractVideoPlayer to the second.

If the VideoWidget is subsquently re-sized, the code path enters
the ScaleFactors branch of the
MMF::SurfaceVideoPlayer::handleParametersChanged function.  At this
point, m_displayWindow is still set to the inital null value, and the
assertion therefore fails.

This change ensures that m_displayWindow is updated before attempting
to apply the scale factor change.

Task-number: QTBUG-11377
Reviewed-by: Thierry Bastian
---
 src/3rdparty/phonon/mmf/videoplayer_surface.cpp | 42 +++++++++++++++++--------
 src/3rdparty/phonon/mmf/videoplayer_surface.h   |  3 ++
 2 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/src/3rdparty/phonon/mmf/videoplayer_surface.cpp b/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
index 5d8db26..343370c 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
@@ -118,23 +118,14 @@ void MMF::SurfaceVideoPlayer::handleParametersChanged(VideoParameters parameters
     if (player) {
         int err = KErrNone;
         if (parameters & WindowHandle) {
-            if (m_displayWindow)
-                player->RemoveDisplayWindow(*m_displayWindow);
-
-            RWindow *window = static_cast<RWindow *>(m_window);
-            if (window) {
-                window->SetBackgroundColor(TRgb(0, 0, 0, 255));
-                TRAP(err, player->AddDisplayWindowL(m_wsSession, m_screenDevice, *window, rect, rect));
-                if (KErrNone != err) {
-                    setError(tr("Video display error"), err);
-                    window = 0;
-                }
-            }
-            m_displayWindow = window;
+            removeDisplayWindow();
+            addDisplayWindow(rect);
         }
 
         if (KErrNone == err) {
             if (parameters & ScaleFactors) {
+                if (!m_displayWindow)
+                    addDisplayWindow(rect);
                 Q_ASSERT(m_displayWindow);
                 TRAP(err, player->SetVideoExtentL(*m_displayWindow, rect));
                 if (KErrNone == err)
@@ -148,5 +139,30 @@ void MMF::SurfaceVideoPlayer::handleParametersChanged(VideoParameters parameters
     }
 }
 
+void MMF::SurfaceVideoPlayer::addDisplayWindow(const TRect &rect)
+{
+    Q_ASSERT(!m_displayWindow);
+    RWindow *window = static_cast<RWindow *>(m_window);
+    if (window) {
+        window->SetBackgroundColor(TRgb(0, 0, 0, 255));
+        CVideoPlayerUtility2 *player = static_cast<CVideoPlayerUtility2 *>(m_player.data());
+        Q_ASSERT(player);
+        TRAPD(err, player->AddDisplayWindowL(m_wsSession, m_screenDevice, *window, rect, rect));
+        if (KErrNone == err)
+            m_displayWindow = window;
+        else
+            setError(tr("Video display error"), err);
+    }
+}
+
+void MMF::SurfaceVideoPlayer::removeDisplayWindow()
+{
+    CVideoPlayerUtility2 *player = static_cast<CVideoPlayerUtility2 *>(m_player.data());
+    if (player && m_displayWindow) {
+        player->RemoveDisplayWindow(*m_displayWindow);
+        m_displayWindow = 0;
+    }
+}
+
 QT_END_NAMESPACE
 
diff --git a/src/3rdparty/phonon/mmf/videoplayer_surface.h b/src/3rdparty/phonon/mmf/videoplayer_surface.h
index c05da9c..8572fdc 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_surface.h
+++ b/src/3rdparty/phonon/mmf/videoplayer_surface.h
@@ -62,6 +62,9 @@ private:
     void handleVideoWindowChanged();
     void handleParametersChanged(VideoParameters parameters);
 
+    void addDisplayWindow(const TRect &rect);
+    void removeDisplayWindow();
+
 private:
     // Window handle which has been passed to the MMF via
     // CVideoPlayerUtility2::SetDisplayWindowL
-- 
cgit v0.12


From 64f711e91a30c7689314f4bceca78745236f8bee Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Thu, 17 Jun 2010 09:42:52 +0100
Subject: MMF Phonon backend: call winId() from VideoWidget constructor

This is to be consistent with the backends for other platforms, which
also call QWidget::winId() on the VideoWidget (or one of its children)
during construction.

Reviewed-by: Thierry Bastian
---
 src/3rdparty/phonon/mmf/abstractvideooutput.cpp | 3 ++-
 src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/3rdparty/phonon/mmf/abstractvideooutput.cpp b/src/3rdparty/phonon/mmf/abstractvideooutput.cpp
index a8aabfd..2d221ed 100644
--- a/src/3rdparty/phonon/mmf/abstractvideooutput.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideooutput.cpp
@@ -60,7 +60,8 @@ MMF::AbstractVideoOutput::AbstractVideoOutput(QWidget *parent)
     ,   m_aspectRatio(DefaultAspectRatio)
     ,   m_scaleMode(DefaultScaleMode)
 {
-
+    // Ensure that this widget has a native window handle
+    winId();
 }
 
 MMF::AbstractVideoOutput::~AbstractVideoOutput()
diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
index c45ed98..9ea4d18 100644
--- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp
@@ -384,9 +384,6 @@ void MMF::AbstractVideoPlayer::initVideoOutput()
     // Suppress warnings in release builds
     Q_UNUSED(connected);
 
-    // Do these after all connections are complete, to ensure
-    // that any signals generated get to their destinations.
-    m_videoOutput->winId();
     m_videoOutput->setVideoSize(m_videoFrameSize);
 }
 
-- 
cgit v0.12


From 6f6ec0ee680c7d4b5cf70116e756cca90668fd90 Mon Sep 17 00:00:00 2001
From: Adrian Constantin <adrian.constantin@nokia.com>
Date: Wed, 7 Jul 2010 16:13:07 +0300
Subject: Set QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH to default value

Remove workaround introduced in Qt 4.6 as not needed any more

Reviewed-by: Adrian Constantin
---
 mkspecs/linux-g++-maemo/qmake.conf | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf
index cced090..a977e7a 100644
--- a/mkspecs/linux-g++-maemo/qmake.conf
+++ b/mkspecs/linux-g++-maemo/qmake.conf
@@ -27,7 +27,4 @@ QMAKE_CXXFLAGS_RELEASE  += -g -fno-omit-frame-pointer -fno-optimize-sibling-call
 # Work round PowerVR SGX 1.3 driver bug with glScissor & FBOs:
 DEFINES += QT_GL_NO_SCISSOR_TEST
 
-# Work round SGX 1.4 driver bug (text corrupted), modify glyph cache width:
-DEFINES += QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024
-
 load(qt_config)
-- 
cgit v0.12


From 495dfda1bea31017d08a435dcb61b43b4df81d24 Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jbache@trolltech.com>
Date: Wed, 7 Jul 2010 15:38:22 +0200
Subject: Phonon MediaSource fails to load when passed as a resource file

Files fail to load when passing resoure path to mediasource.
The original regression seems to be caused by a behavior change
as reported here: http://bugreports.qt.nokia.com/browse/QTBUG-12015

Note a merge request is also pending on Gitorious
http://gitorious.org/phonon/phonon/merge_requests/17

Task-number: QTBUG-9323
Reviewed-by: thierry
---
 src/3rdparty/phonon/phonon/mediasource.cpp | 2 +-
 tests/auto/mediaobject/tst_mediaobject.cpp | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp
index be22dc3..11d2428 100644
--- a/src/3rdparty/phonon/phonon/mediasource.cpp
+++ b/src/3rdparty/phonon/phonon/mediasource.cpp
@@ -50,7 +50,7 @@ MediaSource::MediaSource(const QString &filename)
     const QFileInfo fileInfo(filename);
     if (fileInfo.exists()) {
         bool localFs = QAbstractFileEngine::LocalDiskFlag & QFSFileEngine(filename).fileFlags(QAbstractFileEngine::LocalDiskFlag);
-        if (localFs) {
+        if (localFs && !filename.startsWith(QLatin1String(":/")) && !filename.startsWith(QLatin1String("qrc://"))) {
             d->url = QUrl::fromLocalFile(fileInfo.absoluteFilePath());
         } else {
 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp
index 994057b..2f98521 100644
--- a/tests/auto/mediaobject/tst_mediaobject.cpp
+++ b/tests/auto/mediaobject/tst_mediaobject.cpp
@@ -204,9 +204,8 @@ void tst_MediaObject::testPlayFromResource()
 #ifdef Q_OS_SYMBIAN
     QSKIP("Not implemented yet.", SkipAll);
 #else
-    QFile file(MEDIA_FILEPATH);
     MediaObject media;
-    media.setCurrentSource(&file);
+    media.setCurrentSource(QString(MEDIA_FILEPATH));
     QVERIFY(media.state() != Phonon::ErrorState);
     if (media.state() != Phonon::StoppedState)
         QTest::waitForSignal(&media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), 10000);
-- 
cgit v0.12


From f91a2789c385af25310ac5f0463d5bb3311ec089 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>
Date: Wed, 7 Jul 2010 16:06:11 +0200
Subject: Fix crash when removing columns in merged row

Change 4b709b41f5a7ae8dc6e537b644158f5201ce0a98 tried to make sure that
rows with merged cells would not be completely removed, as this would
cause a crash. However, when removing just a few columns from a merged
cell, the span of the cell should be reduced by the number of columns
removed. The "touched" guard would cause the span to be decreased a
maximum of one time, regardless of how many columns were removed,
leaving the table in an invalid state, as the column count would be
smaller than the span of the cell. This would assert later on.
To avoid this, we only guard against removal, not against decreasing
the span.

Task-number: QTBUG-11646
Reviewed-by: Thomas Zander
---
 src/gui/text/qtexttable.cpp              |  7 ++++---
 tests/auto/qtexttable/tst_qtexttable.cpp | 14 ++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 5100176..ada18c8 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -915,12 +915,13 @@ void QTextTable::removeColumns(int pos, int num)
     for (int r = 0; r < d->nRows; ++r) {
         for (int c = pos; c < pos + num; ++c) {
             int cell = d->grid[r*d->nCols + c];
-            if (touchedCells.contains(cell))
-                continue;
-            touchedCells << cell;
             QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
             QTextCharFormat fmt = collection->charFormat(it->format);
             int span = fmt.tableCellColumnSpan();
+            if (touchedCells.contains(cell) && span <= 1)
+                continue;
+            touchedCells << cell;
+
             if (span > 1) {
                 fmt.setTableCellColumnSpan(span - 1);
                 p->setCharFormat(it.position(), 1, fmt);
diff --git a/tests/auto/qtexttable/tst_qtexttable.cpp b/tests/auto/qtexttable/tst_qtexttable.cpp
index 2e6007e..c6ead5a 100644
--- a/tests/auto/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/qtexttable/tst_qtexttable.cpp
@@ -93,6 +93,7 @@ private slots:
     void removeColumns3();
     void removeColumns4();
     void removeColumns5();
+	void removeColumnsInTableWithMergedRows();
 
 private:
     QTextTable *create2x2Table();
@@ -931,5 +932,18 @@ void tst_QTextTable::removeColumns5()
     QCOMPARE(table->cellAt(3, 2).firstPosition(), 11);
 }
 
+void tst_QTextTable::removeColumnsInTableWithMergedRows()
+{
+    QTextTable *table = cursor.insertTable(3, 4);
+    table->mergeCells(0, 0, 1, 4);
+    QCOMPARE(table->rows(), 3);
+    QCOMPARE(table->columns(), 4);
+
+    table->removeColumns(0, table->columns() - 1);
+
+    QCOMPARE(table->rows(), 3);
+    QCOMPARE(table->columns(), 1);
+}
+
 QTEST_MAIN(tst_QTextTable)
 #include "tst_qtexttable.moc"
-- 
cgit v0.12


From 4337d695410301b97b753231c3b8fc9560a9d4c7 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 5 Jul 2010 11:52:11 +0200
Subject: immediately set function context when entering a namespace

otherwise, tr() calls without absolute qualification will not be
properly qualified inside the first function if it has no qualification,
either.

Task-number: QTBUG-11742 (not really)
---
 .../lupdate/testdata/good/parsecpp/main.cpp        | 27 ++++++++++++++++++++++
 .../testdata/good/parsecpp/project.ts.result       | 13 +++++++++++
 tools/linguist/lupdate/cpp.cpp                     |  7 +++++-
 3 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
index 0765bfc..f58f932 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp
@@ -275,3 +275,30 @@ void bogosity()
     // no spaces here. test collateral damage from ignoring equal sign
     Class::member=QObject::tr("just QObject");
 }
+
+
+
+namespace Internal {
+
+class Message : public QObject
+{
+    Q_OBJECT
+public:
+    Message(QObject *parent = 0);
+};
+
+} // The temporary closing of the namespace triggers the problem
+
+namespace Internal {
+
+static inline QString message1()
+{
+    return Message::tr("message1"); // Had no namespace
+}
+
+static inline QString message2()
+{
+    return Message::tr("message2"); // Already had namespace
+}
+
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index 208191d..7ac318e 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -120,6 +120,19 @@ backslashed \ stuff.</source>
     </message>
 </context>
 <context>
+    <name>Internal::Message</name>
+    <message>
+        <location filename="main.cpp" line="296"/>
+        <source>message1</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="main.cpp" line="301"/>
+        <source>message2</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>Kåntekst</name>
     <message utf8="true">
         <location filename="finddialog.cpp" line="180"/>
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 609bd3d..bc9bb26 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1686,9 +1686,14 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
                 HashString ns = HashString(text);
                 yyTok = getToken();
                 if (yyTok == Tok_LeftBrace) {
+                    yyTok = getToken();
                     namespaceDepths.push(namespaces.count());
                     enterNamespace(&namespaces, ns);
-                    yyTok = getToken();
+
+                    functionContext = namespaces;
+                    functionContextUnresolved.clear();
+                    prospectiveContext.clear();
+                    pendingContext.clear();
                 } else if (yyTok == Tok_Equals) {
                     // e.g. namespace Is = OuterSpace::InnerSpace;
                     QList<HashString> fullName;
-- 
cgit v0.12


From f2187e31de13a6ab8631a9067487dab555f7c2e7 Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Tue, 6 Jul 2010 11:06:40 +0200
Subject: SSL backend: load libraries for certificates only once

Reviewed-by: Olivier Goffart
---
 src/network/ssl/qsslsocket.cpp         |  6 ++---
 src/network/ssl/qsslsocket_openssl.cpp | 42 ++++++++++++++++++----------------
 src/network/ssl/qsslsocket_p.h         | 11 ++++-----
 3 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index f85fa84..809e8aa 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1849,7 +1849,7 @@ QList<QSslCipher> QSslSocketPrivate::defaultCiphers()
 */
 QList<QSslCipher> QSslSocketPrivate::supportedCiphers()
 {
-    QSslSocketPrivate::ensureInitialized();
+    QSslSocketPrivate::ensureCertsAndCiphersLoaded();
     QMutexLocker locker(&globalData()->mutex);
     return globalData()->supportedCiphers;
 }
@@ -1879,7 +1879,7 @@ void QSslSocketPrivate::setDefaultSupportedCiphers(const QList<QSslCipher> &ciph
 */
 QList<QSslCertificate> QSslSocketPrivate::defaultCaCertificates()
 {
-    QSslSocketPrivate::ensureInitialized();
+    QSslSocketPrivate::ensureCertsAndCiphersLoaded();
     QMutexLocker locker(&globalData()->mutex);
     return globalData()->config->caCertificates;
 }
@@ -1962,7 +1962,7 @@ void QSslConfigurationPrivate::setDefaultConfiguration(const QSslConfiguration &
 */
 void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPrivate *ptr)
 {
-    QSslSocketPrivate::ensureInitialized();
+    QSslSocketPrivate::ensureCertsAndCiphersLoaded();
     QMutexLocker locker(&globalData()->mutex);
     const QSslConfigurationPrivate *global = globalData()->config.constData();
 
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index d7088ee..b602b29 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -74,8 +74,9 @@
 
 QT_BEGIN_NAMESPACE
 
-bool QSslSocketPrivate::s_libraryLoaded = false;
-bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
+bool QSslSocketPrivate::s_initialized = false;
+QBasicAtomicInt QSslSocketPrivate::s_CertsAndCiphersLoaded;
+Q_GLOBAL_STATIC(QMutex, s_CertsAndCiphersLoadedMutex);
 
 // Useful defines
 #define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL))
@@ -170,7 +171,7 @@ QSslSocketBackendPrivate::QSslSocketBackendPrivate()
       session(0)
 {
     // Calls SSL_library_init().
-    ensureInitialized();
+    ensureCertsAndCiphersLoaded();
 }
 
 QSslSocketBackendPrivate::~QSslSocketBackendPrivate()
@@ -421,18 +422,18 @@ void QSslSocketPrivate::deinitialize()
 
 bool QSslSocketPrivate::supportsSsl()
 {
-    return ensureLibraryLoaded();
+    return ensureInitialized();
 }
 
-bool QSslSocketPrivate::ensureLibraryLoaded()
+bool QSslSocketPrivate::ensureInitialized()
 {
     if (!q_resolveOpenSslSymbols())
         return false;
 
     // Check if the library itself needs to be initialized.
     QMutexLocker locker(openssl_locks()->initLock());
-    if (!s_libraryLoaded) {
-        s_libraryLoaded = true;
+    if (!s_initialized) {
+        s_initialized = true;
 
         // Initialize OpenSSL.
         q_CRYPTO_set_id_callback(id_function);
@@ -473,16 +474,6 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
     return true;
 }
 
-void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
-{
-    if (s_loadedCiphersAndCerts)
-        return;
-    s_loadedCiphersAndCerts = true;
-
-    resetDefaultCiphers();
-    setDefaultCaCertificates(systemCaCertificates());
-}
-
 /*!
     \internal
 
@@ -490,13 +481,18 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
     been initialized.
 */
 
-void QSslSocketPrivate::ensureInitialized()
+void QSslSocketPrivate::ensureCertsAndCiphersLoaded()
 {
-    if (!supportsSsl())
+    // use double-checked locking to speed up this function
+    if (s_CertsAndCiphersLoaded)
         return;
 
-    ensureCiphersAndCertsLoaded();
+    QMutexLocker locker(s_CertsAndCiphersLoadedMutex());
+    if (s_CertsAndCiphersLoaded)
+        return;
 
+    if (!supportsSsl())
+        return;
     //load symbols needed to receive certificates from system store
 #if defined(Q_OS_MAC)
     QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security");
@@ -532,6 +528,12 @@ void QSslSocketPrivate::ensureInitialized()
         qWarning("could not load crypt32 library"); // should never happen
     }
 #endif
+    resetDefaultCiphers();
+    setDefaultCaCertificates(systemCaCertificates());
+    // we need to make sure that s_CertsAndCiphersLoaded is executed after the library loading above
+    // (the compiler/processor might reorder instructions otherwise)
+    if (!s_CertsAndCiphersLoaded.testAndSetRelease(0, 1))
+        Q_ASSERT_X(false, "certificate store", "certificate store has already been initialized!");
 }
 
 /*!
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 72b3ef7..b474175 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -63,6 +63,7 @@
 #include <QtCore/qstringlist.h>
 
 #include <private/qringbuffer_p.h>
+#include <QtCore/QMutex>
 
 QT_BEGIN_NAMESPACE
 
@@ -113,7 +114,8 @@ public:
     QString verificationPeerName;
 
     static bool supportsSsl();
-    static void ensureInitialized();
+    static bool ensureInitialized();
+    static void ensureCertsAndCiphersLoaded();
     static void deinitialize();
     static QList<QSslCipher> defaultCiphers();
     static QList<QSslCipher> supportedCiphers();
@@ -161,11 +163,8 @@ public:
     virtual QSslCipher sessionCipher() const = 0;
 
 private:
-    static bool ensureLibraryLoaded();
-    static void ensureCiphersAndCertsLoaded();
-
-    static bool s_libraryLoaded;
-    static bool s_loadedCiphersAndCerts;
+    static bool s_initialized;
+    static QBasicAtomicInt s_CertsAndCiphersLoaded;
 };
 
 QT_END_NAMESPACE
-- 
cgit v0.12


From 4c100e6f1ddecff46e5b1e46a481b62c275bc30d Mon Sep 17 00:00:00 2001
From: Roland Wolf <ext-roland.wolf@nokia.com>
Date: Wed, 26 May 2010 16:53:41 +0200
Subject: dummy commit to check permissions

---
 src/testfile.txt | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 src/testfile.txt

diff --git a/src/testfile.txt b/src/testfile.txt
new file mode 100644
index 0000000..e69de29
-- 
cgit v0.12


From 09f3e7adf39ef93a9181486680fb6575b4d56de5 Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Wed, 26 May 2010 17:30:14 +0200
Subject: Michaels first commit

---
 doc/src/frameworks-technologies/modelview.qdoc | 840 +++++++++++++++++++++++++
 doc/src/images/clock.png                       | Bin 0 -> 16514 bytes
 doc/src/images/columnview.png                  | Bin 0 -> 11717 bytes
 doc/src/images/combobox.png                    | Bin 0 -> 5022 bytes
 doc/src/images/dummy_tree.png                  | Bin 0 -> 20189 bytes
 doc/src/images/edit.png                        | Bin 0 -> 19636 bytes
 doc/src/images/example_model.png               | Bin 0 -> 16577 bytes
 doc/src/images/header.png                      | Bin 0 -> 30302 bytes
 doc/src/images/lineedit.png                    | Bin 0 -> 2613 bytes
 doc/src/images/list_table_tree.png             | Bin 0 -> 85530 bytes
 doc/src/images/listview.png                    | Bin 0 -> 9695 bytes
 doc/src/images/lotto.png                       | Bin 0 -> 17015 bytes
 doc/src/images/modelview.png                   | Bin 0 -> 2887 bytes
 doc/src/images/path.png                        | Bin 0 -> 31015 bytes
 doc/src/images/qcompleter.png                  | Bin 0 -> 17017 bytes
 doc/src/images/readonlytable.png               | Bin 0 -> 28971 bytes
 doc/src/images/readonlytable_role.png          | Bin 0 -> 27467 bytes
 doc/src/images/selection2.png                  | Bin 0 -> 23784 bytes
 doc/src/images/standardwidget.png              | Bin 0 -> 1466 bytes
 doc/src/images/tableview.png                   | Bin 0 -> 10102 bytes
 doc/src/images/tree.png                        | Bin 0 -> 27074 bytes
 doc/src/images/tree_2.png                      | Bin 0 -> 14084 bytes
 doc/src/images/tree_2_with_algorithm.png       | Bin 0 -> 16921 bytes
 doc/src/images/tree_city.png                   | Bin 0 -> 30398 bytes
 doc/src/images/treeview.png                    | Bin 0 -> 17173 bytes
 doc/src/images/widgetmapper.png                | Bin 0 -> 20145 bytes
 26 files changed, 840 insertions(+)
 create mode 100755 doc/src/frameworks-technologies/modelview.qdoc
 create mode 100755 doc/src/images/clock.png
 create mode 100755 doc/src/images/columnview.png
 create mode 100755 doc/src/images/combobox.png
 create mode 100755 doc/src/images/dummy_tree.png
 create mode 100755 doc/src/images/edit.png
 create mode 100755 doc/src/images/example_model.png
 create mode 100755 doc/src/images/header.png
 create mode 100755 doc/src/images/lineedit.png
 create mode 100755 doc/src/images/list_table_tree.png
 create mode 100755 doc/src/images/listview.png
 create mode 100755 doc/src/images/lotto.png
 create mode 100755 doc/src/images/modelview.png
 create mode 100755 doc/src/images/path.png
 create mode 100755 doc/src/images/qcompleter.png
 create mode 100755 doc/src/images/readonlytable.png
 create mode 100755 doc/src/images/readonlytable_role.png
 create mode 100755 doc/src/images/selection2.png
 create mode 100755 doc/src/images/standardwidget.png
 create mode 100755 doc/src/images/tableview.png
 create mode 100755 doc/src/images/tree.png
 create mode 100755 doc/src/images/tree_2.png
 create mode 100755 doc/src/images/tree_2_with_algorithm.png
 create mode 100755 doc/src/images/tree_city.png
 create mode 100755 doc/src/images/treeview.png
 create mode 100755 doc/src/images/widgetmapper.png

diff --git a/doc/src/frameworks-technologies/modelview.qdoc b/doc/src/frameworks-technologies/modelview.qdoc
new file mode 100755
index 0000000..7729cd2
--- /dev/null
+++ b/doc/src/frameworks-technologies/modelview.qdoc
@@ -0,0 +1,840 @@
+/*!
+
+    \contentspage{modelview.html}{Crash Course in Model/View Programming}
+    \page modelview.html
+
+\title Crash Course in Model/View Programming
+Contents:
+\tableofcontents
+
+\section1 1 Introduction
+Model/View is a technology used to separate data from views in widgets that handle data sets. Standard Widgets are not designed for separating data from views and this is why Qt 4 has two different types of widgets. Both types of widgets look the same, but they interact with data differently.
+    \table
+        \row
+            \o  Standard widgets use data that is part of the widget.
+            \o  \image standardwidget.png
+        \row
+            \o  View classes operate on external data (the model)
+            \o  \image modelview.png
+    \endtable
+\section2 1.1 Standard widgets
+Let's have a closer look at a standard table widget. A table widget is a 2D array of the data elements that the user can change. The table widget can be integrated into a program flow by reading and writing the data elements that the table widget provides. This method is very intuitive and useful in many applications.
+
+Displaying and editing a database table with a standard table widget can be problematic. Two copies of the data have to be coordinated: one outside the widget; one inside the widget. The developer needs to know where up-to-date data is so the both copies contain the most recent data. The tight coupling of presentation and data makes it harder to write unit tests.
+
+\section2 1.2 Model/View to the rescue
+Model/View stepped up to provide a solution that uses a more versatile architecture. Model/View eliminates the data consistency problems that may occur with standard widgets. Model/View also makes it easier to use more than one view of the same data because one model can be passed on to many views. The most important difference is that model/view widgets do not store data behind the table cells. In fact, they operate directly from your data. Since view classes do not know your data's structure, you need to provide a wrapper to make your data conform to the \l QAbstractItemModel interface. A view uses this interface to read from and write to your data and any class that implements \l QAbstractItemModel is a model. Once the view receives a pointer to a model, it will read and display its content and be its editor.
+
+\section2 1.3 Overview of  the model/view widgets
+Here is an overview of the model/view widgets and their corresponding standard widgets.
+    \table
+        \header
+            \o  Widget
+            \o  Standard Widget
+(a convenience class with data in the widget)
+            \o  Model/View View Class (for use with external data)
+        \row
+            \o  \image listview.png
+            \o  \l QListWidget
+            \o  \l QListView
+        \row
+            \o  \image tableview.png
+            \o  \l QTableWidget
+            \o  \l QTableView
+        \row
+            \o  \image treeview.png
+            \o  \l QTreeWidget
+            \o  \l QTreeView
+        \row
+            \o  \image columnview.png
+            \o   
+            \o  \l QColumnView shows a tree as a hierarchy of lists
+        \row
+            \o  \image combobox.png
+            \o {2, 1} \l QComboBox can work as both a view class and also as a traditional widget
+    \endtable
+\section2 1.4 Having adapters between forms and models can come in handy.
+We often prefer editing data stored in tables (e.g. in database tables) in forms rather than in tables. There is no direct model/view counterpart for separating data and views for widgets that operate on one value instead of a dataset, so we need an adapter in order to connect the form to the source of  data.
+
+\l QDataWidgetMapper is a great solution because it maps form widgets to a table row and it makes it very easy to build forms for database tables. \image widgetmapper.png
+
+Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter. \image qcompleter.png
+
+\section1 2 A Simple Model/View Application
+If you want to develop a model/view application, where should you start? We recommend starting with a simple example and extending it step-by-step. This makes understanding the architecture a lot easier. Trying to understand the model/view architecture in detail before invoking the IDE has proven to be less convenient for many developers. It is substantially easier to start with a simple model/view application that has demo data. Give it a try! Simply replace the data in the examples below with your own.
+
+Below are 7 very simple and independent applications that show different sides of model/view programming. The source code can be downloaded from  @todo___________paste link here_________________________
+
+\section2 2.1 A read only table
+We start with an application that uses a \l QTableView to show data. We will add editing capabilities later. 
+
+-------------------------------------------------------------main.cpp---------------------
+\code
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
+\endcode
+
+We have the usual main() function;
+-------------------------------------------------------------modelview.h---------------------
+\code
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTableView; //forward declaration
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTableView *tableView;
+public:
+    ModelView(QWidget *parent = 0);
+
+};
+
+#endif // MODELVIEW_H
+\endcode
+
+The application is a \l QMainWindow that holds a \l QTableView.  
+
+-------------------------------------------------------------modelview.cpp---------------------
+\code
+#include <QTableView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    tableView = new QTableView(this);
+    setCentralWidget(tableView);
+    tableView->setModel(new MyModel(this) );
+}
+
+\endcode
+
+Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView::}{tableView()} OR \l QTableView::tableView() OR \l QTableView::tableView .  \l {QTableView::}{tableView} will invoke the methods of the pointer it has received to find out two things: 
+    \list
+       \o   How many rows and columns should be displayed
+       \o   What content should be printed into each cell.
+    \endlist
+
+The model needs some code to respond to this. 
+
+We have a table data set, so let's start with QAbstractTableModel since it is easier to use.
+-------------------------------------------------------------mymodel.h---------------------
+\code
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+};
+
+#endif // MYMODEL_H
+\endcode
+
+QAbstractTableModel requires the implementation of three abstract methods.
+
+
+-------------------------------------------------------------mymodel.cpp---------------------
+\code
+HIER FEHLT mymodel.cpp !!!
+\endcode
+
+The number of rows and columns is set by \c MyModel::rowCount() and \c MyModel::columnCount(). 
+When the view has to know what the cell 's text is, it calls the \l{QAbstractItemModel::data()}{data()} method. Row and column information is specified with parameter \c index and the role is set to Qt::Display Role.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
+
+This small example demonstrates the passive nature of a model. The model does not know when it will be used or which data is needed. It simply provides data each time the view requests it. 
+
+What happens when the model 's data needs to be changed? How does the view know when data changes and needs to be read again? The model has to emit a signal that indicates what range of cells has changed.  This will be demonstrated in section 2.3.
+
+\section2 2.2 Extending the read only example with roles
+In addition to controlling what text the view displays, the model also controls the text's appearance. When we slightly change the model, we get the following result: \image readonlytable_role.png
+
+
+In fact, nothing except for the \l{QAbstractItemModel::data()}{data()} method needs to be changed to set fonts, background colour, alignment and a checkbox. Here is the \l{QAbstractItemModel::data()}{data()} method that produces the result shown above:
+
+\code
+HIER FEHLT WAS !!!
+\endcode
+
+Each formatting property will be requested from the model with a separate call to the \l{QAbstractItemModel::data()}{data()} method. The \c role parameter is used to let the model know which property is being requested:
+
+    \table
+        \header
+            \o  Role (enum Qt::ItemDataRole )
+            \o  Meaning
+            \o  Type 
+        \row
+            \o  Qt::DisplayRole
+            \o  text
+            \o  QString
+        \row
+            \o  Qt::FontRole
+            \o  font
+            \o  QFont
+        \row
+            \o  Qt::BackgroundRole
+            \o  brush for the background of the cell
+            \o  QBrush
+        \row
+            \o  Qt::TextAlignmentRole
+            \o  text alignment
+            \o  enum Qt::AlignmentFlag
+        \row
+	    \o {1, 3} Qt::CheckStateRole
+	    \o {1, 3} suppresses checkboxes with QVariant(), sets checkboxes with Qt::Checked or Qt::Unchecked
+	    \o {1, 3} enum Qt::ItemDataRole
+
+    \endtable
+
+Refer to Qt documentation to learn more about  enum Qt::ItemDataRole's capabilities.
+
+
+Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()}) is invoked and expensive lookup operations are cached.
+
+\section2 2.3 A clock inside a table cell
+\image clock.png
+
+We still have a read only table, but this time the content changes every second because we are showing the current time.
+\code
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    QVariant returnVal;
+    int row = index.row();
+    int col = index.column();
+
+    if(role == Qt::DisplayRole)
+
+    {
+        if(row == 0 && col == 0 )
+        {
+            returnVal = QTime::currentTime().toString();
+       }
+    }
+    return returnVal;
+}
+\endcode
+
+Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
+\code
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+//    selectedCell = 0;
+    timer = new QTimer(this);
+    timer->setInterval(1000);
+    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
+    timer->start();
+}
+\endcode
+
+Here is the corresponding slot:
+\code
+
+void MyModel::timerHit()
+{
+    //we identify the top left cell
+    QModelIndex topLeft = createIndex ( 0,0 );
+    //emit a signal to make the view reread identified data
+    emit dataChanged ( topLeft, topLeft );
+}
+\endcode
+
+We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QAbstractItemModel::setModel()}{setModel()} .
+
+\section2 2.4 Setting up Headers for Columns and Rows
+Headers can be hidden via a view method. 
+\c tableView->verticalHeader()->hide();
+\image header.png
+
+
+The header content, however , is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
+\code
+QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    if (role == Qt::DisplayRole)
+    {
+        if (orientation == Qt::Horizontal) {
+            switch (section)
+            {
+            case 0:
+                return QString("first");
+            case 1:
+                return QString("second");
+            case 2:
+                return QString("third");
+            }
+        }
+    }
+    return QVariant();
+}
+\endcode
+
+
+\section2 2.5 The minimal Editing example
+In this example, we are going to build an application that automatically populates a window title with content by repeating values entered into table cells.
+
+The model decides whether editing capabilities are available . We only have to modify the model in order for the available editing capabilities to be enabled. This is done by reimplementing the following virtual methods:  \l{QAbstractItemModel::setData()}{setData()} and \l{QAbstractItemModel::flags()}{flags()}. 
+\code
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
+    Qt::ItemFlags flags ( const QModelIndex & index ) const ;
+private:
+    QStringList m_gridData;  //holds text entered into QTableView
+    int modelIndexToOffset(const QModelIndex & index) const;
+signals:
+    void editCompleted(const QString &);
+};
+
+#endif // MYMODEL_H
+\endcode
+
+We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
+\code
+#include "mymodel.h"
+
+const int COLS= 3;
+const int ROWS= 2;
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+    //gridData needs to have 6 element, one for each table cell
+    m_gridData << "1/1" << "1/2" << "1/3" << "2/1" << "2/2" << "2/3" ;
+}
+\endcode
+
+In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
+\code
+HIER FEHLT WAS!!!
+\endcode
+
+\l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
+\code
+HIER FEHLT WAS!!!
+\endcode
+
+Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
+
+\section1 3 Intermediate Topics
+\section2 3.1 TreeView
+You can convert the example above into an application with a tree view. Simply replace QTableView with QTreeView, which results in a read/write tree. No changes have to be made to the model. The tree won't have any hierarchies because there aren't any hierarchies in the model itself.
+\image dummy_tree.png
+
+
+QListView, QTableView and QTreeView all use a model abstraction, which is a merged list, table and tree. This makes it possible to use several different types of view classes from the same model.
+\image list_table_tree.png
+
+This is how our example model looks so far:
+\image example_model.png
+
+
+We want to, however, present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with QStandardItems, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
+\code
+#include <QTreeView>
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include "modelview.h"
+
+
+const int ROWS = 2;
+const int COLUMNS = 3;
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    treeView = new QTreeView(this);
+    setCentralWidget(treeView);
+    standardModel = new QStandardItemModel ;
+
+    QList<QStandardItem *> preparedColumn =prepareColumn("first", "second", "third");
+    QStandardItem *item = standardModel->invisibleRootItem();
+    // adding a row to the invisible root item produces a root element
+    item->appendRow(preparedColumn);
+
+    QList<QStandardItem *> secondRow =prepareColumn("111", "222", "333");
+    // adding a row to an item starts a subtree
+    preparedColumn.first()->appendRow(secondRow);
+
+    treeView->setModel( standardModel );
+    treeView->expandAll();
+}
+
+//---------------------------------------------------------------------------
+QList<QStandardItem *> ModelView::prepareColumn(const QString &first,
+                                                const QString &second,
+                                                const QString &third )
+{
+    QList<QStandardItem *> colItems;
+    colItems << new QStandardItem(first);
+    colItems << new QStandardItem(second);
+    colItems << new QStandardItem(third);
+    return colItems;
+}
+
+\endcode
+
+We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other QStandardItems. Nodes are collapsed and expanded within the view.
+
+\section2 3.2 Working with selection
+We want to access a selected item's content in order to output it into the window title together with the hierarchy level.
+\image selection2.png
+
+
+So let's create a couple of items:
+\code
+#include <QTreeView>
+#include <QStandardItemModel>
+#include <QItemSelectionModel>
+#include "modelview.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    treeView = new QTreeView(this);
+    setCentralWidget(treeView);
+    standardModel = new QStandardItemModel ;
+    QStandardItem *rootNode = standardModel->invisibleRootItem();
+
+
+    //defining a couple of items
+    QStandardItem *americaItem = new QStandardItem("America");
+    QStandardItem *mexicoItem =  new QStandardItem("Canada");
+    QStandardItem *usaItem =     new QStandardItem("USA");
+    QStandardItem *bostonItem =  new QStandardItem("Boston");
+    QStandardItem *europeItem =  new QStandardItem("Europe");
+    QStandardItem *italyItem =   new QStandardItem("Italy");
+    QStandardItem *romeItem =    new QStandardItem("Rome");
+    QStandardItem *veronaItem =  new QStandardItem("Verona");
+
+    //building up the hierarchy
+    rootNode->    appendRow(americaItem);
+    rootNode->    appendRow(europeItem);
+    americaItem-> appendRow(mexicoItem);
+    americaItem-> appendRow(usaItem);
+    usaItem->     appendRow(bostonItem);
+    europeItem->  appendRow(italyItem);
+    italyItem->   appendRow(romeItem);
+    italyItem->   appendRow(veronaItem);
+    
+    //register the model
+    treeView->setModel( standardModel );
+    treeView->expandAll();
+
+    //selection changes shall trigger a slot
+    QItemSelectionModel *selectionModel= treeView->selectionModel();
+    connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
+            this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
+}
+\endcode
+
+Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
+\code
+HIER FEHLT WAS!!!
+\endcode
+
+We get the model index that corresponds to the selection by calling 
+\c treeView->selectionModel()->currentIndex() and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed QModelIndex(). This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
+
+The selection model (as shown above) can be retrieved, but it can also be set with \c QAbstractItemView::setSelectionModel. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemModel::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemModel::setSelectionModel()}{setSelectionModel()};
+\section2 3.3 Predefined Models
+The typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures. If one of the available data structures is suitable for your application, a predefined model can be a good choice.
+
+    \table
+        \row
+            \o  QStringListModel
+            \o  Stores a list of strings
+        \row
+            \o  QStandardItemModel
+            \o  Stores arbitrary hierarchical items
+        \row
+            \o  {1, 2}  QFileSystemModel
+QDirModel (deprecated)
+            \o  {1, 2}  Encapsulate the local file system
+        \row
+            \o  QSqlQueryModel
+            \o  Encapsulate an SQL result set
+        \row
+            \o  QSqlTableModel
+            \o  Encapsulates an SQL table
+        \row
+            \o  QSqlRelationalTableModel
+            \o  Encapsulates an SQL table with foreign keys
+        \row
+            \o  QSortFilterProxyModel
+            \o  Sorts and/or filters another model
+
+    \endtable
+
+\section2 3.4 Delegates
+In all examples so far, data is presented as text or a checkbox in a cell and is edited as text or a checkbox. The component that provides these presentation and editing services is called a “delegate.” We are only just beginning to work with the delegate because the view uses a default delegate.  But imagine that we want to have a different editor.(e.g. a slider or a drop down list) Or imagine that we want to present data as graphics. Let's take a look at an example called Stardelegate, (  \l{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html}{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html} ) in which stars are used to show a rating: \image stardelegate.png
+
+The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemModel::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
+\code
+ class StarDelegate : public QStyledItemDelegate
+ {
+     Q_OBJECT
+ public:
+     StarDelegate(QWidget *parent = 0); 
+     void paint(QPainter *painter, const QStyleOptionViewItem &option,
+                const QModelIndex &index) const;
+     QSize sizeHint(const QStyleOptionViewItem &option,
+                    const QModelIndex &index) const;
+ };
+
+\endcode
+
+\l{QAbstractItemModel::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \c index.data(). \c SizeHint specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
+
+Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
+
+\section2 3.5 Debugging with ModelTest
+The passive nature of models provides new challenges for programmers. Inconsistencies in the model can cause the application to crash. Since the model is hit by numerous calls from the view, it is hard to find out which call has crashed the application and which operation has introduced the problem. 
+
+Qt provides software called ModelTest, which checks models while your programming is running. Every time the model is changed, ModelTest scans the model and reports errors with an assert. This is especially important for tree models, since their hierarchical nature leaves many possibilities for subtle inconsistencies. http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
+
+Unlike view classes, ModelTest uses out of range indexes to test the model.  This means your application may crash with ModelTest even if it runs perfectly without it. So you also need to handle all of the indexes that are out of range when using ModelTest. 
+
+
+
+
+
+
+
+
+
+\section2 3.6 Model/View NG
+
+\image path.png
+
+Model/View was introduced in Qt 4.0 and is a frequently used technology. Feedback from clients and new development trends have shown, that there is a need to further develop the model/view technology. Therefore a research project at Nokia is looking into ways to go beyond the current implementation.
+
+One limitation of model/view is that view classes are basically all fixed grids. It is possible, but really hard to make a list view with icons placed on a curve; or cells expanding on mouse over events to show additional information. In order to achieve graphically rich view experiences, Model/View NG will use QGraphicsView to render elements. Nodel/View NG also aims to make model/view programming more intuitive. One way to achieve this is to have  separate models for lists, tables and trees. The current model abstraction is complex because it is capable of representing a list, a table or a tree. 
+
+Model/View NG is a research project. You are welcome to checkout the source code, monitor progress and take part in discussions at the following address:  \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
+
+\section1 4 Good Sources for Additional Information
+\section2 4.1 Books
+Model/View programming is covered quite extensively in the documentation of Qt but also in several good books. 
+    \list 1
+       \o   1.C++ GUI Programming with Qt 4 / Jasmin Blanchette, Mark Summerfield, Prentice Hall, 2nd edition, ISBN 0-13-235416-0
+also available in German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung, Addison-Wesley, ISBN 3-827327-29-6
+       \o   1.The Book of Qt4, The Art of Building Qt Applications / Daniel Molkentin,  Open Source Press ISBN 1-59327-147-6
+Translated from: Qt 4, Einführung in die Applikationsentwicklung, Open Source Press, ISBN 3-937514-12-0
+       \o   1.Foundations of Qt Development / Johan Thelin, Apress, ISBN 1-59059-831-8
+    \endlist
+
+
+The following list provides an overview of example programs contained in the books above. Some of them make very good templates for developing similar applications. 
+
+    \table
+        \header
+            \o  example name
+            \o  view class used
+            \o  model used
+            \o  aspects touched
+            \o  
+        \row
+            \o  Team Leaders
+            \o  QListview
+            \o  QStringListModel
+            \o  
+            \o  Book 1, Chapter 10, Figure 10.6
+        \row
+            \o  Directory Viewer
+            \o  QTreeView
+            \o  QDirModel
+            \o  
+            \o  Book 1, Chapter 10, Figure 10.7
+        \row
+            \o  Color Names
+            \o  QListView
+            \o  QSortFilterProxyModel
+applied to QStringListModel
+            \o  
+            \o  Book 1, Chapter 10, Figure 10.8
+        \row
+            \o  Currencies
+            \o  QTableView
+            \o  custom model based on
+QAbstractTableModel
+            \o  read only
+            \o  Book 1, Chapter 10, Figure 10.10
+        \row
+            \o  Cities
+            \o  QTableView
+            \o  custom model based on
+QAbstractTableModel
+            \o  read / write
+            \o  Book 1, Chapter 10, Figure 10.12
+        \row
+            \o  Boolean Parser
+            \o  QTreeView
+            \o  custom model based on
+QAbstractItemModel
+            \o  read only
+            \o  Book 1, Chapter 10, Figure 10.14
+        \row
+            \o  Track Editor
+            \o  {2, 1} QTableWidget
+            \o  custom delegate providing a custom editor
+            \o  Book 1, Chapter 10, Figure 10.15
+
+        \row
+            \o  Four directory views
+            \o  QListView
+QTableView
+QTreeView
+            \o  QDirModel
+            \o  demonstrates the use of multiple views
+            \o  Book2, Chapter 8.2
+        \row
+            \o  Address Book
+            \o  QListView
+QTableView
+QTreeView
+            \o  custom model based on
+QAbstractTableModel
+            \o  read / write
+            \o  Book2, Chapter 8.4
+        \row
+            \o  Address Book with sorting
+            \o  
+            \o  QProxyModel
+            \o  introducing sort and filter capabilities
+            \o  Book2, Chapter 8.5
+        \row
+            \o  Address Book 
+with checkboxes
+            \o  
+            \o  
+            \o  introducing checkboxes
+in model/view
+            \o  Book2, Chapter 8.6
+        \row
+            \o  Address Book 
+with transposed grid
+            \o  
+            \o  custom proxy Model based on QAbstractProxyModel
+            \o  introducing a custom model
+            \o  Book2, Chapter 8.7
+        \row
+            \o  Address Book
+with drag and drop
+            \o  
+            \o  
+            \o  introducing drag and drop support
+            \o  Book2, Chapter 8.8
+        \row
+            \o  Address Book with custom editor
+            \o  
+            \o  
+            \o  introducing custom delegates
+            \o  Book2, Chapter 8.9
+        \row
+            \o  Views
+            \o  QListView
+QTableView
+QTreeView
+            \o  QStandardItemModel
+            \o  read only
+            \o  Book 3, Chapter 5, figure 5-3
+        \row
+            \o  Bardelegate
+            \o  QTableView
+            \o  
+            \o  custom delegate for presentation based on QAbstractItemDelegate
+            \o  Book 3, Chapter 5, figure 5-5
+        \row
+            \o  Editdelegate
+            \o  QTableView
+            \o  
+            \o  custom delegate for editing based on QAbstractItemDelegate
+            \o  Book 3, Chapter 5, figure 5-6
+        \row
+            \o  Singleitemview
+            \o  custom view based on 
+QAbstractItemView
+            \o  
+            \o  custom view
+            \o  Book 3,
+Chapter 5,
+figure 5-7
+        \row
+            \o  listmodel
+            \o  QTableView
+            \o  custom Model based on
+QAbstractTableModel
+            \o  read only
+            \o  Book 3,
+Chapter 5,
+Figure 5-8
+        \row
+            \o  treemodel
+            \o  QTreeView
+            \o  custom Model based on
+QAbstractItemModel
+            \o  read only
+            \o  Book 3,
+Chapter 5,
+Figure 5-10
+        \row
+            \o  edit integers
+            \o  QListView
+            \o  custom Model based on 
+QAbstractListModel
+            \o  read / write
+            \o  Book 3,
+Chapter 5,
+Listing 5-37, Figure 5-11
+        \row
+            \o  sorting
+            \o  QTableView
+            \o  QSortFilterProxyModel
+applied to QStringListModel
+            \o  demonstrates sorting
+            \o  Book 3, Chapter 5, Figure 5-12
+
+    \endtable
+
+
+\section2 4.2 Qt documentation
+Qt 4.6 comes with 17 examples and 2 Demonstrations for model/view.  The examples can be found here:  \l{http://doc.qt.nokia.com/4.6/examples-itemviews.html}{http://doc.qt.nokia.com/4.6/examples-itemviews.html}
+    \table
+        \header
+            \o  example name
+            \o  view class used
+            \o  model used
+            \o  aspects touched
+        \row
+            \o  Address Book
+            \o  QTableView
+            \o  QTableModel
+QSortFilterProxyModel
+            \o  usage of  QSortFilterProxyModel to generate different subsets from one data pool
+        \row
+            \o  Basic Sort/Filter Model
+            \o  QTreeView
+            \o  QStandardItemModel
+QSortFilterProxyModel
+            \o  
+        \row
+            \o  Chart
+            \o  custom view
+            \o  QStandardItemModel
+            \o  designing custom views that cooperate with selection models 
+        \row
+            \o  Color Editor Factory
+            \o  {2, 1}  QTableWidget
+            \o  enhancing the standard delegate with a new custom editor to choose colours
+        \row
+            \o  Combo Widget Mapper
+            \o  QDataWidgetMapper to map QLineEdit, QTextEdit and QComboBox
+            \o  QStandardItemModel
+            \o  shows how a QComboBox can serve as a view class
+        \row
+            \o  Custom Sort/Filter Model
+            \o  QTreeView
+            \o  QStandardItemModel
+QSortFilterProxyModel
+            \o  subclass QSortFilterProxyModel
+for advanced sorting and filtering
+        \row
+            \o  Dir View
+            \o  QTreeView
+            \o  QDirModel
+            \o  very small example to demonstrate how to assign a model to a view
+        \row
+            \o  Editable Tree Model
+            \o  QTreeView
+            \o  custom tree model
+            \o  comprehensive example for working with trees, demonstrates editing cells and tree structure with an underlying custom model  
+        \row
+            \o  Fetch More
+            \o  QListView
+            \o  custom list model
+            \o  dynamically changing model 
+        \row
+            \o  Frozen Column
+            \o  QTableView
+            \o  QStandardItemModel
+            \o  
+        \row
+            \o  Pixelator
+            \o  QTableView
+            \o  custom table model
+            \o  implementation of a custom delegate
+        \row
+            \o  Puzzle
+            \o  QListView
+            \o  custom list model
+            \o  model/view with drag and drop 
+        \row
+            \o  Simple DOM Model
+            \o  QTreeView
+            \o  custom tree model
+            \o  read only example for a custom tree model
+        \row
+            \o  Simple Tree Model
+            \o  QTreeView
+            \o  custom tree model
+            \o  read only example for a custom tree model
+        \row
+            \o  Simple Widget Mapper
+            \o  QDataWidgetMapper to map QLineEdit, QTextEdit and QSpinBox
+            \o  QStandardItemModel
+            \o  basic QDataWidgetMapper usage
+        \row
+            \o  Spin Box Delegate
+            \o  QTableView
+            \o  QStandardItemModel
+            \o  custom delegate that uses a spin box as a cell editor
+        \row
+            \o  Star Delegate
+            \o  {2, 1}  QTableWidget
+            \o  comprehensive custom delegate example. 
+    \endtable
+
+Demonstrations are similar to examples except that no walk-through is provided  for the code lines. Demonstrations are also sometimes more feature rich. 
+ \l{http://doc.qt.nokia.com/4.6/demos.html}{http://doc.qt.nokia.com/4.6/demos.html}
+    \list
+       \o   The \bold Interview demonstration shows the same model and selection being shared between three different views. 
+       \o   Demonstration \bold Spreadsheet demonstrates the use of a table view as a spreadsheet, using custom delegates to render each item according to the type of data it contains.
+    \endlist
+
+A reference documentation for model/view technology is also available. \l{http://doc.qt.nokia.com/4.6/model-view-programming.html}{http://doc.qt.nokia.com/4.6/model-view-programming.html}
+
+*/
\ No newline at end of file
diff --git a/doc/src/images/clock.png b/doc/src/images/clock.png
new file mode 100755
index 0000000..c7f6a1b
Binary files /dev/null and b/doc/src/images/clock.png differ
diff --git a/doc/src/images/columnview.png b/doc/src/images/columnview.png
new file mode 100755
index 0000000..2fb972e
Binary files /dev/null and b/doc/src/images/columnview.png differ
diff --git a/doc/src/images/combobox.png b/doc/src/images/combobox.png
new file mode 100755
index 0000000..d172b41
Binary files /dev/null and b/doc/src/images/combobox.png differ
diff --git a/doc/src/images/dummy_tree.png b/doc/src/images/dummy_tree.png
new file mode 100755
index 0000000..7373ea6
Binary files /dev/null and b/doc/src/images/dummy_tree.png differ
diff --git a/doc/src/images/edit.png b/doc/src/images/edit.png
new file mode 100755
index 0000000..161b06f
Binary files /dev/null and b/doc/src/images/edit.png differ
diff --git a/doc/src/images/example_model.png b/doc/src/images/example_model.png
new file mode 100755
index 0000000..4261261
Binary files /dev/null and b/doc/src/images/example_model.png differ
diff --git a/doc/src/images/header.png b/doc/src/images/header.png
new file mode 100755
index 0000000..2597635
Binary files /dev/null and b/doc/src/images/header.png differ
diff --git a/doc/src/images/lineedit.png b/doc/src/images/lineedit.png
new file mode 100755
index 0000000..83d1c47
Binary files /dev/null and b/doc/src/images/lineedit.png differ
diff --git a/doc/src/images/list_table_tree.png b/doc/src/images/list_table_tree.png
new file mode 100755
index 0000000..b2daf1f
Binary files /dev/null and b/doc/src/images/list_table_tree.png differ
diff --git a/doc/src/images/listview.png b/doc/src/images/listview.png
new file mode 100755
index 0000000..fa49c52
Binary files /dev/null and b/doc/src/images/listview.png differ
diff --git a/doc/src/images/lotto.png b/doc/src/images/lotto.png
new file mode 100755
index 0000000..dd751cf
Binary files /dev/null and b/doc/src/images/lotto.png differ
diff --git a/doc/src/images/modelview.png b/doc/src/images/modelview.png
new file mode 100755
index 0000000..7b042af
Binary files /dev/null and b/doc/src/images/modelview.png differ
diff --git a/doc/src/images/path.png b/doc/src/images/path.png
new file mode 100755
index 0000000..73107ff
Binary files /dev/null and b/doc/src/images/path.png differ
diff --git a/doc/src/images/qcompleter.png b/doc/src/images/qcompleter.png
new file mode 100755
index 0000000..d25caac
Binary files /dev/null and b/doc/src/images/qcompleter.png differ
diff --git a/doc/src/images/readonlytable.png b/doc/src/images/readonlytable.png
new file mode 100755
index 0000000..90bcba4
Binary files /dev/null and b/doc/src/images/readonlytable.png differ
diff --git a/doc/src/images/readonlytable_role.png b/doc/src/images/readonlytable_role.png
new file mode 100755
index 0000000..7d2d416
Binary files /dev/null and b/doc/src/images/readonlytable_role.png differ
diff --git a/doc/src/images/selection2.png b/doc/src/images/selection2.png
new file mode 100755
index 0000000..66c757f
Binary files /dev/null and b/doc/src/images/selection2.png differ
diff --git a/doc/src/images/standardwidget.png b/doc/src/images/standardwidget.png
new file mode 100755
index 0000000..3ccccf1
Binary files /dev/null and b/doc/src/images/standardwidget.png differ
diff --git a/doc/src/images/tableview.png b/doc/src/images/tableview.png
new file mode 100755
index 0000000..8be1b6c
Binary files /dev/null and b/doc/src/images/tableview.png differ
diff --git a/doc/src/images/tree.png b/doc/src/images/tree.png
new file mode 100755
index 0000000..3f046c9
Binary files /dev/null and b/doc/src/images/tree.png differ
diff --git a/doc/src/images/tree_2.png b/doc/src/images/tree_2.png
new file mode 100755
index 0000000..6ee1f4a
Binary files /dev/null and b/doc/src/images/tree_2.png differ
diff --git a/doc/src/images/tree_2_with_algorithm.png b/doc/src/images/tree_2_with_algorithm.png
new file mode 100755
index 0000000..ecf9101
Binary files /dev/null and b/doc/src/images/tree_2_with_algorithm.png differ
diff --git a/doc/src/images/tree_city.png b/doc/src/images/tree_city.png
new file mode 100755
index 0000000..57f03d9
Binary files /dev/null and b/doc/src/images/tree_city.png differ
diff --git a/doc/src/images/treeview.png b/doc/src/images/treeview.png
new file mode 100755
index 0000000..af31fe9
Binary files /dev/null and b/doc/src/images/treeview.png differ
diff --git a/doc/src/images/widgetmapper.png b/doc/src/images/widgetmapper.png
new file mode 100755
index 0000000..9627088
Binary files /dev/null and b/doc/src/images/widgetmapper.png differ
-- 
cgit v0.12


From 4df3fb13821e13ecf581d87f2d224b2f1b964609 Mon Sep 17 00:00:00 2001
From: Roland Wolf <ext-roland.wolf@nokia.com>
Date: Thu, 27 May 2010 10:37:48 +0200
Subject: clean up previous test commit

---
 src/testfile.txt | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 src/testfile.txt

diff --git a/src/testfile.txt b/src/testfile.txt
deleted file mode 100644
index e69de29..0000000
-- 
cgit v0.12


From f574700f920ae5d5bda25ba217d6face9f3d3902 Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Thu, 27 May 2010 15:12:58 +0200
Subject: Rolands ModelView Source

---
 .../tutorials/modelview/1_readonly/1_readonly.pro  | 10 +++
 examples/tutorials/modelview/1_readonly/main.cpp   | 10 +++
 .../tutorials/modelview/1_readonly/modelview.cpp   | 12 ++++
 .../tutorials/modelview/1_readonly/modelview.h     | 18 ++++++
 .../tutorials/modelview/1_readonly/mymodel.cpp     | 30 +++++++++
 examples/tutorials/modelview/1_readonly/mymodel.h  | 16 +++++
 .../modelview/2_formatting/2_formatting.pro        | 10 +++
 examples/tutorials/modelview/2_formatting/main.cpp | 10 +++
 .../tutorials/modelview/2_formatting/modelview.cpp | 12 ++++
 .../tutorials/modelview/2_formatting/modelview.h   | 17 +++++
 .../tutorials/modelview/2_formatting/mymodel.cpp   | 73 ++++++++++++++++++++++
 .../tutorials/modelview/2_formatting/mymodel.h     | 16 +++++
 .../modelview/3_changingmodel/3_changingmodel.pro  | 10 +++
 .../tutorials/modelview/3_changingmodel/main.cpp   | 10 +++
 .../modelview/3_changingmodel/modelview.cpp        | 12 ++++
 .../modelview/3_changingmodel/modelview.h          | 17 +++++
 .../modelview/3_changingmodel/mymodel.cpp          | 53 ++++++++++++++++
 .../tutorials/modelview/3_changingmodel/mymodel.h  | 23 +++++++
 .../tutorials/modelview/4_headers/4_headers.pro    | 10 +++
 examples/tutorials/modelview/4_headers/main.cpp    | 10 +++
 .../tutorials/modelview/4_headers/modelview.cpp    | 14 +++++
 examples/tutorials/modelview/4_headers/modelview.h | 18 ++++++
 examples/tutorials/modelview/4_headers/mymodel.cpp | 50 +++++++++++++++
 examples/tutorials/modelview/4_headers/mymodel.h   | 17 +++++
 examples/tutorials/modelview/5_edit/5_edit.pro     | 10 +++
 examples/tutorials/modelview/5_edit/main.cpp       | 10 +++
 examples/tutorials/modelview/5_edit/modelview.cpp  | 20 ++++++
 examples/tutorials/modelview/5_edit/modelview.h    | 19 ++++++
 examples/tutorials/modelview/5_edit/mymodel.cpp    | 58 +++++++++++++++++
 examples/tutorials/modelview/5_edit/mymodel.h      | 24 +++++++
 .../tutorials/modelview/6_treeview/6_treeview.pro  |  5 ++
 examples/tutorials/modelview/6_treeview/main.cpp   | 10 +++
 .../tutorials/modelview/6_treeview/modelview.cpp   | 40 ++++++++++++
 .../tutorials/modelview/6_treeview/modelview.h     | 24 +++++++
 .../modelview/7_selections/7_selections.pro        |  5 ++
 examples/tutorials/modelview/7_selections/main.cpp | 10 +++
 .../tutorials/modelview/7_selections/modelview.cpp | 63 +++++++++++++++++++
 .../tutorials/modelview/7_selections/modelview.h   | 23 +++++++
 examples/tutorials/modelview/qmake.pro             | 10 +++
 39 files changed, 809 insertions(+)
 create mode 100755 examples/tutorials/modelview/1_readonly/1_readonly.pro
 create mode 100755 examples/tutorials/modelview/1_readonly/main.cpp
 create mode 100755 examples/tutorials/modelview/1_readonly/modelview.cpp
 create mode 100755 examples/tutorials/modelview/1_readonly/modelview.h
 create mode 100755 examples/tutorials/modelview/1_readonly/mymodel.cpp
 create mode 100755 examples/tutorials/modelview/1_readonly/mymodel.h
 create mode 100755 examples/tutorials/modelview/2_formatting/2_formatting.pro
 create mode 100755 examples/tutorials/modelview/2_formatting/main.cpp
 create mode 100755 examples/tutorials/modelview/2_formatting/modelview.cpp
 create mode 100755 examples/tutorials/modelview/2_formatting/modelview.h
 create mode 100755 examples/tutorials/modelview/2_formatting/mymodel.cpp
 create mode 100755 examples/tutorials/modelview/2_formatting/mymodel.h
 create mode 100755 examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
 create mode 100755 examples/tutorials/modelview/3_changingmodel/main.cpp
 create mode 100755 examples/tutorials/modelview/3_changingmodel/modelview.cpp
 create mode 100755 examples/tutorials/modelview/3_changingmodel/modelview.h
 create mode 100755 examples/tutorials/modelview/3_changingmodel/mymodel.cpp
 create mode 100755 examples/tutorials/modelview/3_changingmodel/mymodel.h
 create mode 100755 examples/tutorials/modelview/4_headers/4_headers.pro
 create mode 100755 examples/tutorials/modelview/4_headers/main.cpp
 create mode 100755 examples/tutorials/modelview/4_headers/modelview.cpp
 create mode 100755 examples/tutorials/modelview/4_headers/modelview.h
 create mode 100755 examples/tutorials/modelview/4_headers/mymodel.cpp
 create mode 100755 examples/tutorials/modelview/4_headers/mymodel.h
 create mode 100755 examples/tutorials/modelview/5_edit/5_edit.pro
 create mode 100755 examples/tutorials/modelview/5_edit/main.cpp
 create mode 100755 examples/tutorials/modelview/5_edit/modelview.cpp
 create mode 100755 examples/tutorials/modelview/5_edit/modelview.h
 create mode 100755 examples/tutorials/modelview/5_edit/mymodel.cpp
 create mode 100755 examples/tutorials/modelview/5_edit/mymodel.h
 create mode 100755 examples/tutorials/modelview/6_treeview/6_treeview.pro
 create mode 100755 examples/tutorials/modelview/6_treeview/main.cpp
 create mode 100755 examples/tutorials/modelview/6_treeview/modelview.cpp
 create mode 100755 examples/tutorials/modelview/6_treeview/modelview.h
 create mode 100755 examples/tutorials/modelview/7_selections/7_selections.pro
 create mode 100755 examples/tutorials/modelview/7_selections/main.cpp
 create mode 100755 examples/tutorials/modelview/7_selections/modelview.cpp
 create mode 100755 examples/tutorials/modelview/7_selections/modelview.h
 create mode 100755 examples/tutorials/modelview/qmake.pro

diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro
new file mode 100755
index 0000000..1162d5a
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/1_readonly.pro
@@ -0,0 +1,10 @@
+TARGET =   mv_readonly
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+           modelview.cpp \
+           mymodel.cpp
+
+HEADERS += modelview.h \
+           mymodel.h
diff --git a/examples/tutorials/modelview/1_readonly/main.cpp b/examples/tutorials/modelview/1_readonly/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp
new file mode 100755
index 0000000..becd61d
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/modelview.cpp
@@ -0,0 +1,12 @@
+#include <QTableView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    tableView = new QTableView(this);
+    setCentralWidget(tableView);
+    tableView->setModel(new MyModel(this) );
+}
+
diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h
new file mode 100755
index 0000000..f1b63bd
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/modelview.h
@@ -0,0 +1,18 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTableView; //forward declaration
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTableView *tableView;
+public:
+    ModelView(QWidget *parent = 0);
+
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.cpp b/examples/tutorials/modelview/1_readonly/mymodel.cpp
new file mode 100755
index 0000000..ff3e2d2
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/mymodel.cpp
@@ -0,0 +1,30 @@
+#include "mymodel.h"
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+}
+
+//-------------------------------------------------------
+int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
+{
+   return 2;
+}
+
+//-------------------------------------------------------
+int MyModel::columnCount(const QModelIndex & /*parent*/ ) const
+{
+    return 3;
+}
+
+//-------------------------------------------------------
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    if(role == Qt::DisplayRole)
+    {
+       return QString("Row%1, Column%2")
+                   .arg(index.row() + 1)
+                   .arg(index.column() +1);
+    }
+    return QVariant();
+}
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.h b/examples/tutorials/modelview/1_readonly/mymodel.h
new file mode 100755
index 0000000..01ae6cb
--- /dev/null
+++ b/examples/tutorials/modelview/1_readonly/mymodel.h
@@ -0,0 +1,16 @@
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+};
+
+#endif // MYMODEL_H
diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.pro b/examples/tutorials/modelview/2_formatting/2_formatting.pro
new file mode 100755
index 0000000..7e70d81
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/2_formatting.pro
@@ -0,0 +1,10 @@
+TARGET = mv_formatting
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+           modelview.cpp \
+           mymodel.cpp
+
+HEADERS += modelview.h \
+           mymodel.h
diff --git a/examples/tutorials/modelview/2_formatting/main.cpp b/examples/tutorials/modelview/2_formatting/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/2_formatting/modelview.cpp b/examples/tutorials/modelview/2_formatting/modelview.cpp
new file mode 100755
index 0000000..becd61d
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/modelview.cpp
@@ -0,0 +1,12 @@
+#include <QTableView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    tableView = new QTableView(this);
+    setCentralWidget(tableView);
+    tableView->setModel(new MyModel(this) );
+}
+
diff --git a/examples/tutorials/modelview/2_formatting/modelview.h b/examples/tutorials/modelview/2_formatting/modelview.h
new file mode 100755
index 0000000..98bee38
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/modelview.h
@@ -0,0 +1,17 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTableView; //forward declaration
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTableView *tableView;
+public:
+    ModelView(QWidget *parent = 0);
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
new file mode 100755
index 0000000..48b1134
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -0,0 +1,73 @@
+#include <QFont>
+#include <QBrush>
+#include "mymodel.h"
+#include <QDebug>
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+}
+
+//-------------------------------------------------------
+int MyModel::rowCount(const QModelIndex  & /*parent */ ) const
+{
+    return 2;
+}
+
+//-------------------------------------------------------
+int MyModel::columnCount(const QModelIndex  & /*parent */ ) const
+{
+    return 3;
+}
+
+//-------------------------------------------------------
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    int row = index.row();
+    int col = index.column();
+    // generate a log message when this method gets called
+    qDebug() << QString("row %1, col%2, role %3")
+            .arg(row).arg(col).arg(role);
+
+    switch(role){
+    case Qt::DisplayRole:
+        if(row == 0 && col == 1 )return QString("<--left");
+        if(row == 1 && col == 1 )return QString("right-->");
+
+        return QString("Row%1, Column%2")
+                .arg(row + 1)
+                .arg(col +1);
+        break;
+    case Qt::FontRole:
+        if(row == 0 && col ==0 ) //change font only for cell(0,0)
+        {
+            QFont boldFont;
+            boldFont.setBold(true);
+            return boldFont;
+        }
+        break;
+    case Qt::BackgroundRole:
+
+        if(row == 1 && col ==2 )  //change background only for cell(1,2)
+        {
+            QBrush redBackground(QColor(Qt::red));
+            return redBackground;
+        }
+        break;
+    case Qt::TextAlignmentRole:
+
+        if(row == 1 && col ==1 ) //change text alignment only for cell(1,1)
+        {
+            return Qt::AlignRight + Qt::AlignVCenter;
+        }
+        break;
+    case Qt::CheckStateRole:
+
+        if(row == 1 && col ==0 ) //add a checkbox to cell(1,0)
+        {
+            return Qt::Checked;
+        }
+    }
+    return QVariant();
+}
+
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.h b/examples/tutorials/modelview/2_formatting/mymodel.h
new file mode 100755
index 0000000..01ae6cb
--- /dev/null
+++ b/examples/tutorials/modelview/2_formatting/mymodel.h
@@ -0,0 +1,16 @@
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+};
+
+#endif // MYMODEL_H
diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
new file mode 100755
index 0000000..d61ee4c
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
@@ -0,0 +1,10 @@
+TARGET = mv_changingmodel
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+           modelview.cpp \
+           mymodel.cpp
+
+HEADERS += modelview.h \
+           mymodel.h
diff --git a/examples/tutorials/modelview/3_changingmodel/main.cpp b/examples/tutorials/modelview/3_changingmodel/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.cpp b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
new file mode 100755
index 0000000..becd61d
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
@@ -0,0 +1,12 @@
+#include <QTableView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    tableView = new QTableView(this);
+    setCentralWidget(tableView);
+    tableView->setModel(new MyModel(this) );
+}
+
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.h b/examples/tutorials/modelview/3_changingmodel/modelview.h
new file mode 100755
index 0000000..98bee38
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/modelview.h
@@ -0,0 +1,17 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTableView; //forward declaration
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTableView *tableView;
+public:
+    ModelView(QWidget *parent = 0);
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
new file mode 100755
index 0000000..d594175
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
@@ -0,0 +1,53 @@
+#include <QTimer>
+#include <QTime>
+#include <QBrush>
+#include "mymodel.h"
+
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+//    selectedCell = 0;
+    timer = new QTimer(this);
+    timer->setInterval(1000);
+    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
+    timer->start();
+}
+
+//-------------------------------------------------------
+int MyModel::rowCount(const QModelIndex  & /*parent */ ) const
+{
+    return 2;
+}
+
+//-------------------------------------------------------
+int MyModel::columnCount(const QModelIndex  & /*parent */ ) const
+{
+    return 3;
+}
+
+//-------------------------------------------------------
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    int row = index.row();
+    int col = index.column();
+
+    if(role == Qt::DisplayRole)
+    {
+        if(row == 0 && col == 0 )
+        {
+            return QTime::currentTime().toString();
+        }
+    }
+    return QVariant();
+}
+
+//-------------------------------------------------------
+void MyModel::timerHit()
+{
+    //we identify the top left cell
+    QModelIndex topLeft = createIndex ( 0,0 );
+    //emit a signal to make the view reread identified data
+    emit dataChanged ( topLeft, topLeft );
+}
+
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.h b/examples/tutorials/modelview/3_changingmodel/mymodel.h
new file mode 100755
index 0000000..9cc023b
--- /dev/null
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.h
@@ -0,0 +1,23 @@
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+
+class QTimer;  // forward declaration
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    QTimer *timer;
+private:
+    int selectedCell;
+private slots:
+    void timerHit();
+};
+
+#endif // MYMODEL_H
diff --git a/examples/tutorials/modelview/4_headers/4_headers.pro b/examples/tutorials/modelview/4_headers/4_headers.pro
new file mode 100755
index 0000000..d6f8d23
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/4_headers.pro
@@ -0,0 +1,10 @@
+TARGET = mv_headers
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+           modelview.cpp \
+           mymodel.cpp
+
+HEADERS += modelview.h \
+           mymodel.h
diff --git a/examples/tutorials/modelview/4_headers/main.cpp b/examples/tutorials/modelview/4_headers/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/4_headers/modelview.cpp b/examples/tutorials/modelview/4_headers/modelview.cpp
new file mode 100755
index 0000000..39394da
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/modelview.cpp
@@ -0,0 +1,14 @@
+#include <QTableView>
+#include <QHeaderView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    tableView = new QTableView(this);
+    setCentralWidget(tableView);
+    tableView->setModel(new MyModel(this) );
+    tableView->verticalHeader()->hide();
+}
+
diff --git a/examples/tutorials/modelview/4_headers/modelview.h b/examples/tutorials/modelview/4_headers/modelview.h
new file mode 100755
index 0000000..f1b63bd
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/modelview.h
@@ -0,0 +1,18 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTableView; //forward declaration
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTableView *tableView;
+public:
+    ModelView(QWidget *parent = 0);
+
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/4_headers/mymodel.cpp b/examples/tutorials/modelview/4_headers/mymodel.cpp
new file mode 100755
index 0000000..a032fe5
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/mymodel.cpp
@@ -0,0 +1,50 @@
+#include "mymodel.h"
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+}
+
+//-------------------------------------------------------
+int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
+{
+    return 2;
+}
+
+//-------------------------------------------------------
+int MyModel::columnCount(const QModelIndex & /*parent*/ ) const
+{
+    return 3;
+}
+
+//-------------------------------------------------------
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    if(role == Qt::DisplayRole)
+    {
+        return QString("Row%1, Column%2")
+                .arg(index.row() + 1)
+                .arg(index.column() +1);
+    }
+    return QVariant();
+}
+
+
+QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    if (role == Qt::DisplayRole)
+    {
+        if (orientation == Qt::Horizontal) {
+            switch (section)
+            {
+            case 0:
+                return QString("first");
+            case 1:
+                return QString("second");
+            case 2:
+                return QString("third");
+            }
+        }
+    }
+    return QVariant();
+}
diff --git a/examples/tutorials/modelview/4_headers/mymodel.h b/examples/tutorials/modelview/4_headers/mymodel.h
new file mode 100755
index 0000000..327ca10
--- /dev/null
+++ b/examples/tutorials/modelview/4_headers/mymodel.h
@@ -0,0 +1,17 @@
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+};
+
+#endif // MYMODEL_H
diff --git a/examples/tutorials/modelview/5_edit/5_edit.pro b/examples/tutorials/modelview/5_edit/5_edit.pro
new file mode 100755
index 0000000..e18c596
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/5_edit.pro
@@ -0,0 +1,10 @@
+TARGET = mv_edit
+
+TEMPLATE = app
+
+SOURCES += main.cpp \
+           modelview.cpp \
+           mymodel.cpp
+
+HEADERS += modelview.h \
+           mymodel.h
diff --git a/examples/tutorials/modelview/5_edit/main.cpp b/examples/tutorials/modelview/5_edit/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/5_edit/modelview.cpp b/examples/tutorials/modelview/5_edit/modelview.cpp
new file mode 100755
index 0000000..b6e8e34
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/modelview.cpp
@@ -0,0 +1,20 @@
+#include <QTableView>
+#include "modelview.h"
+#include "mymodel.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    tableView = new QTableView(this);
+    setCentralWidget(tableView);
+    QAbstractTableModel *myModel = new MyModel(this);
+    tableView->setModel( myModel );
+
+    //transfer changes to the model to the window title
+    connect(myModel, SIGNAL(editCompleted(const QString &) ), this, SLOT(setWindowTitle(const QString &)));
+}
+
+void ModelView::showWindowTitle(const QString & title)
+{
+setWindowTitle( title );
+}
diff --git a/examples/tutorials/modelview/5_edit/modelview.h b/examples/tutorials/modelview/5_edit/modelview.h
new file mode 100755
index 0000000..e1591f9
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/modelview.h
@@ -0,0 +1,19 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTableView; //forward declaration
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTableView *tableView;
+public:
+    ModelView(QWidget *parent = 0);
+public slots:
+    void showWindowTitle(const QString & title);
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/5_edit/mymodel.cpp b/examples/tutorials/modelview/5_edit/mymodel.cpp
new file mode 100755
index 0000000..c64a6b7
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/mymodel.cpp
@@ -0,0 +1,58 @@
+#include "mymodel.h"
+
+const int COLS= 3;
+const int ROWS= 2;
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+    //gridData needs to have 6 element, one for each table cell
+    m_gridData << "1/1" << "1/2" << "1/3" << "2/1" << "2/2" << "2/3" ;
+}
+
+//-------------------------------------------------------
+int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
+{
+    return ROWS;
+}
+
+//-------------------------------------------------------
+int MyModel::columnCount(const QModelIndex & /*parent*/ ) const
+{
+    return COLS;
+}
+
+//-------------------------------------------------------
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    if(role == Qt::DisplayRole)
+    {
+        return m_gridData[modelIndexToOffset(index)];
+    }
+    return QVariant();
+}
+
+//-----------------------------------------------------------------
+bool MyModel::setData ( const QModelIndex & index, const QVariant & value, int role  )
+{
+    if(role == Qt::EditRole)
+    {
+        m_gridData[modelIndexToOffset(index)] = value.toString();
+        emit editCompleted(m_gridData.join(" | ") );
+    }
+    return true;
+}
+
+//-----------------------------------------------------------------
+Qt::ItemFlags MyModel::flags ( const QModelIndex & /*index*/ ) const
+{
+    return Qt::ItemIsSelectable |  Qt::ItemIsEditable | Qt::ItemIsEnabled ;
+}
+
+//-----------------------------------------------------------------
+//convert row and column information to array offset
+int MyModel::modelIndexToOffset(const QModelIndex & index) const
+{
+    return index.row()*COLS + index.column();
+}
+
diff --git a/examples/tutorials/modelview/5_edit/mymodel.h b/examples/tutorials/modelview/5_edit/mymodel.h
new file mode 100755
index 0000000..f8fac77
--- /dev/null
+++ b/examples/tutorials/modelview/5_edit/mymodel.h
@@ -0,0 +1,24 @@
+#ifndef MYMODEL_H
+#define MYMODEL_H
+
+#include <QAbstractTableModel>
+#include <QStringList>
+
+class MyModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    MyModel(QObject *parent);
+    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
+    Qt::ItemFlags flags ( const QModelIndex & index ) const ;
+private:
+    QStringList m_gridData;  //holds text entered into QTableView
+    int modelIndexToOffset(const QModelIndex & index) const;
+signals:
+    void editCompleted(const QString &);
+};
+
+#endif // MYMODEL_H
diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.pro b/examples/tutorials/modelview/6_treeview/6_treeview.pro
new file mode 100755
index 0000000..6d078be
--- /dev/null
+++ b/examples/tutorials/modelview/6_treeview/6_treeview.pro
@@ -0,0 +1,5 @@
+TARGET = mv_tree
+TEMPLATE = app
+SOURCES += main.cpp \
+    modelview.cpp
+HEADERS += modelview.h
diff --git a/examples/tutorials/modelview/6_treeview/main.cpp b/examples/tutorials/modelview/6_treeview/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/6_treeview/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/6_treeview/modelview.cpp b/examples/tutorials/modelview/6_treeview/modelview.cpp
new file mode 100755
index 0000000..a5488f7
--- /dev/null
+++ b/examples/tutorials/modelview/6_treeview/modelview.cpp
@@ -0,0 +1,40 @@
+#include <QTreeView>
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include "modelview.h"
+
+
+const int ROWS = 2;
+const int COLUMNS = 3;
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    treeView = new QTreeView(this);
+    setCentralWidget(treeView);
+    standardModel = new QStandardItemModel ;
+
+    QList<QStandardItem *> preparedColumn =prepareColumn("first", "second", "third");
+    QStandardItem *item = standardModel->invisibleRootItem();
+    // adding a row to the invisible root item produces a root element
+    item->appendRow(preparedColumn);
+
+    QList<QStandardItem *> secondRow =prepareColumn("111", "222", "333");
+    // adding a row to an item starts a subtree
+    preparedColumn.first()->appendRow(secondRow);
+
+    treeView->setModel( standardModel );
+    treeView->expandAll();
+}
+
+//---------------------------------------------------------------------------
+QList<QStandardItem *> ModelView::prepareColumn(const QString &first,
+                                                const QString &second,
+                                                const QString &third )
+{
+    QList<QStandardItem *> colItems;
+    colItems << new QStandardItem(first);
+    colItems << new QStandardItem(second);
+    colItems << new QStandardItem(third);
+    return colItems;
+}
diff --git a/examples/tutorials/modelview/6_treeview/modelview.h b/examples/tutorials/modelview/6_treeview/modelview.h
new file mode 100755
index 0000000..1ab23ea
--- /dev/null
+++ b/examples/tutorials/modelview/6_treeview/modelview.h
@@ -0,0 +1,24 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTreeView; //forward declaration
+class QStandardItemModel;
+class QStandardItem;
+
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTreeView *treeView;
+    QStandardItemModel *standardModel;
+    QList<QStandardItem *> prepareColumn(const QString &first,
+                                         const QString &second,
+                                         const QString &third );
+public:
+    ModelView(QWidget *parent = 0);
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/7_selections/7_selections.pro b/examples/tutorials/modelview/7_selections/7_selections.pro
new file mode 100755
index 0000000..952641c6
--- /dev/null
+++ b/examples/tutorials/modelview/7_selections/7_selections.pro
@@ -0,0 +1,5 @@
+TARGET = mv_selections
+TEMPLATE = app
+SOURCES += main.cpp \
+    modelview.cpp
+HEADERS += modelview.h 
diff --git a/examples/tutorials/modelview/7_selections/main.cpp b/examples/tutorials/modelview/7_selections/main.cpp
new file mode 100755
index 0000000..998503c
--- /dev/null
+++ b/examples/tutorials/modelview/7_selections/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "modelview.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv);
+    ModelView w;
+    w.show();
+    return a.exec();
+}
diff --git a/examples/tutorials/modelview/7_selections/modelview.cpp b/examples/tutorials/modelview/7_selections/modelview.cpp
new file mode 100755
index 0000000..49c5bb8
--- /dev/null
+++ b/examples/tutorials/modelview/7_selections/modelview.cpp
@@ -0,0 +1,63 @@
+#include <QTreeView>
+#include <QStandardItemModel>
+#include <QItemSelectionModel>
+#include "modelview.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    treeView = new QTreeView(this);
+    setCentralWidget(treeView);
+    standardModel = new QStandardItemModel ;
+    QStandardItem *rootNode = standardModel->invisibleRootItem();
+
+
+    //defining a couple of items
+    QStandardItem *americaItem = new QStandardItem("America");
+    QStandardItem *mexicoItem =  new QStandardItem("Canada");
+    QStandardItem *usaItem =     new QStandardItem("USA");
+    QStandardItem *bostonItem =  new QStandardItem("Boston");
+    QStandardItem *europeItem =  new QStandardItem("Europe");
+    QStandardItem *italyItem =   new QStandardItem("Italy");
+    QStandardItem *romeItem =    new QStandardItem("Rome");
+    QStandardItem *veronaItem =  new QStandardItem("Verona");
+
+    //building up the hierarchy
+    rootNode->    appendRow(americaItem);
+    rootNode->    appendRow(europeItem);
+    americaItem-> appendRow(mexicoItem);
+    americaItem-> appendRow(usaItem);
+    usaItem->     appendRow(bostonItem);
+    europeItem->  appendRow(italyItem);
+    italyItem->   appendRow(romeItem);
+    italyItem->   appendRow(veronaItem);
+    
+    //register the model
+    treeView->setModel( standardModel );
+    treeView->expandAll();
+
+    //selection changes shall trigger a slot
+    QItemSelectionModel *selectionModel= treeView->selectionModel();
+    connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
+            this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
+}
+
+//------------------------------------------------------------------------------------
+void ModelView::selectionChangedSlot(const QItemSelection & /*newSelection*/, const QItemSelection & /*oldSelection*/)
+{
+    const QModelIndex index = treeView->selectionModel()->currentIndex();
+    QString selectedText = index.data(Qt::DisplayRole).toString();
+    int hierarchyLevel=1;
+    QModelIndex seekRoot = index;
+    while(seekRoot.parent() != QModelIndex() )
+    {
+        seekRoot = seekRoot.parent();
+        hierarchyLevel++;
+    }
+    QString showString = QString("%1, Level %2").arg(selectedText)
+                         .arg(hierarchyLevel);
+    setWindowTitle(showString);
+}
+
+
+
diff --git a/examples/tutorials/modelview/7_selections/modelview.h b/examples/tutorials/modelview/7_selections/modelview.h
new file mode 100755
index 0000000..0e638a9
--- /dev/null
+++ b/examples/tutorials/modelview/7_selections/modelview.h
@@ -0,0 +1,23 @@
+#ifndef MODELVIEW_H
+#define MODELVIEW_H
+
+#include <QtGui/QMainWindow>
+
+class QTreeView; //forward declaration
+class QStandardItemModel;
+class QItemSelection;
+
+
+class ModelView : public QMainWindow
+{
+    Q_OBJECT
+private:
+    QTreeView *treeView;
+    QStandardItemModel *standardModel;
+private slots:
+    void selectionChangedSlot(const QItemSelection & newSelection, const QItemSelection & oldSelection);
+public:
+    ModelView(QWidget *parent = 0);
+};
+
+#endif // MODELVIEW_H
diff --git a/examples/tutorials/modelview/qmake.pro b/examples/tutorials/modelview/qmake.pro
new file mode 100755
index 0000000..7f684ba
--- /dev/null
+++ b/examples/tutorials/modelview/qmake.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+
+SUBDIRS = 1_readonly \
+          2_formatting \
+          3_changingmodel \
+          4_headers \
+          5_edit \
+          6_treeview \
+          7_selections
+
-- 
cgit v0.12


From cdc354e3e777b6de28710c05b83567fa3ad63658 Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Tue, 22 Jun 2010 11:56:24 +0200
Subject: new version of modelview.qdoc with snippets

---
 doc/src/frameworks-technologies/modelview.qdoc | 168 +++++--------------------
 1 file changed, 29 insertions(+), 139 deletions(-)

diff --git a/doc/src/frameworks-technologies/modelview.qdoc b/doc/src/frameworks-technologies/modelview.qdoc
index 7729cd2..5f9969b 100755
--- a/doc/src/frameworks-technologies/modelview.qdoc
+++ b/doc/src/frameworks-technologies/modelview.qdoc
@@ -69,59 +69,16 @@ Below are 7 very simple and independent applications that show different sides o
 We start with an application that uses a \l QTableView to show data. We will add editing capabilities later. 
 
 -------------------------------------------------------------main.cpp---------------------
-\code
-#include <QtGui/QApplication>
-#include "modelview.h"
-
-int main(int argc, char *argv[])
-{
-    QApplication a(argc, argv);
-    ModelView w;
-    w.show();
-    return a.exec();
-}
-\endcode
+    \snippet examples/tutorials/modelview/1_readonly/main.cpp
 
 We have the usual main() function;
 -------------------------------------------------------------modelview.h---------------------
-\code
-#ifndef MODELVIEW_H
-#define MODELVIEW_H
-
-#include <QtGui/QMainWindow>
-
-class QTableView; //forward declaration
-
-class ModelView : public QMainWindow
-{
-    Q_OBJECT
-private:
-    QTableView *tableView;
-public:
-    ModelView(QWidget *parent = 0);
-
-};
-
-#endif // MODELVIEW_H
-\endcode
+    \snippet examples/tutorials/modelview/1_readonly/modelview.h
 
 The application is a \l QMainWindow that holds a \l QTableView.  
 
 -------------------------------------------------------------modelview.cpp---------------------
-\code
-#include <QTableView>
-#include "modelview.h"
-#include "mymodel.h"
-
-ModelView::ModelView(QWidget *parent)
-    : QMainWindow(parent)
-{
-    tableView = new QTableView(this);
-    setCentralWidget(tableView);
-    tableView->setModel(new MyModel(this) );
-}
-
-\endcode
+    \snippet examples/tutorials/modelview/1_readonly/modelview.cpp
 
 Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView::}{tableView()} OR \l QTableView::tableView() OR \l QTableView::tableView .  \l {QTableView::}{tableView} will invoke the methods of the pointer it has received to find out two things: 
     \list
@@ -133,32 +90,13 @@ The model needs some code to respond to this.
 
 We have a table data set, so let's start with QAbstractTableModel since it is easier to use.
 -------------------------------------------------------------mymodel.h---------------------
-\code
-#ifndef MYMODEL_H
-#define MYMODEL_H
-
-#include <QAbstractTableModel>
-
-class MyModel : public QAbstractTableModel
-{
-    Q_OBJECT
-public:
-    MyModel(QObject *parent);
-    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
-    int columnCount(const QModelIndex &parent = QModelIndex()) const;
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-};
-
-#endif // MYMODEL_H
-\endcode
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.h
 
 QAbstractTableModel requires the implementation of three abstract methods.
 
 
 -------------------------------------------------------------mymodel.cpp---------------------
-\code
-HIER FEHLT mymodel.cpp !!!
-\endcode
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp
 
 The number of rows and columns is set by \c MyModel::rowCount() and \c MyModel::columnCount(). 
 When the view has to know what the cell 's text is, it calls the \l{QAbstractItemModel::data()}{data()} method. Row and column information is specified with parameter \c index and the role is set to Qt::Display Role.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
@@ -173,9 +111,8 @@ In addition to controlling what text the view displays, the model also controls
 
 In fact, nothing except for the \l{QAbstractItemModel::data()}{data()} method needs to be changed to set fonts, background colour, alignment and a checkbox. Here is the \l{QAbstractItemModel::data()}{data()} method that produces the result shown above:
 
-\code
-HIER FEHLT WAS !!!
-\endcode
+-------------------------------------------------------------mymodel.cpp---------------------
+    \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp
 
 Each formatting property will be requested from the model with a separate call to the \l{QAbstractItemModel::data()}{data()} method. The \c role parameter is used to let the model know which property is being requested:
 
@@ -216,6 +153,8 @@ Now we need to determine how using a seperated model impacts the application's p
 \image clock.png
 
 We still have a read only table, but this time the content changes every second because we are showing the current time.
+
+!!!!!I CAN'T FIND THIS FILE!!!!!
 \code
 QVariant MyModel::data(const QModelIndex &index, int role ) const
 {
@@ -236,6 +175,8 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
 \endcode
 
 Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
+
+?????(include section from 3_changingmodel/mymodel.cpp)?????
 \code
 MyModel::MyModel(QObject *parent)
     :QAbstractTableModel(parent)
@@ -249,6 +190,8 @@ MyModel::MyModel(QObject *parent)
 \endcode
 
 Here is the corresponding slot:
+
+?????(include section from 3_changingmodel/mymodel.cpp)?????
 \code
 
 void MyModel::timerHit()
@@ -269,6 +212,9 @@ Headers can be hidden via a view method.
 
 
 The header content, however , is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
+
+
+?????(include section from 4_headers/mymodel.cpp)?????
 \code
 QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
 {
@@ -295,34 +241,12 @@ QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role)
 In this example, we are going to build an application that automatically populates a window title with content by repeating values entered into table cells.
 
 The model decides whether editing capabilities are available . We only have to modify the model in order for the available editing capabilities to be enabled. This is done by reimplementing the following virtual methods:  \l{QAbstractItemModel::setData()}{setData()} and \l{QAbstractItemModel::flags()}{flags()}. 
-\code
-#ifndef MYMODEL_H
-#define MYMODEL_H
-
-#include <QAbstractTableModel>
-#include <QStringList>
-
-class MyModel : public QAbstractTableModel
-{
-    Q_OBJECT
-public:
-    MyModel(QObject *parent);
-    int rowCount(const QModelIndex &parent = QModelIndex()) const ;
-    int columnCount(const QModelIndex &parent = QModelIndex()) const;
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-    bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
-    Qt::ItemFlags flags ( const QModelIndex & index ) const ;
-private:
-    QStringList m_gridData;  //holds text entered into QTableView
-    int modelIndexToOffset(const QModelIndex & index) const;
-signals:
-    void editCompleted(const QString &);
-};
-
-#endif // MYMODEL_H
-\endcode
+-------------------------------------------------------------mymodel.h---------------------
+    \snippet examples/tutorials/modelview/5_edit/mymodel.h
 
 We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
+
+?????(include section from 5_edit/mymodel.cpp)?????
 \code
 #include "mymodel.h"
 
@@ -338,11 +262,13 @@ MyModel::MyModel(QObject *parent)
 \endcode
 
 In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
+?????(include section from 5_edit/mymodel.cpp)?????
 \code
 HIER FEHLT WAS!!!
 \endcode
 
 \l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
+?????(include section from 5_edit/mymodel.cpp)?????
 \code
 HIER FEHLT WAS!!!
 \endcode
@@ -363,49 +289,8 @@ This is how our example model looks so far:
 
 
 We want to, however, present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with QStandardItems, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
-\code
-#include <QTreeView>
-#include <QStandardItemModel>
-#include <QStandardItem>
-#include "modelview.h"
-
-
-const int ROWS = 2;
-const int COLUMNS = 3;
-
-ModelView::ModelView(QWidget *parent)
-    : QMainWindow(parent)
-{
-    treeView = new QTreeView(this);
-    setCentralWidget(treeView);
-    standardModel = new QStandardItemModel ;
-
-    QList<QStandardItem *> preparedColumn =prepareColumn("first", "second", "third");
-    QStandardItem *item = standardModel->invisibleRootItem();
-    // adding a row to the invisible root item produces a root element
-    item->appendRow(preparedColumn);
-
-    QList<QStandardItem *> secondRow =prepareColumn("111", "222", "333");
-    // adding a row to an item starts a subtree
-    preparedColumn.first()->appendRow(secondRow);
-
-    treeView->setModel( standardModel );
-    treeView->expandAll();
-}
-
-//---------------------------------------------------------------------------
-QList<QStandardItem *> ModelView::prepareColumn(const QString &first,
-                                                const QString &second,
-                                                const QString &third )
-{
-    QList<QStandardItem *> colItems;
-    colItems << new QStandardItem(first);
-    colItems << new QStandardItem(second);
-    colItems << new QStandardItem(third);
-    return colItems;
-}
-
-\endcode
+-------------------------------------------------------------modelview.cpp---------------------
+    \snippet examples/tutorials/modelview/6_treeview/modelview.cpp
 
 We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other QStandardItems. Nodes are collapsed and expanded within the view.
 
@@ -415,6 +300,7 @@ We want to access a selected item's content in order to output it into the windo
 
 
 So let's create a couple of items:
+?????(include section from 7_selections/modelview.cpp)?????
 \code
 #include <QTreeView>
 #include <QStandardItemModel>
@@ -462,6 +348,8 @@ ModelView::ModelView(QWidget *parent)
 \endcode
 
 Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
+
+?????(include section from 7_selections/modelview.cpp)?????
 \code
 HIER FEHLT WAS!!!
 \endcode
@@ -503,6 +391,8 @@ QDirModel (deprecated)
 In all examples so far, data is presented as text or a checkbox in a cell and is edited as text or a checkbox. The component that provides these presentation and editing services is called a “delegate.” We are only just beginning to work with the delegate because the view uses a default delegate.  But imagine that we want to have a different editor.(e.g. a slider or a drop down list) Or imagine that we want to present data as graphics. Let's take a look at an example called Stardelegate, (  \l{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html}{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html} ) in which stars are used to show a rating: \image stardelegate.png
 
 The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemModel::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
+
+!!!!!I CAN'T FIND THIS FILE!!!!!
 \code
  class StarDelegate : public QStyledItemDelegate
  {
-- 
cgit v0.12


From 6de484f195366b560e10f95b04d2f0e7303a2b63 Mon Sep 17 00:00:00 2001
From: Roland Wolf <ext-roland.wolf@nokia.com>
Date: Tue, 22 Jun 2010 14:26:05 +0200
Subject: integrating modelview tutorial in the build system, first attempt

---
 doc/src/frameworks-technologies/modelview.qdoc | 730 ------------------------
 doc/src/tutorials/modelview.qdoc               | 732 +++++++++++++++++++++++++
 examples/tutorials/modelview/modelview.pro     |  10 +
 examples/tutorials/modelview/qmake.pro         |  10 -
 examples/tutorials/tutorials.pro               |   4 +-
 5 files changed, 745 insertions(+), 741 deletions(-)
 delete mode 100755 doc/src/frameworks-technologies/modelview.qdoc
 create mode 100755 doc/src/tutorials/modelview.qdoc
 create mode 100755 examples/tutorials/modelview/modelview.pro
 delete mode 100755 examples/tutorials/modelview/qmake.pro

diff --git a/doc/src/frameworks-technologies/modelview.qdoc b/doc/src/frameworks-technologies/modelview.qdoc
deleted file mode 100755
index 5f9969b..0000000
--- a/doc/src/frameworks-technologies/modelview.qdoc
+++ /dev/null
@@ -1,730 +0,0 @@
-/*!
-
-    \contentspage{modelview.html}{Crash Course in Model/View Programming}
-    \page modelview.html
-
-\title Crash Course in Model/View Programming
-Contents:
-\tableofcontents
-
-\section1 1 Introduction
-Model/View is a technology used to separate data from views in widgets that handle data sets. Standard Widgets are not designed for separating data from views and this is why Qt 4 has two different types of widgets. Both types of widgets look the same, but they interact with data differently.
-    \table
-        \row
-            \o  Standard widgets use data that is part of the widget.
-            \o  \image standardwidget.png
-        \row
-            \o  View classes operate on external data (the model)
-            \o  \image modelview.png
-    \endtable
-\section2 1.1 Standard widgets
-Let's have a closer look at a standard table widget. A table widget is a 2D array of the data elements that the user can change. The table widget can be integrated into a program flow by reading and writing the data elements that the table widget provides. This method is very intuitive and useful in many applications.
-
-Displaying and editing a database table with a standard table widget can be problematic. Two copies of the data have to be coordinated: one outside the widget; one inside the widget. The developer needs to know where up-to-date data is so the both copies contain the most recent data. The tight coupling of presentation and data makes it harder to write unit tests.
-
-\section2 1.2 Model/View to the rescue
-Model/View stepped up to provide a solution that uses a more versatile architecture. Model/View eliminates the data consistency problems that may occur with standard widgets. Model/View also makes it easier to use more than one view of the same data because one model can be passed on to many views. The most important difference is that model/view widgets do not store data behind the table cells. In fact, they operate directly from your data. Since view classes do not know your data's structure, you need to provide a wrapper to make your data conform to the \l QAbstractItemModel interface. A view uses this interface to read from and write to your data and any class that implements \l QAbstractItemModel is a model. Once the view receives a pointer to a model, it will read and display its content and be its editor.
-
-\section2 1.3 Overview of  the model/view widgets
-Here is an overview of the model/view widgets and their corresponding standard widgets.
-    \table
-        \header
-            \o  Widget
-            \o  Standard Widget
-(a convenience class with data in the widget)
-            \o  Model/View View Class (for use with external data)
-        \row
-            \o  \image listview.png
-            \o  \l QListWidget
-            \o  \l QListView
-        \row
-            \o  \image tableview.png
-            \o  \l QTableWidget
-            \o  \l QTableView
-        \row
-            \o  \image treeview.png
-            \o  \l QTreeWidget
-            \o  \l QTreeView
-        \row
-            \o  \image columnview.png
-            \o   
-            \o  \l QColumnView shows a tree as a hierarchy of lists
-        \row
-            \o  \image combobox.png
-            \o {2, 1} \l QComboBox can work as both a view class and also as a traditional widget
-    \endtable
-\section2 1.4 Having adapters between forms and models can come in handy.
-We often prefer editing data stored in tables (e.g. in database tables) in forms rather than in tables. There is no direct model/view counterpart for separating data and views for widgets that operate on one value instead of a dataset, so we need an adapter in order to connect the form to the source of  data.
-
-\l QDataWidgetMapper is a great solution because it maps form widgets to a table row and it makes it very easy to build forms for database tables. \image widgetmapper.png
-
-Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter. \image qcompleter.png
-
-\section1 2 A Simple Model/View Application
-If you want to develop a model/view application, where should you start? We recommend starting with a simple example and extending it step-by-step. This makes understanding the architecture a lot easier. Trying to understand the model/view architecture in detail before invoking the IDE has proven to be less convenient for many developers. It is substantially easier to start with a simple model/view application that has demo data. Give it a try! Simply replace the data in the examples below with your own.
-
-Below are 7 very simple and independent applications that show different sides of model/view programming. The source code can be downloaded from  @todo___________paste link here_________________________
-
-\section2 2.1 A read only table
-We start with an application that uses a \l QTableView to show data. We will add editing capabilities later. 
-
--------------------------------------------------------------main.cpp---------------------
-    \snippet examples/tutorials/modelview/1_readonly/main.cpp
-
-We have the usual main() function;
--------------------------------------------------------------modelview.h---------------------
-    \snippet examples/tutorials/modelview/1_readonly/modelview.h
-
-The application is a \l QMainWindow that holds a \l QTableView.  
-
--------------------------------------------------------------modelview.cpp---------------------
-    \snippet examples/tutorials/modelview/1_readonly/modelview.cpp
-
-Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView::}{tableView()} OR \l QTableView::tableView() OR \l QTableView::tableView .  \l {QTableView::}{tableView} will invoke the methods of the pointer it has received to find out two things: 
-    \list
-       \o   How many rows and columns should be displayed
-       \o   What content should be printed into each cell.
-    \endlist
-
-The model needs some code to respond to this. 
-
-We have a table data set, so let's start with QAbstractTableModel since it is easier to use.
--------------------------------------------------------------mymodel.h---------------------
-    \snippet examples/tutorials/modelview/1_readonly/mymodel.h
-
-QAbstractTableModel requires the implementation of three abstract methods.
-
-
--------------------------------------------------------------mymodel.cpp---------------------
-    \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp
-
-The number of rows and columns is set by \c MyModel::rowCount() and \c MyModel::columnCount(). 
-When the view has to know what the cell 's text is, it calls the \l{QAbstractItemModel::data()}{data()} method. Row and column information is specified with parameter \c index and the role is set to Qt::Display Role.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
-
-This small example demonstrates the passive nature of a model. The model does not know when it will be used or which data is needed. It simply provides data each time the view requests it. 
-
-What happens when the model 's data needs to be changed? How does the view know when data changes and needs to be read again? The model has to emit a signal that indicates what range of cells has changed.  This will be demonstrated in section 2.3.
-
-\section2 2.2 Extending the read only example with roles
-In addition to controlling what text the view displays, the model also controls the text's appearance. When we slightly change the model, we get the following result: \image readonlytable_role.png
-
-
-In fact, nothing except for the \l{QAbstractItemModel::data()}{data()} method needs to be changed to set fonts, background colour, alignment and a checkbox. Here is the \l{QAbstractItemModel::data()}{data()} method that produces the result shown above:
-
--------------------------------------------------------------mymodel.cpp---------------------
-    \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp
-
-Each formatting property will be requested from the model with a separate call to the \l{QAbstractItemModel::data()}{data()} method. The \c role parameter is used to let the model know which property is being requested:
-
-    \table
-        \header
-            \o  Role (enum Qt::ItemDataRole )
-            \o  Meaning
-            \o  Type 
-        \row
-            \o  Qt::DisplayRole
-            \o  text
-            \o  QString
-        \row
-            \o  Qt::FontRole
-            \o  font
-            \o  QFont
-        \row
-            \o  Qt::BackgroundRole
-            \o  brush for the background of the cell
-            \o  QBrush
-        \row
-            \o  Qt::TextAlignmentRole
-            \o  text alignment
-            \o  enum Qt::AlignmentFlag
-        \row
-	    \o {1, 3} Qt::CheckStateRole
-	    \o {1, 3} suppresses checkboxes with QVariant(), sets checkboxes with Qt::Checked or Qt::Unchecked
-	    \o {1, 3} enum Qt::ItemDataRole
-
-    \endtable
-
-Refer to Qt documentation to learn more about  enum Qt::ItemDataRole's capabilities.
-
-
-Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()}) is invoked and expensive lookup operations are cached.
-
-\section2 2.3 A clock inside a table cell
-\image clock.png
-
-We still have a read only table, but this time the content changes every second because we are showing the current time.
-
-!!!!!I CAN'T FIND THIS FILE!!!!!
-\code
-QVariant MyModel::data(const QModelIndex &index, int role ) const
-{
-    QVariant returnVal;
-    int row = index.row();
-    int col = index.column();
-
-    if(role == Qt::DisplayRole)
-
-    {
-        if(row == 0 && col == 0 )
-        {
-            returnVal = QTime::currentTime().toString();
-       }
-    }
-    return returnVal;
-}
-\endcode
-
-Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
-
-?????(include section from 3_changingmodel/mymodel.cpp)?????
-\code
-MyModel::MyModel(QObject *parent)
-    :QAbstractTableModel(parent)
-{
-//    selectedCell = 0;
-    timer = new QTimer(this);
-    timer->setInterval(1000);
-    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
-    timer->start();
-}
-\endcode
-
-Here is the corresponding slot:
-
-?????(include section from 3_changingmodel/mymodel.cpp)?????
-\code
-
-void MyModel::timerHit()
-{
-    //we identify the top left cell
-    QModelIndex topLeft = createIndex ( 0,0 );
-    //emit a signal to make the view reread identified data
-    emit dataChanged ( topLeft, topLeft );
-}
-\endcode
-
-We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QAbstractItemModel::setModel()}{setModel()} .
-
-\section2 2.4 Setting up Headers for Columns and Rows
-Headers can be hidden via a view method. 
-\c tableView->verticalHeader()->hide();
-\image header.png
-
-
-The header content, however , is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
-
-
-?????(include section from 4_headers/mymodel.cpp)?????
-\code
-QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-    if (role == Qt::DisplayRole)
-    {
-        if (orientation == Qt::Horizontal) {
-            switch (section)
-            {
-            case 0:
-                return QString("first");
-            case 1:
-                return QString("second");
-            case 2:
-                return QString("third");
-            }
-        }
-    }
-    return QVariant();
-}
-\endcode
-
-
-\section2 2.5 The minimal Editing example
-In this example, we are going to build an application that automatically populates a window title with content by repeating values entered into table cells.
-
-The model decides whether editing capabilities are available . We only have to modify the model in order for the available editing capabilities to be enabled. This is done by reimplementing the following virtual methods:  \l{QAbstractItemModel::setData()}{setData()} and \l{QAbstractItemModel::flags()}{flags()}. 
--------------------------------------------------------------mymodel.h---------------------
-    \snippet examples/tutorials/modelview/5_edit/mymodel.h
-
-We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
-
-?????(include section from 5_edit/mymodel.cpp)?????
-\code
-#include "mymodel.h"
-
-const int COLS= 3;
-const int ROWS= 2;
-
-MyModel::MyModel(QObject *parent)
-    :QAbstractTableModel(parent)
-{
-    //gridData needs to have 6 element, one for each table cell
-    m_gridData << "1/1" << "1/2" << "1/3" << "2/1" << "2/2" << "2/3" ;
-}
-\endcode
-
-In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
-?????(include section from 5_edit/mymodel.cpp)?????
-\code
-HIER FEHLT WAS!!!
-\endcode
-
-\l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
-?????(include section from 5_edit/mymodel.cpp)?????
-\code
-HIER FEHLT WAS!!!
-\endcode
-
-Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
-
-\section1 3 Intermediate Topics
-\section2 3.1 TreeView
-You can convert the example above into an application with a tree view. Simply replace QTableView with QTreeView, which results in a read/write tree. No changes have to be made to the model. The tree won't have any hierarchies because there aren't any hierarchies in the model itself.
-\image dummy_tree.png
-
-
-QListView, QTableView and QTreeView all use a model abstraction, which is a merged list, table and tree. This makes it possible to use several different types of view classes from the same model.
-\image list_table_tree.png
-
-This is how our example model looks so far:
-\image example_model.png
-
-
-We want to, however, present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with QStandardItems, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
--------------------------------------------------------------modelview.cpp---------------------
-    \snippet examples/tutorials/modelview/6_treeview/modelview.cpp
-
-We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other QStandardItems. Nodes are collapsed and expanded within the view.
-
-\section2 3.2 Working with selection
-We want to access a selected item's content in order to output it into the window title together with the hierarchy level.
-\image selection2.png
-
-
-So let's create a couple of items:
-?????(include section from 7_selections/modelview.cpp)?????
-\code
-#include <QTreeView>
-#include <QStandardItemModel>
-#include <QItemSelectionModel>
-#include "modelview.h"
-
-ModelView::ModelView(QWidget *parent)
-    : QMainWindow(parent)
-{
-    treeView = new QTreeView(this);
-    setCentralWidget(treeView);
-    standardModel = new QStandardItemModel ;
-    QStandardItem *rootNode = standardModel->invisibleRootItem();
-
-
-    //defining a couple of items
-    QStandardItem *americaItem = new QStandardItem("America");
-    QStandardItem *mexicoItem =  new QStandardItem("Canada");
-    QStandardItem *usaItem =     new QStandardItem("USA");
-    QStandardItem *bostonItem =  new QStandardItem("Boston");
-    QStandardItem *europeItem =  new QStandardItem("Europe");
-    QStandardItem *italyItem =   new QStandardItem("Italy");
-    QStandardItem *romeItem =    new QStandardItem("Rome");
-    QStandardItem *veronaItem =  new QStandardItem("Verona");
-
-    //building up the hierarchy
-    rootNode->    appendRow(americaItem);
-    rootNode->    appendRow(europeItem);
-    americaItem-> appendRow(mexicoItem);
-    americaItem-> appendRow(usaItem);
-    usaItem->     appendRow(bostonItem);
-    europeItem->  appendRow(italyItem);
-    italyItem->   appendRow(romeItem);
-    italyItem->   appendRow(veronaItem);
-    
-    //register the model
-    treeView->setModel( standardModel );
-    treeView->expandAll();
-
-    //selection changes shall trigger a slot
-    QItemSelectionModel *selectionModel= treeView->selectionModel();
-    connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
-            this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
-}
-\endcode
-
-Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
-
-?????(include section from 7_selections/modelview.cpp)?????
-\code
-HIER FEHLT WAS!!!
-\endcode
-
-We get the model index that corresponds to the selection by calling 
-\c treeView->selectionModel()->currentIndex() and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed QModelIndex(). This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
-
-The selection model (as shown above) can be retrieved, but it can also be set with \c QAbstractItemView::setSelectionModel. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemModel::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemModel::setSelectionModel()}{setSelectionModel()};
-\section2 3.3 Predefined Models
-The typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures. If one of the available data structures is suitable for your application, a predefined model can be a good choice.
-
-    \table
-        \row
-            \o  QStringListModel
-            \o  Stores a list of strings
-        \row
-            \o  QStandardItemModel
-            \o  Stores arbitrary hierarchical items
-        \row
-            \o  {1, 2}  QFileSystemModel
-QDirModel (deprecated)
-            \o  {1, 2}  Encapsulate the local file system
-        \row
-            \o  QSqlQueryModel
-            \o  Encapsulate an SQL result set
-        \row
-            \o  QSqlTableModel
-            \o  Encapsulates an SQL table
-        \row
-            \o  QSqlRelationalTableModel
-            \o  Encapsulates an SQL table with foreign keys
-        \row
-            \o  QSortFilterProxyModel
-            \o  Sorts and/or filters another model
-
-    \endtable
-
-\section2 3.4 Delegates
-In all examples so far, data is presented as text or a checkbox in a cell and is edited as text or a checkbox. The component that provides these presentation and editing services is called a “delegate.” We are only just beginning to work with the delegate because the view uses a default delegate.  But imagine that we want to have a different editor.(e.g. a slider or a drop down list) Or imagine that we want to present data as graphics. Let's take a look at an example called Stardelegate, (  \l{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html}{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html} ) in which stars are used to show a rating: \image stardelegate.png
-
-The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemModel::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
-
-!!!!!I CAN'T FIND THIS FILE!!!!!
-\code
- class StarDelegate : public QStyledItemDelegate
- {
-     Q_OBJECT
- public:
-     StarDelegate(QWidget *parent = 0); 
-     void paint(QPainter *painter, const QStyleOptionViewItem &option,
-                const QModelIndex &index) const;
-     QSize sizeHint(const QStyleOptionViewItem &option,
-                    const QModelIndex &index) const;
- };
-
-\endcode
-
-\l{QAbstractItemModel::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \c index.data(). \c SizeHint specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
-
-Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
-
-\section2 3.5 Debugging with ModelTest
-The passive nature of models provides new challenges for programmers. Inconsistencies in the model can cause the application to crash. Since the model is hit by numerous calls from the view, it is hard to find out which call has crashed the application and which operation has introduced the problem. 
-
-Qt provides software called ModelTest, which checks models while your programming is running. Every time the model is changed, ModelTest scans the model and reports errors with an assert. This is especially important for tree models, since their hierarchical nature leaves many possibilities for subtle inconsistencies. http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
-
-Unlike view classes, ModelTest uses out of range indexes to test the model.  This means your application may crash with ModelTest even if it runs perfectly without it. So you also need to handle all of the indexes that are out of range when using ModelTest. 
-
-
-
-
-
-
-
-
-
-\section2 3.6 Model/View NG
-
-\image path.png
-
-Model/View was introduced in Qt 4.0 and is a frequently used technology. Feedback from clients and new development trends have shown, that there is a need to further develop the model/view technology. Therefore a research project at Nokia is looking into ways to go beyond the current implementation.
-
-One limitation of model/view is that view classes are basically all fixed grids. It is possible, but really hard to make a list view with icons placed on a curve; or cells expanding on mouse over events to show additional information. In order to achieve graphically rich view experiences, Model/View NG will use QGraphicsView to render elements. Nodel/View NG also aims to make model/view programming more intuitive. One way to achieve this is to have  separate models for lists, tables and trees. The current model abstraction is complex because it is capable of representing a list, a table or a tree. 
-
-Model/View NG is a research project. You are welcome to checkout the source code, monitor progress and take part in discussions at the following address:  \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
-
-\section1 4 Good Sources for Additional Information
-\section2 4.1 Books
-Model/View programming is covered quite extensively in the documentation of Qt but also in several good books. 
-    \list 1
-       \o   1.C++ GUI Programming with Qt 4 / Jasmin Blanchette, Mark Summerfield, Prentice Hall, 2nd edition, ISBN 0-13-235416-0
-also available in German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung, Addison-Wesley, ISBN 3-827327-29-6
-       \o   1.The Book of Qt4, The Art of Building Qt Applications / Daniel Molkentin,  Open Source Press ISBN 1-59327-147-6
-Translated from: Qt 4, Einführung in die Applikationsentwicklung, Open Source Press, ISBN 3-937514-12-0
-       \o   1.Foundations of Qt Development / Johan Thelin, Apress, ISBN 1-59059-831-8
-    \endlist
-
-
-The following list provides an overview of example programs contained in the books above. Some of them make very good templates for developing similar applications. 
-
-    \table
-        \header
-            \o  example name
-            \o  view class used
-            \o  model used
-            \o  aspects touched
-            \o  
-        \row
-            \o  Team Leaders
-            \o  QListview
-            \o  QStringListModel
-            \o  
-            \o  Book 1, Chapter 10, Figure 10.6
-        \row
-            \o  Directory Viewer
-            \o  QTreeView
-            \o  QDirModel
-            \o  
-            \o  Book 1, Chapter 10, Figure 10.7
-        \row
-            \o  Color Names
-            \o  QListView
-            \o  QSortFilterProxyModel
-applied to QStringListModel
-            \o  
-            \o  Book 1, Chapter 10, Figure 10.8
-        \row
-            \o  Currencies
-            \o  QTableView
-            \o  custom model based on
-QAbstractTableModel
-            \o  read only
-            \o  Book 1, Chapter 10, Figure 10.10
-        \row
-            \o  Cities
-            \o  QTableView
-            \o  custom model based on
-QAbstractTableModel
-            \o  read / write
-            \o  Book 1, Chapter 10, Figure 10.12
-        \row
-            \o  Boolean Parser
-            \o  QTreeView
-            \o  custom model based on
-QAbstractItemModel
-            \o  read only
-            \o  Book 1, Chapter 10, Figure 10.14
-        \row
-            \o  Track Editor
-            \o  {2, 1} QTableWidget
-            \o  custom delegate providing a custom editor
-            \o  Book 1, Chapter 10, Figure 10.15
-
-        \row
-            \o  Four directory views
-            \o  QListView
-QTableView
-QTreeView
-            \o  QDirModel
-            \o  demonstrates the use of multiple views
-            \o  Book2, Chapter 8.2
-        \row
-            \o  Address Book
-            \o  QListView
-QTableView
-QTreeView
-            \o  custom model based on
-QAbstractTableModel
-            \o  read / write
-            \o  Book2, Chapter 8.4
-        \row
-            \o  Address Book with sorting
-            \o  
-            \o  QProxyModel
-            \o  introducing sort and filter capabilities
-            \o  Book2, Chapter 8.5
-        \row
-            \o  Address Book 
-with checkboxes
-            \o  
-            \o  
-            \o  introducing checkboxes
-in model/view
-            \o  Book2, Chapter 8.6
-        \row
-            \o  Address Book 
-with transposed grid
-            \o  
-            \o  custom proxy Model based on QAbstractProxyModel
-            \o  introducing a custom model
-            \o  Book2, Chapter 8.7
-        \row
-            \o  Address Book
-with drag and drop
-            \o  
-            \o  
-            \o  introducing drag and drop support
-            \o  Book2, Chapter 8.8
-        \row
-            \o  Address Book with custom editor
-            \o  
-            \o  
-            \o  introducing custom delegates
-            \o  Book2, Chapter 8.9
-        \row
-            \o  Views
-            \o  QListView
-QTableView
-QTreeView
-            \o  QStandardItemModel
-            \o  read only
-            \o  Book 3, Chapter 5, figure 5-3
-        \row
-            \o  Bardelegate
-            \o  QTableView
-            \o  
-            \o  custom delegate for presentation based on QAbstractItemDelegate
-            \o  Book 3, Chapter 5, figure 5-5
-        \row
-            \o  Editdelegate
-            \o  QTableView
-            \o  
-            \o  custom delegate for editing based on QAbstractItemDelegate
-            \o  Book 3, Chapter 5, figure 5-6
-        \row
-            \o  Singleitemview
-            \o  custom view based on 
-QAbstractItemView
-            \o  
-            \o  custom view
-            \o  Book 3,
-Chapter 5,
-figure 5-7
-        \row
-            \o  listmodel
-            \o  QTableView
-            \o  custom Model based on
-QAbstractTableModel
-            \o  read only
-            \o  Book 3,
-Chapter 5,
-Figure 5-8
-        \row
-            \o  treemodel
-            \o  QTreeView
-            \o  custom Model based on
-QAbstractItemModel
-            \o  read only
-            \o  Book 3,
-Chapter 5,
-Figure 5-10
-        \row
-            \o  edit integers
-            \o  QListView
-            \o  custom Model based on 
-QAbstractListModel
-            \o  read / write
-            \o  Book 3,
-Chapter 5,
-Listing 5-37, Figure 5-11
-        \row
-            \o  sorting
-            \o  QTableView
-            \o  QSortFilterProxyModel
-applied to QStringListModel
-            \o  demonstrates sorting
-            \o  Book 3, Chapter 5, Figure 5-12
-
-    \endtable
-
-
-\section2 4.2 Qt documentation
-Qt 4.6 comes with 17 examples and 2 Demonstrations for model/view.  The examples can be found here:  \l{http://doc.qt.nokia.com/4.6/examples-itemviews.html}{http://doc.qt.nokia.com/4.6/examples-itemviews.html}
-    \table
-        \header
-            \o  example name
-            \o  view class used
-            \o  model used
-            \o  aspects touched
-        \row
-            \o  Address Book
-            \o  QTableView
-            \o  QTableModel
-QSortFilterProxyModel
-            \o  usage of  QSortFilterProxyModel to generate different subsets from one data pool
-        \row
-            \o  Basic Sort/Filter Model
-            \o  QTreeView
-            \o  QStandardItemModel
-QSortFilterProxyModel
-            \o  
-        \row
-            \o  Chart
-            \o  custom view
-            \o  QStandardItemModel
-            \o  designing custom views that cooperate with selection models 
-        \row
-            \o  Color Editor Factory
-            \o  {2, 1}  QTableWidget
-            \o  enhancing the standard delegate with a new custom editor to choose colours
-        \row
-            \o  Combo Widget Mapper
-            \o  QDataWidgetMapper to map QLineEdit, QTextEdit and QComboBox
-            \o  QStandardItemModel
-            \o  shows how a QComboBox can serve as a view class
-        \row
-            \o  Custom Sort/Filter Model
-            \o  QTreeView
-            \o  QStandardItemModel
-QSortFilterProxyModel
-            \o  subclass QSortFilterProxyModel
-for advanced sorting and filtering
-        \row
-            \o  Dir View
-            \o  QTreeView
-            \o  QDirModel
-            \o  very small example to demonstrate how to assign a model to a view
-        \row
-            \o  Editable Tree Model
-            \o  QTreeView
-            \o  custom tree model
-            \o  comprehensive example for working with trees, demonstrates editing cells and tree structure with an underlying custom model  
-        \row
-            \o  Fetch More
-            \o  QListView
-            \o  custom list model
-            \o  dynamically changing model 
-        \row
-            \o  Frozen Column
-            \o  QTableView
-            \o  QStandardItemModel
-            \o  
-        \row
-            \o  Pixelator
-            \o  QTableView
-            \o  custom table model
-            \o  implementation of a custom delegate
-        \row
-            \o  Puzzle
-            \o  QListView
-            \o  custom list model
-            \o  model/view with drag and drop 
-        \row
-            \o  Simple DOM Model
-            \o  QTreeView
-            \o  custom tree model
-            \o  read only example for a custom tree model
-        \row
-            \o  Simple Tree Model
-            \o  QTreeView
-            \o  custom tree model
-            \o  read only example for a custom tree model
-        \row
-            \o  Simple Widget Mapper
-            \o  QDataWidgetMapper to map QLineEdit, QTextEdit and QSpinBox
-            \o  QStandardItemModel
-            \o  basic QDataWidgetMapper usage
-        \row
-            \o  Spin Box Delegate
-            \o  QTableView
-            \o  QStandardItemModel
-            \o  custom delegate that uses a spin box as a cell editor
-        \row
-            \o  Star Delegate
-            \o  {2, 1}  QTableWidget
-            \o  comprehensive custom delegate example. 
-    \endtable
-
-Demonstrations are similar to examples except that no walk-through is provided  for the code lines. Demonstrations are also sometimes more feature rich. 
- \l{http://doc.qt.nokia.com/4.6/demos.html}{http://doc.qt.nokia.com/4.6/demos.html}
-    \list
-       \o   The \bold Interview demonstration shows the same model and selection being shared between three different views. 
-       \o   Demonstration \bold Spreadsheet demonstrates the use of a table view as a spreadsheet, using custom delegates to render each item according to the type of data it contains.
-    \endlist
-
-A reference documentation for model/view technology is also available. \l{http://doc.qt.nokia.com/4.6/model-view-programming.html}{http://doc.qt.nokia.com/4.6/model-view-programming.html}
-
-*/
\ No newline at end of file
diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
new file mode 100755
index 0000000..1be4b46
--- /dev/null
+++ b/doc/src/tutorials/modelview.qdoc
@@ -0,0 +1,732 @@
+/*!
+
+    \page modelview.html
+    \startpage {index.html}{Qt Reference Documentation}
+    \contentspage Tutorials
+    \contentspage{modelview.html}{Crash Course in Model/View Programming}
+
+\title Crash Course in Model/View Programming
+Contents:
+\tableofcontents
+
+\section1 1 Introduction
+Model/View is a technology used to separate data from views in widgets that handle data sets. Standard Widgets are not designed for separating data from views and this is why Qt 4 has two different types of widgets. Both types of widgets look the same, but they interact with data differently.
+    \table
+        \row
+            \o  Standard widgets use data that is part of the widget.
+            \o  \image standardwidget.png
+        \row
+            \o  View classes operate on external data (the model)
+            \o  \image modelview.png
+    \endtable
+\section2 1.1 Standard widgets
+Let's have a closer look at a standard table widget. A table widget is a 2D array of the data elements that the user can change. The table widget can be integrated into a program flow by reading and writing the data elements that the table widget provides. This method is very intuitive and useful in many applications.
+
+Displaying and editing a database table with a standard table widget can be problematic. Two copies of the data have to be coordinated: one outside the widget; one inside the widget. The developer needs to know where up-to-date data is so the both copies contain the most recent data. The tight coupling of presentation and data makes it harder to write unit tests.
+
+\section2 1.2 Model/View to the rescue
+Model/View stepped up to provide a solution that uses a more versatile architecture. Model/View eliminates the data consistency problems that may occur with standard widgets. Model/View also makes it easier to use more than one view of the same data because one model can be passed on to many views. The most important difference is that model/view widgets do not store data behind the table cells. In fact, they operate directly from your data. Since view classes do not know your data's structure, you need to provide a wrapper to make your data conform to the \l QAbstractItemModel interface. A view uses this interface to read from and write to your data and any class that implements \l QAbstractItemModel is a model. Once the view receives a pointer to a model, it will read and display its content and be its editor.
+
+\section2 1.3 Overview of  the model/view widgets
+Here is an overview of the model/view widgets and their corresponding standard widgets.
+    \table
+        \header
+            \o  Widget
+            \o  Standard Widget
+(a convenience class with data in the widget)
+            \o  Model/View View Class (for use with external data)
+        \row
+            \o  \image listview.png
+            \o  \l QListWidget
+            \o  \l QListView
+        \row
+            \o  \image tableview.png
+            \o  \l QTableWidget
+            \o  \l QTableView
+        \row
+            \o  \image treeview.png
+            \o  \l QTreeWidget
+            \o  \l QTreeView
+        \row
+            \o  \image columnview.png
+            \o   
+            \o  \l QColumnView shows a tree as a hierarchy of lists
+        \row
+            \o  \image combobox.png
+            \o {2, 1} \l QComboBox can work as both a view class and also as a traditional widget
+    \endtable
+\section2 1.4 Having adapters between forms and models can come in handy.
+We often prefer editing data stored in tables (e.g. in database tables) in forms rather than in tables. There is no direct model/view counterpart for separating data and views for widgets that operate on one value instead of a dataset, so we need an adapter in order to connect the form to the source of  data.
+
+\l QDataWidgetMapper is a great solution because it maps form widgets to a table row and it makes it very easy to build forms for database tables. \image widgetmapper.png
+
+Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter. \image qcompleter.png
+
+\section1 2 A Simple Model/View Application
+If you want to develop a model/view application, where should you start? We recommend starting with a simple example and extending it step-by-step. This makes understanding the architecture a lot easier. Trying to understand the model/view architecture in detail before invoking the IDE has proven to be less convenient for many developers. It is substantially easier to start with a simple model/view application that has demo data. Give it a try! Simply replace the data in the examples below with your own.
+
+Below are 7 very simple and independent applications that show different sides of model/view programming. The source code can be downloaded from  @todo___________paste link here_________________________
+
+\section2 2.1 A read only table
+We start with an application that uses a \l QTableView to show data. We will add editing capabilities later. 
+
+-------------------------------------------------------------main.cpp---------------------
+    \snippet examples/tutorials/modelview/1_readonly/main.cpp
+
+We have the usual main() function;
+-------------------------------------------------------------modelview.h---------------------
+    \snippet examples/tutorials/modelview/1_readonly/modelview.h
+
+The application is a \l QMainWindow that holds a \l QTableView.  
+
+-------------------------------------------------------------modelview.cpp---------------------
+    \snippet examples/tutorials/modelview/1_readonly/modelview.cpp
+
+Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView::}{tableView()} OR \l QTableView::tableView() OR \l QTableView::tableView .  \l {QTableView::}{tableView} will invoke the methods of the pointer it has received to find out two things: 
+    \list
+       \o   How many rows and columns should be displayed
+       \o   What content should be printed into each cell.
+    \endlist
+
+The model needs some code to respond to this. 
+
+We have a table data set, so let's start with QAbstractTableModel since it is easier to use.
+-------------------------------------------------------------mymodel.h---------------------
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.h
+
+QAbstractTableModel requires the implementation of three abstract methods.
+
+
+-------------------------------------------------------------mymodel.cpp---------------------
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp
+
+The number of rows and columns is set by \c MyModel::rowCount() and \c MyModel::columnCount(). 
+When the view has to know what the cell 's text is, it calls the \l{QAbstractItemModel::data()}{data()} method. Row and column information is specified with parameter \c index and the role is set to Qt::Display Role.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
+
+This small example demonstrates the passive nature of a model. The model does not know when it will be used or which data is needed. It simply provides data each time the view requests it. 
+
+What happens when the model 's data needs to be changed? How does the view know when data changes and needs to be read again? The model has to emit a signal that indicates what range of cells has changed.  This will be demonstrated in section 2.3.
+
+\section2 2.2 Extending the read only example with roles
+In addition to controlling what text the view displays, the model also controls the text's appearance. When we slightly change the model, we get the following result: \image readonlytable_role.png
+
+
+In fact, nothing except for the \l{QAbstractItemModel::data()}{data()} method needs to be changed to set fonts, background colour, alignment and a checkbox. Here is the \l{QAbstractItemModel::data()}{data()} method that produces the result shown above:
+
+-------------------------------------------------------------mymodel.cpp---------------------
+    \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp
+
+Each formatting property will be requested from the model with a separate call to the \l{QAbstractItemModel::data()}{data()} method. The \c role parameter is used to let the model know which property is being requested:
+
+    \table
+        \header
+            \o  Role (enum Qt::ItemDataRole )
+            \o  Meaning
+            \o  Type 
+        \row
+            \o  Qt::DisplayRole
+            \o  text
+            \o  QString
+        \row
+            \o  Qt::FontRole
+            \o  font
+            \o  QFont
+        \row
+            \o  Qt::BackgroundRole
+            \o  brush for the background of the cell
+            \o  QBrush
+        \row
+            \o  Qt::TextAlignmentRole
+            \o  text alignment
+            \o  enum Qt::AlignmentFlag
+        \row
+	    \o {1, 3} Qt::CheckStateRole
+	    \o {1, 3} suppresses checkboxes with QVariant(), sets checkboxes with Qt::Checked or Qt::Unchecked
+	    \o {1, 3} enum Qt::ItemDataRole
+
+    \endtable
+
+Refer to Qt documentation to learn more about  enum Qt::ItemDataRole's capabilities.
+
+
+Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()}) is invoked and expensive lookup operations are cached.
+
+\section2 2.3 A clock inside a table cell
+\image clock.png
+
+We still have a read only table, but this time the content changes every second because we are showing the current time.
+
+!!!!!I CAN'T FIND THIS FILE!!!!!
+\code
+QVariant MyModel::data(const QModelIndex &index, int role ) const
+{
+    QVariant returnVal;
+    int row = index.row();
+    int col = index.column();
+
+    if(role == Qt::DisplayRole)
+
+    {
+        if(row == 0 && col == 0 )
+        {
+            returnVal = QTime::currentTime().toString();
+       }
+    }
+    return returnVal;
+}
+\endcode
+
+Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
+
+?????(include section from 3_changingmodel/mymodel.cpp)?????
+\code
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+//    selectedCell = 0;
+    timer = new QTimer(this);
+    timer->setInterval(1000);
+    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
+    timer->start();
+}
+\endcode
+
+Here is the corresponding slot:
+
+?????(include section from 3_changingmodel/mymodel.cpp)?????
+\code
+
+void MyModel::timerHit()
+{
+    //we identify the top left cell
+    QModelIndex topLeft = createIndex ( 0,0 );
+    //emit a signal to make the view reread identified data
+    emit dataChanged ( topLeft, topLeft );
+}
+\endcode
+
+We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QAbstractItemModel::setModel()}{setModel()} .
+
+\section2 2.4 Setting up Headers for Columns and Rows
+Headers can be hidden via a view method. 
+\c tableView->verticalHeader()->hide();
+\image header.png
+
+
+The header content, however , is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
+
+
+?????(include section from 4_headers/mymodel.cpp)?????
+\code
+QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    if (role == Qt::DisplayRole)
+    {
+        if (orientation == Qt::Horizontal) {
+            switch (section)
+            {
+            case 0:
+                return QString("first");
+            case 1:
+                return QString("second");
+            case 2:
+                return QString("third");
+            }
+        }
+    }
+    return QVariant();
+}
+\endcode
+
+
+\section2 2.5 The minimal Editing example
+In this example, we are going to build an application that automatically populates a window title with content by repeating values entered into table cells.
+
+The model decides whether editing capabilities are available . We only have to modify the model in order for the available editing capabilities to be enabled. This is done by reimplementing the following virtual methods:  \l{QAbstractItemModel::setData()}{setData()} and \l{QAbstractItemModel::flags()}{flags()}. 
+-------------------------------------------------------------mymodel.h---------------------
+    \snippet examples/tutorials/modelview/5_edit/mymodel.h
+
+We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
+
+?????(include section from 5_edit/mymodel.cpp)?????
+\code
+#include "mymodel.h"
+
+const int COLS= 3;
+const int ROWS= 2;
+
+MyModel::MyModel(QObject *parent)
+    :QAbstractTableModel(parent)
+{
+    //gridData needs to have 6 element, one for each table cell
+    m_gridData << "1/1" << "1/2" << "1/3" << "2/1" << "2/2" << "2/3" ;
+}
+\endcode
+
+In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
+?????(include section from 5_edit/mymodel.cpp)?????
+\code
+HIER FEHLT WAS!!!
+\endcode
+
+\l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
+?????(include section from 5_edit/mymodel.cpp)?????
+\code
+HIER FEHLT WAS!!!
+\endcode
+
+Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
+
+\section1 3 Intermediate Topics
+\section2 3.1 TreeView
+You can convert the example above into an application with a tree view. Simply replace QTableView with QTreeView, which results in a read/write tree. No changes have to be made to the model. The tree won't have any hierarchies because there aren't any hierarchies in the model itself.
+\image dummy_tree.png
+
+
+QListView, QTableView and QTreeView all use a model abstraction, which is a merged list, table and tree. This makes it possible to use several different types of view classes from the same model.
+\image list_table_tree.png
+
+This is how our example model looks so far:
+\image example_model.png
+
+
+We want to, however, present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with QStandardItems, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
+-------------------------------------------------------------modelview.cpp---------------------
+    \snippet examples/tutorials/modelview/6_treeview/modelview.cpp
+
+We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other QStandardItems. Nodes are collapsed and expanded within the view.
+
+\section2 3.2 Working with selection
+We want to access a selected item's content in order to output it into the window title together with the hierarchy level.
+\image selection2.png
+
+
+So let's create a couple of items:
+?????(include section from 7_selections/modelview.cpp)?????
+\code
+#include <QTreeView>
+#include <QStandardItemModel>
+#include <QItemSelectionModel>
+#include "modelview.h"
+
+ModelView::ModelView(QWidget *parent)
+    : QMainWindow(parent)
+{
+    treeView = new QTreeView(this);
+    setCentralWidget(treeView);
+    standardModel = new QStandardItemModel ;
+    QStandardItem *rootNode = standardModel->invisibleRootItem();
+
+
+    //defining a couple of items
+    QStandardItem *americaItem = new QStandardItem("America");
+    QStandardItem *mexicoItem =  new QStandardItem("Canada");
+    QStandardItem *usaItem =     new QStandardItem("USA");
+    QStandardItem *bostonItem =  new QStandardItem("Boston");
+    QStandardItem *europeItem =  new QStandardItem("Europe");
+    QStandardItem *italyItem =   new QStandardItem("Italy");
+    QStandardItem *romeItem =    new QStandardItem("Rome");
+    QStandardItem *veronaItem =  new QStandardItem("Verona");
+
+    //building up the hierarchy
+    rootNode->    appendRow(americaItem);
+    rootNode->    appendRow(europeItem);
+    americaItem-> appendRow(mexicoItem);
+    americaItem-> appendRow(usaItem);
+    usaItem->     appendRow(bostonItem);
+    europeItem->  appendRow(italyItem);
+    italyItem->   appendRow(romeItem);
+    italyItem->   appendRow(veronaItem);
+    
+    //register the model
+    treeView->setModel( standardModel );
+    treeView->expandAll();
+
+    //selection changes shall trigger a slot
+    QItemSelectionModel *selectionModel= treeView->selectionModel();
+    connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
+            this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
+}
+\endcode
+
+Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
+
+?????(include section from 7_selections/modelview.cpp)?????
+\code
+HIER FEHLT WAS!!!
+\endcode
+
+We get the model index that corresponds to the selection by calling 
+\c treeView->selectionModel()->currentIndex() and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed QModelIndex(). This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
+
+The selection model (as shown above) can be retrieved, but it can also be set with \c QAbstractItemView::setSelectionModel. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemModel::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemModel::setSelectionModel()}{setSelectionModel()};
+\section2 3.3 Predefined Models
+The typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures. If one of the available data structures is suitable for your application, a predefined model can be a good choice.
+
+    \table
+        \row
+            \o  QStringListModel
+            \o  Stores a list of strings
+        \row
+            \o  QStandardItemModel
+            \o  Stores arbitrary hierarchical items
+        \row
+            \o  {1, 2}  QFileSystemModel
+QDirModel (deprecated)
+            \o  {1, 2}  Encapsulate the local file system
+        \row
+            \o  QSqlQueryModel
+            \o  Encapsulate an SQL result set
+        \row
+            \o  QSqlTableModel
+            \o  Encapsulates an SQL table
+        \row
+            \o  QSqlRelationalTableModel
+            \o  Encapsulates an SQL table with foreign keys
+        \row
+            \o  QSortFilterProxyModel
+            \o  Sorts and/or filters another model
+
+    \endtable
+
+\section2 3.4 Delegates
+In all examples so far, data is presented as text or a checkbox in a cell and is edited as text or a checkbox. The component that provides these presentation and editing services is called a “delegate.” We are only just beginning to work with the delegate because the view uses a default delegate.  But imagine that we want to have a different editor.(e.g. a slider or a drop down list) Or imagine that we want to present data as graphics. Let's take a look at an example called Stardelegate, (  \l{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html}{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html} ) in which stars are used to show a rating: \image stardelegate.png
+
+The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemModel::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
+
+!!!!!I CAN'T FIND THIS FILE!!!!!
+\code
+ class StarDelegate : public QStyledItemDelegate
+ {
+     Q_OBJECT
+ public:
+     StarDelegate(QWidget *parent = 0); 
+     void paint(QPainter *painter, const QStyleOptionViewItem &option,
+                const QModelIndex &index) const;
+     QSize sizeHint(const QStyleOptionViewItem &option,
+                    const QModelIndex &index) const;
+ };
+
+\endcode
+
+\l{QAbstractItemModel::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \c index.data(). \c SizeHint specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
+
+Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
+
+\section2 3.5 Debugging with ModelTest
+The passive nature of models provides new challenges for programmers. Inconsistencies in the model can cause the application to crash. Since the model is hit by numerous calls from the view, it is hard to find out which call has crashed the application and which operation has introduced the problem. 
+
+Qt provides software called ModelTest, which checks models while your programming is running. Every time the model is changed, ModelTest scans the model and reports errors with an assert. This is especially important for tree models, since their hierarchical nature leaves many possibilities for subtle inconsistencies. http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
+
+Unlike view classes, ModelTest uses out of range indexes to test the model.  This means your application may crash with ModelTest even if it runs perfectly without it. So you also need to handle all of the indexes that are out of range when using ModelTest. 
+
+
+
+
+
+
+
+
+
+\section2 3.6 Model/View NG
+
+\image path.png
+
+Model/View was introduced in Qt 4.0 and is a frequently used technology. Feedback from clients and new development trends have shown, that there is a need to further develop the model/view technology. Therefore a research project at Nokia is looking into ways to go beyond the current implementation.
+
+One limitation of model/view is that view classes are basically all fixed grids. It is possible, but really hard to make a list view with icons placed on a curve; or cells expanding on mouse over events to show additional information. In order to achieve graphically rich view experiences, Model/View NG will use QGraphicsView to render elements. Nodel/View NG also aims to make model/view programming more intuitive. One way to achieve this is to have  separate models for lists, tables and trees. The current model abstraction is complex because it is capable of representing a list, a table or a tree. 
+
+Model/View NG is a research project. You are welcome to checkout the source code, monitor progress and take part in discussions at the following address:  \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
+
+\section1 4 Good Sources for Additional Information
+\section2 4.1 Books
+Model/View programming is covered quite extensively in the documentation of Qt but also in several good books. 
+    \list 1
+       \o   1.C++ GUI Programming with Qt 4 / Jasmin Blanchette, Mark Summerfield, Prentice Hall, 2nd edition, ISBN 0-13-235416-0
+also available in German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung, Addison-Wesley, ISBN 3-827327-29-6
+       \o   1.The Book of Qt4, The Art of Building Qt Applications / Daniel Molkentin,  Open Source Press ISBN 1-59327-147-6
+Translated from: Qt 4, Einführung in die Applikationsentwicklung, Open Source Press, ISBN 3-937514-12-0
+       \o   1.Foundations of Qt Development / Johan Thelin, Apress, ISBN 1-59059-831-8
+    \endlist
+
+
+The following list provides an overview of example programs contained in the books above. Some of them make very good templates for developing similar applications. 
+
+    \table
+        \header
+            \o  example name
+            \o  view class used
+            \o  model used
+            \o  aspects touched
+            \o  
+        \row
+            \o  Team Leaders
+            \o  QListview
+            \o  QStringListModel
+            \o  
+            \o  Book 1, Chapter 10, Figure 10.6
+        \row
+            \o  Directory Viewer
+            \o  QTreeView
+            \o  QDirModel
+            \o  
+            \o  Book 1, Chapter 10, Figure 10.7
+        \row
+            \o  Color Names
+            \o  QListView
+            \o  QSortFilterProxyModel
+applied to QStringListModel
+            \o  
+            \o  Book 1, Chapter 10, Figure 10.8
+        \row
+            \o  Currencies
+            \o  QTableView
+            \o  custom model based on
+QAbstractTableModel
+            \o  read only
+            \o  Book 1, Chapter 10, Figure 10.10
+        \row
+            \o  Cities
+            \o  QTableView
+            \o  custom model based on
+QAbstractTableModel
+            \o  read / write
+            \o  Book 1, Chapter 10, Figure 10.12
+        \row
+            \o  Boolean Parser
+            \o  QTreeView
+            \o  custom model based on
+QAbstractItemModel
+            \o  read only
+            \o  Book 1, Chapter 10, Figure 10.14
+        \row
+            \o  Track Editor
+            \o  {2, 1} QTableWidget
+            \o  custom delegate providing a custom editor
+            \o  Book 1, Chapter 10, Figure 10.15
+
+        \row
+            \o  Four directory views
+            \o  QListView
+QTableView
+QTreeView
+            \o  QDirModel
+            \o  demonstrates the use of multiple views
+            \o  Book2, Chapter 8.2
+        \row
+            \o  Address Book
+            \o  QListView
+QTableView
+QTreeView
+            \o  custom model based on
+QAbstractTableModel
+            \o  read / write
+            \o  Book2, Chapter 8.4
+        \row
+            \o  Address Book with sorting
+            \o  
+            \o  QProxyModel
+            \o  introducing sort and filter capabilities
+            \o  Book2, Chapter 8.5
+        \row
+            \o  Address Book 
+with checkboxes
+            \o  
+            \o  
+            \o  introducing checkboxes
+in model/view
+            \o  Book2, Chapter 8.6
+        \row
+            \o  Address Book 
+with transposed grid
+            \o  
+            \o  custom proxy Model based on QAbstractProxyModel
+            \o  introducing a custom model
+            \o  Book2, Chapter 8.7
+        \row
+            \o  Address Book
+with drag and drop
+            \o  
+            \o  
+            \o  introducing drag and drop support
+            \o  Book2, Chapter 8.8
+        \row
+            \o  Address Book with custom editor
+            \o  
+            \o  
+            \o  introducing custom delegates
+            \o  Book2, Chapter 8.9
+        \row
+            \o  Views
+            \o  QListView
+QTableView
+QTreeView
+            \o  QStandardItemModel
+            \o  read only
+            \o  Book 3, Chapter 5, figure 5-3
+        \row
+            \o  Bardelegate
+            \o  QTableView
+            \o  
+            \o  custom delegate for presentation based on QAbstractItemDelegate
+            \o  Book 3, Chapter 5, figure 5-5
+        \row
+            \o  Editdelegate
+            \o  QTableView
+            \o  
+            \o  custom delegate for editing based on QAbstractItemDelegate
+            \o  Book 3, Chapter 5, figure 5-6
+        \row
+            \o  Singleitemview
+            \o  custom view based on 
+QAbstractItemView
+            \o  
+            \o  custom view
+            \o  Book 3,
+Chapter 5,
+figure 5-7
+        \row
+            \o  listmodel
+            \o  QTableView
+            \o  custom Model based on
+QAbstractTableModel
+            \o  read only
+            \o  Book 3,
+Chapter 5,
+Figure 5-8
+        \row
+            \o  treemodel
+            \o  QTreeView
+            \o  custom Model based on
+QAbstractItemModel
+            \o  read only
+            \o  Book 3,
+Chapter 5,
+Figure 5-10
+        \row
+            \o  edit integers
+            \o  QListView
+            \o  custom Model based on 
+QAbstractListModel
+            \o  read / write
+            \o  Book 3,
+Chapter 5,
+Listing 5-37, Figure 5-11
+        \row
+            \o  sorting
+            \o  QTableView
+            \o  QSortFilterProxyModel
+applied to QStringListModel
+            \o  demonstrates sorting
+            \o  Book 3, Chapter 5, Figure 5-12
+
+    \endtable
+
+
+\section2 4.2 Qt documentation
+Qt 4.6 comes with 17 examples and 2 Demonstrations for model/view.  The examples can be found here:  \l{http://doc.qt.nokia.com/4.6/examples-itemviews.html}{http://doc.qt.nokia.com/4.6/examples-itemviews.html}
+    \table
+        \header
+            \o  example name
+            \o  view class used
+            \o  model used
+            \o  aspects touched
+        \row
+            \o  Address Book
+            \o  QTableView
+            \o  QTableModel
+QSortFilterProxyModel
+            \o  usage of  QSortFilterProxyModel to generate different subsets from one data pool
+        \row
+            \o  Basic Sort/Filter Model
+            \o  QTreeView
+            \o  QStandardItemModel
+QSortFilterProxyModel
+            \o  
+        \row
+            \o  Chart
+            \o  custom view
+            \o  QStandardItemModel
+            \o  designing custom views that cooperate with selection models 
+        \row
+            \o  Color Editor Factory
+            \o  {2, 1}  QTableWidget
+            \o  enhancing the standard delegate with a new custom editor to choose colours
+        \row
+            \o  Combo Widget Mapper
+            \o  QDataWidgetMapper to map QLineEdit, QTextEdit and QComboBox
+            \o  QStandardItemModel
+            \o  shows how a QComboBox can serve as a view class
+        \row
+            \o  Custom Sort/Filter Model
+            \o  QTreeView
+            \o  QStandardItemModel
+QSortFilterProxyModel
+            \o  subclass QSortFilterProxyModel
+for advanced sorting and filtering
+        \row
+            \o  Dir View
+            \o  QTreeView
+            \o  QDirModel
+            \o  very small example to demonstrate how to assign a model to a view
+        \row
+            \o  Editable Tree Model
+            \o  QTreeView
+            \o  custom tree model
+            \o  comprehensive example for working with trees, demonstrates editing cells and tree structure with an underlying custom model  
+        \row
+            \o  Fetch More
+            \o  QListView
+            \o  custom list model
+            \o  dynamically changing model 
+        \row
+            \o  Frozen Column
+            \o  QTableView
+            \o  QStandardItemModel
+            \o  
+        \row
+            \o  Pixelator
+            \o  QTableView
+            \o  custom table model
+            \o  implementation of a custom delegate
+        \row
+            \o  Puzzle
+            \o  QListView
+            \o  custom list model
+            \o  model/view with drag and drop 
+        \row
+            \o  Simple DOM Model
+            \o  QTreeView
+            \o  custom tree model
+            \o  read only example for a custom tree model
+        \row
+            \o  Simple Tree Model
+            \o  QTreeView
+            \o  custom tree model
+            \o  read only example for a custom tree model
+        \row
+            \o  Simple Widget Mapper
+            \o  QDataWidgetMapper to map QLineEdit, QTextEdit and QSpinBox
+            \o  QStandardItemModel
+            \o  basic QDataWidgetMapper usage
+        \row
+            \o  Spin Box Delegate
+            \o  QTableView
+            \o  QStandardItemModel
+            \o  custom delegate that uses a spin box as a cell editor
+        \row
+            \o  Star Delegate
+            \o  {2, 1}  QTableWidget
+            \o  comprehensive custom delegate example. 
+    \endtable
+
+Demonstrations are similar to examples except that no walk-through is provided  for the code lines. Demonstrations are also sometimes more feature rich. 
+ \l{http://doc.qt.nokia.com/4.6/demos.html}{http://doc.qt.nokia.com/4.6/demos.html}
+    \list
+       \o   The \bold Interview demonstration shows the same model and selection being shared between three different views. 
+       \o   Demonstration \bold Spreadsheet demonstrates the use of a table view as a spreadsheet, using custom delegates to render each item according to the type of data it contains.
+    \endlist
+
+A reference documentation for model/view technology is also available. \l{http://doc.qt.nokia.com/4.6/model-view-programming.html}{http://doc.qt.nokia.com/4.6/model-view-programming.html}
+
+*/
\ No newline at end of file
diff --git a/examples/tutorials/modelview/modelview.pro b/examples/tutorials/modelview/modelview.pro
new file mode 100755
index 0000000..7f684ba
--- /dev/null
+++ b/examples/tutorials/modelview/modelview.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+
+SUBDIRS = 1_readonly \
+          2_formatting \
+          3_changingmodel \
+          4_headers \
+          5_edit \
+          6_treeview \
+          7_selections
+
diff --git a/examples/tutorials/modelview/qmake.pro b/examples/tutorials/modelview/qmake.pro
deleted file mode 100755
index 7f684ba..0000000
--- a/examples/tutorials/modelview/qmake.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS = 1_readonly \
-          2_formatting \
-          3_changingmodel \
-          4_headers \
-          5_edit \
-          6_treeview \
-          7_selections
-
diff --git a/examples/tutorials/tutorials.pro b/examples/tutorials/tutorials.pro
index 949fdf6..34723c2 100644
--- a/examples/tutorials/tutorials.pro
+++ b/examples/tutorials/tutorials.pro
@@ -1,6 +1,8 @@
 TEMPLATE      = subdirs
 SUBDIRS       = \
-                addressbook
+                addressbook \
+                modelview
+
 
 # install
 sources.files = README *.pro
-- 
cgit v0.12


From ca10c2c5a8190cac9c2ae0526f2e250add09d6f2 Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Wed, 23 Jun 2010 17:19:49 +0200
Subject: correction of snippet tags

---
 doc/src/tutorials/modelview.qdoc                   |  41 ++++++---------------
 examples/tutorials/modelview/._.DS_Store           | Bin 0 -> 4096 bytes
 examples/tutorials/modelview/1_readonly/main.cpp   |   2 +
 .../tutorials/modelview/1_readonly/modelview.cpp   |   3 +-
 .../tutorials/modelview/1_readonly/modelview.h     |   3 ++
 .../tutorials/modelview/1_readonly/mymodel.cpp     |   2 +
 examples/tutorials/modelview/1_readonly/mymodel.h  |   2 +
 .../tutorials/modelview/2_formatting/mymodel.cpp   |   3 +-
 .../modelview/3_changingmodel/mymodel.cpp          |   7 ++--
 examples/tutorials/modelview/4_headers/mymodel.cpp |   3 +-
 examples/tutorials/modelview/5_edit/mymodel.cpp    |   8 +++-
 examples/tutorials/modelview/5_edit/mymodel.h      |   2 +
 .../tutorials/modelview/6_treeview/modelview.cpp   |   2 +
 .../tutorials/modelview/7_selections/modelview.cpp |   6 ++-
 examples/tutorials/modelview/qmake.pro             |  10 +++++
 15 files changed, 57 insertions(+), 37 deletions(-)
 create mode 100755 examples/tutorials/modelview/._.DS_Store
 create mode 100755 examples/tutorials/modelview/qmake.pro

diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
index 1be4b46..3c73a80 100755
--- a/doc/src/tutorials/modelview.qdoc
+++ b/doc/src/tutorials/modelview.qdoc
@@ -1,9 +1,7 @@
 /*!
 
-    \page modelview.html
-    \startpage {index.html}{Qt Reference Documentation}
-    \contentspage Tutorials
     \contentspage{modelview.html}{Crash Course in Model/View Programming}
+    \page modelview.html
 
 \title Crash Course in Model/View Programming
 Contents:
@@ -71,16 +69,16 @@ Below are 7 very simple and independent applications that show different sides o
 We start with an application that uses a \l QTableView to show data. We will add editing capabilities later. 
 
 -------------------------------------------------------------main.cpp---------------------
-    \snippet examples/tutorials/modelview/1_readonly/main.cpp
+    \snippet examples/tutorials/modelview/1_readonly/main.cpp Quoting ModelView Tutorial
 
 We have the usual main() function;
 -------------------------------------------------------------modelview.h---------------------
-    \snippet examples/tutorials/modelview/1_readonly/modelview.h
+    \snippet examples/tutorials/modelview/1_readonly/modelview.h Quoting ModelView Tutorial
 
 The application is a \l QMainWindow that holds a \l QTableView.  
 
 -------------------------------------------------------------modelview.cpp---------------------
-    \snippet examples/tutorials/modelview/1_readonly/modelview.cpp
+    \snippet examples/tutorials/modelview/1_readonly/modelview.cpp Quoting ModelView Tutorial
 
 Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView::}{tableView()} OR \l QTableView::tableView() OR \l QTableView::tableView .  \l {QTableView::}{tableView} will invoke the methods of the pointer it has received to find out two things: 
     \list
@@ -92,13 +90,13 @@ The model needs some code to respond to this.
 
 We have a table data set, so let's start with QAbstractTableModel since it is easier to use.
 -------------------------------------------------------------mymodel.h---------------------
-    \snippet examples/tutorials/modelview/1_readonly/mymodel.h
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.h Quoting ModelView Tutorial
 
 QAbstractTableModel requires the implementation of three abstract methods.
 
 
 -------------------------------------------------------------mymodel.cpp---------------------
-    \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp Quoting ModelView Tutorial
 
 The number of rows and columns is set by \c MyModel::rowCount() and \c MyModel::columnCount(). 
 When the view has to know what the cell 's text is, it calls the \l{QAbstractItemModel::data()}{data()} method. Row and column information is specified with parameter \c index and the role is set to Qt::Display Role.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
@@ -114,7 +112,7 @@ In addition to controlling what text the view displays, the model also controls
 In fact, nothing except for the \l{QAbstractItemModel::data()}{data()} method needs to be changed to set fonts, background colour, alignment and a checkbox. Here is the \l{QAbstractItemModel::data()}{data()} method that produces the result shown above:
 
 -------------------------------------------------------------mymodel.cpp---------------------
-    \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp
+    \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp Quoting ModelView Tutorial
 
 Each formatting property will be requested from the model with a separate call to the \l{QAbstractItemModel::data()}{data()} method. The \c role parameter is used to let the model know which property is being requested:
 
@@ -178,7 +176,6 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
 
 Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
 
-?????(include section from 3_changingmodel/mymodel.cpp)?????
 \code
 MyModel::MyModel(QObject *parent)
     :QAbstractTableModel(parent)
@@ -193,7 +190,6 @@ MyModel::MyModel(QObject *parent)
 
 Here is the corresponding slot:
 
-?????(include section from 3_changingmodel/mymodel.cpp)?????
 \code
 
 void MyModel::timerHit()
@@ -215,8 +211,6 @@ Headers can be hidden via a view method.
 
 The header content, however , is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
 
-
-?????(include section from 4_headers/mymodel.cpp)?????
 \code
 QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
 {
@@ -244,11 +238,10 @@ In this example, we are going to build an application that automatically populat
 
 The model decides whether editing capabilities are available . We only have to modify the model in order for the available editing capabilities to be enabled. This is done by reimplementing the following virtual methods:  \l{QAbstractItemModel::setData()}{setData()} and \l{QAbstractItemModel::flags()}{flags()}. 
 -------------------------------------------------------------mymodel.h---------------------
-    \snippet examples/tutorials/modelview/5_edit/mymodel.h
+    \snippet examples/tutorials/modelview/5_edit/mymodel.h Quoting ModelView Tutorial
 
 We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
 
-?????(include section from 5_edit/mymodel.cpp)?????
 \code
 #include "mymodel.h"
 
@@ -264,16 +257,10 @@ MyModel::MyModel(QObject *parent)
 \endcode
 
 In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
-?????(include section from 5_edit/mymodel.cpp)?????
-\code
-HIER FEHLT WAS!!!
-\endcode
+    \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_e
 
 \l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
-?????(include section from 5_edit/mymodel.cpp)?????
-\code
-HIER FEHLT WAS!!!
-\endcode
+    \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_f
 
 Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
 
@@ -292,7 +279,7 @@ This is how our example model looks so far:
 
 We want to, however, present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with QStandardItems, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
 -------------------------------------------------------------modelview.cpp---------------------
-    \snippet examples/tutorials/modelview/6_treeview/modelview.cpp
+    \snippet examples/tutorials/modelview/6_treeview/modelview.cpp Quoting ModelView Tutorial
 
 We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other QStandardItems. Nodes are collapsed and expanded within the view.
 
@@ -302,7 +289,6 @@ We want to access a selected item's content in order to output it into the windo
 
 
 So let's create a couple of items:
-?????(include section from 7_selections/modelview.cpp)?????
 \code
 #include <QTreeView>
 #include <QStandardItemModel>
@@ -351,10 +337,7 @@ ModelView::ModelView(QWidget *parent)
 
 Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
 
-?????(include section from 7_selections/modelview.cpp)?????
-\code
-HIER FEHLT WAS!!!
-\endcode
+    \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_b
 
 We get the model index that corresponds to the selection by calling 
 \c treeView->selectionModel()->currentIndex() and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed QModelIndex(). This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
diff --git a/examples/tutorials/modelview/._.DS_Store b/examples/tutorials/modelview/._.DS_Store
new file mode 100755
index 0000000..338bd7b
Binary files /dev/null and b/examples/tutorials/modelview/._.DS_Store differ
diff --git a/examples/tutorials/modelview/1_readonly/main.cpp b/examples/tutorials/modelview/1_readonly/main.cpp
index 998503c..bdf740c 100755
--- a/examples/tutorials/modelview/1_readonly/main.cpp
+++ b/examples/tutorials/modelview/1_readonly/main.cpp
@@ -1,3 +1,4 @@
+//! [Quoting ModelView Tutorial]
 #include <QtGui/QApplication>
 #include "modelview.h"
 
@@ -8,3 +9,4 @@ int main(int argc, char *argv[])
     w.show();
     return a.exec();
 }
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp
index becd61d..14311f9 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.cpp
+++ b/examples/tutorials/modelview/1_readonly/modelview.cpp
@@ -1,3 +1,4 @@
+//! [Quoting ModelView Tutorial]
 #include <QTableView>
 #include "modelview.h"
 #include "mymodel.h"
@@ -9,4 +10,4 @@ ModelView::ModelView(QWidget *parent)
     setCentralWidget(tableView);
     tableView->setModel(new MyModel(this) );
 }
-
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h
index f1b63bd..93b6b90 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.h
+++ b/examples/tutorials/modelview/1_readonly/modelview.h
@@ -1,6 +1,8 @@
+//! [Quoting ModelView Tutorial]
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
+
 #include <QtGui/QMainWindow>
 
 class QTableView; //forward declaration
@@ -16,3 +18,4 @@ public:
 };
 
 #endif // MODELVIEW_H
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.cpp b/examples/tutorials/modelview/1_readonly/mymodel.cpp
index ff3e2d2..3386907 100755
--- a/examples/tutorials/modelview/1_readonly/mymodel.cpp
+++ b/examples/tutorials/modelview/1_readonly/mymodel.cpp
@@ -1,3 +1,4 @@
+//! [Quoting ModelView Tutorial]
 #include "mymodel.h"
 
 MyModel::MyModel(QObject *parent)
@@ -28,3 +29,4 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
     }
     return QVariant();
 }
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.h b/examples/tutorials/modelview/1_readonly/mymodel.h
index 01ae6cb..aac1bf0 100755
--- a/examples/tutorials/modelview/1_readonly/mymodel.h
+++ b/examples/tutorials/modelview/1_readonly/mymodel.h
@@ -1,3 +1,4 @@
+//! [Quoting ModelView Tutorial]
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
@@ -14,3 +15,4 @@ public:
 };
 
 #endif // MYMODEL_H
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
index 48b1134..916dabc 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -3,6 +3,7 @@
 #include "mymodel.h"
 #include <QDebug>
 
+//! [Quoting ModelView Tutorial]
 MyModel::MyModel(QObject *parent)
     :QAbstractTableModel(parent)
 {
@@ -70,4 +71,4 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
     }
     return QVariant();
 }
-
+//! [Quoting ModelView Tutorial]
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
index d594175..fa7f566 100755
--- a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
@@ -3,7 +3,7 @@
 #include <QBrush>
 #include "mymodel.h"
 
-
+//! [quoting mymodel_a]
 MyModel::MyModel(QObject *parent)
     :QAbstractTableModel(parent)
 {
@@ -13,7 +13,7 @@ MyModel::MyModel(QObject *parent)
     connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
     timer->start();
 }
-
+//! [quoting mymodel_a]
 //-------------------------------------------------------
 int MyModel::rowCount(const QModelIndex  & /*parent */ ) const
 {
@@ -43,6 +43,7 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
 }
 
 //-------------------------------------------------------
+//! [quoting mymodel_b ]
 void MyModel::timerHit()
 {
     //we identify the top left cell
@@ -50,4 +51,4 @@ void MyModel::timerHit()
     //emit a signal to make the view reread identified data
     emit dataChanged ( topLeft, topLeft );
 }
-
+//! [quoting mymodel_b ]
diff --git a/examples/tutorials/modelview/4_headers/mymodel.cpp b/examples/tutorials/modelview/4_headers/mymodel.cpp
index a032fe5..7891c80 100755
--- a/examples/tutorials/modelview/4_headers/mymodel.cpp
+++ b/examples/tutorials/modelview/4_headers/mymodel.cpp
@@ -29,7 +29,7 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
     return QVariant();
 }
 
-
+//! [quoting mymodel_c]
 QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
 {
     if (role == Qt::DisplayRole)
@@ -48,3 +48,4 @@ QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role)
     }
     return QVariant();
 }
+//! [quoting mymodel_c]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/5_edit/mymodel.cpp b/examples/tutorials/modelview/5_edit/mymodel.cpp
index c64a6b7..ef45bc3 100755
--- a/examples/tutorials/modelview/5_edit/mymodel.cpp
+++ b/examples/tutorials/modelview/5_edit/mymodel.cpp
@@ -1,3 +1,4 @@
+//! [quoting mymodel_d]
 #include "mymodel.h"
 
 const int COLS= 3;
@@ -9,7 +10,9 @@ MyModel::MyModel(QObject *parent)
     //gridData needs to have 6 element, one for each table cell
     m_gridData << "1/1" << "1/2" << "1/3" << "2/1" << "2/2" << "2/3" ;
 }
+//! [quoting mymodel_d]
 
+//! [quoting mymodel_e]
 //-------------------------------------------------------
 int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
 {
@@ -31,8 +34,11 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
     }
     return QVariant();
 }
+//! [quoting mymodel_e]
 
 //-----------------------------------------------------------------
+
+//! [quoting mymodel_f]
 bool MyModel::setData ( const QModelIndex & index, const QVariant & value, int role  )
 {
     if(role == Qt::EditRole)
@@ -55,4 +61,4 @@ int MyModel::modelIndexToOffset(const QModelIndex & index) const
 {
     return index.row()*COLS + index.column();
 }
-
+//! [quoting mymodel_f]
diff --git a/examples/tutorials/modelview/5_edit/mymodel.h b/examples/tutorials/modelview/5_edit/mymodel.h
index f8fac77..1612fa0 100755
--- a/examples/tutorials/modelview/5_edit/mymodel.h
+++ b/examples/tutorials/modelview/5_edit/mymodel.h
@@ -1,3 +1,4 @@
+//! [Quoting ModelView Tutorial]
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
@@ -22,3 +23,4 @@ signals:
 };
 
 #endif // MYMODEL_H
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/6_treeview/modelview.cpp b/examples/tutorials/modelview/6_treeview/modelview.cpp
index a5488f7..b5b4d06 100755
--- a/examples/tutorials/modelview/6_treeview/modelview.cpp
+++ b/examples/tutorials/modelview/6_treeview/modelview.cpp
@@ -1,3 +1,4 @@
+//! [Quoting ModelView Tutorial]
 #include <QTreeView>
 #include <QStandardItemModel>
 #include <QStandardItem>
@@ -38,3 +39,4 @@ QList<QStandardItem *> ModelView::prepareColumn(const QString &first,
     colItems << new QStandardItem(third);
     return colItems;
 }
+//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/7_selections/modelview.cpp b/examples/tutorials/modelview/7_selections/modelview.cpp
index 49c5bb8..eac6df9 100755
--- a/examples/tutorials/modelview/7_selections/modelview.cpp
+++ b/examples/tutorials/modelview/7_selections/modelview.cpp
@@ -1,3 +1,4 @@
+//! [quoting modelview_a]
 #include <QTreeView>
 #include <QStandardItemModel>
 #include <QItemSelectionModel>
@@ -41,8 +42,11 @@ ModelView::ModelView(QWidget *parent)
     connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
             this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
 }
+//! [quoting modelview_a]
 
 //------------------------------------------------------------------------------------
+
+//! [quoting modelview_b]
 void ModelView::selectionChangedSlot(const QItemSelection & /*newSelection*/, const QItemSelection & /*oldSelection*/)
 {
     const QModelIndex index = treeView->selectionModel()->currentIndex();
@@ -58,6 +62,6 @@ void ModelView::selectionChangedSlot(const QItemSelection & /*newSelection*/, co
                          .arg(hierarchyLevel);
     setWindowTitle(showString);
 }
-
+//! [quoting modelview_b]
 
 
diff --git a/examples/tutorials/modelview/qmake.pro b/examples/tutorials/modelview/qmake.pro
new file mode 100755
index 0000000..7f684ba
--- /dev/null
+++ b/examples/tutorials/modelview/qmake.pro
@@ -0,0 +1,10 @@
+TEMPLATE = subdirs
+
+SUBDIRS = 1_readonly \
+          2_formatting \
+          3_changingmodel \
+          4_headers \
+          5_edit \
+          6_treeview \
+          7_selections
+
-- 
cgit v0.12


From 798433c9046281a8739eb6b313c7dd0fc7b5e3b1 Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Mon, 28 Jun 2010 12:49:05 +0200
Subject: I've cleaned up the qdoc file a bit.

---
 doc/src/tutorials/modelview.qdoc                   | 213 +++++++--------------
 .../modelview/3_changingmodel/mymodel.cpp          |   3 +-
 2 files changed, 70 insertions(+), 146 deletions(-)

diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
index 3c73a80..c9caf17 100755
--- a/doc/src/tutorials/modelview.qdoc
+++ b/doc/src/tutorials/modelview.qdoc
@@ -56,9 +56,13 @@ Here is an overview of the model/view widgets and their corresponding standard w
 \section2 1.4 Having adapters between forms and models can come in handy.
 We often prefer editing data stored in tables (e.g. in database tables) in forms rather than in tables. There is no direct model/view counterpart for separating data and views for widgets that operate on one value instead of a dataset, so we need an adapter in order to connect the form to the source of  data.
 
-\l QDataWidgetMapper is a great solution because it maps form widgets to a table row and it makes it very easy to build forms for database tables. \image widgetmapper.png
 
-Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter. \image qcompleter.png
+\l QDataWidgetMapper is a great solution because it maps form widgets to a table row and it makes it very easy to build forms for database tables.
+\image widgetmapper.png
+
+
+Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter.
+\image qcompleter.png
 
 \section1 2 A Simple Model/View Application
 If you want to develop a model/view application, where should you start? We recommend starting with a simple example and extending it step-by-step. This makes understanding the architecture a lot easier. Trying to understand the model/view architecture in detail before invoking the IDE has proven to be less convenient for many developers. It is substantially easier to start with a simple model/view application that has demo data. Give it a try! Simply replace the data in the examples below with your own.
@@ -71,7 +75,7 @@ We start with an application that uses a \l QTableView to show data. We will add
 -------------------------------------------------------------main.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/main.cpp Quoting ModelView Tutorial
 
-We have the usual main() function;
+We have the usual \l {tutorials/modelview/1_readonly/main.cpp}{main()} function;
 -------------------------------------------------------------modelview.h---------------------
     \snippet examples/tutorials/modelview/1_readonly/modelview.h Quoting ModelView Tutorial
 
@@ -80,7 +84,7 @@ The application is a \l QMainWindow that holds a \l QTableView.
 -------------------------------------------------------------modelview.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/modelview.cpp Quoting ModelView Tutorial
 
-Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView::}{tableView()} OR \l QTableView::tableView() OR \l QTableView::tableView .  \l {QTableView::}{tableView} will invoke the methods of the pointer it has received to find out two things: 
+Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView}{tableView()}.  \l {QTableView}{tableView} will invoke the methods of the pointer it has received to find out two things: 
     \list
        \o   How many rows and columns should be displayed
        \o   What content should be printed into each cell.
@@ -154,54 +158,17 @@ Now we need to determine how using a seperated model impacts the application's p
 
 We still have a read only table, but this time the content changes every second because we are showing the current time.
 
-!!!!!I CAN'T FIND THIS FILE!!!!!
-\code
-QVariant MyModel::data(const QModelIndex &index, int role ) const
-{
-    QVariant returnVal;
-    int row = index.row();
-    int col = index.column();
-
-    if(role == Qt::DisplayRole)
-
-    {
-        if(row == 0 && col == 0 )
-        {
-            returnVal = QTime::currentTime().toString();
-       }
-    }
-    return returnVal;
-}
-\endcode
+    \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_QVariant
 
 Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
 
-\code
-MyModel::MyModel(QObject *parent)
-    :QAbstractTableModel(parent)
-{
-//    selectedCell = 0;
-    timer = new QTimer(this);
-    timer->setInterval(1000);
-    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
-    timer->start();
-}
-\endcode
+    \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_a
 
 Here is the corresponding slot:
 
-\code
+    \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_b
 
-void MyModel::timerHit()
-{
-    //we identify the top left cell
-    QModelIndex topLeft = createIndex ( 0,0 );
-    //emit a signal to make the view reread identified data
-    emit dataChanged ( topLeft, topLeft );
-}
-\endcode
-
-We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QAbstractItemModel::setModel()}{setModel()} .
+We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QTableView::setModel}{setModel()} .
 
 \section2 2.4 Setting up Headers for Columns and Rows
 Headers can be hidden via a view method. 
@@ -209,28 +176,9 @@ Headers can be hidden via a view method.
 \image header.png
 
 
-The header content, however , is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
+The header content, however, is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
 
-\code
-QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-    if (role == Qt::DisplayRole)
-    {
-        if (orientation == Qt::Horizontal) {
-            switch (section)
-            {
-            case 0:
-                return QString("first");
-            case 1:
-                return QString("second");
-            case 2:
-                return QString("third");
-            }
-        }
-    }
-    return QVariant();
-}
-\endcode
+    \snippet examples/tutorials/modelview/4_headers/mymodel.cpp quoting mymodel_c
 
 
 \section2 2.5 The minimal Editing example
@@ -242,19 +190,7 @@ The model decides whether editing capabilities are available . We only have to m
 
 We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
 
-\code
-#include "mymodel.h"
-
-const int COLS= 3;
-const int ROWS= 2;
-
-MyModel::MyModel(QObject *parent)
-    :QAbstractTableModel(parent)
-{
-    //gridData needs to have 6 element, one for each table cell
-    m_gridData << "1/1" << "1/2" << "1/3" << "2/1" << "2/2" << "2/3" ;
-}
-\endcode
+    \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_d
 
 In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
     \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_e
@@ -266,6 +202,7 @@ Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()
 
 \section1 3 Intermediate Topics
 \section2 3.1 TreeView
+
 You can convert the example above into an application with a tree view. Simply replace QTableView with QTreeView, which results in a read/write tree. No changes have to be made to the model. The tree won't have any hierarchies because there aren't any hierarchies in the model itself.
 \image dummy_tree.png
 
@@ -273,76 +210,33 @@ You can convert the example above into an application with a tree view. Simply r
 QListView, QTableView and QTreeView all use a model abstraction, which is a merged list, table and tree. This makes it possible to use several different types of view classes from the same model.
 \image list_table_tree.png
 
+
 This is how our example model looks so far:
 \image example_model.png
 
 
-We want to, however, present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with QStandardItems, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
+We want to present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with \l{QStandardItem}{QStandardItems}, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
 -------------------------------------------------------------modelview.cpp---------------------
     \snippet examples/tutorials/modelview/6_treeview/modelview.cpp Quoting ModelView Tutorial
 
-We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other QStandardItems. Nodes are collapsed and expanded within the view.
+We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other \l{QStandardItem}{QStandardItems}. Nodes are collapsed and expanded within the view.
 
 \section2 3.2 Working with selection
+
+
 We want to access a selected item's content in order to output it into the window title together with the hierarchy level.
 \image selection2.png
 
-
 So let's create a couple of items:
-\code
-#include <QTreeView>
-#include <QStandardItemModel>
-#include <QItemSelectionModel>
-#include "modelview.h"
-
-ModelView::ModelView(QWidget *parent)
-    : QMainWindow(parent)
-{
-    treeView = new QTreeView(this);
-    setCentralWidget(treeView);
-    standardModel = new QStandardItemModel ;
-    QStandardItem *rootNode = standardModel->invisibleRootItem();
-
-
-    //defining a couple of items
-    QStandardItem *americaItem = new QStandardItem("America");
-    QStandardItem *mexicoItem =  new QStandardItem("Canada");
-    QStandardItem *usaItem =     new QStandardItem("USA");
-    QStandardItem *bostonItem =  new QStandardItem("Boston");
-    QStandardItem *europeItem =  new QStandardItem("Europe");
-    QStandardItem *italyItem =   new QStandardItem("Italy");
-    QStandardItem *romeItem =    new QStandardItem("Rome");
-    QStandardItem *veronaItem =  new QStandardItem("Verona");
-
-    //building up the hierarchy
-    rootNode->    appendRow(americaItem);
-    rootNode->    appendRow(europeItem);
-    americaItem-> appendRow(mexicoItem);
-    americaItem-> appendRow(usaItem);
-    usaItem->     appendRow(bostonItem);
-    europeItem->  appendRow(italyItem);
-    italyItem->   appendRow(romeItem);
-    italyItem->   appendRow(veronaItem);
-    
-    //register the model
-    treeView->setModel( standardModel );
-    treeView->expandAll();
-
-    //selection changes shall trigger a slot
-    QItemSelectionModel *selectionModel= treeView->selectionModel();
-    connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
-            this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
-}
-\endcode
-
+    \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_a
 Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
 
     \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_b
 
 We get the model index that corresponds to the selection by calling 
-\c treeView->selectionModel()->currentIndex() and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed QModelIndex(). This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
+\l{QItemSelectionModel::currentIndex()}{treeView->selectionModel()->currentIndex()} and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed \l{QModelIndex}{QModelIndex()}. This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
 
-The selection model (as shown above) can be retrieved, but it can also be set with \c QAbstractItemView::setSelectionModel. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemModel::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemModel::setSelectionModel()}{setSelectionModel()};
+The selection model (as shown above) can be retrieved, but it can also be set with \l{QAbstractItemView}{QAbstractItemView::setSelectionModel}. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemModel::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemModel::setSelectionModel()}{setSelectionModel()};
 \section2 3.3 Predefined Models
 The typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures. If one of the available data structures is suitable for your application, a predefined model can be a good choice.
 
@@ -354,9 +248,12 @@ The typical way to use model/view is to wrap specific data to make it usable wit
             \o  QStandardItemModel
             \o  Stores arbitrary hierarchical items
         \row
-            \o  {1, 2}  QFileSystemModel
-QDirModel (deprecated)
-            \o  {1, 2}  Encapsulate the local file system
+            \o  QFileSystemModel
+    \raw HTML
+            <br>
+    \endraw
+		QDirModel (deprecated)
+            \o  Encapsulate the local file system
         \row
             \o  QSqlQueryModel
             \o  Encapsulate an SQL result set
@@ -375,9 +272,8 @@ QDirModel (deprecated)
 \section2 3.4 Delegates
 In all examples so far, data is presented as text or a checkbox in a cell and is edited as text or a checkbox. The component that provides these presentation and editing services is called a “delegate.” We are only just beginning to work with the delegate because the view uses a default delegate.  But imagine that we want to have a different editor.(e.g. a slider or a drop down list) Or imagine that we want to present data as graphics. Let's take a look at an example called Stardelegate, (  \l{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html}{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html} ) in which stars are used to show a rating: \image stardelegate.png
 
-The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemModel::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
+The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemView::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
 
-!!!!!I CAN'T FIND THIS FILE!!!!!
 \code
  class StarDelegate : public QStyledItemDelegate
  {
@@ -392,20 +288,22 @@ The view has a method that replaces the default delegate and installs a custom d
 
 \endcode
 
-\l{QAbstractItemModel::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \c index.data(). \c SizeHint specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
+\l{QStyledItemDelegate::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \l{QModelIndex::data()}{index.data()}. \l{QStyledItemDelegate::SizeHint}{SizeHint} specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
 
 Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
 
 \section2 3.5 Debugging with ModelTest
 The passive nature of models provides new challenges for programmers. Inconsistencies in the model can cause the application to crash. Since the model is hit by numerous calls from the view, it is hard to find out which call has crashed the application and which operation has introduced the problem. 
 
-Qt provides software called ModelTest, which checks models while your programming is running. Every time the model is changed, ModelTest scans the model and reports errors with an assert. This is especially important for tree models, since their hierarchical nature leaves many possibilities for subtle inconsistencies. http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
+Qt provides software called ModelTest, which checks models while your programming is running. Every time the model is changed, ModelTest scans the model and reports errors with an assert. This is especially important for tree models, since their hierarchical nature leaves many possibilities for subtle inconsistencies. \l http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
 
 Unlike view classes, ModelTest uses out of range indexes to test the model.  This means your application may crash with ModelTest even if it runs perfectly without it. So you also need to handle all of the indexes that are out of range when using ModelTest. 
 
 
 
-
+\raw HTML
+<br>
+\endraw
 
 
 
@@ -413,25 +311,50 @@ Unlike view classes, ModelTest uses out of range indexes to test the model.  Thi
 
 \section2 3.6 Model/View NG
 
-\image path.png
+\raw HTML
+<table style="background-color:white;border:none;font: normal 13px/1.2 Verdana;">
+<tr><td align="left" valign="top" style="background-color:white;border:none;padding:5px;">
+\endraw
 
-Model/View was introduced in Qt 4.0 and is a frequently used technology. Feedback from clients and new development trends have shown, that there is a need to further develop the model/view technology. Therefore a research project at Nokia is looking into ways to go beyond the current implementation.
+\raw HTML
+<!-- wrap content table p has 0 padding and the padding for p outside of the table is 5px-->
+\endraw
 
+Model/View was introduced in Qt 4.0 and is a frequently used technology. Feedback from clients and new development trends have shown, that there is a need to further develop the model/view technology. Therefore a research project at Nokia is looking into ways to go beyond the current implementation.
+\raw HTML
+<br>
+\endraw
 One limitation of model/view is that view classes are basically all fixed grids. It is possible, but really hard to make a list view with icons placed on a curve; or cells expanding on mouse over events to show additional information. In order to achieve graphically rich view experiences, Model/View NG will use QGraphicsView to render elements. Nodel/View NG also aims to make model/view programming more intuitive. One way to achieve this is to have  separate models for lists, tables and trees. The current model abstraction is complex because it is capable of representing a list, a table or a tree. 
-
+\raw HTML
+<br>
+\endraw
 Model/View NG is a research project. You are welcome to checkout the source code, monitor progress and take part in discussions at the following address:  \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
 
+\raw HTML
+</td><td align="right" valign="top">
+\endraw
+
+\inlineimage path.png
+
+\raw HTML
+</td></tr></table>
+\endraw
+\raw HTML
+<br>
+\endraw
 \section1 4 Good Sources for Additional Information
 \section2 4.1 Books
 Model/View programming is covered quite extensively in the documentation of Qt but also in several good books. 
     \list 1
-       \o   1.C++ GUI Programming with Qt 4 / Jasmin Blanchette, Mark Summerfield, Prentice Hall, 2nd edition, ISBN 0-13-235416-0
+       \o  C++ GUI Programming with Qt 4 / Jasmin Blanchette, Mark Summerfield, Prentice Hall, 2nd edition, ISBN 0-13-235416-0
 also available in German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung, Addison-Wesley, ISBN 3-827327-29-6
-       \o   1.The Book of Qt4, The Art of Building Qt Applications / Daniel Molkentin,  Open Source Press ISBN 1-59327-147-6
+       \o  The Book of Qt4, The Art of Building Qt Applications / Daniel Molkentin,  Open Source Press ISBN 1-59327-147-6
 Translated from: Qt 4, Einführung in die Applikationsentwicklung, Open Source Press, ISBN 3-937514-12-0
-       \o   1.Foundations of Qt Development / Johan Thelin, Apress, ISBN 1-59059-831-8
+       \o  Foundations of Qt Development / Johan Thelin, Apress, ISBN 1-59059-831-8
     \endlist
-
+\raw HTML
+<br>
+\endraw
 
 The following list provides an overview of example programs contained in the books above. Some of them make very good templates for developing similar applications. 
 
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
index fa7f566..8943003 100755
--- a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
@@ -27,6 +27,7 @@ int MyModel::columnCount(const QModelIndex  & /*parent */ ) const
 }
 
 //-------------------------------------------------------
+//! [quoting mymodel_QVariant ]
 QVariant MyModel::data(const QModelIndex &index, int role ) const
 {
     int row = index.row();
@@ -41,7 +42,7 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
     }
     return QVariant();
 }
-
+//! [quoting mymodel_QVariant ]
 //-------------------------------------------------------
 //! [quoting mymodel_b ]
 void MyModel::timerHit()
-- 
cgit v0.12


From 269b910f08f54333834c3a4d91b250b185a53863 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Mon, 28 Jun 2010 15:52:45 +0200
Subject: Doc: Added the standard three clause BSD license header.

Reviewed-by: Trust Me
---
 examples/tutorials/modelview/1_readonly/main.cpp | 42 +++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/examples/tutorials/modelview/1_readonly/main.cpp b/examples/tutorials/modelview/1_readonly/main.cpp
index bdf740c..ad11f38 100755
--- a/examples/tutorials/modelview/1_readonly/main.cpp
+++ b/examples/tutorials/modelview/1_readonly/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #include <QtGui/QApplication>
 #include "modelview.h"
@@ -9,4 +49,4 @@ int main(int argc, char *argv[])
     w.show();
     return a.exec();
 }
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
+//! [Quoting ModelView Tutorial]
-- 
cgit v0.12


From 5938c706524fa9a7de531847bedae19a97fa130b Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Thu, 1 Jul 2010 10:32:05 +0200
Subject: replaced image, license headers, more links in modelview.qdoc file

---
 doc/src/images/columnview.png                      | Bin 11717 -> 3480 bytes
 doc/src/tutorials/modelview.qdoc                   |  30 ++++++++--------
 .../tutorials/modelview/1_readonly/1_readonly.pro  |  40 +++++++++++++++++++++
 .../tutorials/modelview/1_readonly/modelview.cpp   |  40 +++++++++++++++++++++
 .../tutorials/modelview/1_readonly/modelview.h     |  40 +++++++++++++++++++++
 .../tutorials/modelview/1_readonly/mymodel.cpp     |  40 +++++++++++++++++++++
 examples/tutorials/modelview/1_readonly/mymodel.h  |  40 +++++++++++++++++++++
 .../modelview/2_formatting/2_formatting.pro        |  40 +++++++++++++++++++++
 examples/tutorials/modelview/2_formatting/main.cpp |  40 +++++++++++++++++++++
 .../tutorials/modelview/2_formatting/modelview.cpp |  40 +++++++++++++++++++++
 .../tutorials/modelview/2_formatting/modelview.h   |  40 +++++++++++++++++++++
 .../tutorials/modelview/2_formatting/mymodel.cpp   |  40 +++++++++++++++++++++
 .../tutorials/modelview/2_formatting/mymodel.h     |  40 +++++++++++++++++++++
 .../modelview/3_changingmodel/3_changingmodel.pro  |  40 +++++++++++++++++++++
 .../tutorials/modelview/3_changingmodel/main.cpp   |  40 +++++++++++++++++++++
 .../modelview/3_changingmodel/modelview.cpp        |  40 +++++++++++++++++++++
 .../modelview/3_changingmodel/modelview.h          |  40 +++++++++++++++++++++
 .../modelview/3_changingmodel/mymodel.cpp          |  40 +++++++++++++++++++++
 .../tutorials/modelview/3_changingmodel/mymodel.h  |  40 +++++++++++++++++++++
 .../tutorials/modelview/4_headers/4_headers.pro    |  40 +++++++++++++++++++++
 examples/tutorials/modelview/4_headers/main.cpp    |  40 +++++++++++++++++++++
 .../tutorials/modelview/4_headers/modelview.cpp    |  40 +++++++++++++++++++++
 examples/tutorials/modelview/4_headers/modelview.h |  40 +++++++++++++++++++++
 examples/tutorials/modelview/4_headers/mymodel.cpp |  40 +++++++++++++++++++++
 examples/tutorials/modelview/4_headers/mymodel.h   |  40 +++++++++++++++++++++
 examples/tutorials/modelview/5_edit/5_edit.pro     |  40 +++++++++++++++++++++
 examples/tutorials/modelview/5_edit/main.cpp       |  40 +++++++++++++++++++++
 examples/tutorials/modelview/5_edit/modelview.cpp  |  40 +++++++++++++++++++++
 examples/tutorials/modelview/5_edit/modelview.h    |  40 +++++++++++++++++++++
 examples/tutorials/modelview/5_edit/mymodel.cpp    |  40 +++++++++++++++++++++
 examples/tutorials/modelview/5_edit/mymodel.h      |  40 +++++++++++++++++++++
 .../tutorials/modelview/6_treeview/6_treeview.pro  |  40 +++++++++++++++++++++
 examples/tutorials/modelview/6_treeview/main.cpp   |  40 +++++++++++++++++++++
 .../tutorials/modelview/6_treeview/modelview.cpp   |  40 +++++++++++++++++++++
 .../tutorials/modelview/6_treeview/modelview.h     |  40 +++++++++++++++++++++
 .../modelview/7_selections/7_selections.pro        |  40 +++++++++++++++++++++
 examples/tutorials/modelview/7_selections/main.cpp |  40 +++++++++++++++++++++
 .../tutorials/modelview/7_selections/modelview.cpp |  40 +++++++++++++++++++++
 .../tutorials/modelview/7_selections/modelview.h   |  40 +++++++++++++++++++++
 39 files changed, 1495 insertions(+), 15 deletions(-)
 mode change 100755 => 100644 doc/src/images/columnview.png

diff --git a/doc/src/images/columnview.png b/doc/src/images/columnview.png
old mode 100755
new mode 100644
index 2fb972e..127b795
Binary files a/doc/src/images/columnview.png and b/doc/src/images/columnview.png differ
diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
index c9caf17..67908b9 100755
--- a/doc/src/tutorials/modelview.qdoc
+++ b/doc/src/tutorials/modelview.qdoc
@@ -3,7 +3,7 @@
     \contentspage{modelview.html}{Crash Course in Model/View Programming}
     \page modelview.html
 
-\title Crash Course in Model/View Programming
+\title An Introduction to Model/View Programming
 Contents:
 \tableofcontents
 
@@ -84,7 +84,7 @@ The application is a \l QMainWindow that holds a \l QTableView.
 -------------------------------------------------------------modelview.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/modelview.cpp Quoting ModelView Tutorial
 
-Here is the interesting part: We use \c tableView->setModel(new MyModel(this) ); to instantiate the Model and pass its pointer to \l {QTableView}{tableView()}.  \l {QTableView}{tableView} will invoke the methods of the pointer it has received to find out two things: 
+Here is the interesting part: We use \l{QTableView::setModel()}{tableView->setModel(new MyModel(this) );} to instantiate the Model and pass its pointer to \l {QTableView}{tableView()}.  \l {QTableView}{tableView} will invoke the methods of the pointer it has received to find out two things: 
     \list
        \o   How many rows and columns should be displayed
        \o   What content should be printed into each cell.
@@ -102,8 +102,8 @@ QAbstractTableModel requires the implementation of three abstract methods.
 -------------------------------------------------------------mymodel.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp Quoting ModelView Tutorial
 
-The number of rows and columns is set by \c MyModel::rowCount() and \c MyModel::columnCount(). 
-When the view has to know what the cell 's text is, it calls the \l{QAbstractItemModel::data()}{data()} method. Row and column information is specified with parameter \c index and the role is set to Qt::Display Role.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
+The number of rows and columns is set by \l{QAbstractItemModel::rowCount()}{MyModel::rowCount()} and \l{QAbstractItemModel::columnCount()}{MyModel::columnCount()}. 
+When the view has to know what the cell 's text is, it calls the  method. Row and column information is specified with parameter \c index and the role is set to \l{Qt::ItemDataRole}{Qt::DisplayRole}.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
 
 This small example demonstrates the passive nature of a model. The model does not know when it will be used or which data is needed. It simply provides data each time the view requests it. 
 
@@ -126,7 +126,7 @@ Each formatting property will be requested from the model with a separate call t
             \o  Meaning
             \o  Type 
         \row
-            \o  Qt::DisplayRole
+            \o  \l{Qt::ItemDataRole}{Qt::DisplayRole}
             \o  text
             \o  QString
         \row
@@ -143,15 +143,15 @@ Each formatting property will be requested from the model with a separate call t
             \o  enum Qt::AlignmentFlag
         \row
 	    \o {1, 3} Qt::CheckStateRole
-	    \o {1, 3} suppresses checkboxes with QVariant(), sets checkboxes with Qt::Checked or Qt::Unchecked
-	    \o {1, 3} enum Qt::ItemDataRole
+	    \o {1, 3} suppresses checkboxes with \l{QVariant}{QVariant()}, sets checkboxes with Qt::Checked or Qt::Unchecked
+	    \o {1, 3} \l{Qt::ItemDataRole}{enum Qt::ItemDataRole}
 
     \endtable
 
 Refer to Qt documentation to learn more about  enum Qt::ItemDataRole's capabilities.
 
 
-Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()}) is invoked and expensive lookup operations are cached.
+Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()} is invoked and expensive lookup operations are cached.
 
 \section2 2.3 A clock inside a table cell
 \image clock.png
@@ -168,7 +168,7 @@ Here is the corresponding slot:
 
     \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_b
 
-We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QTableView::setModel}{setModel()} .
+We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QTableView::setModel()}{setModel()}.
 
 \section2 2.4 Setting up Headers for Columns and Rows
 Headers can be hidden via a view method. 
@@ -219,7 +219,7 @@ We want to present a real tree. We have wrapped our data in the examples above i
 -------------------------------------------------------------modelview.cpp---------------------
     \snippet examples/tutorials/modelview/6_treeview/modelview.cpp Quoting ModelView Tutorial
 
-We simply instantiate a QStandardItemModel and add a couple of QStandardItems to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other \l{QStandardItem}{QStandardItems}. Nodes are collapsed and expanded within the view.
+We simply instantiate a QStandardItemModel and add a couple of \l{QStandardItem}{QStandardItems} to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other \l{QStandardItem}{QStandardItems}. Nodes are collapsed and expanded within the view.
 
 \section2 3.2 Working with selection
 
@@ -229,14 +229,14 @@ We want to access a selected item's content in order to output it into the windo
 
 So let's create a couple of items:
     \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_a
-Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemModel::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemModel::selectionChanged()}{selectionChanged()} signal.
+Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemView::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemView::selectionChanged()}{selectionChanged()} signal.
 
     \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_b
 
 We get the model index that corresponds to the selection by calling 
 \l{QItemSelectionModel::currentIndex()}{treeView->selectionModel()->currentIndex()} and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed \l{QModelIndex}{QModelIndex()}. This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
 
-The selection model (as shown above) can be retrieved, but it can also be set with \l{QAbstractItemView}{QAbstractItemView::setSelectionModel}. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemModel::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemModel::setSelectionModel()}{setSelectionModel()};
+The selection model (as shown above) can be retrieved, but it can also be set with \l{QAbstractItemView}{QAbstractItemView::setSelectionModel}. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemView::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemView::setSelectionModel()}{setSelectionModel()};
 \section2 3.3 Predefined Models
 The typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures. If one of the available data structures is suitable for your application, a predefined model can be a good choice.
 
@@ -252,7 +252,7 @@ The typical way to use model/view is to wrap specific data to make it usable wit
     \raw HTML
             <br>
     \endraw
-		QDirModel (deprecated)
+		QDirModel
             \o  Encapsulate the local file system
         \row
             \o  QSqlQueryModel
@@ -288,7 +288,7 @@ The view has a method that replaces the default delegate and installs a custom d
 
 \endcode
 
-\l{QStyledItemDelegate::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \l{QModelIndex::data()}{index.data()}. \l{QStyledItemDelegate::SizeHint}{SizeHint} specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
+\l{QStyledItemDelegate::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \l{QModelIndex::data()}{index.data()}. \l{QGraphicsLayoutItem::sizeHint()}{sizeHint} specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
 
 Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
 
@@ -540,7 +540,7 @@ Qt 4.6 comes with 17 examples and 2 Demonstrations for model/view.  The examples
         \row
             \o  Address Book
             \o  QTableView
-            \o  QTableModel
+            \o  QAbstractTableModel
 QSortFilterProxyModel
             \o  usage of  QSortFilterProxyModel to generate different subsets from one data pool
         \row
diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro
index 1162d5a..8528cde 100755
--- a/examples/tutorials/modelview/1_readonly/1_readonly.pro
+++ b/examples/tutorials/modelview/1_readonly/1_readonly.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET =   mv_readonly
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp
index 14311f9..027be56 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.cpp
+++ b/examples/tutorials/modelview/1_readonly/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #include <QTableView>
 #include "modelview.h"
diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h
index 93b6b90..d0f96cd 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.h
+++ b/examples/tutorials/modelview/1_readonly/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.cpp b/examples/tutorials/modelview/1_readonly/mymodel.cpp
index 3386907..c441720 100755
--- a/examples/tutorials/modelview/1_readonly/mymodel.cpp
+++ b/examples/tutorials/modelview/1_readonly/mymodel.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #include "mymodel.h"
 
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.h b/examples/tutorials/modelview/1_readonly/mymodel.h
index aac1bf0..c0ddf4ac6 100755
--- a/examples/tutorials/modelview/1_readonly/mymodel.h
+++ b/examples/tutorials/modelview/1_readonly/mymodel.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #ifndef MYMODEL_H
 #define MYMODEL_H
diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.pro b/examples/tutorials/modelview/2_formatting/2_formatting.pro
index 7e70d81..cdf72bf 100755
--- a/examples/tutorials/modelview/2_formatting/2_formatting.pro
+++ b/examples/tutorials/modelview/2_formatting/2_formatting.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET = mv_formatting
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/2_formatting/main.cpp b/examples/tutorials/modelview/2_formatting/main.cpp
index 998503c..7be212e 100755
--- a/examples/tutorials/modelview/2_formatting/main.cpp
+++ b/examples/tutorials/modelview/2_formatting/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/2_formatting/modelview.cpp b/examples/tutorials/modelview/2_formatting/modelview.cpp
index becd61d..2b05d4c 100755
--- a/examples/tutorials/modelview/2_formatting/modelview.cpp
+++ b/examples/tutorials/modelview/2_formatting/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QTableView>
 #include "modelview.h"
 #include "mymodel.h"
diff --git a/examples/tutorials/modelview/2_formatting/modelview.h b/examples/tutorials/modelview/2_formatting/modelview.h
index 98bee38..7291487 100755
--- a/examples/tutorials/modelview/2_formatting/modelview.h
+++ b/examples/tutorials/modelview/2_formatting/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
index 916dabc..e9e68de 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QFont>
 #include <QBrush>
 #include "mymodel.h"
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.h b/examples/tutorials/modelview/2_formatting/mymodel.h
index 01ae6cb..4dc405a 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.h
+++ b/examples/tutorials/modelview/2_formatting/mymodel.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
index d61ee4c..8b217cb 100755
--- a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
+++ b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET = mv_changingmodel
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/3_changingmodel/main.cpp b/examples/tutorials/modelview/3_changingmodel/main.cpp
index 998503c..7be212e 100755
--- a/examples/tutorials/modelview/3_changingmodel/main.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.cpp b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
index becd61d..2b05d4c 100755
--- a/examples/tutorials/modelview/3_changingmodel/modelview.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QTableView>
 #include "modelview.h"
 #include "mymodel.h"
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.h b/examples/tutorials/modelview/3_changingmodel/modelview.h
index 98bee38..7291487 100755
--- a/examples/tutorials/modelview/3_changingmodel/modelview.h
+++ b/examples/tutorials/modelview/3_changingmodel/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
index 8943003..d806945 100755
--- a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QTimer>
 #include <QTime>
 #include <QBrush>
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.h b/examples/tutorials/modelview/3_changingmodel/mymodel.h
index 9cc023b..47b026e 100755
--- a/examples/tutorials/modelview/3_changingmodel/mymodel.h
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
diff --git a/examples/tutorials/modelview/4_headers/4_headers.pro b/examples/tutorials/modelview/4_headers/4_headers.pro
index d6f8d23..13b0b1d 100755
--- a/examples/tutorials/modelview/4_headers/4_headers.pro
+++ b/examples/tutorials/modelview/4_headers/4_headers.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET = mv_headers
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/4_headers/main.cpp b/examples/tutorials/modelview/4_headers/main.cpp
index 998503c..7be212e 100755
--- a/examples/tutorials/modelview/4_headers/main.cpp
+++ b/examples/tutorials/modelview/4_headers/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/4_headers/modelview.cpp b/examples/tutorials/modelview/4_headers/modelview.cpp
index 39394da..f661ab5 100755
--- a/examples/tutorials/modelview/4_headers/modelview.cpp
+++ b/examples/tutorials/modelview/4_headers/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QTableView>
 #include <QHeaderView>
 #include "modelview.h"
diff --git a/examples/tutorials/modelview/4_headers/modelview.h b/examples/tutorials/modelview/4_headers/modelview.h
index f1b63bd..7669e35 100755
--- a/examples/tutorials/modelview/4_headers/modelview.h
+++ b/examples/tutorials/modelview/4_headers/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
diff --git a/examples/tutorials/modelview/4_headers/mymodel.cpp b/examples/tutorials/modelview/4_headers/mymodel.cpp
index 7891c80..94fde34 100755
--- a/examples/tutorials/modelview/4_headers/mymodel.cpp
+++ b/examples/tutorials/modelview/4_headers/mymodel.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include "mymodel.h"
 
 MyModel::MyModel(QObject *parent)
diff --git a/examples/tutorials/modelview/4_headers/mymodel.h b/examples/tutorials/modelview/4_headers/mymodel.h
index 327ca10..ada3169 100755
--- a/examples/tutorials/modelview/4_headers/mymodel.h
+++ b/examples/tutorials/modelview/4_headers/mymodel.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
diff --git a/examples/tutorials/modelview/5_edit/5_edit.pro b/examples/tutorials/modelview/5_edit/5_edit.pro
index e18c596..d0a2571 100755
--- a/examples/tutorials/modelview/5_edit/5_edit.pro
+++ b/examples/tutorials/modelview/5_edit/5_edit.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET = mv_edit
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/5_edit/main.cpp b/examples/tutorials/modelview/5_edit/main.cpp
index 998503c..7be212e 100755
--- a/examples/tutorials/modelview/5_edit/main.cpp
+++ b/examples/tutorials/modelview/5_edit/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/5_edit/modelview.cpp b/examples/tutorials/modelview/5_edit/modelview.cpp
index b6e8e34..d8853c9 100755
--- a/examples/tutorials/modelview/5_edit/modelview.cpp
+++ b/examples/tutorials/modelview/5_edit/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QTableView>
 #include "modelview.h"
 #include "mymodel.h"
diff --git a/examples/tutorials/modelview/5_edit/modelview.h b/examples/tutorials/modelview/5_edit/modelview.h
index e1591f9..97c840c 100755
--- a/examples/tutorials/modelview/5_edit/modelview.h
+++ b/examples/tutorials/modelview/5_edit/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
diff --git a/examples/tutorials/modelview/5_edit/mymodel.cpp b/examples/tutorials/modelview/5_edit/mymodel.cpp
index ef45bc3..6007da1 100755
--- a/examples/tutorials/modelview/5_edit/mymodel.cpp
+++ b/examples/tutorials/modelview/5_edit/mymodel.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [quoting mymodel_d]
 #include "mymodel.h"
 
diff --git a/examples/tutorials/modelview/5_edit/mymodel.h b/examples/tutorials/modelview/5_edit/mymodel.h
index 1612fa0..54f2b30 100755
--- a/examples/tutorials/modelview/5_edit/mymodel.h
+++ b/examples/tutorials/modelview/5_edit/mymodel.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #ifndef MYMODEL_H
 #define MYMODEL_H
diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.pro b/examples/tutorials/modelview/6_treeview/6_treeview.pro
index 6d078be..fa27c3a 100755
--- a/examples/tutorials/modelview/6_treeview/6_treeview.pro
+++ b/examples/tutorials/modelview/6_treeview/6_treeview.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET = mv_tree
 TEMPLATE = app
 SOURCES += main.cpp \
diff --git a/examples/tutorials/modelview/6_treeview/main.cpp b/examples/tutorials/modelview/6_treeview/main.cpp
index 998503c..7be212e 100755
--- a/examples/tutorials/modelview/6_treeview/main.cpp
+++ b/examples/tutorials/modelview/6_treeview/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/6_treeview/modelview.cpp b/examples/tutorials/modelview/6_treeview/modelview.cpp
index b5b4d06..a25e4e9 100755
--- a/examples/tutorials/modelview/6_treeview/modelview.cpp
+++ b/examples/tutorials/modelview/6_treeview/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [Quoting ModelView Tutorial]
 #include <QTreeView>
 #include <QStandardItemModel>
diff --git a/examples/tutorials/modelview/6_treeview/modelview.h b/examples/tutorials/modelview/6_treeview/modelview.h
index 1ab23ea..2329e89 100755
--- a/examples/tutorials/modelview/6_treeview/modelview.h
+++ b/examples/tutorials/modelview/6_treeview/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
diff --git a/examples/tutorials/modelview/7_selections/7_selections.pro b/examples/tutorials/modelview/7_selections/7_selections.pro
index 952641c6..671dc24 100755
--- a/examples/tutorials/modelview/7_selections/7_selections.pro
+++ b/examples/tutorials/modelview/7_selections/7_selections.pro
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 TARGET = mv_selections
 TEMPLATE = app
 SOURCES += main.cpp \
diff --git a/examples/tutorials/modelview/7_selections/main.cpp b/examples/tutorials/modelview/7_selections/main.cpp
index 998503c..7be212e 100755
--- a/examples/tutorials/modelview/7_selections/main.cpp
+++ b/examples/tutorials/modelview/7_selections/main.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/7_selections/modelview.cpp b/examples/tutorials/modelview/7_selections/modelview.cpp
index eac6df9..2ef980d 100755
--- a/examples/tutorials/modelview/7_selections/modelview.cpp
+++ b/examples/tutorials/modelview/7_selections/modelview.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 //! [quoting modelview_a]
 #include <QTreeView>
 #include <QStandardItemModel>
diff --git a/examples/tutorials/modelview/7_selections/modelview.h b/examples/tutorials/modelview/7_selections/modelview.h
index 0e638a9..5229ac3 100755
--- a/examples/tutorials/modelview/7_selections/modelview.h
+++ b/examples/tutorials/modelview/7_selections/modelview.h
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
-- 
cgit v0.12


From b7bf2ab2d0aa9e3bf073126f0e15c71e39567fcc Mon Sep 17 00:00:00 2001
From: Michael D Scull <ext-michael.scull@nokia.com>
Date: Fri, 2 Jul 2010 18:10:13 +0200
Subject:  new image for tutorial.qdoc

---
 doc/src/getting-started/tutorials.qdoc |  12 ++++
 doc/src/images/treeview_sml.png        | Bin 0 -> 17419 bytes
 doc/src/tutorials/modelview.qdoc       | 115 ++++++++++++++++++++++++++++++---
 3 files changed, 118 insertions(+), 9 deletions(-)
 create mode 100755 doc/src/images/treeview_sml.png

diff --git a/doc/src/getting-started/tutorials.qdoc b/doc/src/getting-started/tutorials.qdoc
index 6e1cee8..0a83170 100644
--- a/doc/src/getting-started/tutorials.qdoc
+++ b/doc/src/getting-started/tutorials.qdoc
@@ -71,6 +71,18 @@
     A guided tour through the translations process, explaining the
     tools provided for developers, translators and release managers.
 
+
+    \row
+    \o{2,1} \l{modelview.html}{\bold{ModelView}}
+    \o{2,1}
+    
+    \row
+    \o \image treeview_sml.png ModelView
+    \o This tutorial gives an introduction to ModelView programming using the Qt cross-platform framework
+
+    \o
+    \o
+    
     \row
     \o{2,1} \l{QTestLib Tutorial}{\bold QTestLib}
     \o{2,1} \l{qmake Tutorial}{\bold qmake}
diff --git a/doc/src/images/treeview_sml.png b/doc/src/images/treeview_sml.png
new file mode 100755
index 0000000..fb6de1d
Binary files /dev/null and b/doc/src/images/treeview_sml.png differ
diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
index 67908b9..bc03f44 100755
--- a/doc/src/tutorials/modelview.qdoc
+++ b/doc/src/tutorials/modelview.qdoc
@@ -1,12 +1,63 @@
 /*!
-
-    \contentspage{modelview.html}{Crash Course in Model/View Programming}
     \page modelview.html
 
-\title An Introduction to Model/View Programming
-Contents:
-\tableofcontents
+    \startpage {index.html}{Qt Reference Documentation}
+    \contentspage {modelview-index.html}{ModelView Contents}
+    \nextpage {modelview-part1.html}{Introduction}
+    \title ModelView Contents Page
+    \brief An introduction to ModelView programming
+
+    This tutorial gives an introduction to ModelView programming using the Qt
+    cross-platform framework.
+
+    \image treeview.png
+
+    \omit
+    It doesn't cover everything; the emphasis is on teaching the programming
+    philosophy of ModelView programming, and Qt's features are introduced as needed.
+    Some commonly used features are never used in this tutorial.
+    \endomit
+
+    In the process, we will learn about some basic technologies provided by Qt,
+    such as:
+
+    \list
+    \o The difference between standard and modelview widgets
+    \o Adapters betweeen forms and models
+    \o Developing a simple Model/View application
+    \o Intermediate topics such as:
+      \list
+      \o Tree views
+      \o Selection
+      \o Predefined models
+      \o Delegates
+      \o Debugging with model test
+      \endlist
+    \endlist
+
+    If you are completely new to Qt, please read \l{How to Learn Qt} if you
+    have not already done so.
+
+    The tutorial's source code is located in Qt's \c examples/tutorials/modelview
+    directory.
+
+    \list 1
+    \o \l{modelview-part1.html}{Introduction}
+    \o \l{modelview-part2.html}{Developing a simple ModelView application}
+    \o \l{modelview-part3.html}{Intermediate Topics}
+    \o \l{modelview-part4.html}{Good Sources for Additional Information}
+    \endlist
 
+
+*/
+
+/*!
+    \page modelview-part1.html
+    \title An Introduction to Model/View Programming
+
+    \raw HTML
+            <br>
+    \endraw
 \section1 1 Introduction
 Model/View is a technology used to separate data from views in widgets that handle data sets. Standard Widgets are not designed for separating data from views and this is why Qt 4 has two different types of widgets. Both types of widgets look the same, but they interact with data differently.
     \table
@@ -64,6 +115,27 @@ We often prefer editing data stored in tables (e.g. in database tables) in forms
 Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter.
 \image qcompleter.png
 
+
+*/
+
+/*!
+
+
+    \page modelview-part2-main-cpp.html
+    \title main.cpp
+    \quotefile tutorials/modelview/1_readonly/main.cpp
+
+
+*/
+
+/*!
+    \page modelview-part2.html
+    \title ModelView Chapter 2 - A Simple Model/View Application
+   
+    \raw HTML
+            <br>
+    \endraw
+    
 \section1 2 A Simple Model/View Application
 If you want to develop a model/view application, where should you start? We recommend starting with a simple example and extending it step-by-step. This makes understanding the architecture a lot easier. Trying to understand the model/view architecture in detail before invoking the IDE has proven to be less convenient for many developers. It is substantially easier to start with a simple model/view application that has demo data. Give it a try! Simply replace the data in the examples below with your own.
 
@@ -75,7 +147,7 @@ We start with an application that uses a \l QTableView to show data. We will add
 -------------------------------------------------------------main.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/main.cpp Quoting ModelView Tutorial
 
-We have the usual \l {tutorials/modelview/1_readonly/main.cpp}{main()} function;
+We have the usual \l {modelview-part2-main-cpp.html}{main()} function;
 -------------------------------------------------------------modelview.h---------------------
     \snippet examples/tutorials/modelview/1_readonly/modelview.h Quoting ModelView Tutorial
 
@@ -148,7 +220,7 @@ Each formatting property will be requested from the model with a separate call t
 
     \endtable
 
-Refer to Qt documentation to learn more about  enum Qt::ItemDataRole's capabilities.
+Refer to Qt documentation to learn more about enum Qt::ItemDataRole's capabilities.
 
 
 Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()} is invoked and expensive lookup operations are cached.
@@ -198,9 +270,20 @@ In the constructor, we fill \c QStringList gridData with 6 items. (one item for
 \l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
     \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_f
 
-Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
+Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | \c  Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
+
+*/
 
+/*!
+    \page modelview-part3.html
+    \title ModelView Chapter 3 - Intermediate Topics
+    \raw HTML
+            <br>
+    \endraw
 \section1 3 Intermediate Topics
+    \raw HTML
+            <br>
+    \endraw
 \section2 3.1 TreeView
 
 You can convert the example above into an application with a tree view. Simply replace QTableView with QTreeView, which results in a read/write tree. No changes have to be made to the model. The tree won't have any hierarchies because there aren't any hierarchies in the model itself.
@@ -288,7 +371,7 @@ The view has a method that replaces the default delegate and installs a custom d
 
 \endcode
 
-\l{QStyledItemDelegate::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \l{QModelIndex::data()}{index.data()}. \l{QGraphicsLayoutItem::sizeHint()}{sizeHint} specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
+\l{QStyledItemDelegate::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \l{QModelIndex::data()}{index.data()}. \l{QAbstractItemDelegate::sizeHint()}{sizeHint} specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
 
 Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
 
@@ -342,7 +425,21 @@ Model/View NG is a research project. You are welcome to checkout the source code
 \raw HTML
 <br>
 \endraw
+
+*/
+
+/*!
+    \page modelview-part4.html
+    
+    \title ModelView Chapter 4 - Good Sources for Additional Information
+    
+    \raw HTML
+            <br>
+    \endraw
 \section1 4 Good Sources for Additional Information
+\raw HTML
+<br>
+\endraw
 \section2 4.1 Books
 Model/View programming is covered quite extensively in the documentation of Qt but also in several good books. 
     \list 1
-- 
cgit v0.12


From 03da6bf799823d8b2f7aa8ebe337076dd5d170e4 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Wed, 7 Jul 2010 18:12:46 +0100
Subject: Added trace statements to Phonon MMF backend

Reviewed-by: trustme
---
 src/3rdparty/phonon/mmf/videoplayer_surface.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/3rdparty/phonon/mmf/videoplayer_surface.cpp b/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
index 343370c..f380e69 100644
--- a/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
+++ b/src/3rdparty/phonon/mmf/videoplayer_surface.cpp
@@ -107,6 +107,9 @@ void MMF::SurfaceVideoPlayer::handleVideoWindowChanged()
 
 void MMF::SurfaceVideoPlayer::handleParametersChanged(VideoParameters parameters)
 {
+    TRACE_CONTEXT(SurfaceVideoPlayer::handleParametersChanged, EVideoApi);
+    TRACE_ENTRY("parameters 0x%x", parameters.operator int());
+
     TRect rect;
     if (m_videoOutput) {
         m_videoOutput->dump();
@@ -137,12 +140,20 @@ void MMF::SurfaceVideoPlayer::handleParametersChanged(VideoParameters parameters
             }
         }
     }
+
+    TRACE_EXIT_0();
 }
 
 void MMF::SurfaceVideoPlayer::addDisplayWindow(const TRect &rect)
 {
+    TRACE_CONTEXT(SurfaceVideoPlayer::addDisplayWindow, EVideoApi);
+    TRACE_ENTRY("rect %d %d - %d %d", rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY);
+
     Q_ASSERT(!m_displayWindow);
     RWindow *window = static_cast<RWindow *>(m_window);
+
+    TRACE("window 0x%08x", window);
+
     if (window) {
         window->SetBackgroundColor(TRgb(0, 0, 0, 255));
         CVideoPlayerUtility2 *player = static_cast<CVideoPlayerUtility2 *>(m_player.data());
@@ -152,11 +163,17 @@ void MMF::SurfaceVideoPlayer::addDisplayWindow(const TRect &rect)
             m_displayWindow = window;
         else
             setError(tr("Video display error"), err);
+	TRACE("err %d", err);
     }
+
+    TRACE_EXIT_0();
 }
 
 void MMF::SurfaceVideoPlayer::removeDisplayWindow()
 {
+    TRACE_CONTEXT(SurfaceVideoPlayer::removeDisplayWindow, EVideoApi);
+    TRACE("player 0x%08x window 0x%08x", m_player.data(), m_displayWindow);
+
     CVideoPlayerUtility2 *player = static_cast<CVideoPlayerUtility2 *>(m_player.data());
     if (player && m_displayWindow) {
         player->RemoveDisplayWindow(*m_displayWindow);
-- 
cgit v0.12


From 656fd8d3f308205c811a8b1b1c9230ce5f8fc49e Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Wed, 7 Jul 2010 18:43:04 +0100
Subject: Use lower case for including system header files

All platform includes are now lower case, i.e. '#include <foobar.h>'
rather than '#include <FooBar.h>'.

Note that Qt includes are still camel case, e.g.
'#include <QtGui/QWidget>'

Task-number: QTBUG-6528
Reviewed-by: trustme
---
 src/3rdparty/phonon/mmf/abstractaudioeffect.h   | 2 +-
 src/3rdparty/phonon/mmf/audioequalizer.cpp      | 2 +-
 src/3rdparty/phonon/mmf/bassboost.cpp           | 2 +-
 src/3rdparty/phonon/mmf/environmentalreverb.cpp | 2 +-
 src/3rdparty/phonon/mmf/loudness.cpp            | 2 +-
 src/3rdparty/phonon/mmf/stereowidening.cpp      | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
index 70adcf6..8879636 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
@@ -21,7 +21,7 @@ along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <QScopedPointer>
 
-#include <AudioEffectBase.h>
+#include <audioeffectbase.h>
 
 #include <phonon/effectinterface.h>
 
diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp
index 1d2bbd4..28433f6 100644
--- a/src/3rdparty/phonon/mmf/audioequalizer.cpp
+++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp
@@ -16,7 +16,7 @@ along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
-#include <AudioEqualizerBase.h>
+#include <audioequalizerbase.h>
 #include "audioequalizer.h"
 
 QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp
index 67076f6..81d9208 100644
--- a/src/3rdparty/phonon/mmf/bassboost.cpp
+++ b/src/3rdparty/phonon/mmf/bassboost.cpp
@@ -16,7 +16,7 @@ along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
-#include <BassBoostBase.h>
+#include <bassboostbase.h>
 #include "bassboost.h"
 
 QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp
index d4f5223..c500385 100644
--- a/src/3rdparty/phonon/mmf/environmentalreverb.cpp
+++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp
@@ -16,7 +16,7 @@ along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
-#include <EnvironmentalReverbBase.h>
+#include <environmentalreverbbase.h>
 #include "environmentalreverb.h"
 
 QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/loudness.cpp b/src/3rdparty/phonon/mmf/loudness.cpp
index ca05ab0..22d7518 100644
--- a/src/3rdparty/phonon/mmf/loudness.cpp
+++ b/src/3rdparty/phonon/mmf/loudness.cpp
@@ -16,7 +16,7 @@ along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
-#include <LoudnessBase.h>
+#include <loudnessbase.h>
 #include "loudness.h"
 
 QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/stereowidening.cpp b/src/3rdparty/phonon/mmf/stereowidening.cpp
index f90651b..e452160 100644
--- a/src/3rdparty/phonon/mmf/stereowidening.cpp
+++ b/src/3rdparty/phonon/mmf/stereowidening.cpp
@@ -16,7 +16,7 @@ along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
-#include <StereoWideningBase.h>
+#include <stereowideningbase.h>
 #include "stereowidening.h"
 
 QT_BEGIN_NAMESPACE
-- 
cgit v0.12


From 95e55e6bbfaf76166b64e7f57c612826afd19a86 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Wed, 7 Jul 2010 20:39:30 +0200
Subject: typos fixed

Reviewed-by: TrustMe
---
 examples/qtconcurrent/progressdialog/main.cpp | 2 +-
 src/corelib/concurrent/qtconcurrentmap.cpp    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/qtconcurrent/progressdialog/main.cpp b/examples/qtconcurrent/progressdialog/main.cpp
index 04a18dc..369d82c 100644
--- a/examples/qtconcurrent/progressdialog/main.cpp
+++ b/examples/qtconcurrent/progressdialog/main.cpp
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
     QProgressDialog dialog;
     dialog.setLabelText(QString("Progressing using %1 thread(s)...").arg(QThread::idealThreadCount()));
  
-    // Create a QFutureWatcher and conncect signals and slots.
+    // Create a QFutureWatcher and connect signals and slots.
     QFutureWatcher<void> futureWatcher;
     QObject::connect(&futureWatcher, SIGNAL(finished()), &dialog, SLOT(reset()));
     QObject::connect(&dialog, SIGNAL(canceled()), &futureWatcher, SLOT(cancel()));
diff --git a/src/corelib/concurrent/qtconcurrentmap.cpp b/src/corelib/concurrent/qtconcurrentmap.cpp
index 39a13fb..e74d69c 100644
--- a/src/corelib/concurrent/qtconcurrentmap.cpp
+++ b/src/corelib/concurrent/qtconcurrentmap.cpp
@@ -70,7 +70,7 @@
     \value UnorderedReduce Reduction is done in an arbitrary order.
     \value OrderedReduce Reduction is done in the order of the
     original sequence.
-    \value SequentialReduce Reduction is done sequentally: only one
+    \value SequentialReduce Reduction is done sequentially: only one
     thread will enter the reduce function at a time. (Parallel reduction
     might be supported in a future version of Qt Concurrent.)
 */
-- 
cgit v0.12


From 28f84d2ed4000391f855140f57c359bc858d4799 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Thu, 8 Jul 2010 09:18:50 +0200
Subject: qdoc: Fixed table of contents for namespace pages.

Task-number: QTBUG-11992
---
 tools/qdoc3/htmlgenerator.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 441cfc6..1e455dd 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -2034,7 +2034,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
             }
         }
     }
-    else if (sections && (node->type() == Node::Class)) {
+    else if (sections && ((node->type() == Node::Class) ||
+                          (node->type() == Node::Namespace))) {
         QList<Section>::ConstIterator s = sections->begin();
         while (s != sections->end()) {
             if (!s->members.isEmpty() || !s->reimpMembers.isEmpty()) {
-- 
cgit v0.12


From ab4e036137ba21bd6296837af1594db45064bce3 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 10:18:07 +0200
Subject: Doc: fixing typos

---
 doc/src/declarative/qdeclarativeintro.qdoc | 2 +-
 doc/src/getting-started/examples.qdoc      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 9126a79..3f1b184 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -314,7 +314,7 @@ Item {
 
 \section2 Signal Handlers
 
-Signal handlers allow actions to be taken in reponse to an event.  For instance,
+Signal handlers allow actions to be taken in response to an event.  For instance,
 the \l MouseArea element has signal handlers to handle mouse press, release
 and click:
 
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index b6766d5..a32d120 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -343,8 +343,8 @@
 /*!
     \page examples-draganddrop.html
     \ingroup all-examples
-    \title Drag &amp Drop Examples
-    \brief How to access your platform's native darg &amp drop functionality
+    \title Drag &amp; Drop Examples
+    \brief How to access your platform's native darg &amp; drop functionality
 
     \image draganddrop-examples.png
 
-- 
cgit v0.12


From 8feb9c7ee7deda8c5fa3459108d349497af82924 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 10:20:09 +0200
Subject: Doc: fixing typo

---
 tools/qdoc3/test/qt-html-templates.qdocconf | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 31c9d5a..b7dead2 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -113,7 +113,6 @@ HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
 			  "              <li class=\"defaultLink\"><a href=\"tutorials.html\">Tutorials</a></li>\n" \
 			  "              <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \
 			  "              <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \
-			  "              <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li>\n" \
 			  "            </ul> \n" \
 			  "          </div>\n" \
 			  "        </div>\n" \
@@ -160,8 +159,8 @@ HTML.footer             = "        <!-- /div -->\n" \
 			  "  <div id=\"feedbackBox\">\n" \
 			  "      <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
 			  "    <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
-			  "      <p id=\"noteHead\">Thank you for giving your feedback. <div class=\"note\">Make sure it is related the page. For more general bugs and \n" \
-			  "      requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a></div></p>\n" \
+			  "      <p id=\"noteHead\">Thank you for giving your feedback. <div class=\"note\">Make sure it is related to this specific page. For more general bugs and \n" \
+			  "      requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</div></p>\n" \
 			  "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
 			  "      <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
 			  "    </form>\n" \
-- 
cgit v0.12


From 272ccd24941465fd6a8fc79d9f7ab8546a6ce870 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 10:21:17 +0200
Subject: Doc: Fixing broken link

---
 doc/src/index.qdoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 18a1746..22ee63f 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -44,7 +44,7 @@
                   <li><a href="installation.html">Installation &amp; first steps</a></li>
                   <li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
                   <li><a href="tutorials.html">Tutorials</a></li>
-                  <li><a href="examples.html">Examples</a></li>
+                  <li><a href="all-examples.html">Examples</a></li>
                   <li><a href="qt4-7-intro.html">Whats new in Qt 4.7</a></li>
                 </ul>
               </div>
-- 
cgit v0.12


From 25e3227fc922f75cc772aadb9dd07cc8b965dcbd Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Thu, 8 Jul 2010 10:24:49 +0200
Subject: doc: Added doc for accessing views and models from delegates.

Task-number: QTBUG-11648
---
 doc/src/declarative/qdeclarativemodels.qdoc | 73 +++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index b44e6f2..a2f4d3a 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -429,4 +429,77 @@ Rectangle {
 }
 \endcode
 
+\section1 Accessing Views and Models from Delegates
+
+You can access the view for which a delegate is used, and its
+properties, by using ListView.view in a delegate on a ListView, or
+GridView.view in a delegate on a GridView, etc. In particular, you can
+access the model and its properties by using ListView.view.model.
+
+This is useful when you want to use the same delegate for a number of
+views, for example, but you want decorations or other features to be
+different for each view, and you would like these different settings to
+be properties of each of the views. Similarly, it might be of interest
+to access or show some properties of the model.
+
+In the following example, the delegate shows the property \e{language}
+of the model, and the color of one of the fields depends on the
+property \e{fruit_color} of the view.
+
+\code
+Rectangle {
+     width: 200; height: 200
+
+    ListModel {
+        id: fruitModel
+        property string language: "en"
+        ListElement {
+            name: "Apple"
+            cost: 2.45
+        }
+        ListElement {
+            name: "Orange"
+            cost: 3.25
+        }
+        ListElement {
+            name: "Banana"
+            cost: 1.95
+        }
+    }
+
+    Component {
+        id: fruitDelegate
+        Row {
+                Text { text: " Fruit: " + name; color: ListView.view.fruit_color }
+                Text { text: " Cost: $" + cost }
+                Text { text: " Language: " + ListView.view.model.language }
+        }
+    }
+
+    ListView {
+        property color fruit_color: "green"
+        model: fruitModel
+        delegate: fruitDelegate
+        anchors.fill: parent
+    }
+}
+\endcode
+
+Another important case is when some action (e.g. mouse click) in the
+delegate should update data in the model. In this case you can define
+a function in the model, e.g.:
+
+\code
+        setData(int row, const QString & field_name, QVariant new_value),
+\endcode
+
+...and call it from the delegate using:
+
+\code
+        ListView.view.model.setData(index, field, value)
+\endcode
+
+...assuming that \e{field} holds the name of the field which should be
+updated, and that \e{value} holds the new value.
+
 */
-- 
cgit v0.12


From 2ef8b92ececbf9d33d7c0b44f46c7c975fb0fdaa Mon Sep 17 00:00:00 2001
From: "Bradley T. Hughes" <bradley.hughes@nokia.com>
Date: Thu, 8 Jul 2010 08:42:27 +0200
Subject: QUUid::createUuid() should not generate identical sequences on UNIX

An unintended side-effect of commit
90a082c9076f35dcca092ade019891e92692710e is that if qrand() is used
without being seeded first, then createUuid() would always generate the
same sequence. This quite likely to happen considering the Qt does not
actually seed the PRNG, but does use it in many places (we do not call
qsrand(), but we do often call qrand()).

Fix this by changing qrand() to calculate a seed, instead of defaulting to
1. This allows us to remove the qsrand() overload with no arguments, since
qrand() will now seed automatically unless manually seeded by the programmer.

Task-number: QTBUG-11213
Reviewed-by: thiago
---
 src/corelib/global/qglobal.cpp | 58 ++++++------------------------------------
 src/corelib/plugin/quuid.cpp   | 12 +++------
 2 files changed, 12 insertions(+), 58 deletions(-)

diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 66519be..b24ba38 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2586,55 +2586,6 @@ void qsrand(uint seed)
 #endif
 }
 
-/*! \internal
-    \relates <QtGlobal>
-    \since 4.6
-
-    Seed the PRNG, but only if it has not already been seeded.
-
-    The default seed is a combination of current time, a stack address and a
-    serial counter (since thread stack addresses are re-used).
-*/
-void qsrand()
-{
-#if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD)
-    SeedStorage *seedStorage = randTLS();
-    if (seedStorage) {
-        SeedStorageType *pseed = seedStorage->localData();
-        if (pseed) {
-            // already seeded
-            return;
-        }
-        seedStorage->setLocalData(pseed = new SeedStorageType);
-        // start beyond 1 to avoid the sequence reset
-        static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
-        *pseed = QDateTime::currentDateTime().toTime_t()
-                 + quintptr(&pseed)
-                 + serial.fetchAndAddRelaxed(1);
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
-        // for Windows and Symbian the srand function must still be called.
-        srand(*pseed);
-#endif
-    }
-
-//QT_NO_THREAD implementations
-#else
-    static unsigned int seed = 0;
-
-    if (seed)
-        return;
-
-#if defined(Q_OS_SYMBIAN)
-    seed = Math::Random();
-#elif defined(Q_OS_WIN)
-    seed = GetTickCount();
-#else
-    seed = quintptr(&seed) + QDateTime::currentDateTime().toTime_t();
-#endif
-    srand(seed);
-#endif // defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD)
-}
-
 /*!
     \relates <QtGlobal>
     \since 4.2
@@ -2658,7 +2609,14 @@ int qrand()
         SeedStorageType *pseed = seedStorage->localData();
         if (!pseed) {
             seedStorage->setLocalData(pseed = new SeedStorageType);
-            *pseed = 1;
+
+            // Seed the PRNG, but only if it has not already been seeded. The
+            // default seed is a combination of current time, a stack address
+            // and a serial counter (since thread stack addresses are re-used).
+            static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
+            *pseed = QDateTime::currentDateTime().toTime_t()
+                     + quintptr(&pseed)
+                     + serial.fetchAndAddRelaxed(1);
         }
         return rand_r(pseed);
     } else {
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 8541c7d..6a7d35c 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -577,23 +577,19 @@ QUuid QUuid::createUuid()
 
 QT_BEGIN_INCLUDE_NAMESPACE
 #include "qdatetime.h"
-#include "stdlib.h" // For srand/rand
 QT_END_INCLUDE_NAMESPACE
 
-extern void qsrand(); // in qglobal.cpp
-
 QUuid QUuid::createUuid()
 {
     static const int intbits = sizeof(int)*8;
     static int randbits = 0;
     if (!randbits) {
+        int r = 0;
         int max = RAND_MAX;
-        do { ++randbits; } while ((max=max>>1));
+        do { ++r; } while ((max=max>>1));
+        randbits = r;
     }
 
-    // reseed, but only if not already seeded
-    qsrand();
-
     QUuid result;
     uint *data = &(result.data1);
     int chunks = 16 / sizeof(uint);
@@ -601,7 +597,7 @@ QUuid QUuid::createUuid()
         uint randNumber = 0;
         for (int filled = 0; filled < intbits; filled += randbits)
             randNumber |= qrand()<<filled;
-         *(data+chunks) = randNumber;
+        *(data+chunks) = randNumber;
     }
 
     result.data4[0] = (result.data4[0] & 0x3F) | 0x80;        // UV_DCE
-- 
cgit v0.12


From b24a4194b2b0c4420e1a8e4a95c73fd6673088d3 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 10:30:43 +0200
Subject: Doc: Fixing typo - background file name

---
 examples/declarative/tutorials/samegame/samegame1/samegame.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
index 68f8712..80567ef 100644
--- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
@@ -55,7 +55,7 @@ Rectangle {
         Image {
             id: background
             anchors.fill: parent
-            source: "../shared/pics/background.jpg"
+            source: "../shared/pics/background.png"
             fillMode: Image.PreserveAspectCrop
         }
     }
-- 
cgit v0.12


From 3062dac75befacffc1964d49392a58f5fb0b583f Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 10:36:50 +0200
Subject: Doc: adding HTML class names and style docs to the generator

---
 tools/qdoc3/htmlgenerator.cpp | 66 ++++++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 1e455dd..5b6ea28 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -909,13 +909,13 @@ int HtmlGenerator::generateAtom(const Atom *atom,
 				else
 					out() << "<tr class=\"even\">";
 
-					out() << "<tr><th>Constant</th>"
-                      << "<th>Value</th>"
-                      << "<th>Description</th></tr>\n";
+					out() << "<tr><th class=\"tblConst\">Constant</th>"
+                      << "<th class=\"tblval\">Value</th>"
+                      << "<th class=\"tbldscr\">Description</th></tr>\n";
             }
             else {
                 out() << "<table class=\"valuelist\">"
-                      << "<tr><th>Constant</th><th>Value</th></tr>\n";
+                      << "<tr><th class=\"tblConst\">Constant</th><th class=\"tblVal\">Value</th></tr>\n";
             }
         }
         else {
@@ -1129,9 +1129,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
     case Atom::TableItemLeft:
         {
             if (inTableHeader)
-                out() << "<th";
+                out() << "<th ";
             else
-                out() << "<td";
+                out() << "<td ";
 
             QStringList spans = atom->string().split(",");
             if (spans.size() == 2) {
@@ -1764,35 +1764,37 @@ void HtmlGenerator::generateHeader(const QString& title,
 
     if (offlineDocs)
 	{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />";
+		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Style common to all browsers
+		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/OfflineStyle.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
-		out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator
+		out() << "<body class=\"offline narrow\">\n"; // narrow mainly for Creator
+		out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
 		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
 	}	
     else
 		{
 		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />";
-		out() << "  <!--[if IE]>\n";
-		out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
-		out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
-		out() << "<![endif]-->\n";
-		out() << "<!--[if lt IE 7]>\n";
-		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
-		out() << "<![endif]-->\n";
-		out() << "<!--[if IE 7]>\n";
-		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
-		out() << "<![endif]-->\n";
-		out() << "<!--[if IE 8]>\n";
-		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
-		out() << "<![endif]-->\n";
+		// out() << "  <!--[if IE]>\n";
+		// out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
+		// out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
+		// out() << "<![endif]-->\n";
+		// out() << "<!--[if lt IE 7]>\n";
+		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
+		// out() << "<![endif]-->\n";
+		// out() << "<!--[if IE 7]>\n";
+		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
+		// out() << "<![endif]-->\n";
+		// out() << "<!--[if IE 8]>\n";
+		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
+		// out() << "<![endif]-->\n";
 		// jquery functions
 		out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
 		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
 		// menus and small docs js and css
-		out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
-		out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
+		// out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
+		// out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
+		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
+		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
 		
 		// syntax highlighter js and css
 	//		out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shCore.css\"/>\n";
@@ -1804,7 +1806,7 @@ void HtmlGenerator::generateHeader(const QString& title,
 	//	 out() << " </script>\n";
 		
 		out() << "</head>\n";
-		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
+		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; // CheckEmptyAndLoadList() activating online search
 		}
 
 #ifdef GENERATE_MAC_REFS    
@@ -2296,20 +2298,20 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
             out() << "<tr class=\"odd topAlign\">";
         else
             out() << "<tr class=\"even topAlign\">";
-        out() << "<td><p>";
+        out() << "<td class=\"tblName\"><p>";
         generateFullName(node, relative, marker);
         out() << "</p></td>";
 
         if (!(node->type() == Node::Fake)) {
             Text brief = node->doc().trimmedBriefText(name);
             if (!brief.isEmpty()) {
-                out() << "<td><p>";
+                out() << "<td class=\"tblDescr\"><p>";
                 generateText(brief, node, marker);
                 out() << "</p></td>";
             }
         }
         else {
-            out() << "<td><p>";
+            out() << "<td class=\"tblDescr\"><p>";
             out() << protectEnc(node->doc().briefText().toString());
             out() << "</p></td>";
         }
@@ -4073,7 +4075,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
                 else
                     out() << "<tr class=\"even\">";
 				
-                out() << "<td><p>";
+                out() << "<td class=\"tblQmlPropNode\"><p>";
 
                 out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
                 if (!qpn->isWritable())
@@ -4097,7 +4099,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
 			out() << "<tr class=\"odd\">";
 		else
 			out() << "<tr class=\"even\">";
-        out() << "<td><p>";
+        out() << "<td class=\"tblQmlFuncNode\"><p>";
         out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
         generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
         //generateQmlItem(qsn,relative,marker,false);
@@ -4114,7 +4116,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
 			out() << "<tr class=\"odd\">";
 		else
 			out() << "<tr class=\"even\">";
-        out() << "<td><p>";
+        out() << "<td class=\"tblQmlFuncNode\"><p>";
         out() << "<a name=\"" + refForNode(qmn) + "\"></a>";
         generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false);
         out() << "</p></td></tr>";
-- 
cgit v0.12


From baab1d25cbae435a6a84ba75c2702350adb027cc Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 10:49:14 +0200
Subject: Doc: fixing link to devnet

---
 tools/qdoc3/test/qt-html-templates.qdocconf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index b7dead2..e032d6f 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -17,7 +17,7 @@ HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
 			  "    <div id=\"nav-topright\">\n" \
 			  "      <ul>\n" \
 			  "        <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \
-			  "        <li class=\"nav-topright-dev\"><a href=\"http://qt.nokia.com/developer\">DEV</a></li>\n" \
+			  "        <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/">DEV</a></li>\n" \
 			  "        <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \
 			  "        <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \
 			  "          DOC</a></li>\n" \
-- 
cgit v0.12


From a538ccb93fd05b26dc7a7058bbb62e0dcb682f81 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 11:13:17 +0200
Subject: Doc: changing index page

---
 doc/src/index.qdoc                          |  33 +-
 doc/src/template/style/OfflineStyle.css     | 832 ----------------------------
 tools/qdoc3/htmlgenerator.cpp               |  52 +-
 tools/qdoc3/test/qt-html-templates.qdocconf |   1 -
 4 files changed, 62 insertions(+), 856 deletions(-)
 delete mode 100644 doc/src/template/style/OfflineStyle.css

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 22ee63f..657f5d0 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -44,7 +44,7 @@
                   <li><a href="installation.html">Installation &amp; first steps</a></li>
                   <li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
                   <li><a href="tutorials.html">Tutorials</a></li>
-                  <li><a href="all-examples.html">Examples</a></li>
+                  <li><a href="examples.html">Examples</a></li>
                   <li><a href="qt4-7-intro.html">Whats new in Qt 4.7</a></li>
                 </ul>
               </div>
@@ -56,30 +56,29 @@
             <div class="indexboxcont indexboxbar ">
               <div class="sectionlist tricol">
                 <ul>
-                  <li><a href="classes.html">Class index</a></li>
-                  <li><a href="functions.html">Function index</a></li>
-                  <li><a href="modules.html">Modules</a></li>
-                  <li><a href="namespaces.html">Namespaces</a></li>
-		  <li><a href="qtglobal.html">Global stuff</a></li>
-		  <li><a href="qdeclarativeelements.html">QML elements</a></li>
+					<li><a href="classes.html">Class index</a></li>
+					<li><a href="functions.html">Function index</a></li>
+					<li><a href="modules.html">Modules</a></li>
+					<li><a href="namespaces.html">Namespaces</a></li>
+					<li><a href="qtglobal.html">Global stuff</a></li>
                 </ul>
               </div>
               <div class="sectionlist  tricol">
                 <ul>
-		  <li><a href="qt-basic-concepts.html">Basic Qt Architecture</a></li>
-		  <li><a href="declarativeui.html">Device UI's &amp; Qt Quick</a></li>
-		  <li><a href="qt-gui-concepts.html">Desktop UI components</a></li>
-		  <li><a href="platform-specific.html">Platform-specific info</a></li>
-		  <li><a href="qt-graphics.html">Graphics, Painting &amp; Printing</a></li>
-                  <li><a href="qt-network.html">Input/Output &amp; networking</a></li>
+					<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
+					<li><a href="qt-basic-concepts.html">Qt Architecture</a></li>
+					<li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
+					<li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
+					<li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
                 </ul>
               </div>
               <div class="sectionlist">
                 <ul>
-                  <li><a href="model-view-programming.html">Model/View programming</a></li>
-                  <li><a href="technology-apis.html">Qt API's for other technologies</a></li>
-                  <li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
-                  <li><a href="developing-with-qt.html">Cross-platform development</a></li>
+					<li><a href="declarativeui.html">Qt Quick</a></li>
+					<li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
+					<li><a href="qdeclarativeelements.html">QML Elements</a></li>
+					<li><a href="qt-gui-concepts.html">UI components</a></li>
+					<li><a href="declarativeui.html">Qt & GUI design</a></li>
                 </ul>
               </div>
             </div>
diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css
deleted file mode 100644
index afa7de0..0000000
--- a/doc/src/template/style/OfflineStyle.css
+++ /dev/null
@@ -1,832 +0,0 @@
-@media screen
-{
-    html
-    {
-        color: #000000;
-        background: #FFFFFF;
-    }
-    body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td
-    {
-        margin: 0;
-        padding: 0;
-    }
-    table
-    {
-        border-collapse: collapse;
-        border-spacing: 0;
-    }
-    fieldset, img
-    {
-        border: 0;
-    }
-    address, caption, cite, code, dfn, em, strong, th, var, optgroup
-    {
-        font-style: inherit;
-        font-weight: inherit;
-    }
-    del, ins
-    {
-        text-decoration: none;
-    }
-    li
-    {
-        list-style: none;
-    }
-    caption, th
-    {
-        text-align: left;
-    }
-    h1, h2, h3, h4, h5, h6
-    {
-        font-size: 100%;
-    }
-    q:before, q:after
-    {
-        content: '';
-    }
-    abbr, acronym
-    {
-        border: 0;
-        font-variant: normal;
-    }
-    sup
-    {
-        vertical-align: baseline;
-    }
-    sub
-    {
-        vertical-align: baseline;
-    }
-	tt, .qmlreadonly span, .qmldefault span
-	{
-		word-spacing:5px;
-	}
-    .heading
-    {
-        font: normal 600 16px/1.0 Arial;
-    }
-    .subtitle
-    {
-        font-size: 13px;
-    }
-    .small-subtitle
-    {
-        font-size: 13px;
-    }
-    legend
-    {
-        color: #000000;
-    }
-    input, button, textarea, select, optgroup, option
-    {
-        font-family: inherit;
-        font-size: inherit;
-        font-style: inherit;
-        font-weight: inherit;
-    }
-    input, button, textarea, select
-    {
-        font-size: 100%;
-    }
-    body
-    {
-        font: normal 13px/1.2 Verdana;
-        color: #363534;
-    }
-    strong
-    {
-        font-weight: bold;
-    }
-    em
-    {
-        font-style: italic;
-    }
-    a
-    {
-        color: #00732f;
-        text-decoration: none;
-    }
-    .header, .footer, .wrapper
-    {
-        /*min-width: 600px;*/
-        max-width: 1500px;
-        margin: 0 5px;
-    }
-    .wrapper
-    {
-	position:relative;
-	top:50px;
-    }
-    .wrapper .bd
-    {
-        position: relative;
-    }
-
-    .header, .footer
-    {
-        display: block;
-        clear: both;
-        overflow: hidden;
-    }
-    .header
-    {
-        height: 115px;
-        position: relative;
-    }
-    
-    
-    .header .qtref
-    {
-        position: absolute;
-        top: 28px;
-        left: 88px;
-        width: 302px;
-        height: 22px;
-    }
-    .header .qtref span
-    {
-        display: block;
-        height: 22px;
-    }
-    .wrap .content h1
-    {
-        font: 600 18px/1.2 Arial;
-    }
-    .wrap .content h2
-    {
-        font: 600 16px/1.2 Arial;
-    }
-    .wrap .content h3
-    {
-        font: 600 14px/1.2 Arial;
-    }
-    .wrap .content h4
-    {
-        font: 600 12px/1.2 Arial;
-    }
-	
-    .wrap .content p
-    {
-        line-height: 20px;
-        padding: 5px;
-    }
-    .wrap .content table p
-    {
-        line-height: 20px;
-        padding: 0px;
-    }	
-    .wrap .content ul
-    {
-        padding-left: 25px;
-        padding-top: 10px;
-    }
-    a:hover
-    {
-        color: #4c0033;
-        text-decoration: underline;
-    }
-    .content a:visited
-    {
-        color: #4c0033;
-        text-decoration: none;
-    }
-     .content a:visited:hover
-    {
-        color: #4c0033;
-        text-decoration: underline;
-    }   
-
-    pre
-    {
-        border: 1px solid #DDDDDD;
-        margin: 0 20px 10px 10px;
-        padding: 20px 15px 20px 20px;
-        overflow-x: auto;
-    }
-    table, pre
-    {
-        -moz-border-radius: 7px 7px 7px 7px;
-        background-color: #F6F6F6;
-        border: 1px solid #E6E6E6;
-        border-collapse: separate;
-        font-size: 11px;
-        /*min-width: 395px;*/
-        margin-bottom: 25px;
-        display: inline-block;
-    }
-    thead
-    {
-        margin-top: 5px;
-		font:600 12px/1.2 Arial;
-    }
-    th
-    {
-        padding: 5px 15px 5px 15px;
-        background-color: #E1E1E1;
-      /*  border-bottom: 1px solid #E6E6E6;*/
-        border-left: 1px solid #E6E6E6;
-      /*  border-right: 1px solid #E6E6E6;*/
-    }
-    td
-    {
-        padding: 3px 15px 3px 20px;
-  /*      border-left: 1px solid #E6E6E6;
-        border-right: 1px solid #E6E6E6;*/
-    }
-    tr.odd td:hover,  tr.even td:hover
-    {
-    /*    border-right: 1px solid #C3C3C3;
-        border-left: 1px solid #C3C3C3;*/
-    }
-		
-	td.rightAlign
-	{
-        padding: 3px 15px 3px 10px;
-	}
-    table tr.odd
-    {
-        border-left: 1px solid #E6E6E6;
-        background-color: #F6F6F6;
-        color: #66666E;
-    }
-    table tr.even
-    {
-        border-left: 1px solid #E6E6E6;
-        background-color: #ffffff;
-        color: #66666E;
-    }
-    table tr.odd td:hover, table tr.even td:hover
-    {
-        background-color: #E6E6E6;
-    }
-    		
-    span.comment
-    {
-        color: #8B0000;
-        font-style: italic;
-    }
-    span.string, span.char
-    {
-        color: #254117;
-    }
-
-    .qmltype
-    {
-        text-align: center;
-        font-size: 160%;
-    }
-    .qmlreadonly
-    {
-        float: right;
-        color: #254117;
-    }
-
-    .qmldefault
-    {
-        float: right;
-        color: red;
-    }
-
-	.footer
-    {
-		border-top:1px solid #E5E5E5;
-        min-height: 100px;
-        color: #797775;
-        font: normal 9px/1 Verdana;
-        text-align: center;
-        padding-top: 40px;
-        margin: 0;
-    }
-
-    
-     .wrap
-    {
-        margin: 0 5px 0 5px;
-    }
-    .wrap .toolbar
-    {
-     display:block;
-    }
-
-    .wrap .breadcrumb ul li
-    {
-        float: left;
-        background: url(../images/breadcrumb.png) no-repeat 0 5px;
-        padding-left: 15px;
-        margin-left: 15px;
-        font-weight: bold;
-    }
-    .wrap .breadcrumb ul li.last
-    {
-        font-weight: normal;
-    }
-    .wrap .breadcrumb ul li a
-    {
-      /*  color: #363534;*/
-        color: #00732F;
-    }
-    .wrap .breadcrumb ul li.first
-    {
-        background-image: none;
-        padding-left: 0;
-        margin-left: 0;
-    }
-    .wrap .content
-    {
-		word-wrap:break-word;
-    }
-    .wrap .content li
-    {
-        /*padding-left: 12px;*/
-        background: url(../images/bullet_sq.png) no-repeat 0 5px;
-        font: normal 400 10pt/1 Verdana;
-       /* color: #44a51c;*/
-        margin-bottom: 10px; 
-    }
-
-    .offline .wrap .content
-    {
-        padding-top: 15px;
-    }
-
-    .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
-    {
-        content: ".";
-        display: block;
-        height: 0;
-        clear: both;
-        visibility: hidden;
-    }
-    
-    hr
-    {
-        background-color: #E6E6E6;
-        border: 1px solid #E6E6E6;
-        height: 1px;
-        width: 100%;
-        text-align: left;
-        margin: 5px 0px 5px 0px;
-    }
-
-    .content .alignedsummary
-    {
-        margin: 5px;
-		width:100%;
-    }
-
-     
-    .toc
-    {
-        float: right;
-        -moz-border-radius: 7px 7px 7px 7px;
-        background-color: #F6F6F6;
-        border: 1px solid #DDDDDD;
-        margin: 0 20px 10px 10px;
-        padding: 20px 15px 20px 20px;
-        height: auto;
-        width: 200px;
-    }
-
-    .toc h3, .generic a
-    {
-        font: 600 12px/1.2 Arial;
-    }
-
-    .wrap .content .toc ul
-    {
-        padding-left: 0px;
-    }
-
-
-    .wrap .content .toc .level2
-    {
-        margin-left: 15px;
-    }
-
-    .wrap .content .toc .level3
-    {
-        margin-left: 30px;
-    }
-
-    .content .toc li
-    {
-        font: normal 10px/1.2 Verdana;
-        background: url(../images/bullet_dn.png) no-repeat 0 5px;
-    }
-	
-	
-	.generic{
-		max-width:75%;
-	}
-	.generic td{
-		padding:0;
-	}
-	
-	.generic .odd .alphaChar{
-        background-color: #F6F6F6;
-	}
-	
-	.generic .even .alphaChar{
-        background-color: #FFFFFF;
-	}
-
-	.highlightedCode
-	{
-	margin:10px;
-	}
-
-	.flowList{
-	vertical-align:top;
-	}	
-	.alphaChar{
-	width:100%;
-	background-color:#F6F6F6;
-	border:1px solid #E6E6E6;
-	font-size:12pt;
-	padding-left:10px;
-	margin-top:10px;
-	margin-bottom:10px;
-	}
-
-	.flowList dl{
-	}
-	.flowList dd{
-	display:inline-block;
-	margin-left:10px;
-	width:250px;
-	}
-	.wrap .content .flowList p{
-	padding:0px;
-	}
-	
-    .relpage
-    {
-        -moz-border-radius: 7px 7px 7px 7px;
-        border: 1px solid #DDDDDD;
-        padding: 25px 25px;
-        clear: both;
-    }
-    .relpage ul
-    {
-        float: none;
-        padding: 15px;
-    }
-    .content .relpage li
-    {
-        font: normal 11px/1.2 Verdana;
-    }
-    h3.fn, span.fn
-    {
-        background-color: #F6F6F6;
-        border-width: 1px;
-        border-style: solid;
-        border-color: #E6E6E6;
-        font-weight: bold;
-		word-spacing:3px;
-    }
-
-	.functionIndex {
-	font-size:12pt;
-	word-spacing:10px;
-	margin-bottom:10px;
-    background-color: #F6F6F6;
-    border-width: 1px;
-    border-style: solid;
-    border-color: #E6E6E6;
-	width:100%;
-	}
-	
-	.centerAlign {	text-align:center;}
-	.rightAlign {text-align:right;}
-	.leftAlign {text-align:left;}
-	.topAlign{vertical-align:top	}
-	.functionIndex a{display:inline-block;}
-
-    /* start index box */
-    .indexbox
-    {
-        width: 100%;
-		display:inline-block;
-    }
-
-    .indexboxcont { display: block; }
-
-    .indexboxbar
-    {
-		border-bottom:1px solid #E5E5E5;
-        margin-bottom: 25px;
-    }
-
-    .indexboxcont .section
-    {
-        display: inline-block;
-        padding:0 2% 0 1%;
-        vertical-align:top;
-	}
-
-	.indexboxcont .section {
-	  float: left;
-	}
-
-    .indexboxcont .section p
-    {
-        padding-top: 20px;
-        padding-bottom: 20px;
-    }
-    .indexboxcont .sectionlist
-    {
-        display: inline-block;
-		vertical-align:top;
-        padding: 0;
-    }
-    .indexboxcont .sectionlist ul
-    {
-        margin-bottom: 20px;
-    }
-
-    .indexboxcont .sectionlist ul li
-    {
-        line-height: 12px;
-    }
-
-    .content .indexboxcont li
-    {
-        font: normal 600 13px/1 Verdana;
-    }
-
-    .indexbox a:hover, .indexbox a:visited:hover
-    {
-        color: #4c0033;
-        text-decoration: underline;
-    }
-
-    .indexbox a:visited
-    {
-        color: #00732f;
-        text-decoration: none;
-    }
-	
-	.indexbox .indexIcon {
-	width: 11%;
-	}
-	
-   
-    .indexboxcont:after
-    {
-        content: ".";
-        display: block;
-        height: 0;
-        clear: both;
-        visibility: hidden;
-    }
-	
-    body.offline
-    {
-      background-image: none;
-    }
-
-    .offline .footer {
-      margin: 0;
-    }
-    .offline .header
-    {
-      width: 100%;
-      margin: 0;
-      height: auto;
-      background-color: #ffffff;
-      padding: 10px 0 5px 0;
-      overflow: visible;
-	  border-bottom: solid #E5E5E5 1px;
-	  z-index:1;
-	  position:fixed;
-    }
-
-    .offline .header .content
-    {
-    }
-    .offline .header .qtref
-    {
-      color: #00732F;
-      position: static;
-      float: left;
-      margin-left: 5px;
-      font: bold 18px/1 Arial;
-    }
-
-    .offline .header .qtref:visited
-    {
-      color: #00732F;
-	  }
-    .offline .header .qtref:hover
-    {
-      color: #00732F;
-	  text-decoration:none;
-	  }
-    .offline .header .qtref span
-    {
-      background-image: none;
-      text-indent: 0;
-	  text-decoration:none;
-    }
-
-    .offline .wrap
-    {
-        margin: 0 5px 0 5px;
-    }
-
-    .offline .wrap .toolbar
-    {
-      display:block;
-	  padding-top:5px;
-    }
-
-    .offline .wrap .breadcrumb ul li {
-      font-weight: normal;
-    }
-
-    .offline .wrap .breadcrumb ul li a {
-      /*color: #44a51c;*/
-    }
-
-    .offline .wrap .breadcrumb ul li.last a {
-      /*color: #363534;*/
-    }
-    
-
-    
-    .narrow .indexboxcont .section {
-      width: 64%;
-      padding-left: 0;
-    }
-    
-    .narrow .indexboxcont .sectionlist {
-      width: 32.5%;
-    }
-
-    .header .icon,
-	.sidebar,
-	.feedback,
-	.t_button,
-    .feedback,
-	#feedbackBox,
-	#feedback,
-	#blurpage,
-	.indexbox .indexIcon span,
-	.wrapper .hd,
-	.offline .indexbox .indexIcon,
-	.offline .header #nav-logo,
-	#offlinemenu,
-	#offlinesearch,
-	.offline .header #nav-topright,
-    .offline .header #shortCut ,
-	.offline .wrapper .hd,
-    .offline .wrapper .ft,
-	.offline .sidebar,
-	.offline .wrap .feedback
-    {
-	display:none;
-    }
-
-    /* end offline mode */
-#narrowmenu {
-      display: none;
-      float: right;
-      margin: 15px 40px 0 0;
-      font-size: 11px;
-    }
-
-    .narrow #narrowmenu {
-      display: block;
-    }
-	
-	#narrowsearch{
-		display:none;
-	}
-
-	#narrowmenu ul
-	{
-	  border-bottom:solid 1px #E5E5E5;
-	  border-left:solid 1px #E5E5E5;
-	  border-right:solid 1px #E5E5E5;
-	}
-
-    #narrowmenu a {
-      line-height: 1.1;
-      background: url(../images/arrow_down.png) no-repeat 100% 50%;
-      white-space: nowrap;
-      padding: 0 16px 0 5px;
-    }
-
-    #narrowmenu li {
-      margin-left: 20px;
-    }
-
-    #narrowmenu li li {
-      margin: 0 0 5px 0;
-    }
-
-    #narrowmenu li li a {
-      padding: 0;
-      background-image: none;
-    }
-
-    #narrowmenu li,
-    #narrowmenu li ul {
-      background-color: #fff;
-    }
-
-    #narrowmenu li ul {
-      width: auto;
-      padding: 5px;
- 	  margin-top:-15px;
-   }
-
-    .sf-menu li:hover ul, .sf-menu li.sfHover ul {
-      top: 1.2em;
-    }
-.sf-menu, .sf-menu * {
-	margin:			0;
-	padding:		0;
-	list-style:		none;
-}
-.sf-menu {
-	line-height:	1.0;
-}
-.sf-menu ul {
-	position:		absolute;
-	top:			-999em;
-	width:			10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
-	width:			100%;
-}
-.sf-menu li:hover {
-	visibility:		inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
-	float:			left;
-	position:		relative;
-}
-.sf-menu a {
-	display:		block;
-	position:		relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
-	left:			0;
-	top:			2.5em; /* match top ul list item height */
-	z-index:		99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
-	top:			-999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
-	left:			10em; /* match ul width */
-	top:			0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
-	top:			-999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
-	left:			10em; /* match ul width */
-	top:			0;
-}
-	.wrap .content ol li {
-	background:none;
-	font:400 10pt/1 Verdana;
-	margin-bottom:10px;
-	margin-left:12px;
-	}
-	.wrap .content ol li {
-	list-style-type:decimal;
-
-	}
-
-
-
-}
-/* end of screen media */
-
-/* start of print media */
-
-@media print
-{
-     input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
-    {
-        display: none;
-        background: none;
-    }
-    .content
-    {
-        position: absolute;
-        top: 0px;
-        left: 0px;
-        background: none;
-        display: block;
-    }
-}
-/* end of print media */
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 5b6ea28..5c2d17a 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1757,22 +1757,41 @@ void HtmlGenerator::generateHeader(const QString& title,
         else
             shortVersion = "Qt " + shortVersion + ": ";
     }
-
+	// Generating page title
     out() << "  <title>" << shortVersion << protectEnc(title) << "</title>\n";
-
-    //out() << "  <title>Qt Reference Documentation</title>";
-
+	// Adding style sheet
+	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />";
+	// Adding jquery and functions - providing online tools and search features
+	out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
+	out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+	// Adding style and js for small windows
+	out() << "  <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
+	out() << "  <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
+	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
+	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
+	
+	// Adding syntax highlighter 	// future release
+	
+	// Setting assistant configuration
     if (offlineDocs)
 	{
+<<<<<<< Updated upstream:tools/qdoc3/htmlgenerator.cpp
 		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Style common to all browsers
 		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/OfflineStyle.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
 		out() << "<body class=\"offline narrow\">\n"; // narrow mainly for Creator
 		out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
 		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+=======
+		out() << "</head>\n";
+		out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator
+//		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+>>>>>>> Stashed changes:tools/qdoc3/htmlgenerator.cpp
 	}	
+	// Setting online doc configuration
     else
 		{
+<<<<<<< Updated upstream:tools/qdoc3/htmlgenerator.cpp
 		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />";
 		// out() << "  <!--[if IE]>\n";
 		// out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
@@ -1787,10 +1806,25 @@ void HtmlGenerator::generateHeader(const QString& title,
 		// out() << "<!--[if IE 8]>\n";
 		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
 		// out() << "<![endif]-->\n";
+=======
+		// Custom browser styles
+		out() << "  <!--[if IE]>\n";
+		out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
+		out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
+		out() << "<![endif]-->\n";
+		out() << "<!--[if lt IE 7]>\n";
+		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
+		out() << "<![endif]-->\n";
+		out() << "<!--[if IE 7]>\n";
+		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
+		out() << "<![endif]-->\n";
+		out() << "<!--[if IE 8]>\n";
+		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
+		out() << "<![endif]-->\n";
+>>>>>>> Stashed changes:tools/qdoc3/htmlgenerator.cpp
 		// jquery functions
-		out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
-		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
 		// menus and small docs js and css
+<<<<<<< Updated upstream:tools/qdoc3/htmlgenerator.cpp
 		// out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
 		// out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
 		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
@@ -1807,6 +1841,12 @@ void HtmlGenerator::generateHeader(const QString& title,
 		
 		out() << "</head>\n";
 		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; // CheckEmptyAndLoadList() activating online search
+=======
+				
+		out() << "</head>\n";
+		// CheckEmptyAndLoadList activating search
+		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
+>>>>>>> Stashed changes:tools/qdoc3/htmlgenerator.cpp
 		}
 
 #ifdef GENERATE_MAC_REFS    
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index e032d6f..550d80f 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -22,7 +22,6 @@ HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
 			  "        <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \
 			  "          DOC</a></li>\n" \
 			  "        <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \
-			  "        <li class=\"nav-topright-shop\"><a title=\"SHOP\" href=\"http://shop.qt.nokia.com\">SHOP</a></li>\n" \
 			  "      </ul>\n" \
 			  "    </div>\n" \
 			  "    <div id=\"shortCut\">\n" \
-- 
cgit v0.12


From 5a6e3d952327753cb0cc00fa22804c5dab435c39 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 11:17:16 +0200
Subject: Doc: cleaning html generator

---
 tools/qdoc3/htmlgenerator.cpp | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 5c2d17a..7075efc 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1775,23 +1775,17 @@ void HtmlGenerator::generateHeader(const QString& title,
 	// Setting assistant configuration
     if (offlineDocs)
 	{
-<<<<<<< Updated upstream:tools/qdoc3/htmlgenerator.cpp
 		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Style common to all browsers
 		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/OfflineStyle.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
 		out() << "<body class=\"offline narrow\">\n"; // narrow mainly for Creator
-		out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
-		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
-=======
 		out() << "</head>\n";
 		out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator
 //		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
->>>>>>> Stashed changes:tools/qdoc3/htmlgenerator.cpp
 	}	
 	// Setting online doc configuration
     else
 		{
-<<<<<<< Updated upstream:tools/qdoc3/htmlgenerator.cpp
 		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />";
 		// out() << "  <!--[if IE]>\n";
 		// out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
@@ -1806,7 +1800,6 @@ void HtmlGenerator::generateHeader(const QString& title,
 		// out() << "<!--[if IE 8]>\n";
 		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
 		// out() << "<![endif]-->\n";
-=======
 		// Custom browser styles
 		out() << "  <!--[if IE]>\n";
 		out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
@@ -1821,32 +1814,13 @@ void HtmlGenerator::generateHeader(const QString& title,
 		out() << "<!--[if IE 8]>\n";
 		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
 		out() << "<![endif]-->\n";
->>>>>>> Stashed changes:tools/qdoc3/htmlgenerator.cpp
-		// jquery functions
-		// menus and small docs js and css
-<<<<<<< Updated upstream:tools/qdoc3/htmlgenerator.cpp
-		// out() << " <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
-		// out() << " <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
-		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
-		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
-		
-		// syntax highlighter js and css
-	//		out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shCore.css\"/>\n";
-	//		out() << " <link type=\"text/css\" rel=\"stylesheet\" href=\"style/shThemeDefault.css\"/>\n";
-	//		out() << " <script type=\"text/javascript\" src=\"scripts/shCore.js\"></script>\n";
-	//		out() << " <script type=\"text/javascript\" src=\"scripts/shBrushCpp.js\"></script>\n";
-	//	 out() << " <script type=\"text/javascript\">\n";
-	//	 out() << " 	SyntaxHighlighter.all();\n";
-	//	 out() << " </script>\n";
 		
 		out() << "</head>\n";
 		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; // CheckEmptyAndLoadList() activating online search
-=======
 				
 		out() << "</head>\n";
 		// CheckEmptyAndLoadList activating search
 		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
->>>>>>> Stashed changes:tools/qdoc3/htmlgenerator.cpp
 		}
 
 #ifdef GENERATE_MAC_REFS    
-- 
cgit v0.12


From 16264dc0035260d3e68f1ed22ea647e7c157bd3c Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 11:19:37 +0200
Subject: Doc: fixing escape character

---
 tools/qdoc3/test/qt-html-templates.qdocconf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 550d80f..b428a90 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -17,7 +17,7 @@ HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
 			  "    <div id=\"nav-topright\">\n" \
 			  "      <ul>\n" \
 			  "        <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \
-			  "        <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/">DEV</a></li>\n" \
+			  "        <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/\">DEV</a></li>\n" \
 			  "        <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \
 			  "        <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \
 			  "          DOC</a></li>\n" \
-- 
cgit v0.12


From 25ace9513587abb5e52f78d900e6bec7b04bb663 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 11:35:27 +0200
Subject: Doc: more cleaning

---
 tools/qdoc3/htmlgenerator.cpp | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 7075efc..567a297 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1766,8 +1766,8 @@ void HtmlGenerator::generateHeader(const QString& title,
 	out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
 	// Adding style and js for small windows
 	out() << "  <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
-	out() << "  <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
 	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
+	out() << "  <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
 	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
 	
 	// Adding syntax highlighter 	// future release
@@ -1775,32 +1775,14 @@ void HtmlGenerator::generateHeader(const QString& title,
 	// Setting assistant configuration
     if (offlineDocs)
 	{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Style common to all browsers
-		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/OfflineStyle.css\" />"; // Only for Qt Creator
+		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/CreatorStyle.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
 		out() << "<body class=\"offline narrow\">\n"; // narrow mainly for Creator
-		out() << "</head>\n";
-		out() << "<body class=\"offline narrow\" >\n"; // narrow mainly for Creator
-//		out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
 	}	
 	// Setting online doc configuration
     else
 		{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"\n />";
-		// out() << "  <!--[if IE]>\n";
-		// out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
-		// out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
-		// out() << "<![endif]-->\n";
-		// out() << "<!--[if lt IE 7]>\n";
-		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
-		// out() << "<![endif]-->\n";
-		// out() << "<!--[if IE 7]>\n";
-		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
-		// out() << "<![endif]-->\n";
-		// out() << "<!--[if IE 8]>\n";
-		// out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
-		// out() << "<![endif]-->\n";
-		// Custom browser styles
+		// Browser spec styles
 		out() << "  <!--[if IE]>\n";
 		out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
 		out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
@@ -1816,9 +1798,6 @@ void HtmlGenerator::generateHeader(const QString& title,
 		out() << "<![endif]-->\n";
 		
 		out() << "</head>\n";
-		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"; // CheckEmptyAndLoadList() activating online search
-				
-		out() << "</head>\n";
 		// CheckEmptyAndLoadList activating search
 		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
 		}
-- 
cgit v0.12


From f28a27987fa4e1b2faa1c57188c128afb735f70a Mon Sep 17 00:00:00 2001
From: "Bradley T. Hughes" <bradley.hughes@nokia.com>
Date: Thu, 8 Jul 2010 11:47:09 +0200
Subject: Compile

Re-add the stdlib.h include, since it brings in RAND_MAX

Reviewed-by: TrustMe
---
 src/corelib/plugin/quuid.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 6a7d35c..f48cc2e 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -577,6 +577,7 @@ QUuid QUuid::createUuid()
 
 QT_BEGIN_INCLUDE_NAMESPACE
 #include "qdatetime.h"
+#include <stdlib.h> // for RAND_MAX
 QT_END_INCLUDE_NAMESPACE
 
 QUuid QUuid::createUuid()
-- 
cgit v0.12


From e2db7c19dcf53458d480e148cc21f0577bcb0a44 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Wed, 7 Jul 2010 12:50:26 +0200
Subject: respect UI_DIR when creating image collections

Reviewed-by: joerg
Task-number: QTBUG-11752
---
 mkspecs/features/uic.prf | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf
index 5324e65..0a18b47 100644
--- a/mkspecs/features/uic.prf
+++ b/mkspecs/features/uic.prf
@@ -86,20 +86,20 @@ defineReplace(imageCollectionCmd) {
     for(image, $$list($$split(1))) {
            EMBEDDED_IMAGES += $$image
            count(EMBEDDED_IMAGES, 5) {
-                isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > images.tmp $$escape_expand(\\n\\t)
-                else:         RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\\n\\t)
+                isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > $${UI_DIR}/images.tmp $$escape_expand(\\n\\t)
+                else:         RET += echo $$EMBEDDED_IMAGES >> $${UI_DIR}/images.tmp $$escape_expand(\\n\\t)
                 unset(EMBEDDED_IMAGES)
            }
     }
-    !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\\n\\t)
+    !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> $${UI_DIR}/images.tmp $$escape_expand(\\n\\t)
     !isEmpty(RET) {
-        RET += $$QMAKE_UIC3 -embed $$TARGET -f images.tmp -o $$2 $$escape_expand(\\n\\t)
+        RET += $$QMAKE_UIC3 -embed $$TARGET -f $${UI_DIR}/images.tmp -o $$2 $$escape_expand(\\n\\t)
         return($$RET)
     }
     return($$QMAKE_UIC3 -embed $$TARGET $$1 -o $$2)
 }
 
-image_collection.output = qmake_image_collection$${first(QMAKE_EXT_CPP)}
+image_collection.output = $${UI_DIR}/qmake_image_collection$${first(QMAKE_EXT_CPP)}
 image_collection.variable_out = SOURCES
 image_collection.input = IMAGES
 image_collection.CONFIG += combine
@@ -109,7 +109,7 @@ image_collection.name = UIC3 Image collection in ${QMAKE_FILE_OUT}
     silent:image_collection.commands = @echo uic3 -embed ${QMAKE_FILE_IN} && $$image_collection.commands
 } else {
     image_collection.commands = ${QMAKE_FUNC_imageCollectionCmd}
-    silent:image_collection.commands = @echo uic3 -embed $$TARGET -f images.tmp && $image_collection.commands
+    silent:image_collection.commands = @echo uic3 -embed $$TARGET -f $${UI_DIR}/images.tmp && $image_collection.commands
 }
 QMAKE_EXTRA_COMPILERS += image_collection
 
-- 
cgit v0.12


From b57afadf3f91f87eba02458faa2809dd07b45da5 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Thu, 8 Jul 2010 12:27:42 +0200
Subject: fix build with sqlite2

---
 src/sql/drivers/sqlite2/qsql_sqlite2.pri | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.pri b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
index 76fe255..9a9f6cd 100644
--- a/src/sql/drivers/sqlite2/qsql_sqlite2.pri
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.pri
@@ -1,4 +1,4 @@
-HEADERS += $PWD/qsql_sqlite2.h
-SOURCES += $PWD/qsql_sqlite2.cpp
+HEADERS += $$PWD/qsql_sqlite2.h
+SOURCES += $$PWD/qsql_sqlite2.cpp
 
 !contains(LIBS, .*sqlite.*):LIBS += -lsqlite
-- 
cgit v0.12


From bd576d42be264ff60503db0da509ad16139de09f Mon Sep 17 00:00:00 2001
From: Tasuku Suzuki <tasuku.suzuki@nokia.com>
Date: Thu, 8 Jul 2010 12:47:11 +0200
Subject: Fix compilation when QT_NO_IM is defined

Merge-request: 734
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 src/gui/kernel/qapplication.cpp | 2 ++
 src/gui/kernel/qapplication.h   | 3 +++
 src/gui/kernel/qwidget.cpp      | 4 +++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index ccfe88c..d984721 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -5291,6 +5291,7 @@ bool QApplication::keypadNavigationEnabled()
     \sa QCoreApplication::instance()
 */
 
+#ifndef QT_NO_IM
 // ************************************************************************
 // Input Method support
 // ************************************************************************
@@ -5356,6 +5357,7 @@ QInputContext *QApplication::inputContext() const
 #endif
     return d->inputContext;
 }
+#endif // QT_NO_IM
 
 //Returns the current platform used by keyBindings
 uint QApplicationPrivate::currentPlatform(){
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index d31d9e5..799d4c2 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -267,8 +267,11 @@ public:
     virtual void commitData(QSessionManager& sm);
     virtual void saveState(QSessionManager& sm);
 #endif
+
+#ifndef QT_NO_IM
     void setInputContext(QInputContext *);
     QInputContext *inputContext() const;
+#endif
 
     static QLocale keyboardInputLocale();
     static Qt::LayoutDirection keyboardInputDirection();
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 233df15..fed8d0a 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -338,8 +338,10 @@ QInputContext *QWidgetPrivate::inputContext() const
 #ifndef QT_NO_IM
     if (ic)
         return ic;
-#endif
     return qApp->inputContext();
+#else
+    return 0;
+#endif
 }
 
 /*!
-- 
cgit v0.12


From a9c8decc741d8c2b340f38d7a854ef206672ab3e Mon Sep 17 00:00:00 2001
From: liang jian <jianliang79@gmail.com>
Date: Thu, 8 Jul 2010 12:56:03 +0200
Subject: Build Qt with option -Zc:wchar_t under MSVC

This will make projects generated by visual studio being successfully
linked to the Qt dlls if they use the QString::fromWCharArray() or
QString::toWCharArray() methods.

Merge-request: 727
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 mkspecs/win32-msvc2005/qmake.conf | 2 +-
 mkspecs/win32-msvc2008/qmake.conf | 2 +-
 mkspecs/win32-msvc2010/qmake.conf | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf
index 0406fd0..a5999cc 100644
--- a/mkspecs/win32-msvc2005/qmake.conf
+++ b/mkspecs/win32-msvc2005/qmake.conf
@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = byacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t
 QMAKE_CFLAGS_WARN_ON    = -W3
 QMAKE_CFLAGS_WARN_OFF   = -W0
 QMAKE_CFLAGS_RELEASE    = -O2 -MD
diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf
index 9805e90..1aab8e1 100644
--- a/mkspecs/win32-msvc2008/qmake.conf
+++ b/mkspecs/win32-msvc2008/qmake.conf
@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = byacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t
 QMAKE_CFLAGS_WARN_ON    = -W3
 QMAKE_CFLAGS_WARN_OFF   = -W0
 QMAKE_CFLAGS_RELEASE    = -O2 -MD
diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf
index 28d4d3c..34a7782 100644
--- a/mkspecs/win32-msvc2010/qmake.conf
+++ b/mkspecs/win32-msvc2010/qmake.conf
@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = byacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t
 QMAKE_CFLAGS_WARN_ON    = -W3
 QMAKE_CFLAGS_WARN_OFF   = -W0
 QMAKE_CFLAGS_RELEASE    = -O2 -MD
-- 
cgit v0.12


From bc16436e33cfc61e0009474186cbb8210fb51df7 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 13:14:06 +0200
Subject: Doc: documenting docs

---
 tools/qdoc3/htmlgenerator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 567a297..8c7d5ad 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1777,7 +1777,7 @@ void HtmlGenerator::generateHeader(const QString& title,
 	{
 		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/CreatorStyle.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
-		out() << "<body class=\"offline narrow\">\n"; // narrow mainly for Creator
+		out() << "<body class=\"offline narrow\">\n"; // offline for Creator and Assistant
 	}	
 	// Setting online doc configuration
     else
-- 
cgit v0.12


From ea7aeec080c9c39449017ff683b27d3659236336 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 13:15:47 +0200
Subject: Doc: fixing style from 600 to bold weight

---
 doc/src/template/style/style.css | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index 184a832..f7ff00a 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -18,7 +18,6 @@
     fieldset, img
     {
         border: 0;
-		height:100%;
 		width:100%
     }
     address, caption, cite, code, dfn, em, strong, th, var, optgroup
@@ -66,7 +65,7 @@
 	}
     .heading
     {
-        font: normal 600 16px/1.0 Arial;
+        font: normal bold 16px/1.0 Arial;
         padding-bottom: 15px;
     }
     .subtitle
@@ -212,7 +211,7 @@
         font-size: 11px;
     }
 
-    .offline .sidebar, .offline .feedback, .offline .t_button
+    .offline .sidebar, .offline .feedback, .offline .t_button, .offline #narrowsearch, .offline #narrowmenu
     {
         display: none;
     }
@@ -258,7 +257,7 @@
 
     .sidebar .box h2
     {
-        font: 600 16px/1.2 Arial;
+        font: bold 16px/1.2 Arial;
         padding: 0;
 /*        min-height: 32px;*/
     }
@@ -493,7 +492,7 @@
 
     .wrap .content h1
     {
-        font: 600 18px/1.2 Arial;
+        font: bold 18px/1.2 Arial;
     }
     .wrap .content h2
     {
@@ -506,7 +505,7 @@
     }
     .wrap .content h3
     {
-        font: 600 14px/1.2 Arial;
+        font: bold 14px/1.2 Arial;
 		/*border-bottom:1px solid #DDDDDD;*/
 		font:600 16px/1.2 Arial;
 		margin-top:15px;
@@ -934,7 +933,7 @@
 
     .toc h3, .generic a
     {
-        font: 600 12px/1.2 Arial;
+        font: bold 12px/1.2 Arial;
     }
 
 	.generic{
@@ -1141,7 +1140,7 @@
 
     .content .indexboxcont li
     {
-        font: normal 600 13px/1 Verdana;
+        font: normal bold 13px/1 Verdana;
     }
 
     .indexbox a:hover, .indexbox a:visited:hover
-- 
cgit v0.12


From 062ceb0ec312e54670362c76aefdcac5353d64cd Mon Sep 17 00:00:00 2001
From: Thomas Zander <t.zander@nokia.com>
Date: Tue, 6 Jul 2010 15:51:48 +0200
Subject: Avoid unneeded addition

Reviewed-By: Denis
---
 src/gui/kernel/qgesturemanager.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index e43a560..fe9dd8a 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -71,7 +71,7 @@
 QT_BEGIN_NAMESPACE
 
 QGestureManager::QGestureManager(QObject *parent)
-    : QObject(parent), state(NotGesture), m_lastCustomGestureId(0)
+    : QObject(parent), state(NotGesture), m_lastCustomGestureId(Qt::CustomGesture)
 {
     qRegisterMetaType<Qt::GestureState>();
 
@@ -119,7 +119,7 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
     if (type == Qt::CustomGesture) {
         // generate a new custom gesture id
         ++m_lastCustomGestureId;
-        type = Qt::GestureType(Qt::CustomGesture + m_lastCustomGestureId);
+        type = Qt::GestureType(m_lastCustomGestureId);
     }
     m_recognizers.insertMulti(type, recognizer);
     delete dummy;
-- 
cgit v0.12


From 8b212b5f36ef7479bb902c6f8c8c1f4335f7f39f Mon Sep 17 00:00:00 2001
From: Thomas Zander <t.zander@nokia.com>
Date: Wed, 7 Jul 2010 11:46:33 +0200
Subject: Change default TapAndHold timeout and make configurable

The new default timeout is 700ms and is what Nokia Research found
through usability studies. Nevertheless lets provide public API to
set this through a platform plugin or similar.

Reviewed-By: Denis
---
 src/gui/kernel/qgesture.cpp          | 29 +++++++++++++++++++++++++++++
 src/gui/kernel/qgesture.h            |  3 +++
 src/gui/kernel/qgesture_p.h          |  1 +
 src/gui/kernel/qstandardgestures.cpp |  7 +++----
 4 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index f5688f4..6359ecf 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -41,6 +41,7 @@
 
 #include "qgesture.h"
 #include "private/qgesture_p.h"
+#include "private/qstandardgestures_p.h"
 
 #ifndef QT_NO_GESTURES
 
@@ -726,6 +727,34 @@ void QTapAndHoldGesture::setPosition(const QPointF &value)
     d_func()->position = value;
 }
 
+/*!
+    Set the timeout, in milliseconds, before the gesture triggers.
+
+    The recognizer will detect a touch down and and if \a msecs
+    later the touch is still down, it will trigger the QTapAndHoldGesture.
+    The default value is 700 milliseconds.
+*/
+// static
+void QTapAndHoldGesture::setTimeout(int msecs)
+{
+    QTapAndHoldGesturePrivate::Timeout = msecs;
+}
+
+/*!
+    Gets the timeout, in milliseconds, before the gesture triggers.
+
+    The recognizer will detect a touch down and and if timeout()
+    later the touch is still down, it will trigger the QTapAndHoldGesture.
+    The default value is 700 milliseconds.
+*/
+// static
+int QTapAndHoldGesture::timeout()
+{
+    return QTapAndHoldGesturePrivate::Timeout;
+}
+
+int QTapAndHoldGesturePrivate::Timeout = 700; // in ms
+
 QT_END_NAMESPACE
 
 #endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index 8c10895..8f410b1 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -252,6 +252,9 @@ public:
     QPointF position() const;
     void setPosition(const QPointF &pos);
 
+    static void setTimeout(int msecs);
+    static int timeout();
+
     friend class QTapAndHoldGestureRecognizer;
 };
 
diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h
index f5474c1..29b923e 100644
--- a/src/gui/kernel/qgesture_p.h
+++ b/src/gui/kernel/qgesture_p.h
@@ -177,6 +177,7 @@ public:
 
     QPointF position;
     int timerId;
+    static int Timeout;
 };
 
 QT_END_NAMESPACE
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 62d8a53..e05f8cc 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -517,7 +517,6 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
     const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
     const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
 
-    enum { TimerInterval = 2000 };
     enum { TapRadius = 40 };
 
     switch (event->type()) {
@@ -526,21 +525,21 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
         q->setHotSpot(d->position);
         if (d->timerId)
             q->killTimer(d->timerId);
-        d->timerId = q->startTimer(TimerInterval);
+        d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
         return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
     case QEvent::MouseButtonPress:
         d->position = me->globalPos();
         q->setHotSpot(d->position);
         if (d->timerId)
             q->killTimer(d->timerId);
-        d->timerId = q->startTimer(TimerInterval);
+        d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
         return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
     case QEvent::TouchBegin:
         d->position = ev->touchPoints().at(0).startScreenPos();
         q->setHotSpot(d->position);
         if (d->timerId)
             q->killTimer(d->timerId);
-        d->timerId = q->startTimer(TimerInterval);
+        d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
         return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
     case QEvent::GraphicsSceneMouseRelease:
     case QEvent::MouseButtonRelease:
-- 
cgit v0.12


From dc1443ac784201bd9c016519d01481aeeb3d8f53 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 13:18:34 +0200
Subject: Doc: changing offline style This file will however be replaced in the
 near future

---
 doc/src/template/style/OfflineStyle.css | 251 ++++++++++++++++++++++++++++++++
 1 file changed, 251 insertions(+)
 create mode 100644 doc/src/template/style/OfflineStyle.css

diff --git a/doc/src/template/style/OfflineStyle.css b/doc/src/template/style/OfflineStyle.css
new file mode 100644
index 0000000..9f5d28b
--- /dev/null
+++ b/doc/src/template/style/OfflineStyle.css
@@ -0,0 +1,251 @@
+@media screen
+{
+
+    .wrapper
+    {
+	top:50px;
+    background: none;
+
+    }
+    .wrapper .bd
+    {
+        background: none;
+        position: relative;
+    }
+
+
+    
+ 
+    body.offline
+    {
+      background-image: none;
+      background-color: #FFFFFF;
+	  
+    }
+
+    .offline .footer {
+      margin: 0;
+    }
+    .offline .header
+    {
+      width: 100%;
+      margin: 0;
+      height: auto;
+      background-color: #ffffff;
+      padding: 10px 0 5px 0;
+      overflow: visible;
+	  border-bottom: solid #E5E5E5 1px;
+	  z-index:1;
+	  position:fixed;
+    }
+
+    .offline .header .content
+    {
+    }
+    .offline .header .qtref
+    {
+      color: #00732F;
+      position: static;
+      float: left;
+      margin-left: 5px;
+      font: bold 18px/1 Arial;
+    }
+
+    .offline .header .qtref:visited
+    {
+      color: #00732F;
+	  }
+    .offline .header .qtref:hover
+    {
+      color: #00732F;
+	  text-decoration:none;
+	  }
+    .offline .header .qtref span
+    {
+      background-image: none;
+      text-indent: 0;
+	  text-decoration:none;
+    }
+
+    .offline .wrap
+    {
+        margin: 0 5px 0 5px;
+    }
+
+    .offline .wrap .toolbar
+    {
+      display:block;
+	  padding-top:5px;
+    }
+
+    .offline .wrap .breadcrumb ul li {
+      font-weight: normal;
+    }
+
+    .offline .wrap .breadcrumb ul li a {
+      /*color: #44a51c;*/
+    }
+
+    .offline .wrap .breadcrumb ul li.last a {
+      /*color: #363534;*/
+    }
+    
+
+    
+    .narrow .indexboxcont .section {
+      width: 64%;
+      padding-left: 0;
+    }
+    
+    .narrow .indexboxcont .sectionlist {
+      width: 32.5%;
+    }
+
+    .header .icon,
+	.sidebar,
+	.feedback,
+	.t_button,
+    .feedback,
+	#feedbackBox,
+	#feedback,
+	#blurpage,
+	.indexbox .indexIcon span,
+	.wrapper .hd,
+	.offline .indexbox .indexIcon,
+	.offline .header #nav-logo,
+	#offlinemenu,
+	#offlinesearch,
+	.offline .header #nav-topright,
+    .offline .header #shortCut ,
+	.offline .wrapper .hd,
+    .offline .wrapper .ft,
+	.offline .sidebar,
+	.offline .wrap .feedback
+    {
+	display:none;
+    }
+
+    /* end offline mode */
+#narrowmenu {
+      display: none;
+      float: right;
+      margin: 15px 40px 0 0;
+      font-size: 11px;
+    }
+
+    .narrow #narrowmenu {
+      display: block;
+    }
+	
+	#narrowsearch{
+		display:none;
+	}
+
+	#narrowmenu ul
+	{
+	  border-bottom:solid 1px #E5E5E5;
+	  border-left:solid 1px #E5E5E5;
+	  border-right:solid 1px #E5E5E5;
+	}
+
+    #narrowmenu a {
+      line-height: 1.1;
+      background: url(../images/arrow_down.png) no-repeat 100% 50%;
+      white-space: nowrap;
+      padding: 0 16px 0 5px;
+    }
+
+    #narrowmenu li {
+      margin-left: 20px;
+    }
+
+    #narrowmenu li li {
+      margin: 0 0 5px 0;
+    }
+
+    #narrowmenu li li a {
+      padding: 0;
+      background-image: none;
+    }
+
+    #narrowmenu li,
+    #narrowmenu li ul {
+      background-color: #fff;
+    }
+
+    #narrowmenu li ul {
+      width: auto;
+      padding: 5px;
+ 	  margin-top:-15px;
+   }
+
+    .sf-menu li:hover ul, .sf-menu li.sfHover ul {
+      top: 1.2em;
+    }
+.sf-menu, .sf-menu * {
+	margin:			0;
+	padding:		0;
+	list-style:		none;
+}
+.sf-menu {
+	line-height:	1.0;
+}
+.sf-menu ul {
+	position:		absolute;
+	top:			-999em;
+	width:			10em; /* left offset of submenus need to match (see below) */
+}
+.sf-menu ul li {
+	width:			100%;
+}
+.sf-menu li:hover {
+	visibility:		inherit; /* fixes IE7 'sticky bug' */
+}
+.sf-menu li {
+	float:			left;
+	position:		relative;
+}
+.sf-menu a {
+	display:		block;
+	position:		relative;
+}
+.sf-menu li:hover ul,
+.sf-menu li.sfHover ul {
+	left:			0;
+	top:			2.5em; /* match top ul list item height */
+	z-index:		99;
+}
+ul.sf-menu li:hover li ul,
+ul.sf-menu li.sfHover li ul {
+	top:			-999em;
+}
+ul.sf-menu li li:hover ul,
+ul.sf-menu li li.sfHover ul {
+	left:			10em; /* match ul width */
+	top:			0;
+}
+ul.sf-menu li li:hover li ul,
+ul.sf-menu li li.sfHover li ul {
+	top:			-999em;
+}
+ul.sf-menu li li li:hover ul,
+ul.sf-menu li li li.sfHover ul {
+	left:			10em; /* match ul width */
+	top:			0;
+}
+	.wrap .content ol li {
+	background:none;
+	font:400 10pt/1 Verdana;
+	margin-bottom:10px;
+	margin-left:12px;
+	}
+	.wrap .content ol li {
+	list-style-type:decimal;
+
+	}
+
+
+
+}
+/* end of screen media */
+
-- 
cgit v0.12


From 0f5e63c6c8cdb81bfd1d202475a13b5730be9623 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 13:22:19 +0200
Subject: Doc: change on index page

---
 doc/src/index.qdoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 657f5d0..42fd4fc 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -60,7 +60,7 @@
 					<li><a href="functions.html">Function index</a></li>
 					<li><a href="modules.html">Modules</a></li>
 					<li><a href="namespaces.html">Namespaces</a></li>
-					<li><a href="qtglobal.html">Global stuff</a></li>
+					<li><a href="qtglobal.html">Global Declarations</a></li>
                 </ul>
               </div>
               <div class="sectionlist  tricol">
-- 
cgit v0.12


From 5903558f17a7a3173ad7a592892262bf297b52f2 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Thu, 8 Jul 2010 13:43:57 +0200
Subject: qdoc: Fixed broken QML property links.

Task-number: QTBUG-12038
---
 tools/qdoc3/htmlgenerator.cpp | 2 +-
 tools/qdoc3/node.cpp          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 567a297..5a8fb86 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -2949,7 +2949,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
     static const QString headerTag("headerfile");
     static const QString funcTag("func");
     static const QString linkTag("link");
-
+    
     // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
     bool done = false;
     for (int i = 0, srcSize = src.size(); i < srcSize;) {
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index b077074..da62e29 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -299,7 +299,7 @@ InnerNode::~InnerNode()
 Node *InnerNode::findNode(const QString& name)
 {
     Node *node = childMap.value(name);
-    if (node)
+    if (node && node->subType() != QmlPropertyGroup)
         return node;
     if ((type() == Fake) && (subType() == QmlClass)) {
         for (int i=0; i<children.size(); ++i) {
-- 
cgit v0.12


From 0b8a7842975b195a17b3add4c98f64baeaedcf8c Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Thu, 8 Jul 2010 14:55:17 +0200
Subject: Doc: Correcting img bug

Task-number: QTBUG-12028
---
 doc/src/template/style/style.css | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index f7ff00a..5144020 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -18,7 +18,6 @@
     fieldset, img
     {
         border: 0;
-		width:100%
     }
     address, caption, cite, code, dfn, em, strong, th, var, optgroup
     {
-- 
cgit v0.12


From 48469ecd3f2918d16ccfacb5d65f3a5e0bbfa8d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= <trond.kjernasen@nokia.com>
Date: Thu, 8 Jul 2010 15:19:04 +0200
Subject: The Q_WGL define was removed years ago.

The proper define should be Q_WS_WIN.

Task-number: QTBUG-12040
Reviewed-by: Prasanth
Reviewed-by: Eskil
---
 src/opengl/qgl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index c294e4f..0521bab 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3447,7 +3447,7 @@ QGLWidget::~QGLWidget()
     bool doRelease = (glcx && glcx->windowCreated());
 #endif
     delete d->glcx;
-#if defined(Q_WGL)
+#if defined(Q_WS_WIN)
     delete d->olcx;
 #endif
 #if defined(GLX_MESA_release_buffers) && defined(QGL_USE_MESA_EXT)
-- 
cgit v0.12


From c69dc51e5e03aaa87a9385f5557a4f6b8aaeded3 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 8 Jul 2010 15:28:24 +0200
Subject: Corrected paths

Merge-request: 715
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 src/sql/drivers/drivers.pri | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri
index 3af5525..87cc0b1 100644
--- a/src/sql/drivers/drivers.pri
+++ b/src/sql/drivers/drivers.pri
@@ -1,11 +1,11 @@
 contains(sql-drivers, all):sql-driver += psql mysql odbc oci tds db2 sqlite ibase
 
-contains(sql-drivers, psql):include($$PWD/sqlite/qsql_psql.pri)
+contains(sql-drivers, psql):include($$PWD/psql/qsql_psql.pri)
 contains(sql-drivers, mysql):include($$PWD/mysql/qsql_mysql.pri)
 contains(sql-drivers, odbc):include($$PWD/odbc/qsql_odbc.pri)
 contains(sql-drivers, oci):include($$PWD/oci/qsql_oci.pri)
 contains(sql-drivers, tds):include($$PWD/tds/qsql_tds.pri)
 contains(sql-drivers, db2):include($$PWD/db2/qsql_db2.pri)
-contains(sql-drivers, ibase):include($$PWD/db2/qsql_ibase.pri)
+contains(sql-drivers, ibase):include($$PWD/ibase/qsql_ibase.pri)
 contains(sql-drivers, sqlite2):include($$PWD/sqlite2/qsql_sqlite2.pri)
 contains(sql-drivers, sqlite):include($$PWD/sqlite/qsql_sqlite.pri)
-- 
cgit v0.12


From c48eb6d5d0a299449330dea8a6a59514942c8781 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@nokia.com>
Date: Thu, 8 Jul 2010 15:27:14 +0200
Subject: Initalize the nativeDialogInUse variable

When the variable was not initalized it would randomly show a native
font dialog or a non native one if the DontUseNativeDialogs flag was
set.

Task-number: QTBUG-12042
Reviewed-by: cduclos
---
 src/gui/dialogs/qfontdialog.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index a4bf15d..e9e3f23 100644
--- a/src/gui/dialogs/qfontdialog.cpp
+++ b/src/gui/dialogs/qfontdialog.cpp
@@ -332,6 +332,7 @@ void QFontDialogPrivate::init()
 
 #ifdef Q_WS_MAC
     delegate = 0;
+    nativeDialogInUse = false;
 #endif
 }
 
-- 
cgit v0.12


From aba1572d588396d3c9e29192ae86047b5b10070a Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Thu, 8 Jul 2010 20:58:46 +0200
Subject: Doc: Fixed incorrect QML property type.

Reviewed-by: Trust Me
---
 src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
index 0342c9f..9dcba60 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -612,7 +612,7 @@ QAction* QDeclarativeWebView::stopAction() const
 #endif // QT_NO_ACTION
 
 /*!
-    \qmlproperty real WebView::title
+    \qmlproperty string WebView::title
     This property holds the title of the web page currently viewed
 
     By default, this property contains an empty string.
-- 
cgit v0.12


From 7787b548907add8b7c2ac642d161181070050ea4 Mon Sep 17 00:00:00 2001
From: ck <qt-info@nokia.com>
Date: Fri, 9 Jul 2010 11:16:28 +0200
Subject: qhelpgenerator: Fix namespace syntax checking.

---
 tools/assistant/lib/qhelpprojectdata.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp
index b0faf0c..5247847 100644
--- a/tools/assistant/lib/qhelpprojectdata.cpp
+++ b/tools/assistant/lib/qhelpprojectdata.cpp
@@ -327,10 +327,12 @@ bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace,
     QUrl url;
     const QLatin1String scheme("qthelp");
     url.setScheme(scheme);
-    url.setHost(nameSpace);
+    const QString canonicalNamespace = nameSpace.toLower();
+    url.setHost(canonicalNamespace);
     url.setPath(vFolder);
 
-    const QString expectedUrl(scheme + QLatin1String("://") + nameSpace + slash + vFolder);
+    const QString expectedUrl(scheme + QLatin1String("://")
+        + canonicalNamespace + slash + vFolder);
     return url.isValid() && url.toString() == expectedUrl;
 }
 
-- 
cgit v0.12


From e0a102ee171ddcebb1104d98d8a4ff4993e91c1d Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 11:28:24 +0200
Subject: qdoc: Marked some missing declarative properties and functions as
 \internal.

---
 src/declarative/graphicsitems/qdeclarativeitem.cpp | 60 +++++++++++-----------
 src/declarative/qml/qdeclarativeengine.cpp         |  4 +-
 tools/qdoc3/test/qt-cpp-ignore.qdocconf            |  3 +-
 3 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 4abffc6..70874f2 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1388,26 +1388,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
 */
 
 /*!
-    \property QDeclarativeItem::baseline
-    \internal
-*/
-
-/*!
-    \property QDeclarativeItem::focus
-    \internal
-*/
-
-/*!
-    \property QDeclarativeItem::wantsFocus
-    \internal
-*/
-
-/*!
-    \property QDeclarativeItem::transformOrigin
-    \internal
-*/
-
-/*!
     \fn void QDeclarativeItem::childrenRectChanged(const QRectF &)
     \internal
 */
@@ -1970,6 +1950,9 @@ QVariant QDeclarativeItem::inputMethodQuery(Qt::InputMethodQuery query) const
     return v;
 }
 
+/*!
+  \internal
+ */
 void QDeclarativeItem::keyPressPreHandler(QKeyEvent *event)
 {
     Q_D(QDeclarativeItem);
@@ -1980,6 +1963,9 @@ void QDeclarativeItem::keyPressPreHandler(QKeyEvent *event)
     d->doneEventPreHandler = true;
 }
 
+/*!
+  \internal
+ */
 void QDeclarativeItem::keyReleasePreHandler(QKeyEvent *event)
 {
     Q_D(QDeclarativeItem);
@@ -1990,6 +1976,9 @@ void QDeclarativeItem::keyReleasePreHandler(QKeyEvent *event)
     d->doneEventPreHandler = true;
 }
 
+/*!
+  \internal
+ */
 void QDeclarativeItem::inputMethodPreHandler(QInputMethodEvent *event)
 {
     Q_D(QDeclarativeItem);
@@ -2000,7 +1989,6 @@ void QDeclarativeItem::inputMethodPreHandler(QInputMethodEvent *event)
     d->doneEventPreHandler = true;
 }
 
-
 /*!
     \internal
 */
@@ -2539,11 +2527,6 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi
   \sa {qmlstates}{States}
 */
 
-/*!
-  \property QDeclarativeItem::state
-  \internal
-*/
-
 /*! \internal */
 QString QDeclarativeItemPrivate::state() const
 {
@@ -2566,11 +2549,6 @@ void QDeclarativeItemPrivate::setState(const QString &state)
   For more information see \l Transform.
 */
 
-/*!
-  \property QDeclarativeItem::transform
-  \internal
-*/
-
 /*! \internal */
 QDeclarativeListProperty<QGraphicsTransform> QDeclarativeItem::transform()
 {
@@ -2859,6 +2837,26 @@ void QDeclarativeItem::setSmooth(bool smooth)
 }
 
 /*!
+  \property QDeclarativeItem::focus
+  \internal
+*/
+
+/*!
+  \property QDeclarativeItem::transform
+  \internal
+*/
+
+/*!
+  \property QDeclarativeItem::transformOrigin
+  \internal
+*/
+
+/*!
+  \property QDeclarativeItem::wantsFocus
+  \internal
+*/
+
+/*!
     \internal
     Return the width of the item
 */
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 036c854..1ce668c 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1077,7 +1077,7 @@ If you are certain the files will be local, you could simplify to:
 \snippet doc/src/snippets/declarative/componentCreation.js 2
 
 To create a QML object from an arbitrary string of QML (instead of a file),
-use \l{Qt::createQmlObject()}{Qt.createQmlObject()}.
+use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
 */
 
 QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QScriptEngine *engine)
@@ -1124,7 +1124,7 @@ Each object in this array has the members \c lineNumber, \c columnNumber, \c fil
 
 Note that this function returns immediately, and therefore may not work if
 the \a qml string loads new components (that is, external QML files that have not yet been loaded).
-If this is the case, consider using \l{Qt::createComponent()}{Qt.createComponent()} instead.
+If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead.
 */
 
 QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index dcf33dc..8cc4fd9 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -90,4 +90,5 @@ Cpp.ignoredirectives    = Q_DECLARE_HANDLE \
                           __attribute__ \
                           K_DECLARE_PRIVATE \
                           PHONON_OBJECT \
-                          PHONON_HEIR
+                          PHONON_HEIR \
+			  Q_PRIVATE_PROPERTY
-- 
cgit v0.12


From 8079d2951419a983df7b83cfa31f00665c3e76a3 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@nokia.com>
Date: Fri, 9 Jul 2010 11:52:06 +0200
Subject: Fix a couple of memory leaks due to not releasing CFTypes on Mac

Reviewed-by: Prasanth Ullattil
---
 src/corelib/io/qfsfileengine_unix.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 33e00f6..76a3512 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -1017,7 +1017,7 @@ QString QFSFileEngine::fileName(FileName file) const
 #if !defined(QWS) && defined(Q_OS_MAC)
         QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, QCFString(d->filePath),
                                                               kCFURLPOSIXPathStyle, true);
-        if (CFDictionaryRef dict = CFBundleCopyInfoDictionaryForURL(url)) {
+        if (QCFType<CFDictionaryRef> dict = CFBundleCopyInfoDictionaryForURL(url)) {
             if (CFTypeRef name = (CFTypeRef)CFDictionaryGetValue(dict, kCFBundleNameKey)) {
                 if (CFGetTypeID(name) == CFStringGetTypeID())
                     return QCFString::toQString((CFStringRef)name);
@@ -1135,7 +1135,7 @@ QString QFSFileEngine::fileName(FileName file) const
                 if (FSResolveAliasFile(&fref, true, &isFolder, &isAlias) == noErr && isAlias) {
                     AliasHandle alias;
                     if (FSNewAlias(0, &fref, &alias) == noErr && alias) {
-                        CFStringRef cfstr;
+                        QCFString cfstr;
                         if (FSCopyAliasInfo(alias, 0, 0, &cfstr, 0, 0) == noErr)
                             return QCFString::toQString(cfstr);
                     }
-- 
cgit v0.12


From 3b0a4bcf854e1d63b947e3f1690748850d416a6f Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 12:07:20 +0200
Subject: doc: Fixed last of the declarative/QML qdoc warnings.

---
 doc/src/declarative/advtutorial.qdoc               | 24 ++++++++++++++--------
 .../graphicsitems/qdeclarativeloader.cpp           |  7 +++----
 .../graphicsitems/qdeclarativetextedit.cpp         |  5 +++--
 src/declarative/util/qdeclarativexmllistmodel.cpp  |  2 +-
 4 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index 9c72e95..740f6f9 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -164,14 +164,22 @@ The \c createBlock() function creates a block from the \c Block.qml file
 and moves the new block to its position on the game canvas. This involves several steps:
 
 \list
-\o \l {Qt::createComponent()}{Qt.createComponent()} is called to generate an element from \c Block.qml.
-   If the component is ready, we can call \c createObject() to create an instance of the \c Block item.
-\o If \c createObject() returned null (i.e. if there was an error while
-   loading the object), print the error information.
-\o Place the block in its position on the board and set its width and height.
-   Also, store it in the blocks array for future reference.
-\o Finally, print error information to the console if the component could not be
-   loaded for some reason (for example, if the file is missing).
+
+\o \l {QML:Qt::createComponent()}{Qt.createComponent()} is called to
+   generate an element from \c Block.qml.  If the component is ready,
+   we can call \c createObject() to create an instance of the \c Block
+   item.
+
+\o If \c createObject() returned null (i.e. if there was an error
+   while loading the object), print the error information.
+
+\o Place the block in its position on the board and set its width and
+   height.  Also, store it in the blocks array for future reference.
+
+\o Finally, print error information to the console if the component
+   could not be loaded for some reason (for example, if the file is
+   missing).
+
 \endlist
 
 
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index c8c9e44..cc7f8e5 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -118,9 +118,9 @@ void QDeclarativeLoaderPrivate::initResize()
     be instantiated may be specified directly by the \l sourceComponent
     property, or loaded from a URL via the \l source property.
 
-    Loader can be used to delay the creation of a component until it is required.
-    For example, this loads "Page1.qml" as a component into the \l Loader element
-    when the \l MouseArea is clicked:
+    Loader can be used to delay the creation of a component until it
+    is required.  For example, this loads "Page1.qml" as a component
+    into the Loader element, when the \l MouseArea is clicked:
 
     \code
     import Qt 4.7
@@ -165,7 +165,6 @@ void QDeclarativeLoaderPrivate::initResize()
 /*!
     \internal
     \class QDeclarativeLoader
-    \qmlclass Loader
  */
 
 /*!
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index c6566ff..3f179da 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -202,8 +202,9 @@ QString QDeclarativeTextEdit::text() const
 
     Sets the font size in pixels.
 
-    Using this function makes the font device dependent.
-    Use \l pointSize to set the size of the font in a device independent manner.
+    Using this function makes the font device dependent.  Use
+    \l{TextEdit::font.pointSize} to set the size of the font in a
+    device independent manner.
 */
 
 /*!
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 0692aaa..8ed34ab 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -589,7 +589,7 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
     with a combined value of all key roles that is not already present in
     the model.
 
-    \sa {declarative/rssnews}{RSS News demo}
+    \sa {RSS News}
 */
 
 QDeclarativeXmlListModel::QDeclarativeXmlListModel(QObject *parent)
-- 
cgit v0.12


From e649d255bc3785c9af7c36e743ac204c8890137e Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Fri, 9 Jul 2010 12:18:18 +0200
Subject: Doc: Adding support for Qt Creator style

Adding a variable to the qdocconf file will now generate the docs in Creator format

Reviewed-by: Martin Smith
---
 tools/qdoc3/config.h          |  1 +
 tools/qdoc3/htmlgenerator.cpp | 18 ++++++++++++++++--
 tools/qdoc3/htmlgenerator.h   |  1 +
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index c29becc..af58a3f 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -143,6 +143,7 @@ class Config
 #define CONFIG_NATURALLANGUAGE          "naturallanguage"
 #define CONFIG_OBSOLETELINKS            "obsoletelinks"
 #define CONFIG_ONLINE                   "online"
+#define CONFIG_CREATOR                  "creator"
 #define CONFIG_OUTPUTDIR                "outputdir"
 #define CONFIG_OUTPUTENCODING           "outputencoding"
 #define CONFIG_OUTPUTLANGUAGE           "outputlanguage"
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index c1e01d7..16b45d6 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -214,6 +214,7 @@ HtmlGenerator::HtmlGenerator()
       numTableRows(0),
       threeColumnEnumValueTable(true),
       offlineDocs(true),
+      creatorDocs(false),
       funcLeftParen("\\S(\\()"),
       myTree(0),
       slow(false),
@@ -276,6 +277,7 @@ void HtmlGenerator::initializeGenerator(const Config &config)
 
     project = config.getString(CONFIG_PROJECT);
     offlineDocs = !config.getBool(CONFIG_ONLINE);
+    creatorDocs = !config.getBool(CONFIG_CREATOR);
     projectDescription = config.getString(CONFIG_DESCRIPTION);
     if (projectDescription.isEmpty() && !project.isEmpty())
         projectDescription = project + " Reference Documentation";
@@ -1775,9 +1777,17 @@ void HtmlGenerator::generateHeader(const QString& title,
 	// Setting assistant configuration
     if (offlineDocs)
 	{
-		// out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/CreatorStyle.css\" />"; // Only for Qt Creator
+		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/creatorStyle.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
-		out() << "<body class=\"offline narrow\">\n"; // offline for Creator and Assistant
+		//out() << "<body class=\"offline narrow \">\n"; // offline for  Assistant
+		out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
+	}	
+    if (creatorDocs)
+	{
+		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/creatorStyle.css\" />"; // Only for Qt Creator
+		out() << "</head>\n";
+		//out() << "<body class=\"offline narrow \">\n"; // offline for  Assistant
+		out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
 	}	
 	// Setting online doc configuration
     else
@@ -1847,6 +1857,10 @@ void HtmlGenerator::generateFooter(const Node *node)
 		{
           out() << "</body>\n";
 		}
+	    if (creatorDocs)
+		{
+          out() << "</body>\n";
+		}
 		else
 		{
 			out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index 9c5be15..abfca60 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -288,6 +288,7 @@ class HtmlGenerator : public PageGenerator
     int numTableRows;
     bool threeColumnEnumValueTable;
     bool offlineDocs;
+    bool creatorDocs;
     QString link;
     QStringList sectionNumber;
     QRegExp funcLeftParen;
-- 
cgit v0.12


From bf791d9beffe766bec954cb70495d13f773dc733 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 12:43:12 +0200
Subject: doc: Fixed several qdoc warnings.

---
 doc/src/examples/trafficinfo.qdoc                        |  2 +-
 .../frameworks-technologies/model-view-programming.qdoc  | 16 ++++++++--------
 src/corelib/kernel/qabstractitemmodel.cpp                | 12 ++++++------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/src/examples/trafficinfo.qdoc b/doc/src/examples/trafficinfo.qdoc
index fe69d52..bc06178 100644
--- a/doc/src/examples/trafficinfo.qdoc
+++ b/doc/src/examples/trafficinfo.qdoc
@@ -145,5 +145,5 @@
 
     The rest of the code in this example is just for representing the time and
     station information to the user, and uses techniques described in the
-    \l{Widgets Examples}.
+    \l{Widget Examples}.
 */
diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc
index 94b9f0d..6c38060 100644
--- a/doc/src/frameworks-technologies/model-view-programming.qdoc
+++ b/doc/src/frameworks-technologies/model-view-programming.qdoc
@@ -900,7 +900,7 @@
     after its application through the use of certain types of selection
     commands. These are discussed later in this section.
 
-    \section3 Current item &amp selected items
+    \section3 Current item and selected items
 
     In a view, there is always a current item and a selected item - two
     independent states. An item can be the current item and selected at the
@@ -1257,7 +1257,7 @@
     reimplement the \l{QAbstractItemModel::columnCount()}{columnCount()}
     function.
 
-    \section3 Model headers &amp data
+    \section3 Model headers and data
 
     For items in the view, we want to return the strings in the string list.
     The \l{QAbstractItemModel::data()}{data()} function is responsible for
@@ -1350,7 +1350,7 @@
 
     \snippet doc/src/snippets/stringlistmodel/model.cpp 1
 
-    \section3 Inserting &amp removing rows
+    \section3 Inserting and removing rows
 
     It is possible to change the number of rows and columns in a model. In the
     string list model it only makes sense to change the number of rows, so we
@@ -1634,7 +1634,7 @@
     contain the text given in the search string. This pattern can also be
     used in the list and table widgets.
 
-    \section1 Using drag &amp drop with item views
+    \section1 Using drag & drop with item views
 
     Qt's drag and drop infrastructure is fully supported by the model/view framework.
     Items in lists, tables, and trees can be dragged within the views, and data can be
@@ -1714,7 +1714,7 @@
     of QAbstractItemModel::removeRows(), either directly or by inheriting the
     implementation from its base class.
 
-    \section3 Enabling drag &amp drop for items
+    \section3 Enabling drag & drop for items
 
     Models indicate to views which items can be dragged, and which will accept drops,
     by reimplementing the QAbstractItemModel::flags() function to provide suitable
@@ -2124,12 +2124,12 @@
     children may be displayed incorrectly in some views until the user
     attempts to view the non-existent child items.
 
-    \section2 Navigation &amp model index creation
+    \section2 Navigation and model index creation
 
     Hierarchical models need to provide functions that views can call to navigate the
     tree-like structures they expose, and obtain model indexes for items.
 
-    \section3 Parents &amp children
+    \section3 Parents and children
 
     Since the structure exposed to views is determined by the underlying data
     structure, it is up to each model subclass to create its own model indexes
@@ -2153,7 +2153,7 @@
     models to supply some unique identifier to this function to ensure that
     the model index can be re-associated with its corresponding item later on.
 
-    \section2 Drag &amp drop support and MIME type handling
+    \section2 Drag & drop support and MIME type handling
 
     The model/view classes support drag and drop operations, providing default behavior
     that is sufficient for many applications. However, it is also possible to customize
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 8415259..464a91c 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1197,7 +1197,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
     \l{QAbstractItemModel::}{endInsertRows()} must be called.
 
     \sa {Model Classes}, {Model Subclassing Reference}, QModelIndex,
-        QAbstractItemView, {Using Drag and Drop with Item Views},
+        QAbstractItemView, {Using drag & drop with item views},
         {Simple DOM Model Example}, {Simple Tree Model Example},
         {Editable Tree Model Example}, {Fetch More Example}
 */
@@ -1761,7 +1761,7 @@ QMimeData *QAbstractItemModel::mimeData(const QModelIndexList &indexes) const
     where to place the data. This can occur in a tree when data is dropped on
     a parent. Models will usually append the data to the parent in this case.
 
-    \sa supportedDropActions(), {Using Drag and Drop with Item Views}
+    \sa supportedDropActions(), {Using drag & drop with item views}
 */
 bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
                                       int row, int column, const QModelIndex &parent)
@@ -1798,8 +1798,8 @@ bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
     reimplement the dropMimeData() function to handle the additional
     operations.
 
-    \sa dropMimeData(), Qt::DropActions, {Using Drag and Drop with Item
-    Views}
+    \sa dropMimeData(), Qt::DropActions, {Using drag & drop with item
+    views}
 */
 Qt::DropActions QAbstractItemModel::supportedDropActions() const
 {
@@ -1815,7 +1815,7 @@ Qt::DropActions QAbstractItemModel::supportedDropActions() const
     supportedDragActions() is used by QAbstractItemView::startDrag() as the
     default values when a drag occurs.
 
-    \sa Qt::DropActions, {Using Drag and Drop with Item Views}
+    \sa Qt::DropActions, {Using drag & drop with item views}
 */
 Qt::DropActions QAbstractItemModel::supportedDragActions() const
 {
@@ -1831,7 +1831,7 @@ Qt::DropActions QAbstractItemModel::supportedDragActions() const
 
     Sets the supported drag \a actions for the items in the model.
 
-    \sa supportedDragActions(), {Using Drag and Drop with Item Views}
+    \sa supportedDragActions(), {Using drag & drop with item views}
 */
 void QAbstractItemModel::setSupportedDragActions(Qt::DropActions actions)
 {
-- 
cgit v0.12


From 630af9571cd65e4c74f682c401d791e2a1436d13 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 13:06:10 +0200
Subject: doc: Fixed several qdoc warnings.

---
 src/gui/graphicsview/qgraphicsitem.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 51dc543..74c51f4 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -133,7 +133,8 @@
 
     \img graphicsview-parentchild.png
 
-    \section1 Transformation
+    \target Transformations
+    \section1 Transformations
 
     QGraphicsItem supports projective transformations in addition to its base
     position, pos(). There are several ways to change an item's transformation.
-- 
cgit v0.12


From a168d8dbeb3eed11cb0ae373d9076f34216155bb Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 13:14:21 +0200
Subject: doc: Fixed several qdoc warnings.

---
 doc/src/examples/movie.qdoc                 | 4 ++--
 doc/src/frameworks-technologies/phonon.qdoc | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/src/examples/movie.qdoc b/doc/src/examples/movie.qdoc
index 733f52d..4d7b3e0 100644
--- a/doc/src/examples/movie.qdoc
+++ b/doc/src/examples/movie.qdoc
@@ -30,8 +30,8 @@
     \title Movie Example
 
     The Movie example demonstrates how to use QMovie and QLabel to
-    display animations. Now that Qt comes with \l{Phonon
-    Overview}{Phonon} (the multimedia framework), QMovie is mostly
+    display animations. Now that Qt comes with the \l{Phonon multimedia
+    framework} {Phonon multimedia framework}, QMovie is mostly
     useful if one wants to play a simple animation without the added
     complexity of a multimedia framework to install and deploy.
 
diff --git a/doc/src/frameworks-technologies/phonon.qdoc b/doc/src/frameworks-technologies/phonon.qdoc
index 023b4ce..5119638 100644
--- a/doc/src/frameworks-technologies/phonon.qdoc
+++ b/doc/src/frameworks-technologies/phonon.qdoc
@@ -34,6 +34,7 @@
 
     \tableofcontents
 
+    \target Phonon Overview
     \section1 Introduction
 
     Qt uses the Phonon multimedia framework to provide functionality
-- 
cgit v0.12


From 3b2e680b5f56227af0716b3bc07b11cb7e044d78 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 13:16:48 +0200
Subject: doc: Fixed several qdoc warnings.

---
 doc/src/frameworks-technologies/model-view-programming.qdoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/frameworks-technologies/model-view-programming.qdoc b/doc/src/frameworks-technologies/model-view-programming.qdoc
index 6c38060..131f063 100644
--- a/doc/src/frameworks-technologies/model-view-programming.qdoc
+++ b/doc/src/frameworks-technologies/model-view-programming.qdoc
@@ -2282,7 +2282,7 @@
     \endlist
 
     For more information about drag and drop with item views, refer to
-    \l{Using Drag and Drop with Item Views}.
+    \l{Using drag & drop with item views}.
 
     \section3 Convenience views
 
@@ -2293,7 +2293,7 @@
     the existing contents with the data being transferred, the underlying model
     will set the data of the target items rather than insert new rows and columns
     into the model. For more information on drag and drop in convenience views,
-    you can see \l{Using Drag and Drop with Item Views}.
+    you can see \l{Using drag & drop with item views}.
 
     \section2 Performance optimization for large amounts of data
 
-- 
cgit v0.12


From ad0e8a48eade0b2cdcf10a68f36d911784ff03ab Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 13:25:50 +0200
Subject: doc: Fixed several qdoc warnings.

---
 doc/src/frameworks-technologies/dnd.qdoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc
index 4a1b631..c5dd27c 100644
--- a/doc/src/frameworks-technologies/dnd.qdoc
+++ b/doc/src/frameworks-technologies/dnd.qdoc
@@ -45,7 +45,7 @@
     outlines the approach used to enable it in custom widgets. Drag
     and drop operations are also supported by Qt's item views and by
     the graphics view framework. More information is available in
-    \l{Using Drag and Drop with Item Views} and \l{Graphics View
+    \l{Using drag & drop with item views} and \l{Graphics View
     Framework}.
 
     \section1 Drag and Drop Classes
-- 
cgit v0.12


From 230ab8adb281aabc2d0ebf41ade5f2ec7f11e020 Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Fri, 9 Jul 2010 10:11:13 +0200
Subject: Revert "SSL backend: load libraries for certificates only once"

This reverts commit f2187e31de13a6ab8631a9067487dab555f7c2e7.

Reviewed-by: Markus Goetz
---
 src/network/ssl/qsslsocket.cpp         |  6 ++---
 src/network/ssl/qsslsocket_openssl.cpp | 42 ++++++++++++++++------------------
 src/network/ssl/qsslsocket_p.h         | 11 +++++----
 3 files changed, 29 insertions(+), 30 deletions(-)

diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 809e8aa..f85fa84 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1849,7 +1849,7 @@ QList<QSslCipher> QSslSocketPrivate::defaultCiphers()
 */
 QList<QSslCipher> QSslSocketPrivate::supportedCiphers()
 {
-    QSslSocketPrivate::ensureCertsAndCiphersLoaded();
+    QSslSocketPrivate::ensureInitialized();
     QMutexLocker locker(&globalData()->mutex);
     return globalData()->supportedCiphers;
 }
@@ -1879,7 +1879,7 @@ void QSslSocketPrivate::setDefaultSupportedCiphers(const QList<QSslCipher> &ciph
 */
 QList<QSslCertificate> QSslSocketPrivate::defaultCaCertificates()
 {
-    QSslSocketPrivate::ensureCertsAndCiphersLoaded();
+    QSslSocketPrivate::ensureInitialized();
     QMutexLocker locker(&globalData()->mutex);
     return globalData()->config->caCertificates;
 }
@@ -1962,7 +1962,7 @@ void QSslConfigurationPrivate::setDefaultConfiguration(const QSslConfiguration &
 */
 void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPrivate *ptr)
 {
-    QSslSocketPrivate::ensureCertsAndCiphersLoaded();
+    QSslSocketPrivate::ensureInitialized();
     QMutexLocker locker(&globalData()->mutex);
     const QSslConfigurationPrivate *global = globalData()->config.constData();
 
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index b602b29..d7088ee 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -74,9 +74,8 @@
 
 QT_BEGIN_NAMESPACE
 
-bool QSslSocketPrivate::s_initialized = false;
-QBasicAtomicInt QSslSocketPrivate::s_CertsAndCiphersLoaded;
-Q_GLOBAL_STATIC(QMutex, s_CertsAndCiphersLoadedMutex);
+bool QSslSocketPrivate::s_libraryLoaded = false;
+bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
 
 // Useful defines
 #define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL))
@@ -171,7 +170,7 @@ QSslSocketBackendPrivate::QSslSocketBackendPrivate()
       session(0)
 {
     // Calls SSL_library_init().
-    ensureCertsAndCiphersLoaded();
+    ensureInitialized();
 }
 
 QSslSocketBackendPrivate::~QSslSocketBackendPrivate()
@@ -422,18 +421,18 @@ void QSslSocketPrivate::deinitialize()
 
 bool QSslSocketPrivate::supportsSsl()
 {
-    return ensureInitialized();
+    return ensureLibraryLoaded();
 }
 
-bool QSslSocketPrivate::ensureInitialized()
+bool QSslSocketPrivate::ensureLibraryLoaded()
 {
     if (!q_resolveOpenSslSymbols())
         return false;
 
     // Check if the library itself needs to be initialized.
     QMutexLocker locker(openssl_locks()->initLock());
-    if (!s_initialized) {
-        s_initialized = true;
+    if (!s_libraryLoaded) {
+        s_libraryLoaded = true;
 
         // Initialize OpenSSL.
         q_CRYPTO_set_id_callback(id_function);
@@ -474,6 +473,16 @@ bool QSslSocketPrivate::ensureInitialized()
     return true;
 }
 
+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+{
+    if (s_loadedCiphersAndCerts)
+        return;
+    s_loadedCiphersAndCerts = true;
+
+    resetDefaultCiphers();
+    setDefaultCaCertificates(systemCaCertificates());
+}
+
 /*!
     \internal
 
@@ -481,18 +490,13 @@ bool QSslSocketPrivate::ensureInitialized()
     been initialized.
 */
 
-void QSslSocketPrivate::ensureCertsAndCiphersLoaded()
+void QSslSocketPrivate::ensureInitialized()
 {
-    // use double-checked locking to speed up this function
-    if (s_CertsAndCiphersLoaded)
+    if (!supportsSsl())
         return;
 
-    QMutexLocker locker(s_CertsAndCiphersLoadedMutex());
-    if (s_CertsAndCiphersLoaded)
-        return;
+    ensureCiphersAndCertsLoaded();
 
-    if (!supportsSsl())
-        return;
     //load symbols needed to receive certificates from system store
 #if defined(Q_OS_MAC)
     QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security");
@@ -528,12 +532,6 @@ void QSslSocketPrivate::ensureCertsAndCiphersLoaded()
         qWarning("could not load crypt32 library"); // should never happen
     }
 #endif
-    resetDefaultCiphers();
-    setDefaultCaCertificates(systemCaCertificates());
-    // we need to make sure that s_CertsAndCiphersLoaded is executed after the library loading above
-    // (the compiler/processor might reorder instructions otherwise)
-    if (!s_CertsAndCiphersLoaded.testAndSetRelease(0, 1))
-        Q_ASSERT_X(false, "certificate store", "certificate store has already been initialized!");
 }
 
 /*!
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index b474175..72b3ef7 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -63,7 +63,6 @@
 #include <QtCore/qstringlist.h>
 
 #include <private/qringbuffer_p.h>
-#include <QtCore/QMutex>
 
 QT_BEGIN_NAMESPACE
 
@@ -114,8 +113,7 @@ public:
     QString verificationPeerName;
 
     static bool supportsSsl();
-    static bool ensureInitialized();
-    static void ensureCertsAndCiphersLoaded();
+    static void ensureInitialized();
     static void deinitialize();
     static QList<QSslCipher> defaultCiphers();
     static QList<QSslCipher> supportedCiphers();
@@ -163,8 +161,11 @@ public:
     virtual QSslCipher sessionCipher() const = 0;
 
 private:
-    static bool s_initialized;
-    static QBasicAtomicInt s_CertsAndCiphersLoaded;
+    static bool ensureLibraryLoaded();
+    static void ensureCiphersAndCertsLoaded();
+
+    static bool s_libraryLoaded;
+    static bool s_loadedCiphersAndCerts;
 };
 
 QT_END_NAMESPACE
-- 
cgit v0.12


From b1a52a071e3741d46df5c45423c6654d517ac4c2 Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Fri, 9 Jul 2010 10:44:59 +0200
Subject: SSL library loading: load system libs only once

... and make the loading thread-safe.
The global methods for loading the OpenSSL libraries
and the system libraries are accessed from within
different QSslSocket and QSslConfiguration instances,
so they need to be thread-safe.

Reviewed-by: Markus Goetz
---
 src/network/ssl/qsslsocket_openssl.cpp | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index d7088ee..b537582 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -475,27 +475,12 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
 
 void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
 {
+    QMutexLocker locker(openssl_locks()->initLock());
     if (s_loadedCiphersAndCerts)
         return;
     s_loadedCiphersAndCerts = true;
 
     resetDefaultCiphers();
-    setDefaultCaCertificates(systemCaCertificates());
-}
-
-/*!
-    \internal
-
-    Declared static in QSslSocketPrivate, makes sure the SSL libraries have
-    been initialized.
-*/
-
-void QSslSocketPrivate::ensureInitialized()
-{
-    if (!supportsSsl())
-        return;
-
-    ensureCiphersAndCertsLoaded();
 
     //load symbols needed to receive certificates from system store
 #if defined(Q_OS_MAC)
@@ -532,6 +517,22 @@ void QSslSocketPrivate::ensureInitialized()
         qWarning("could not load crypt32 library"); // should never happen
     }
 #endif
+    setDefaultCaCertificates(systemCaCertificates());
+}
+
+/*!
+    \internal
+
+    Declared static in QSslSocketPrivate, makes sure the SSL libraries have
+    been initialized.
+*/
+
+void QSslSocketPrivate::ensureInitialized()
+{
+    if (!supportsSsl())
+        return;
+
+    ensureCiphersAndCertsLoaded();
 }
 
 /*!
-- 
cgit v0.12


From 8e1edcd846a46cf55f2f198d3b959498b58fe352 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 13:58:17 +0200
Subject: doc: Fixed several qdoc warnings.

---
 src/gui/text/qtextoption.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 8f31e46..9eeec0b 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -392,7 +392,12 @@ QList<QTextOption::Tab> QTextOption::tabs() const
 
 /*!
     \fn Tab::Tab(qreal pos, TabType tabType, QChar delim = QChar())
-    Creates a tab with the given position, tab type, and (for DelimiterTab) delimiter
+    
+    Creates a tab with the given position, tab type, and delimiter
+    (\a pos, \a tabType, \a delim).
+
+    \note \a delim is only used when \a tabType is DelimiterTab.
+
     \since 4.7
 */
 
-- 
cgit v0.12


From 3e326e54856b1fce33ab2c005de2a46af6a4ea0f Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 9 Jul 2010 13:59:56 +0200
Subject: Doc: Removed accidentally committed file.

Reviewed-by: Trust Me
---
 examples/tutorials/modelview/._.DS_Store | Bin 4096 -> 0 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100755 examples/tutorials/modelview/._.DS_Store

diff --git a/examples/tutorials/modelview/._.DS_Store b/examples/tutorials/modelview/._.DS_Store
deleted file mode 100755
index 338bd7b..0000000
Binary files a/examples/tutorials/modelview/._.DS_Store and /dev/null differ
-- 
cgit v0.12


From 5f2437ae9a11c360139599b4d4b01270cd276a52 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 9 Jul 2010 14:08:30 +0200
Subject: doc: Fixed several qdoc warnings.

---
 src/corelib/kernel/qabstractitemmodel.cpp | 4 ++--
 src/gui/itemviews/qabstractitemview.cpp   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 464a91c..e3fce18 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -2547,7 +2547,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
 
             For example, as shown in the diagram, we move three rows from
             row 2 to 4 in the source, so \a sourceFirst is 2 and \a sourceLast is 4.
-            We move those items to above row 2 in the destination, so \a destinationRow is 2.
+            We move those items to above row 2 in the destination, so \a destinationChild is 2.
 
             \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 6
 
@@ -2558,7 +2558,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
         \o  To append rows to another parent, move them to after the last row.
 
             For example, as shown in the diagram, we move three rows to a
-            collection of 6 existing rows (ending in row 5), so \a destinationStart is 6:
+            collection of 6 existing rows (ending in row 5), so \a destinationChild is 6:
 
             \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 7
 
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 4fb93fc..97499f3 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1363,7 +1363,7 @@ bool QAbstractItemView::dragEnabled() const
 
     Note that the model used needs to provide support for drag and drop operations.
 
-    \sa setDragDropMode() {Using Drag and Drop with Item Views}
+    \sa setDragDropMode() {Using drag & drop with item views}
 */
 
 /*!
-- 
cgit v0.12


From 653f180d4697e0c7ec1c58022622d5d140e7fda8 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Fri, 9 Jul 2010 14:33:16 +0200
Subject: Doc: fixing examples link

---
 doc/src/index.qdoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 42fd4fc..92721c5 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -44,7 +44,7 @@
                   <li><a href="installation.html">Installation &amp; first steps</a></li>
                   <li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
                   <li><a href="tutorials.html">Tutorials</a></li>
-                  <li><a href="examples.html">Examples</a></li>
+                  <li><a href="all-examples.html">Examples</a></li>
                   <li><a href="qt4-7-intro.html">Whats new in Qt 4.7</a></li>
                 </ul>
               </div>
-- 
cgit v0.12


From 5f6018564668d368f75e431c4cdac88d7421cff0 Mon Sep 17 00:00:00 2001
From: "Richard J. Moore" <rich@kde.org>
Date: Sun, 6 Jun 2010 22:10:08 +0100
Subject: Fix handling of SSL certificates with wildcard domain names

Merge-request: 731
Task-number: QTBUG-4455
Reviewed-by: Peter Hartmann
---
 src/network/ssl/qsslsocket_openssl.cpp   | 42 +++++++++++++++++++++++++++++---
 src/network/ssl/qsslsocket_openssl_p.h   |  1 +
 tests/auto/qsslsocket/tst_qsslsocket.cpp | 24 ++++++++++++++++++
 3 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index b537582..fa70381 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1101,17 +1101,16 @@ bool QSslSocketBackendPrivate::startHandshake()
             QString peerName = (verificationPeerName.isEmpty () ? q->peerName() : verificationPeerName);
             QString commonName = configuration.peerCertificate.subjectInfo(QSslCertificate::CommonName);
 
-            QRegExp regexp(commonName, Qt::CaseInsensitive, QRegExp::Wildcard);
-            if (!regexp.exactMatch(peerName)) {
+            if (!isMatchingHostname(commonName.lower(), peerName.lower())) {
                 bool matched = false;
                 foreach (const QString &altName, configuration.peerCertificate
                          .alternateSubjectNames().values(QSsl::DnsEntry)) {
-                    regexp.setPattern(altName);
-                    if (regexp.exactMatch(peerName)) {
+                    if (isMatchingHostname(altName.lower(), peerName.lower())) {
                         matched = true;
                         break;
                     }
                 }
+
                 if (!matched) {
                     // No matches in common names or alternate names.
                     QSslError error(QSslError::HostNameMismatch, configuration.peerCertificate);
@@ -1241,4 +1240,39 @@ QList<QSslCertificate> QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates
     return certificates;
 }
 
+bool QSslSocketBackendPrivate::isMatchingHostname(const QString &cn, const QString &hostname)
+{
+    int wildcard = cn.indexOf(QLatin1Char('*'));
+
+    // Check this is a wildcard cert, if not then just compare the strings
+    if (wildcard < 0)
+        return cn == hostname;
+
+    int firstCnDot = cn.indexOf(QLatin1Char('.'));
+    int secondCnDot = cn.indexOf(QLatin1Char('.'), firstCnDot+1);
+
+    // Check at least 3 components
+    if ((-1 == secondCnDot) || (secondCnDot+1 >= cn.length()))
+        return false;
+
+    // Check * is last character of 1st component (ie. there's a following .)
+    if (wildcard+1 != firstCnDot)
+        return false;
+
+    // Check only one star
+    if (cn.lastIndexOf(QLatin1Char('*')) != wildcard)
+        return false;
+
+    // Check characters preceding * (if any) match
+    if (wildcard && (hostname.leftRef(wildcard) != cn.leftRef(wildcard)))
+        return false;
+
+    // Check characters following first . match
+    if (hostname.midRef(hostname.indexOf(QLatin1Char('.'))) != cn.midRef(firstCnDot))
+        return false;
+
+    // Ok, I guess this was a wildcard CN and the hostname matches.
+    return true;
+}
+
 QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index e41320d..fd02838 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -116,6 +116,7 @@ public:
 
     static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher);
     static QList<QSslCertificate> STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509);
+    Q_AUTOTEST_EXPORT static bool isMatchingHostname(const QString &cn, const QString &hostname);
 };
 
 #if defined(Q_OS_SYMBIAN)
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 0cf638b..0c12974 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -55,6 +55,7 @@
 #include <QAuthenticator>
 
 #include "private/qhostinfo_p.h"
+#include "private/qsslsocket_openssl_p.h"
 
 #include "../network-settings.h"
 
@@ -163,6 +164,7 @@ private slots:
     void setDefaultCiphers();
     void supportedCiphers();
     void systemCaCertificates();
+    void wildcardCertificateNames();
     void wildcard();
     void setEmptyKey();
     void spontaneousWrite();
@@ -1063,6 +1065,28 @@ void tst_QSslSocket::systemCaCertificates()
     QCOMPARE(certs, QSslSocket::defaultCaCertificates());
 }
 
+void tst_QSslSocket::wildcardCertificateNames()
+{
+    // Passing CN matches
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("www.example.com"), QString("www.example.com")), true );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example.com"), QString("www.example.com")), true );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("xxx*.example.com"), QString("xxxwww.example.com")), true );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("f*.example.com"), QString("foo.example.com")), true );
+
+    // Failing CN matches
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("xxx.example.com"), QString("www.example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*"), QString("www.example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.*.com"), QString("www.example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example.com"), QString("baa.foo.example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("f*.example.com"), QString("baa.example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.com"), QString("example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*fail.com"), QString("example.com")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example."), QString("www.example.")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*.example."), QString("www.example")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString(""), QString("www")), false );
+    QCOMPARE( QSslSocketBackendPrivate::isMatchingHostname(QString("*"), QString("www")), false );
+}
+
 void tst_QSslSocket::wildcard()
 {
     QSKIP("TODO: solve wildcard problem", SkipAll);
-- 
cgit v0.12


From c50d351df3b7fe2f0d10444c1080b6a8c9833e0f Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Fri, 9 Jul 2010 15:21:03 +0200
Subject: Doc: fixing offline style

---
 tools/qdoc3/htmlgenerator.cpp | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 16b45d6..c8218dc 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -214,7 +214,7 @@ HtmlGenerator::HtmlGenerator()
       numTableRows(0),
       threeColumnEnumValueTable(true),
       offlineDocs(true),
-      creatorDocs(false),
+      creatorDocs(true),
       funcLeftParen("\\S(\\()"),
       myTree(0),
       slow(false),
@@ -1777,17 +1777,15 @@ void HtmlGenerator::generateHeader(const QString& title,
 	// Setting assistant configuration
     if (offlineDocs)
 	{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/creatorStyle.css\" />"; // Only for Qt Creator
+		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
-		//out() << "<body class=\"offline narrow \">\n"; // offline for  Assistant
-		out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
+		out() << "<body class=\"offline \">\n"; // offline for  Assistant
 	}	
     if (creatorDocs)
 	{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/creatorStyle.css\" />"; // Only for Qt Creator
+		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
-		//out() << "<body class=\"offline narrow \">\n"; // offline for  Assistant
-		out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
+		out() << "<body class=\"offline creator\">\n"; // offline for Creator
 	}	
 	// Setting online doc configuration
     else
-- 
cgit v0.12


From 63171ddd8ec99d9af17e0adcc2cad61586fed42b Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Fri, 9 Jul 2010 16:49:39 +0200
Subject: QFileIconProvider: Load icons on demand.

Drawing icons is quite costly and mostly, only 'file' and
'directory' are required. Speeds up application startup
considerably.

Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
---
 src/gui/itemviews/qfileiconprovider.cpp | 71 +++++++++++++++++++--------------
 1 file changed, 41 insertions(+), 30 deletions(-)

diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index 5dbd1f0..4748f89 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -100,69 +100,80 @@ public:
     QIcon getMacIcon(const QFileInfo &fi) const;
 #endif
     QFileIconProvider *q_ptr;
-    QString homePath;
+    const QString homePath;
 
 private:
-    QIcon file;
-    QIcon fileLink;
-    QIcon directory;
-    QIcon directoryLink;
-    QIcon harddisk;
-    QIcon floppy;
-    QIcon cdrom;
-    QIcon ram;
-    QIcon network;
-    QIcon computer;
-    QIcon desktop;
-    QIcon trashcan;
-    QIcon generic;
-    QIcon home;
+    mutable QIcon file;
+    mutable QIcon fileLink;
+    mutable QIcon directory;
+    mutable QIcon directoryLink;
+    mutable QIcon harddisk;
+    mutable QIcon floppy;
+    mutable QIcon cdrom;
+    mutable QIcon ram;
+    mutable QIcon network;
+    mutable QIcon computer;
+    mutable QIcon desktop;
+    mutable QIcon trashcan;
+    mutable QIcon generic;
+    mutable QIcon home;
 };
 
-QFileIconProviderPrivate::QFileIconProviderPrivate()
+QFileIconProviderPrivate::QFileIconProviderPrivate() :
+    homePath(QDir::home().absolutePath())
 {
-    QStyle *style = QApplication::style();
-    file = style->standardIcon(QStyle::SP_FileIcon);
-    directory = style->standardIcon(QStyle::SP_DirIcon);
-    fileLink = style->standardIcon(QStyle::SP_FileLinkIcon);
-    directoryLink = style->standardIcon(QStyle::SP_DirLinkIcon);
-    harddisk = style->standardIcon(QStyle::SP_DriveHDIcon);
-    floppy = style->standardIcon(QStyle::SP_DriveFDIcon);
-    cdrom = style->standardIcon(QStyle::SP_DriveCDIcon);
-    network = style->standardIcon(QStyle::SP_DriveNetIcon);
-    computer = style->standardIcon(QStyle::SP_ComputerIcon);
-    desktop = style->standardIcon(QStyle::SP_DesktopIcon);
-    trashcan = style->standardIcon(QStyle::SP_TrashIcon);
-    home = style->standardIcon(QStyle::SP_DirHomeIcon);
-    homePath = QDir::home().absolutePath();
 }
 
 QIcon QFileIconProviderPrivate::getIcon(QStyle::StandardPixmap name) const
 {
     switch (name) {
     case QStyle::SP_FileIcon:
+        if (file.isNull())
+            file = QApplication::style()->standardIcon(name);
         return file;
     case QStyle::SP_FileLinkIcon:
+        if (fileLink.isNull())
+            fileLink = QApplication::style()->standardIcon(name);
         return fileLink;
     case QStyle::SP_DirIcon:
+        if (directory.isNull())
+            directory = QApplication::style()->standardIcon(name);
         return directory;
     case QStyle::SP_DirLinkIcon:
+        if (directoryLink.isNull())
+            directoryLink = QApplication::style()->standardIcon(name);
         return directoryLink;
     case QStyle::SP_DriveHDIcon:
+        if (harddisk.isNull())
+            harddisk = QApplication::style()->standardIcon(name);
         return harddisk;
     case QStyle::SP_DriveFDIcon:
+        if (floppy.isNull())
+            floppy = QApplication::style()->standardIcon(name);
         return floppy;
     case QStyle::SP_DriveCDIcon:
+        if (cdrom.isNull())
+            cdrom = QApplication::style()->standardIcon(name);
         return cdrom;
     case QStyle::SP_DriveNetIcon:
+        if (network.isNull())
+            network = QApplication::style()->standardIcon(name);
         return network;
     case QStyle::SP_ComputerIcon:
+        if (computer.isNull())
+            computer = QApplication::style()->standardIcon(name);
         return computer;
     case QStyle::SP_DesktopIcon:
+        if (desktop.isNull())
+            desktop = QApplication::style()->standardIcon(name);
         return desktop;
     case QStyle::SP_TrashIcon:
+        if (trashcan.isNull())
+            trashcan = QApplication::style()->standardIcon(name);
         return trashcan;
     case QStyle::SP_DirHomeIcon:
+        if (home.isNull())
+            home = QApplication::style()->standardIcon(name);
         return home;
     default:
         return QIcon();
-- 
cgit v0.12


From bd287865d2b57395a340e85f1fac9b7ddff3ec14 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Fri, 9 Jul 2010 16:59:04 +0200
Subject: QIODPLB: Sync behavior of ungetBlock() and ungetChar()

ungetChar() supports ungetting data that didn't originate from the
QIODevicePrivateLinearBuffer, so ungetBlock() should too.
---
 src/corelib/io/qiodevice_p.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 4a25562..1dd51ea 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -155,10 +155,10 @@ public:
         if ((first - buf) < size) {
             // underflow, the existing valid data needs to move to the end of the (potentially bigger) buffer
             makeSpace(len + size, freeSpaceAtStart);
-            memcpy(first - size, block, size);
         }
         first -= size;
         len += size;
+        memcpy(first, block, size);
     }
 
 private:
-- 
cgit v0.12


From 1b98fbd82c7145c2f81292f8a1feb6cac74e775d Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Fri, 9 Jul 2010 11:39:01 +0200
Subject: Add NTLMv2 authentication support to QAuthenticator.

This also fixes a long-standing bug in handling usernames of type
"domainname\username", typical of Windows domains, that didn't work
with the previous NTLMv1 code.

Patch by subcontractor.
Task-number: QTBUG-9408, QTBUG-2421, QT-3248
Reviewed-By: Markus Goetz
---
 src/network/kernel/qauthenticator.cpp | 286 +++++++++++++++++++++++++++++++++-
 1 file changed, 279 insertions(+), 7 deletions(-)

diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index e4023c8..e7442c0 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -50,6 +50,8 @@
 #include <qdatastream.h>
 #include <qendian.h>
 #include <qstring.h>
+#include <qdatetime.h>
+
 
 QT_BEGIN_NAMESPACE
 
@@ -162,7 +164,18 @@ QString QAuthenticator::user() const
 void QAuthenticator::setUser(const QString &user)
 {
     detach();
-    d->user = user;
+
+    int separatorPosn = 0;
+    separatorPosn = user.indexOf(QLatin1String("\\"));
+
+    if (separatorPosn == -1) {
+        //No domain name present
+        d->user = user;
+    } else {
+        //domain name is present
+        d->realm = user.left(separatorPosn);
+        d->user = user.mid(separatorPosn+1);
+    }
 }
 
 /*!
@@ -264,16 +277,17 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
 
     switch(method) {
     case Basic:
-        realm = QString::fromLatin1(options.value("realm"));
+        if(realm.isEmpty())
+            realm = QString::fromLatin1(options.value("realm"));
         if (user.isEmpty())
             phase = Done;
         break;
     case Ntlm:
         // #### extract from header
-        realm.clear();
         break;
     case DigestMd5: {
-        realm = QString::fromLatin1(options.value("realm"));
+        if(realm.isEmpty())
+            realm = QString::fromLatin1(options.value("realm"));
         if (options.value("stale").toLower() == "true")
             phase = Start;
         if (user.isEmpty())
@@ -661,6 +675,20 @@ QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge,
  */
 #define NTLMSSP_NEGOTIATE_56 0x80000000
 
+/*
+ * AvId values
+ */
+#define AVTIMESTAMP 7
+
+//#define NTLMV1_CLIENT
+
+
+//************************Global variables***************************
+
+const int blockSize = 64; //As per RFC2104 Block-size is 512 bits
+const int nDigestLen = 16; //Trunctaion Length of the Hmac-Md5 digest
+const quint8 respversion = 1;
+const quint8 hirespversion = 1;
 
 /* usage:
    // fill up ctx with what we know.
@@ -803,6 +831,7 @@ public:
 
     // extracted
     QString targetNameStr, targetInfoStr;
+    QByteArray targetInfoBuff;
 };
 
 
@@ -818,6 +847,7 @@ public:
     // extracted
     QByteArray lmResponseBuf, ntlmResponseBuf;
     QString domainStr, userStr, workstationStr, sessionKeyStr;
+    QByteArray v2Hash;
 };
 
 
@@ -899,7 +929,7 @@ static QString qStringFromUcs2Le(const QByteArray& src)
     return QString((const QChar *)src.data(), src.size()/2);
 }
 
-
+#ifdef NTLMV1_CLIENT
 static QByteArray qEncodeNtlmResponse(const QAuthenticatorPrivate *ctx, const QNtlmPhase2Block& ch)
 {
     QCryptographicHash md4(QCryptographicHash::Md4);
@@ -941,7 +971,232 @@ static QByteArray qEncodeLmResponse(const QAuthenticatorPrivate *ctx, const QNtl
     hash.fill(0);
     return rc;
 }
+#endif
+
+/*********************************************************************
+* Function Name: qEncodeHmacMd5
+* Params:
+*    key:   Type - QByteArray
+*         - It is the Authentication key
+*    message:   Type - QByteArray
+*         - This is the actual message which will be encoded
+*           using HMacMd5 hash algorithm
+*
+* Return Value:
+*    hmacDigest:   Type - QByteArray
+*
+* Description:
+*    This function will be used to encode the input message using
+*    HMacMd5 hash algorithm.
+*
+*    As per the RFC2104 the HMacMd5 algorithm can be specified
+*        ---------------------------------------
+*         MD5(K XOR opad, MD5(K XOR ipad, text))
+*        ---------------------------------------
+*
+*********************************************************************/
+QByteArray qEncodeHmacMd5(QByteArray &key, const QByteArray &message)
+{
+    Q_ASSERT_X(!(message.isEmpty()),"qEncodeHmacMd5", "Empty message check");
+    Q_ASSERT_X(!(key.isEmpty()),"qEncodeHmacMd5", "Empty key check");
+
+    QCryptographicHash hash(QCryptographicHash::Md5);
+    QByteArray hMsg;
+
+    QByteArray iKeyPad(blockSize, 0x36);
+    QByteArray oKeyPad(blockSize, 0x5c);
+
+    hash.reset();
+    // Adjust the key length to blockSize
+
+    if(blockSize < key.length()) {
+        hash.addData(key);
+        key = hash.result(); //MD5 will always return 16 bytes length output
+    }
+
+    //Key will be <= 16 or 20 bytes as hash function (MD5 or SHA hash algorithms)
+    //key size can be max of Block size only
+    key = key.leftJustified(blockSize,0,true);
+
+    //iKeyPad, oKeyPad and key are all of same size "blockSize"
+
+    //xor of iKeyPad with Key and store the result into iKeyPad
+    for(int i = 0; i<key.size();i++) {
+        iKeyPad[i] = key[i]^iKeyPad[i];
+    }
+
+    //xor of oKeyPad with Key and store the result into oKeyPad
+    for(int i = 0; i<key.size();i++) {
+        oKeyPad[i] = key[i]^oKeyPad[i];
+    }
+
+    iKeyPad.append(message); // (K0 xor ipad) || text
+
+    hash.reset();
+    hash.addData(iKeyPad);
+    hMsg = hash.result();
+                    //Digest gen after pass-1: H((K0 xor ipad)||text)
+
+    QByteArray hmacDigest;
+    oKeyPad.append(hMsg);
+    hash.reset();
+    hash.addData(oKeyPad);
+    hmacDigest = hash.result();
+                    // H((K0 xor opad )|| H((K0 xor ipad) || text))
+
+    /*hmacDigest should not be less than half the length of the HMAC output
+      (to match the birthday attack bound) and not less than 80 bits
+      (a suitable lower bound on the number of bits that need to be
+      predicted by an attacker).
+      Refer RFC 2104 for more details on truncation part */
+
+    /*MD5 hash always returns 16 byte digest only and HMAC-MD5 spec
+      (RFC 2104) also says digest length should be 16 bytes*/
+    return hmacDigest;
+}
+
+static QByteArray qCreatev2Hash(const QAuthenticatorPrivate *ctx,
+                                QNtlmPhase3Block *phase3)
+{
+    Q_ASSERT(phase3 != 0);
+    // since v2 Hash is need for both NTLMv2 and LMv2 it is calculated
+    // only once and stored and reused
+    if(phase3->v2Hash.size() == 0) {
+        QCryptographicHash md4(QCryptographicHash::Md4);
+        QByteArray passUnicode = qStringAsUcs2Le(ctx->password);
+        md4.addData(passUnicode.data(), passUnicode.size());
+
+        QByteArray hashKey = md4.result();
+        Q_ASSERT(hashKey.size() == 16);
+        // Assuming the user and domain is always unicode in challenge
+        QByteArray message =
+                qStringAsUcs2Le(ctx->user.toUpper()) +
+                qStringAsUcs2Le(ctx->realm);
+
+        phase3->v2Hash = qEncodeHmacMd5(hashKey, message);
+    }
+    return phase3->v2Hash;
+}
+
+static QByteArray clientChallenge(const QAuthenticatorPrivate *ctx)
+{
+    Q_ASSERT(ctx->cnonce.size() >= 8);
+    QByteArray clientCh = ctx->cnonce.right(8);
+    return clientCh;
+}
+
+// caller has to ensure a valid targetInfoBuff
+static bool qExtractServerTime(const QByteArray& targetInfoBuff,
+                               quint64 *serverTime)
+{
+    Q_ASSERT(serverTime != 0);
+    bool retValue = false;
+    QDataStream ds(targetInfoBuff);
+    ds.setByteOrder(QDataStream::LittleEndian);
+
+    quint16 avId;
+    quint16 avLen;
+
+    ds >> avId;
+    ds >> avLen;
+    while(avId != 0) {
+        if(avId == AVTIMESTAMP) {
+            QByteArray timeArray(avLen, 0);
+            //avLen size of QByteArray is allocated
+            ds.readRawData(timeArray.data(), avLen);
+            bool ok;
+            *serverTime = timeArray.toHex().toLongLong(&ok, 16);
+            retValue = true;
+            break;
+        }
+        ds.skipRawData(avLen);
+        ds >> avId;
+        ds >> avLen;
+    }
+    return retValue;
+}
+
+static QByteArray qEncodeNtlmv2Response(const QAuthenticatorPrivate *ctx,
+                                        const QNtlmPhase2Block& ch,
+                                        QNtlmPhase3Block *phase3)
+{
+    Q_ASSERT(phase3 != 0);
+    // return value stored in phase3
+    qCreatev2Hash(ctx, phase3);
+
+    QByteArray temp;
+    QDataStream ds(&temp, QIODevice::WriteOnly);
+    ds.setByteOrder(QDataStream::LittleEndian);
+
+    ds << respversion;
+    ds << hirespversion;
+
+    //Reserved
+    QByteArray reserved1(6, 0);
+    ds.writeRawData(reserved1.constData(), reserved1.size());
+
+    quint64 time = 0;
+
+    //if server sends time, use it instead of current time
+    if(!(ch.targetInfo.len && qExtractServerTime(ch.targetInfoBuff, &time))) {
+        QDateTime currentTime(QDate::currentDate(),
+                              QTime::currentTime(), Qt::UTC);
+
+        // number of seconds between 1601 and epoc(1970)
+        // 369 years, 89 leap years
+        // ((369 * 365) + 89) * 24 * 3600 = 11644473600
+
+        time = Q_UINT64_C(currentTime.toTime_t() + 11644473600);
+
+        // represented as 100 nano seconds
+        time = Q_UINT64_C(time * 10000000);
+    }
+    ds << time;
+
+    //8 byte client challenge
+    QByteArray clientCh = clientChallenge(ctx);
+    ds.writeRawData(clientCh.constData(), clientCh.size());
+
+    //Reserved
+    QByteArray reserved2(4, 0);
+    ds.writeRawData(reserved2.constData(), reserved2.size());
+
+    if (ch.targetInfo.len > 0) {
+        ds.writeRawData(ch.targetInfoBuff.constData(),
+                        ch.targetInfoBuff.size());
+    }
+
+    //Reserved
+    QByteArray reserved3(4, 0);
+    ds.writeRawData(reserved3.constData(), reserved3.size());
+
+    QByteArray message((const char*)ch.challenge, sizeof(ch.challenge));
+    message.append(temp);
+
+    QByteArray ntChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message);
+    ntChallengeResp.append(temp);
+
+    return ntChallengeResp;
+}
+
+static QByteArray qEncodeLmv2Response(const QAuthenticatorPrivate *ctx,
+                                      const QNtlmPhase2Block& ch,
+                                      QNtlmPhase3Block *phase3)
+{
+    Q_ASSERT(phase3 != 0);
+    // return value stored in phase3
+    qCreatev2Hash(ctx, phase3);
+
+    QByteArray message((const char*)ch.challenge, sizeof(ch.challenge));
+    QByteArray clientCh = clientChallenge(ctx);
 
+    message.append(clientCh);
+
+    QByteArray lmChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message);
+    lmChallengeResp.append(clientCh);
+
+    return lmChallengeResp;
+}
 
 static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch)
 {
@@ -976,7 +1231,10 @@ static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch)
     }
 
     if (ch.targetInfo.len > 0) {
-        // UNUSED right now
+        if (ch.targetInfo.len + ch.targetInfo.offset > (unsigned)data.size())
+            return false;
+
+        ch.targetInfoBuff = data.mid(ch.targetInfo.offset, ch.targetInfo.len);
     }
 
     return true;
@@ -996,7 +1254,8 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
 
     bool unicode = ch.flags & NTLMSSP_NEGOTIATE_UNICODE;
 
-    ctx->realm = ch.targetNameStr;
+    if(ctx->realm.isEmpty())
+        ctx->realm = ch.targetNameStr;
 
     pb.flags = NTLMSSP_NEGOTIATE_NTLM;
     if (unicode)
@@ -1010,6 +1269,7 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
     
     offset = qEncodeNtlmString(pb.domain, offset, ctx->realm, unicode);
     pb.domainStr = ctx->realm;
+
     offset = qEncodeNtlmString(pb.user, offset, ctx->user, unicode);
     pb.userStr = ctx->user;
 
@@ -1017,11 +1277,23 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
     pb.workstationStr = ctx->workstation;
 
     // Get LM response
+#ifdef NTLMV1_CLIENT
     pb.lmResponseBuf = qEncodeLmResponse(ctx, ch);
+#else
+    if (ch.targetInfo.len > 0) {
+        pb.lmResponseBuf = QByteArray();
+    } else {
+        pb.lmResponseBuf = qEncodeLmv2Response(ctx, ch, &pb);
+    }
+#endif
     offset = qEncodeNtlmBuffer(pb.lmResponse, offset, pb.lmResponseBuf);
 
     // Get NTLM response
+#ifdef NTLMV1_CLIENT
     pb.ntlmResponseBuf = qEncodeNtlmResponse(ctx, ch);
+#else
+    pb.ntlmResponseBuf = qEncodeNtlmv2Response(ctx, ch, &pb);
+#endif
     offset = qEncodeNtlmBuffer(pb.ntlmResponse, offset, pb.ntlmResponseBuf);
 
 
-- 
cgit v0.12


From 943d63e45ad09f75daa7d2f3dcc17bb28fda1766 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Fri, 9 Jul 2010 17:43:19 +0200
Subject: Fix a crash when recursing into QSharedPointer from
 QSharedPointer::clear()

We used to delete the tracked object before the new tracking was
properly set up in QSharedPointer. That means if the tracked object's
destructor or deletion function recursed into the QSharedPointer, it
would find itself in an inconsistent state.

So instead finish the setup and only then call out to user code. That
ensures the internal state is always valid.

Task-number: QTBUG-11730
Reviewed-by: ossi
---
 src/corelib/tools/qsharedpointer_impl.h          | 31 +++++++------
 tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 56 ++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 14 deletions(-)

diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 964b279..d581751 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -323,12 +323,17 @@ namespace QtSharedPointer {
         typedef ExternalRefCountData Data;
 
         inline void ref() const { d->weakref.ref(); d->strongref.ref(); }
-        inline bool deref()
+        inline void deref()
+        { deref(d, this->value); }
+        static inline void deref(Data *d, T *value)
         {
+            if (!d) return;
             if (!d->strongref.deref()) {
-                internalDestroy();
+                if (!d->destroy())
+                    delete value;
             }
-            return d->weakref.deref();
+            if (!d->weakref.deref())
+                delete d;
         }
 
         inline void internalConstruct(T *ptr)
@@ -377,7 +382,7 @@ namespace QtSharedPointer {
         template <class X>
         inline ExternalRefCount(const ExternalRefCount<X> &other) : Basic<T>(other.value), d(other.d)
         { if (d) ref(); }
-        inline ~ExternalRefCount() { if (d && !deref()) delete d; }
+        inline ~ExternalRefCount() { deref(); }
 
         template <class X>
         inline void internalCopy(const ExternalRefCount<X> &other)
@@ -385,12 +390,6 @@ namespace QtSharedPointer {
             internalSet(other.d, other.data());
         }
 
-        inline void internalDestroy()
-        {
-            if (!d->destroy())
-                delete this->value;
-        }
-
         inline void internalSwap(ExternalRefCount &other)
         {
             qSwap(d, other.d);
@@ -423,10 +422,14 @@ namespace QtSharedPointer {
                 else
                     o = 0;
             }
-            if (d && !deref())
-                delete d;
-            d = o;
-            this->value = d && d->strongref ? actual : 0;
+
+            qSwap(d, o);
+            qSwap(this->value, actual);
+            if (!d || d->strongref == 0)
+                this->value = 0;
+
+            // dereference saved data
+            deref(o, actual);
         }
 
         Data *d;
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index cb32c9a..4bbc9d8 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -92,6 +92,8 @@ private slots:
     void creating();
     void creatingQObject();
     void mixTrackingPointerCode();
+    void reentrancyWhileDestructing();
+
     void threadStressTest_data();
     void threadStressTest();
     void validConstructs();
@@ -1770,6 +1772,60 @@ void tst_QSharedPointer::invalidConstructs()
     }
 }
 
+namespace QTBUG11730 {
+    struct IB
+    {
+        virtual ~IB() {}
+    };
+
+    struct IA
+    {
+        virtual QSharedPointer<IB> getB() = 0;
+    };
+
+    struct B: public IB
+    {
+        IA *m_a;
+        B(IA *a_a) :m_a(a_a)
+        { }
+        ~B()
+        {
+            QSharedPointer<IB> b = m_a->getB();
+        }
+    };
+
+    struct A: public IA
+    {
+        QSharedPointer<IB> b;
+
+        virtual QSharedPointer<IB> getB()
+        {
+            return b;
+        }
+
+        A()
+        {
+            b = QSharedPointer<IB>(new B(this));
+        }
+
+        ~A()
+        {
+            b.clear();
+        }
+    };
+}
+
+void tst_QSharedPointer::reentrancyWhileDestructing()
+{
+    // this bug is about recursing back into QSharedPointer::clear()
+    // from inside it
+    // that is, the destructor of the object being deleted recurses
+    // into the same QSharedPointer object.
+    // First reported as QTBUG-11730
+    QTBUG11730::A obj;
+}
+
+
 QTEST_MAIN(tst_QSharedPointer)
 
 #include "tst_qsharedpointer.moc"
-- 
cgit v0.12


From 47ba8dba3fe48d317974acd55afeea8a434c95f8 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Fri, 9 Jul 2010 21:36:15 +0200
Subject: Doc: Cleaning style and adding support for Creator Note: Support for
 creator has been disabled. HTML-generator needs an update.

---
 doc/src/template/style/style.css        | 1323 +++++++++++++++++++------------
 tools/qdoc3/htmlgenerator.cpp           |    4 +-
 tools/qdoc3/test/assistant.qdocconf     |   24 +-
 tools/qdoc3/test/qt-build-docs.qdocconf |   12 +-
 tools/qdoc3/test/qt.qdocconf            |    7 -
 5 files changed, 820 insertions(+), 550 deletions(-)

diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css
index 5144020..9f80921 100755
--- a/doc/src/template/style/style.css
+++ b/doc/src/template/style/style.css
@@ -1,6 +1,8 @@
 @media screen
 {
-    html
+ 
+/* basic elements */
+ html
     {
         color: #000000;
         background: #FFFFFF;
@@ -18,6 +20,7 @@
     fieldset, img
     {
         border: 0;
+		max-width:100%;
     }
     address, caption, cite, code, dfn, em, strong, th, var, optgroup
     {
@@ -39,7 +42,6 @@
     h1, h2, h3, h4, h5, h6
     {
         font-size: 100%;
-/*        font-weight: normal; */
     }
     q:before, q:after
     {
@@ -50,11 +52,7 @@
         border: 0;
         font-variant: normal;
     }
-    sup
-    {
-        vertical-align: baseline;
-    }
-    sub
+    sup, sub
     {
         vertical-align: baseline;
     }
@@ -62,19 +60,6 @@
 	{
 		word-spacing:5px;
 	}
-    .heading
-    {
-        font: normal bold 16px/1.0 Arial;
-        padding-bottom: 15px;
-    }
-    .subtitle
-    {
-        font-size: 13px;
-    }
-    .small-subtitle
-    {
-        font-size: 13px;
-    }
     legend
     {
         color: #000000;
@@ -90,9 +75,19 @@
     {
         font-size: 100%;
     }
+    strong
+    {
+        font-weight: bold;
+    }
+    em
+    {
+        font-style: italic;
+    }
+
+	/* adding Qt theme */	
     html
     {
-        background-color: #e5e5e5;
+      /*  background-color: #e5e5e5;*/
     }
     body
     {
@@ -100,73 +95,115 @@
         font: normal 13px/1.2 Verdana;
         color: #363534;
     }
-    strong
+    a
     {
-        font-weight: bold;
+        color: #00732f;
+        text-decoration: none;
     }
-    em
+    hr
     {
-        font-style: italic;
+        background-color: #E6E6E6;
+        border: 1px solid #E6E6E6;
+        height: 1px;
+        width: 100%;
+        text-align: left;
+        margin: 15px 0px 15px 0px;
     }
-    a
+
+    pre
     {
-        color: #00732f;
-        text-decoration: none;
+        border: 1px solid #DDDDDD;
+		-moz-border-radius: 7px 7px 7px 7px;
+        margin: 0 20px 10px 10px;
+        padding: 20px 15px 20px 20px;
+        overflow-x: auto;
     }
-    .header, .footer, .wrapper
+    table, pre
     {
-        min-width: 600px;
-        max-width: 1500px;
-        margin: 0 30px;
+        -moz-border-radius: 7px 7px 7px 7px;
+        background-color: #F6F6F6;
+        border: 1px solid #E6E6E6;
+        border-collapse: separate;
+        font-size: 11px;
+        margin-bottom: 25px;
     }
-    .wrapper
+	pre.highlightedCode {
+		display: block;
+		overflow:hidden;
+	}	
+    thead
     {
-        background: url(../images/bg_r.png) repeat-y 100% 0;
+        margin-top: 5px;
+		font:600 12px/1.2 Arial;
     }
-    .wrapper .hd
+    th
     {
-        padding-left: 216px;
-        height: 15px;
-        background: url(../images/page.png) no-repeat 0 0;
-        overflow: hidden;
+        padding: 5px 15px 5px 15px;
+        background-color: #E1E1E1;
+        border-left: 1px solid #E6E6E6;
     }
-    .offline .wrapper .hd
+    td
     {
-        background: url(../images/page.png) no-repeat 0 -15px;
+        padding: 3px 15px 3px 20px;
     }
-    .wrapper .hd span
+    tr.odd td:hover,  tr.even td:hover    {}
+		
+	td.rightAlign
+	{
+        padding: 3px 5px 3px 10px;
+	}
+    table tr.odd
     {
-        height: 15px;
-        display: block;
-        overflow: hidden;
-        background: url(../images/page.png) no-repeat 100% -30px;
+        border-left: 1px solid #E6E6E6;
+        background-color: #F6F6F6;
+        color: #66666E;
     }
-    .wrapper .bd
+    table tr.even
     {
-        background: url(../images/bg_l.png) repeat-y 0 0;
-        position: relative;
+        border-left: 1px solid #E6E6E6;
+        background-color: #ffffff;
+        color: #66666E;
     }
-    .offline .wrapper .bd
+    table tr.odd td:hover, table tr.even td:hover
     {
-        background: url(../images/bg_l_blank.png) repeat-y 0 0;
+     /*   background-color: #E6E6E6;*/ /* disabled until further notice */
     }
-    .wrapper .ft
+    		
+    span.comment
     {
-        padding-left: 216px;
-        height: 15px;
-        background: url(../images/page.png) no-repeat 0 -75px;
-        overflow: hidden;
+        color: #8B0000;
+        font-style: italic;
     }
-    .offline .wrapper .ft
+    span.string, span.char
     {
-        background: url(../images/page.png) no-repeat 0 -90px;
+        color: #254117;
     }
-    .wrapper .ft span
+
+
+/* end basic elements */
+
+/* font style elements */
+    .heading
     {
-        height: 15px;
-        display: block;
-        background: url(../images/page.png) no-repeat 100% -60px;
-        overflow: hidden;
+        font: normal bold 16px/1.0 Arial;
+        padding-bottom: 15px;
+    }
+    .subtitle
+    {
+        font-size: 13px;
+    }
+    .small-subtitle
+    {
+        font-size: 13px;
+    }
+/* end font style elements */
+
+/* global settings*/
+    .header, .footer, .wrapper
+    {
+        min-width: 600px;
+        max-width: 1500px;
+        margin: 0 30px;
     }
     .header, .footer
     {
@@ -174,6 +211,17 @@
         clear: both;
         overflow: hidden;
     }
+    .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
+    {
+        content: ".";
+        display: block;
+        height: 0;
+        clear: both;
+        visibility: hidden;
+    }
+	
+/* end global settings*/
+/* header elements */
     .header
     {
         height: 115px;
@@ -201,105 +249,332 @@
         text-indent: -999em;
         background: url(../images/sprites-combined.png) no-repeat -78px -235px;
     }
-
-    .sidebar
+    .content a:visited
     {
-        float: left;
-        margin-left: 5px;
-        width: 200px;
-        font-size: 11px;
+        color: #4c0033;
+        text-decoration: none;
     }
-
-    .offline .sidebar, .offline .feedback, .offline .t_button, .offline #narrowsearch, .offline #narrowmenu
+     .content a:visited:hover
     {
-        display: none;
+        color: #4c0033;
+        text-decoration: underline;
     }
-
-    .sidebar .searchlabel
+	
+    #nav-topright
     {
-        padding: 0 0 2px 17px;
-        font: normal bold 11px/1.2 Verdana;
+        height: 70px;
     }
 
-    .sidebar .search
+    #nav-topright ul
     {
-        padding: 0 15px 0 16px;
+        list-style-type: none;
+        float: right;
+        width: 370px;
+        margin-top: 11px;
     }
 
-    .sidebar .search form
+    #nav-topright li
     {
-        background: url(../images/sprites-combined.png) no-repeat -6px -348px;
-		height:21px;
-		padding:2px 0 0 5px;
-		width:167px;
+        display: inline-block;
+        margin-right: 20px;
+        float: left;
     }
 
-    .sidebar .search form input#pageType
+    #nav-topright li.nav-topright-last
     {
-        width: 158px;
-        height: 19px;
-        padding: 0;
-        border: 0px;
-        outline: none;
-        font: 13px/1.2 Verdana;
+        margin-right: 0;
     }
 
-    .sidebar .box
+    #nav-topright li a
     {
-        padding: 17px 15px 5px 16px;
+        background: transparent url(../images/sprites-combined.png) no-repeat;
+        height: 18px;
+        display: block;
+        overflow: hidden;
+        text-indent: -9999px;
     }
 
-    .sidebar .box .first
+    #nav-topright li.nav-topright-home a
     {
-        background-image: none;
+        width: 65px;
+        background-position: -2px -91px;
     }
 
-    .sidebar .box h2
+    #nav-topright li.nav-topright-home a:hover
     {
-        font: bold 16px/1.2 Arial;
-        padding: 0;
-/*        min-height: 32px;*/
+        background-position: -2px -117px;
     }
-    .sidebar .box h2 span
+
+
+    #nav-topright li.nav-topright-dev a
     {
-        overflow: hidden;
-        display: inline-block;
+        width: 30px;
+        background-position: -76px -91px;
     }
-    .sidebar .box#lookup h2
+
+    #nav-topright li.nav-topright-dev a:hover
     {
-        background-image: none;
+        background-position: -76px -117px;
     }
-    .sidebar #lookup.box h2 span
+
+
+    #nav-topright li.nav-topright-labs a
     {
-/*        background: url(../images/sprites-combined.png) no-repeat -6px -311px;
-        width: 27px;
-        height: 35px;
-        margin-right: 13px;*/
+        width: 40px;
+        background-position: -114px -91px;
     }
-    .sidebar .box#topics h2
+
+    #nav-topright li.nav-topright-labs a:hover
     {
-        background-image: none;
+        background-position: -114px -117px;
     }
-    .sidebar #topics.box h2 span
+
+    #nav-topright li.nav-topright-doc a
     {
-    /*    background: url(../images/sprites-combined.png) no-repeat -94px -311px;
-        width: 27px;
-        height: 32px;
-        margin-right: 13px;*/
+        width: 32px;
+        background-position: -162px -91px;
     }
-    .sidebar .box#examples h2
+
+    #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
     {
-        background-image: none;
+        background-position: -162px -117px;
     }
-    .sidebar #examples.box h2 span
+
+    #nav-topright li.nav-topright-blog a
     {
-    /*    background: url(../images/sprites-combined.png) no-repeat -48px -311px;
-        width: 30px;
-        height: 31px;
-        margin-right: 9px;*/
+        width: 40px;
+        background-position: -203px -91px;
     }
 
-    .sidebar .box .list
+    #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
+    {
+        background-position: -203px -117px;
+    }
+
+    #nav-topright li.nav-topright-shop a
+    {
+        width: 40px;
+        background-position: -252px -91px;
+    }
+
+    #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
+    {
+        background-position: -252px -117px;
+    }
+
+    #nav-logo
+    {
+        background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
+        left: -3px;
+        position: absolute;
+        width: 75px;
+        height: 75px;
+        top: 13px;
+    }
+    #nav-logo a
+    {
+        width: 75px;
+        height: 75px;
+        display: block;
+        text-indent: -9999px;
+        overflow: hidden;
+    }
+
+
+    .shortCut-topleft-inactive
+    {
+        padding-left: 3px;
+        background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
+        height: 20px;
+        width: 47px;
+    }
+    .shortCut-topleft-inactive span
+    {
+        font-variant: normal;
+    }
+	    .shortCut-topleft-inactive span a:hover,     .shortCut-topleft-active a:hover
+	{
+		text-decoration:none;
+	}
+    #shortCut
+    {
+        padding-top: 10px;
+        font-weight: bolder;
+        color: #b0adab;
+    }
+    #shortCut ul
+    {
+        list-style-type: none;
+        float: left;
+        width: 347px;
+        margin-left: 100px;
+    }
+    #shortCut li
+    {
+        display: inline-block;
+        margin-right: 25px;
+        float: left;
+        white-space: nowrap;
+    }
+    #shortCut li a
+    {
+        color: #b0adab;
+    }
+    #shortCut li a:hover
+    {
+        color: #44a51c;
+    }
+
+	
+	
+/* end header elements */	
+/* content and sidebar elements */
+    .wrapper
+    {
+        background: url(../images/bg_r.png) repeat-y 100% 0;
+    }
+    .wrapper .hd
+    {
+        padding-left: 216px;
+        height: 15px;
+        background: url(../images/page.png) no-repeat 0 0;
+        overflow: hidden;
+    }
+
+
+
+
+    .wrapper .hd span
+    {
+        height: 15px;
+        display: block;
+        overflow: hidden;
+        background: url(../images/page.png) no-repeat 100% -30px;
+    }
+    .wrapper .bd
+    {
+        background: url(../images/bg_l.png) repeat-y 0 0;
+        position: relative;
+    }
+
+
+
+
+    .wrapper .ft
+    {
+        padding-left: 216px;
+        height: 15px;
+        background: url(../images/page.png) no-repeat 0 -75px;
+        overflow: hidden;
+    }
+
+
+
+
+    .wrapper .ft span
+    {
+        height: 15px;
+        display: block;
+        background: url(../images/page.png) no-repeat 100% -60px;
+        overflow: hidden;
+    }
+	.navTop{ 
+	float:right;
+	display:block;
+	padding-right:15px;
+
+
+	}
+	
+
+	
+/* end content and sidebar elements */	
+/* sidebar elements */
+    .sidebar
+    {
+        float: left;
+        margin-left: 5px;
+        width: 200px;
+        font-size: 11px;
+    }
+
+
+
+
+
+
+    .sidebar .searchlabel
+    {
+        padding: 0 0 2px 17px;
+        font: normal bold 11px/1.2 Verdana;
+    }
+
+    .sidebar .search
+    {
+        padding: 0 15px 0 16px;
+    }
+
+    .sidebar .search form
+    {
+        background: url(../images/sprites-combined.png) no-repeat -6px -348px;
+		height:21px;
+		padding:2px 0 0 5px;
+		width:167px;
+    }
+
+    .sidebar .search form input#pageType
+    {
+        width: 158px;
+        height: 19px;
+        padding: 0;
+        border: 0px;
+        outline: none;
+        font: 13px/1.2 Verdana;
+    }
+
+    .sidebar .box
+    {
+        padding: 17px 15px 5px 16px;
+    }
+
+    .sidebar .box .first
+    {
+        background-image: none;
+    }
+
+    .sidebar .box h2
+    {
+        font: bold 16px/1.2 Arial;
+        padding: 0;
+    }
+    .sidebar .box h2 span
+    {
+        overflow: hidden;
+        display: inline-block;
+    }
+    .sidebar .box#lookup h2
+    {
+        background-image: none;
+    }
+    .sidebar #lookup.box h2 span
+    {
+    }
+    .sidebar .box#topics h2
+    {
+        background-image: none;
+    }
+    .sidebar #topics.box h2 span
+    {
+    }
+    .sidebar .box#examples h2
+    {
+        background-image: none;
+    }
+    .sidebar #examples.box h2 span
+    {
+    }
+
+    .sidebar .box .list
     {
         display: block;
 		max-height:200px;
@@ -313,7 +588,6 @@
     }
     .sidebar .box ul
     {
-	/*padding:10px;*/
 	padding-bottom:5px;
 	padding-left:10px;
 	padding-top:5px;
@@ -340,16 +614,40 @@
 		color:#AAD2F0;
 		font-style:italic;
     }	
+	.sidebar .search form input.loading
+	{
+			background:url("../images/spinner.gif") no-repeat scroll right center transparent;
+	}
+
+.floatingResult{
+	z-index:1;
+	position:relative;
+	padding-top:0px;
+	background-color:white;
+	border:solid 1px black;
+	height:250px;
+	width:600px;
+	overflow-x:hidden;
+	overflow-y:auto;
+}
 
+	.floatingResult:hover{
+		display:block;
+	}
+	.floatingResult:hover{
+	}
+	
+/* end sidebar elements */
+/* content elements */
     .wrap
     {
         margin: 0 5px 0 208px;
         overflow: visible; 
     }
-    .offline .wrap
-    {
-        margin: 0 5px 0 5px;
-    }
+
+
+
+
     .wrap .toolbar
     {
         background-color: #fafafa;
@@ -435,11 +733,14 @@
         color: #00732F;
     }
 
-    .offline .wrap .breadcrumb
-    {
-    }
 
-    .wrap .breadcrumb ul
+    .wrap .content
+    {
+        padding: 30px;
+		word-wrap:break-word;
+    }
+
+    .wrap .breadcrumb ul
     {
     }
     .wrap .breadcrumb ul li
@@ -464,30 +765,36 @@
         padding-left: 0;
         margin-left: 0;
     }
-    .wrap .content
-    {
-        padding: 30px;
-		word-wrap:break-word;
-    }
 
+
+
+
+	.wrap .content ol li {
+	background:none;
+	font:normal 10pt/1 Verdana;
+
+	margin-bottom:10px;
+	margin-left:12px;
+	/*list-style-type:disc;*/
+	}
+	
     .wrap .content li
     {
-        /*padding-left: 12px;*/
         background: url(../images/bullet_sq.png) no-repeat 0 5px;
         font: normal 400 10pt/1 Verdana;
-       /* color: #44a51c;*/
         margin-bottom: 10px; 
 		padding-left:12px;
     }
-    .content li:hover
-    {
-      /*  text-decoration: underline;*/
-    }
 
-    .offline .wrap .content
-    {
-        padding-top: 15px;
-    }
+
+
+
+
+
+
+
+
+    .content li:hover  {}
 
     .wrap .content h1
     {
@@ -495,17 +802,14 @@
     }
     .wrap .content h2
     {
-    
 	border-bottom:1px solid #DDDDDD;
 	font:600 16px/1.2 Arial;
 	margin-top:15px;
-	width:100%;
-		
+	width:100%;	
     }
     .wrap .content h3
     {
         font: bold 14px/1.2 Arial;
-		/*border-bottom:1px solid #DDDDDD;*/
 		font:600 16px/1.2 Arial;
 		margin-top:15px;
 		width:100%;		
@@ -514,320 +818,69 @@
     {
         line-height: 20px;
         padding: 5px;
-	/*	text-align:justify;*/
     }
     .wrap .content table p
     {
         line-height: 20px;
-        padding: 0px;
-    }	
-    .wrap .content ul
-    {
-        padding-left: 25px;
-        padding-top: 10px;
-    }
-    a:hover
-    {
-        color: #4c0033;
-        text-decoration: underline;
-    }
-    .content a:visited
-    {
-        color: #4c0033;
-        text-decoration: none;
-    }
-     .content a:visited:hover
-    {
-        color: #4c0033;
-        text-decoration: underline;
-    }   .footer
-    {
-        min-height: 100px;
-        color: #797775;
-        font: normal 9px/1 Verdana;
-        text-align: center;
-        padding-top: 40px;
-        background-color: #E6E7E8;
-        margin: 0;
-    }
-    .feedback
-    {
-        float: none;
-        position: absolute;
-        right: 15px;
-        bottom: 10px;
-        font: normal 8px/1 Verdana;
-        color: #B0ADAB;
-    }
-    .feedback:hover
-    {
-        float: right;
-        font: normal 8px/1 Verdana;
-        color: #00732F;
-        text-decoration: underline;
-    }
-    .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
-    {
-        content: ".";
-        display: block;
-        height: 0;
-        clear: both;
-        visibility: hidden;
-    }
-    #nav-topright
-    {
-        height: 70px;
-    }
-
-    #nav-topright ul
-    {
-        list-style-type: none;
-        float: right;
-        width: 370px;
-        margin-top: 11px;
-    }
-
-    #nav-topright li
-    {
-        display: inline-block;
-        margin-right: 20px;
-        float: left;
-    }
-
-    #nav-topright li.nav-topright-last
-    {
-        margin-right: 0;
-    }
-
-    #nav-topright li a
-    {
-        background: transparent url(../images/sprites-combined.png) no-repeat;
-        height: 18px;
-        display: block;
-        overflow: hidden;
-        text-indent: -9999px;
-    }
-
-    #nav-topright li.nav-topright-home a
-    {
-        width: 65px;
-        background-position: -2px -91px;
-    }
-
-    #nav-topright li.nav-topright-home a:hover
-    {
-        background-position: -2px -117px;
-    }
-
-
-    #nav-topright li.nav-topright-dev a
-    {
-        width: 30px;
-        background-position: -76px -91px;
-    }
-
-    #nav-topright li.nav-topright-dev a:hover
-    {
-        background-position: -76px -117px;
-    }
-
-
-    #nav-topright li.nav-topright-labs a
-    {
-        width: 40px;
-        background-position: -114px -91px;
-    }
-
-    #nav-topright li.nav-topright-labs a:hover
-    {
-        background-position: -114px -117px;
-    }
-
-    #nav-topright li.nav-topright-doc a
-    {
-        width: 32px;
-        background-position: -162px -91px;
-    }
-
-    #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
-    {
-        background-position: -162px -117px;
-    }
-
-    #nav-topright li.nav-topright-blog a
-    {
-        width: 40px;
-        background-position: -203px -91px;
-    }
-
-    #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
-    {
-        background-position: -203px -117px;
-    }
-
-    #nav-topright li.nav-topright-shop a
-    {
-        width: 40px;
-        background-position: -252px -91px;
-    }
-
-    #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
-    {
-        background-position: -252px -117px;
-    }
-
-    #nav-logo
-    {
-        background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
-        left: -3px;
-        position: absolute;
-        width: 75px;
-        height: 75px;
-        top: 13px;
-    }
-    #nav-logo a
-    {
-        width: 75px;
-        height: 75px;
-        display: block;
-        text-indent: -9999px;
-        overflow: hidden;
-    }
-
-
-    .shortCut-topleft-inactive
-    {
-        padding-left: 3px;
-        background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
-        height: 20px;
-        width: 47px;
-    }
-    .shortCut-topleft-inactive span
-    {
-        font-variant: normal;
-    }
-	    .shortCut-topleft-inactive span a:hover,     .shortCut-topleft-active a:hover
-	{
-		text-decoration:none;
-	}
-    #shortCut
-    {
-        padding-top: 10px;
-        font-weight: bolder;
-        color: #b0adab;
-    }
-    #shortCut ul
-    {
-        list-style-type: none;
-        float: left;
-        width: 347px;
-        margin-left: 100px;
-    }
-    #shortCut li
-    {
-        display: inline-block;
-        margin-right: 25px;
-        float: left;
-        white-space: nowrap;
-    }
-    #shortCut li a
-    {
-        color: #b0adab;
-    }
-    #shortCut li a:hover
-    {
-        color: #44a51c;
-    }
-
-    hr
-    {
-        background-color: #E6E6E6;
-        border: 1px solid #E6E6E6;
-        height: 1px;
-        width: 100%;
-        text-align: left;
-        margin: 15px 0px 15px 0px;
-    }
-
-    .content .alignedsummary
-    {
-        margin: 15px;
-    }
-    pre
-    {
-        border: 1px solid #DDDDDD;
-		-moz-border-radius: 7px 7px 7px 7px;
-        margin: 0 20px 10px 10px;
-        padding: 20px 15px 20px 20px;
-        overflow-x: auto;
-    }
-    table, pre
-    {
-        -moz-border-radius: 7px 7px 7px 7px;
-        background-color: #F6F6F6;
-        border: 1px solid #E6E6E6;
-        border-collapse: separate;
-        font-size: 11px;
-        /*min-width: 395px;*/
-        margin-bottom: 25px;
-     /*   display: inline-block;*/
-    }
-    thead
-    {
-        margin-top: 5px;
-		font:600 12px/1.2 Arial;
-    }
-    th
-    {
-        padding: 5px 15px 5px 15px;
-        background-color: #E1E1E1;
-      /*  border-bottom: 1px solid #E6E6E6;*/
-        border-left: 1px solid #E6E6E6;
-      /*  border-right: 1px solid #E6E6E6;*/
-    }
-    td
-    {
-        padding: 3px 15px 3px 20px;
-  /*      border-left: 1px solid #E6E6E6;
-        border-right: 1px solid #E6E6E6;*/
-    }
-    tr.odd td:hover,  tr.even td:hover
-    {
-    /*    border-right: 1px solid #C3C3C3;
-        border-left: 1px solid #C3C3C3;*/
-    }
-		
-	td.rightAlign
-	{
-        padding: 3px 5px 3px 10px;
-	}
-    table tr.odd
+        padding: 0px;
+    }	
+    .wrap .content ul
     {
-        border-left: 1px solid #E6E6E6;
-        background-color: #F6F6F6;
-        color: #66666E;
+        padding-left: 25px;
+        padding-top: 10px;
     }
-    table tr.even
+    a:hover
     {
-        border-left: 1px solid #E6E6E6;
-        background-color: #ffffff;
-        color: #66666E;
+        color: #4c0033;
+        text-decoration: underline;
     }
-    table tr.odd td:hover, table tr.even td:hover
+    .feedback
     {
-        background-color: #E6E6E6;
+        float: none;
+        position: absolute;
+        right: 15px;
+        bottom: 10px;
+        font: normal 8px/1 Verdana;
+        color: #B0ADAB;
     }
-    		
-    span.comment
+    .feedback:hover
     {
-        color: #8B0000;
-        font-style: italic;
+        float: right;
+        font: normal 8px/1 Verdana;
+        color: #00732F;
+        text-decoration: underline;
     }
-    span.string, span.char
+	.alphaChar{
+	width:100%;
+	background-color:#F6F6F6;
+	border:1px solid #E6E6E6;
+	-moz-border-radius: 7px 7px 7px 7px;
+	font-size:12pt;
+	padding-left:10px;
+	margin-top:10px;
+	margin-bottom:10px;
+	}
+	.flowList{
+	vertical-align:top;
+	}	
+
+	.flowList dl{
+	}
+	.flowList dd{
+	display:inline-block;
+	margin-left:10px;
+	width:250px;
+	}
+	.wrap .content .flowList p{
+	padding:0px;
+	}
+
+    .content .alignedsummary
     {
-        color: #254117;
+        margin: 15px;
     }
 
+
     .qmltype
     {
         text-align: center;
@@ -854,7 +907,6 @@
     *.qmlitem p
     {
     }
-
     #feedbackBox
     {
         display: none;
@@ -936,12 +988,10 @@
     }
 
 	.generic{
-		/*max-width:75%;*/
 	}
 	.generic td{
 		padding:5px;
 	}
-	
 	.generic .alphaChar{
 	margin-top:5px;
 	}
@@ -989,6 +1039,16 @@
         padding-left: 0px;
     }
 
+	.wrap .content .toc h3{
+	border-bottom:0px;
+	margin-top:0px;
+	}	
+	
+	.wrap .content .toc h3  a:hover{
+	color:#00732F;
+	text-decoration:none;
+	}
+
 
     .wrap .content .toc .level2
     {
@@ -1005,7 +1065,6 @@
         font: normal 10px/1.2 Verdana;
         background: url(../images/bullet_dn.png) no-repeat 0 5px;
     }
-
     .relpage
     {
         -moz-border-radius: 7px 7px 7px 7px;
@@ -1069,6 +1128,24 @@
 	.functionIndex a{
 	display:inline-block;
 	}
+	
+/* end content elements */
+/* footer elements */
+
+   .footer
+    {
+        min-height: 100px;
+        color: #797775;
+        font: normal 9px/1 Verdana;
+        text-align: center;
+        padding-top: 40px;
+        background-color: #E6E7E8;
+        margin: 0;
+    }
+/* end footer elements */
+
+
+
 
     /* start index box */
     .indexbox
@@ -1080,15 +1157,15 @@
     .indexboxcont
     {
         display: block;
-       /* overflow: hidden;*/
+
     }
 
     .indexboxbar
     {
         background: transparent url(../images/horBar.png ) repeat-x left bottom;
         margin-bottom: 25px;
-     /*   background-image: none;
-        border-bottom: 1px solid #e2e2e2;*/
+
+
     }
 
     .indexboxcont .section
@@ -1188,87 +1265,285 @@
         visibility: hidden;
     }
 	
-.sidebar .search form input.loading
-{
-        background:url("../images/spinner.gif") no-repeat scroll right center transparent;
-}
 
-    /* end of screen media */
-
-.flowList{
-vertical-align:top;
-}	
-.alphaChar{
-width:100%;
-background-color:#F6F6F6;
-border:1px solid #E6E6E6;
--moz-border-radius: 7px 7px 7px 7px;
-font-size:12pt;
-padding-left:10px;
-margin-top:10px;
-margin-bottom:10px;
-}
 
-.flowList dl{
-}
-.flowList dd{
-display:inline-block;
-margin-left:10px;
-width:250px;
-}
-.wrap .content .flowList p{
-padding:0px;
-}
-pre.highlightedCode {
-	display: block;
-	overflow:hidden;
-}
-.floatingResult{
-	z-index:1;
-	position:relative;
-	padding-top:0px;
-	background-color:white;
-	border:solid 1px black;
-	height:250px;
-	width:600px;
-	overflow-x:hidden;
-	overflow-y:auto;
-}
+/* start of offline spec*/
+    .offline .wrapper .hd
+    {
+        background: url(../images/page.png) no-repeat 0 -15px;
+    }
+	    .offline .wrapper .bd
+    {
+        background: url(../images/bg_l_blank.png) repeat-y 0 0;
+    }
+    .offline .wrapper .ft
+    {
+        background: url(../images/page.png) no-repeat 0 -90px;
+    }
+    .offline .sidebar,
+	.offline .feedback,
+	.offline .t_button,
+	.offline #narrowsearch,
+	.offline #narrowmenu
+    {
+        display: none;
+    }
+    .offline .wrap
+    {
+        margin: 0 5px 0 5px;
+    }
+    .offline .wrap .breadcrumb
+    {
+    }
 
-	.floatingResult:hover{
-		display:block;
-	}
-	.floatingResult:hover{
-		/*display:none;*/
-	}
+    .offline .wrap .content
+    {
+        padding-top: 15px;
+    }
 
-	.wrap .content ol li {
-	background:none;
-	font:400 10pt/1 Verdana;
-	margin-bottom:10px;
-	margin-left:12px;
+
+/* end of offline spec*/
+	
+/* start of creator spec*/
+	.creator
+	{
+	margin-left:0px;
+	margin-right:0px;
+	padding-left:0px;
+	padding-right:0px;
 	}
-	.wrap .content ol li {
+	.creator .wrap .content ol li {
 	list-style-type:decimal;
 
 	}
-	.navTop{ 
-	float:right;
-	display:block;
-	padding-right:15px;
-	/*margin-top:10px;*/
+    .creator .header .icon,
+	.creator .feedback,
+	.creator .t_button,
+    .creator .feedback,
+	.creator #feedbackBox,
+	.creator #feedback,
+	.creator #blurpage,
+	.creator .indexbox .indexIcon span,
+	.creator .wrapper .hd,
+	.creator  .indexbox .indexIcon,
+	.creator .header #nav-logo,
+	.creator #offlinemenu,
+	.creator #offlinesearch,
+	.creator  .header #nav-topright,
+    .creator .header #shortCut ,
+	.creator .wrapper .hd,
+    .creator .wrapper .ft,
+	.creator .sidebar,
+	.creator .wrap .feedback
+    {
+	display:none;
+    }
+	
+	body.creator
+    {
+	background: none;
+
+        font: normal 13px/1.2 Verdana;
+        color: #363534;
+		background-color: #FFFFFF;
+    }
+
+
+
+    .creator .header, .footer, .wrapper
+    {
+        max-width: 1500px;
+        margin: 0px;
+    }
+
+   .creator .wrapper
+    {
+	position:relative;
+	top:50px;
+    }
+    .creator .wrapper .bd
+	{
+
+	background:#FFFFFF;
 	}
+
+
+   .creator .header, .footer
+    {
+        display: block;
+        clear: both;
+        overflow: hidden;
+    }
+    .creator .wrap .content p
+
+    {
+        line-height: 20px;
+        padding: 5px;
+    }
+
+    .creator .header .qtref span
+    {
+		background:none;
+    }	
+
+
 	
-	.wrap .content .toc h3{
-	border-bottom:0px;
-	margin-top:0px;
+		.creator .footer
+    {
+		border-top:1px solid #E5E5E5;
+        min-height: 100px;
+		margin:0px;
+    }
+	
+     .creator .wrap
+    {
+
+        padding:0 5px 0 5px;
+		margin: 0px;
+    }
+    .creator .wrap .toolbar
+    {
+
+
+	border-bottom:1px solid #E5E5E5;
+	width:100%,
+    }	
+    .creator .wrap .breadcrumb ul li a
+    {
+      /*  color: #363534;*/
+        color: #00732F;
+    }	
+	
+    .creator .wrap .content
+    {
+        padding: 0px;
+		word-wrap:break-word;
+    }
+	
+    .creator .wrap .content ol li { 
+        background:none; 
+        font: inherit; 
+        padding-left: 0px;
+    } 
+	
+    .creator .wrap .content .descr ol li {
+	margin-left: 45px;
+
+    }
+    .creator .content .alignedsummary
+    {
+        margin: 5px;
+		width:100%;
+    }
+	.creator .generic{
+		max-width:75%;
+	}
+	.creator .generic td{
+		padding:0;
 	}
+    .creator .indexboxbar
+    {
+		border-bottom:1px solid #E5E5E5;
+        margin-bottom: 25px;
+		background: none;
+    }
 	
-	.wrap .content .toc h3  a:hover{
-	color:#00732F;
-	text-decoration:none;
+	
+
+    .creator .header
+    {
+      width: 100%;
+      margin: 0;
+      height: auto;
+      background-color: #ffffff;
+      padding: 10px 0 5px 0;
+      overflow: visible;
+	  border-bottom: solid #E5E5E5 1px;
+	  z-index:1;
+
+
+
+
+
+
+
+
+	  position:fixed;
+    }
+
+
+    .creator .header .content
+    {
+    }
+    .creator .header .qtref
+    {
+      color: #00732F;
+      position: static;
+      float: left;
+      margin-left: 5px;
+      font: bold 18px/1 Arial;
+    }
+
+    .creator .header .qtref:visited
+    {
+      color: #00732F;
+	  }
+    .creator .header .qtref:hover
+    {
+      color: #00732F;
+	  text-decoration:none;
+	  }
+    .creator .header .qtref span
+    {
+      background-image: none;
+      text-indent: 0;
+	  text-decoration:none;
+    }
+
+
+
+
+
+
+    .creator .wrap .toolbar
+    {
+      display:block;
+	  padding-top:0px;
+    }
+
+
+
+    .creator .wrap .breadcrumb ul li {
+      font-weight: normal;
+    }
+
+    .creator .wrap .breadcrumb ul li a {
+      /*color: #44a51c;*/
+    }
+
+    .creator .wrap .breadcrumb ul li.last a {
+      /*color: #363534;*/
+    }
+    
+	.creator #narrowmenu ul
+	{
+	  border-bottom:solid 1px #E5E5E5;
+	  border-left:solid 1px #E5E5E5;
+	  border-right:solid 1px #E5E5E5;
 	}
+
+    .creator #narrowmenu li ul {
+      margin-top:-15px;
+   }
+
+
+	.creator .toc {
+	margin:10px 20px 10px 10px;
+	}	
+/* end of creator spec*/
 	
+}
+
 /* end of screen media */
 
 /* start of print media */
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index c8218dc..fc761e5 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -277,7 +277,7 @@ void HtmlGenerator::initializeGenerator(const Config &config)
 
     project = config.getString(CONFIG_PROJECT);
     offlineDocs = !config.getBool(CONFIG_ONLINE);
-    creatorDocs = !config.getBool(CONFIG_CREATOR);
+    creatorDocs = false; //!config.getBool(CONFIG_CREATOR);
     projectDescription = config.getString(CONFIG_DESCRIPTION);
     if (projectDescription.isEmpty() && !project.isEmpty())
         projectDescription = project + " Reference Documentation";
@@ -1785,7 +1785,7 @@ void HtmlGenerator::generateHeader(const QString& title,
 	{
 		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
 		out() << "</head>\n";
-		out() << "<body class=\"offline creator\">\n"; // offline for Creator
+		out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
 	}	
 	// Setting online doc configuration
     else
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 4b52992..8d5fa89 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -17,7 +17,10 @@ qhp.Assistant.namespace           = com.trolltech.assistant.470
 qhp.Assistant.virtualFolder       = qdoc
 qhp.Assistant.indexTitle          = Qt Assistant Manual
 qhp.Assistant.extraFiles          = 									images/bg_l.png \
-                             	    images/bg_l_blank.png \
+           	    images/bg_l_blank.png \
+		     images/bg_ll_blank.png \
+			     images/bg_ul_blank.png \
+			     images/header_bg.png \
                              	    images/bg_r.png \
 									images/box_bg.png \
 									images/breadcrumb.png \
@@ -25,24 +28,27 @@ qhp.Assistant.extraFiles          = 									images/bg_l.png \
                              	    images/bullet_dn.png \
 									images/bullet_sq.png \
                              	    images/bullet_up.png \
+									images/arrow_down.png \
                              	    images/feedbackground.png \
                              	    images/horBar.png \
 									images/page.png \
 									images/page_bg.png \
 									images/sprites-combined.png \
-									images/arrow-down.png \
 									images/spinner.gif \
                              	    images/stylesheet-coffee-plastique.png \
                              	    images/taskmenuextension-example.png \
                              	   images/coloreditorfactoryimage.png \
                              	   images/dynamiclayouts-example.png \
-									scripts/functions.js \
-									scripts/jquery.js \
-									style/OfflineStyle.css \
-									style/style_ie6.css \
-									style/style_ie7.css \
-									style/style_ie8.css \
-                             	    style/style.css
+			     scripts/functions.js \
+			     scripts/jquery.js \
+			     scripts/narrow.js \
+			     scripts/superfish.js \
+			     style/narrow.css \
+			     style/superfish.css \
+			     style/style_ie6.css \
+			     style/style_ie7.css \
+			     style/style_ie8.css \
+			     style/style.css
 
 qhp.Assistant.filterAttributes    = qt 4.7.0 tools assistant
 qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 140b81f..4ac4f47 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -24,6 +24,9 @@ qhp.Qt.indexTitle          = Qt Reference Documentation
 qhp.Qt.extraFiles          = index.html \
                              images/bg_l.png \
                              images/bg_l_blank.png \
+			     images/bg_ll_blank.png \
+			     images/bg_ul_blank.png \
+			     images/header_bg.png \
                              images/bg_r.png \
                              images/box_bg.png \
                              images/breadcrumb.png \
@@ -31,12 +34,12 @@ qhp.Qt.extraFiles          = index.html \
                              images/bullet_dn.png \
                              images/bullet_sq.png \
                              images/bullet_up.png \
+                             images/arrow_down.png \
                              images/feedbackground.png \
                              images/horBar.png \
                              images/page.png \
                              images/page_bg.png \
                              images/sprites-combined.png \
-                             images/arrow-down.png \
                              images/spinner.gif \
                              images/stylesheet-coffee-plastique.png \
                              images/taskmenuextension-example.png \
@@ -44,17 +47,10 @@ qhp.Qt.extraFiles          = index.html \
                              images/dynamiclayouts-example.png \
                              scripts/functions.js \
                              scripts/jquery.js \
-                             scripts/shBrushCpp.js \
-                             scripts/shCore.js \
-                             scripts/shLegacy.js \
                              scripts/narrow.js \
                              scripts/superfish.js \
-                             style/shCore.css \
-                             style/shThemeDefault.css \
                              style/narrow.css \
                              style/superfish.css \
-                             style/superfish_skin.css \
-                             style/OfflineStyle.css \
                              style/style_ie6.css \
                              style/style_ie7.css \
                              style/style_ie8.css \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index d132771..5575b7b 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -51,17 +51,10 @@ qhp.Qt.extraFiles          = index.html \
 			     images/dynamiclayouts-example.png \
 			     scripts/functions.js \
 			     scripts/jquery.js \
-			     scripts/shBrushCpp.js \
-			     scripts/shCore.js \
-			     scripts/shLegacy.js \
 			     scripts/narrow.js \
 			     scripts/superfish.js \
-			     style/shCore.css \
-			     style/shThemeDefault.css \
 			     style/narrow.css \
 			     style/superfish.css \
-			     style/superfish_skin.css \
-  				style/OfflineStyle.css \
 			     style/style_ie6.css \
 			     style/style_ie7.css \
 			     style/style_ie8.css \
-- 
cgit v0.12


From 4b6180908a52ada73288021c1380f06ae3f75707 Mon Sep 17 00:00:00 2001
From: Dominik Holland <dominik.holland@nokia.com>
Date: Wed, 7 Jul 2010 10:37:09 +0200
Subject: Compile fix for bearermonitor example

---
 examples/network/bearermonitor/sessionwidget.h     |  2 +-
 .../network/bearermonitor/sessionwidget_maemo.ui   | 48 ++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index 5b5827b..c92db44 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -41,12 +41,12 @@
 #ifndef SESSIONWIDGET_H
 #define SESSIONWIDGET_H
 
+#include <qnetworksession.h>
 #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
 #include "ui_sessionwidget_maemo.h"
 #else
 #include "ui_sessionwidget.h"
 #endif
-#include <qnetworksession.h>
 
 QT_USE_NAMESPACE
 
diff --git a/examples/network/bearermonitor/sessionwidget_maemo.ui b/examples/network/bearermonitor/sessionwidget_maemo.ui
index ca68246..8867509 100644
--- a/examples/network/bearermonitor/sessionwidget_maemo.ui
+++ b/examples/network/bearermonitor/sessionwidget_maemo.ui
@@ -214,6 +214,54 @@
        </item>
       </layout>
      </item>
+     <item>
+      <layout class="QHBoxLayout" name="errorStringLayout_2">
+       <item>
+        <widget class="QLabel" name="rxData">
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="txData">
+         <property name="text">
+          <string>0</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="errorStringLayout_3">
+       <item>
+        <widget class="QLabel" name="errorStringLabel_2">
+         <property name="text">
+          <string>Active Time:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="activeTime">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string>0 seconds</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
     </layout>
    </item>
    <item>
-- 
cgit v0.12


From 46175e55c8d053b61a45aea89a3e1b8371207dee Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Mon, 12 Jul 2010 10:47:00 +0200
Subject: fix build for -no-qt3support

QString::lower() is QT3_SUPPORT, the correct method is
QString::toLower().
---
 src/network/ssl/qsslsocket_openssl.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index a5da391..8dc1743 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1106,11 +1106,11 @@ bool QSslSocketBackendPrivate::startHandshake()
             QString peerName = (verificationPeerName.isEmpty () ? q->peerName() : verificationPeerName);
             QString commonName = configuration.peerCertificate.subjectInfo(QSslCertificate::CommonName);
 
-            if (!isMatchingHostname(commonName.lower(), peerName.lower())) {
+            if (!isMatchingHostname(commonName.toLower(), peerName.toLower())) {
                 bool matched = false;
                 foreach (const QString &altName, configuration.peerCertificate
                          .alternateSubjectNames().values(QSsl::DnsEntry)) {
-                    if (isMatchingHostname(altName.lower(), peerName.lower())) {
+                    if (isMatchingHostname(altName.toLower(), peerName.toLower())) {
                         matched = true;
                         break;
                     }
-- 
cgit v0.12


From 29dcc069ba9a2c38b4461d5fd19d5fa9a1531595 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Mon, 12 Jul 2010 10:44:12 +0200
Subject: syncqt: fix wrong paths in include/ActiveQt/headers.pri

Assigning a semicolon separated list of directories to a Qt module does not
work correctly. The values of %modules must be split into single values
before operating on them. This doesn't happen in all places.

ActiveQt is the only module where this feature is used.
Also, it is not needed anymore for this particular module.
Thus, I'll just remove the semicolon separated list from ActiveQt and
replace it with the module directory.

Task-number: QTBUG-4586
Reviewed-by: ossi
---
 bin/syncqt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/syncqt b/bin/syncqt
index db6dce6..4f8e343 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -42,7 +42,7 @@ my %modules = ( # path to module name map
         "QtScript" => "$basedir/src/script",
         "QtScriptTools" => "$basedir/src/scripttools",
         "Qt3Support" => "$basedir/src/qt3support",
-        "ActiveQt" => "$basedir/src/activeqt/container;$basedir/src/activeqt/control;$basedir/src/activeqt/shared",
+        "ActiveQt" => "$basedir/src/activeqt",
         "QtTest" => "$basedir/src/testlib",
         "QtAssistant" => "$basedir/tools/assistant/compat/lib",
         "QtHelp" => "$basedir/tools/assistant/lib",
-- 
cgit v0.12


From 4ba6646150300feb79af9510c7c5d238d653a98e Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Mon, 12 Jul 2010 11:10:43 +0200
Subject: syncqt: don't try to split %module's values

Using semiconlon separated directory lists in module values is broken
and unused. Removing this feature.

Task-number: QTBUG-4586
Reviewed-by: ossi
---
 bin/syncqt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/syncqt b/bin/syncqt
index 4f8e343..d665e87 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -960,7 +960,7 @@ if($check_includes) {
 	#iteration info
 	my $lib = $_;
 	my $dir = "$modules{$lib}";
-	foreach (split(/;/, $dir)) {
+	{
 	    my $current_dir = "$_";
 	    #calc subdirs
 	    my @subdirs = ($current_dir);
-- 
cgit v0.12


From 156193223ee9d58da66817ae6ffc0174bdf34e5b Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Mon, 12 Jul 2010 12:14:45 +0200
Subject: fix indentation

Merge-request: 740
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 tools/configure/configureapp.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 952d4e0..0c450f0 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2439,7 +2439,7 @@ void Configure::generateOutputVars()
         qmakeFormatPlugins += "gif";
 
     if (dictionary[ "TIFF" ] == "no")
-          qtConfig += "no-tiff";
+        qtConfig += "no-tiff";
     else if (dictionary[ "TIFF" ] == "plugin")
         qmakeFormatPlugins += "tiff";
     if (dictionary[ "LIBTIFF" ] == "system")
-- 
cgit v0.12


From 80ad34046e2d3d0b8bd5d8346cb1edb0c83c1585 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Mon, 12 Jul 2010 12:14:46 +0200
Subject: fixed built-in jpeg and tiff in configure.exe, QTBUG-12093

Merge-request: 740
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 tools/configure/configureapp.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 0c450f0..d3dec3c 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2440,6 +2440,8 @@ void Configure::generateOutputVars()
 
     if (dictionary[ "TIFF" ] == "no")
         qtConfig += "no-tiff";
+    else if (dictionary[ "TIFF" ] == "yes")
+        qtConfig += "tiff";
     else if (dictionary[ "TIFF" ] == "plugin")
         qmakeFormatPlugins += "tiff";
     if (dictionary[ "LIBTIFF" ] == "system")
@@ -2447,6 +2449,8 @@ void Configure::generateOutputVars()
 
     if (dictionary[ "JPEG" ] == "no")
         qtConfig += "no-jpeg";
+    else if (dictionary[ "JPEG" ] == "yes")
+        qtConfig += "jpeg";
     else if (dictionary[ "JPEG" ] == "plugin")
         qmakeFormatPlugins += "jpeg";
     if (dictionary[ "LIBJPEG" ] == "system")
-- 
cgit v0.12


From 446770c939b8c643c2a3bec73906055238cf3925 Mon Sep 17 00:00:00 2001
From: Markus Goetz <Markus.Goetz@nokia.com>
Date: Mon, 12 Jul 2010 16:37:36 +0200
Subject: QNAM: Add future enum attribute for Zerocopy QNAM

Implementation will follow in 4.7.1 or 4.8, let's see.

Reviewed-by: David Boddie
Reviewed-by: Simon Hausmann
Reviewed-by: Peter Hartmann
---
 src/network/access/qnetworkrequest.cpp | 8 ++++++++
 src/network/access/qnetworkrequest.h   | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index bccfec1..fa592c2 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -230,6 +230,14 @@ QT_BEGIN_NAMESPACE
 
         \since 4.7
 
+    \omitvalue MaximumDownloadBufferSizeAttribute
+        \since 4.7
+        \internal
+
+    \omitvalue DownloadBufferAttribute
+        \since 4.7
+        \internal
+
     \value User
         Special type. Additional information can be passed in
         QVariants with types ranging from User to UserMax. The default
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index d2945c4..cdadf0f 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -82,6 +82,8 @@ public:
         CookieLoadControlAttribute,
         AuthenticationReuseAttribute,
         CookieSaveControlAttribute,
+        MaximumDownloadBufferSizeAttribute, // internal
+        DownloadBufferAttribute, // internal
 
         User = 1000,
         UserMax = 32767
-- 
cgit v0.12


From 1e9348f52f06feb355245a9fffd786562e76e15f Mon Sep 17 00:00:00 2001
From: Robert Griebl <robert.griebl@nokia.com>
Date: Mon, 12 Jul 2010 18:02:03 +0200
Subject: Timing fix for slow devices.

Although the wait is only specified as 50ms, it might still take longer than
that for Qt to deliver the actual mouse release event (especially on
embedded devices).  The problem here is that in the meantime the auto-repeat
on the button might have been triggered.

Reviewed-by: Dominik Holland
---
 tests/auto/qscrollbar/tst_qscrollbar.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/qscrollbar/tst_qscrollbar.cpp b/tests/auto/qscrollbar/tst_qscrollbar.cpp
index 735b2dd..16d5b42 100644
--- a/tests/auto/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/qscrollbar/tst_qscrollbar.cpp
@@ -130,7 +130,7 @@ void tst_QScrollBar::task_209492()
     QMouseEvent mousePressEvent(QEvent::MouseButtonPress, pressPoint, globalPressPoint,
                                 Qt::LeftButton, Qt::LeftButton, 0);
     QApplication::sendEvent(verticalScrollBar, &mousePressEvent);
-    QTest::qWait(50);
+    QTest::qWait(1);
     QMouseEvent mouseReleaseEvent(QEvent::MouseButtonRelease, pressPoint, globalPressPoint,
                                   Qt::LeftButton, Qt::LeftButton, 0);
     QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent);
-- 
cgit v0.12


From ca1276ebca0f8fa47116994b97153899116c8b57 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 12 Jul 2010 20:18:37 +0200
Subject: make projects lupdate-friendly

lupdate currently doesn't parse .qmake.cache, so it lacks
QT_SOURCE_TREE. so use relative paths in include statements and (the
relevant) include paths instead.
---
 tools/assistant/tools/assistant/assistant.pro                  |  2 +-
 tools/designer/src/components/lib/lib.pro                      | 10 +++++-----
 .../src/components/objectinspector/objectinspector.pri         |  2 +-
 .../designer/src/components/propertyeditor/propertyeditor.pri  |  4 ++--
 tools/designer/src/designer/designer.pro                       |  4 ++--
 tools/designer/src/lib/shared/shared.pri                       | 10 +++++-----
 tools/qvfb/qvfb.pro                                            |  2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro
index eb8cc51..d9aff7a 100644
--- a/tools/assistant/tools/assistant/assistant.pro
+++ b/tools/assistant/tools/assistant/assistant.pro
@@ -1,4 +1,4 @@
-include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri)
+include(../../../shared/fontpanel/fontpanel.pri)
 TEMPLATE = app
 LANGUAGE = C++
 TARGET = assistant
diff --git a/tools/designer/src/components/lib/lib.pro b/tools/designer/src/components/lib/lib.pro
index 8d0e692..0ada845 100644
--- a/tools/designer/src/components/lib/lib.pro
+++ b/tools/designer/src/components/lib/lib.pro
@@ -44,11 +44,11 @@ SOURCES += qdesigner_components.cpp
 }
 
 INCLUDEPATH += . .. \
-    $$QT_SOURCE_TREE/tools/designer/src/lib/components \
-    $$QT_SOURCE_TREE/tools/designer/src/lib/sdk \
-    $$QT_SOURCE_TREE/tools/designer/src/lib/extension \
-    $$QT_SOURCE_TREE/tools/designer/src/lib/uilib \
-    $$QT_SOURCE_TREE/tools/designer/src/lib/shared
+    $$PWD/../../lib/components \
+    $$PWD/../../lib/sdk \
+    $$PWD/../../lib/extension \
+    $$PWD/../../lib/uilib \
+    $$PWD/../../lib/shared
 
 include(../propertyeditor/propertyeditor.pri)
 include(../objectinspector/objectinspector.pri)
diff --git a/tools/designer/src/components/objectinspector/objectinspector.pri b/tools/designer/src/components/objectinspector/objectinspector.pri
index 733c4b3..565f78b 100644
--- a/tools/designer/src/components/objectinspector/objectinspector.pri
+++ b/tools/designer/src/components/objectinspector/objectinspector.pri
@@ -3,7 +3,7 @@
 contains(CONFIG, static) {
     INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/findwidget
 } else {
-    include($$QT_SOURCE_TREE/tools/shared/findwidget/findwidget.pri)
+    include(../../../../shared/findwidget/findwidget.pri)
 }
 
 INCLUDEPATH += $$PWD
diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.pri b/tools/designer/src/components/propertyeditor/propertyeditor.pri
index a8ed37e..7d2e7cb 100644
--- a/tools/designer/src/components/propertyeditor/propertyeditor.pri
+++ b/tools/designer/src/components/propertyeditor/propertyeditor.pri
@@ -10,8 +10,8 @@ contains(CONFIG, static) {
     INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/qtpropertybrowser
     INCLUDEPATH *= $$QT_SOURCE_TREE/tools/shared/qtgradienteditor
 } else {
-    include($$QT_SOURCE_TREE/tools/shared/qtpropertybrowser/qtpropertybrowser.pri)
-    include($$QT_SOURCE_TREE/tools/shared/qtgradienteditor/qtcolorbutton.pri)
+    include(../../../../shared/qtpropertybrowser/qtpropertybrowser.pri)
+    include(../../../../shared/qtgradienteditor/qtcolorbutton.pri)
 }
 
 FORMS += $$PWD/paletteeditor.ui \
diff --git a/tools/designer/src/designer/designer.pro b/tools/designer/src/designer/designer.pro
index 8590c7b..51842c5 100644
--- a/tools/designer/src/designer/designer.pro
+++ b/tools/designer/src/designer/designer.pro
@@ -25,8 +25,8 @@ contains(CONFIG, static) {
 
 TARGET = designer
 
-include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri)
-include($$QT_SOURCE_TREE/tools/shared/qttoolbardialog/qttoolbardialog.pri)
+include(../../../shared/fontpanel/fontpanel.pri)
+include(../../../shared/qttoolbardialog/qttoolbardialog.pri)
 
 HEADERS += \
     qdesigner.h \
diff --git a/tools/designer/src/lib/shared/shared.pri b/tools/designer/src/lib/shared/shared.pri
index 570b208..8286360 100644
--- a/tools/designer/src/lib/shared/shared.pri
+++ b/tools/designer/src/lib/shared/shared.pri
@@ -2,11 +2,11 @@
 INCLUDEPATH += $$PWD
 contains(QT_CONFIG, script): QT += script
 
-include($$QT_SOURCE_TREE/tools/shared/qtpropertybrowser/qtpropertybrowser.pri)
-include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri)
-include($$QT_SOURCE_TREE/src/tools/rcc/rcc.pri)
-include($$QT_SOURCE_TREE/tools/shared/findwidget/findwidget.pri)
-include($$QT_SOURCE_TREE/tools/shared/qtgradienteditor/qtgradienteditor.pri)
+include(../../../../shared/qtpropertybrowser/qtpropertybrowser.pri)
+include(../../../../shared/deviceskin/deviceskin.pri)
+include(../../../../../src/tools/rcc/rcc.pri)
+include(../../../../shared/findwidget/findwidget.pri)
+include(../../../../shared/qtgradienteditor/qtgradienteditor.pri)
 
 # Input
 FORMS += $$PWD/addlinkdialog.ui \
diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro
index dde7e8d..c101d00 100644
--- a/tools/qvfb/qvfb.pro
+++ b/tools/qvfb/qvfb.pro
@@ -35,7 +35,7 @@ SOURCES         = qvfb.cpp \
                   ../../src/gui/embedded/qlock.cpp \
                   ../../src/gui/embedded/qwssignalhandler.cpp
 
-include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri)
+include(../shared/deviceskin/deviceskin.pri)
 
 contains(QT_CONFIG, opengl) {
 	QT += opengl
-- 
cgit v0.12


From 30bd9791c06bba8f70bcf129022808fd99be743d Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 12 Jul 2010 20:21:31 +0200
Subject: remove redundand translations project files

lupdate is now powerful enough to use the real project files.
this avoids that the file lists run out of sync (which they did, though
not as much as i expected).
---
 tools/assistant/lib/lib.pro                   |  13 +++
 tools/assistant/tools/assistant/assistant.pro |  13 +++
 tools/assistant/translations/qt_help.pro      |  53 ----------
 tools/assistant/translations/translations.pro |  54 ----------
 tools/designer/designer.pro                   |  13 +++
 tools/designer/src/designer/designer.pro      |   1 -
 tools/designer/translations/translations.pro  | 141 --------------------------
 tools/qtconfig/qtconfig.pro                   |   8 ++
 tools/qtconfig/translations/translations.pro  |  16 ---
 tools/qvfb/qvfb.pro                           |   8 ++
 tools/qvfb/translations/translations.pro      |  35 -------
 translations/translations.pri                 |  10 +-
 12 files changed, 60 insertions(+), 305 deletions(-)
 delete mode 100644 tools/assistant/translations/qt_help.pro
 delete mode 100644 tools/assistant/translations/translations.pro
 delete mode 100644 tools/designer/translations/translations.pro
 delete mode 100644 tools/qtconfig/translations/translations.pro
 delete mode 100644 tools/qvfb/translations/translations.pro

diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro
index 26d3456..e84cf31 100644
--- a/tools/assistant/lib/lib.pro
+++ b/tools/assistant/lib/lib.pro
@@ -69,3 +69,16 @@ HEADERS += qhelpenginecore.h \
 # access to clucene
 HEADERS += qhelpsearchindexwriter_clucene_p.h \
     qhelpsearchindexreader_clucene_p.h
+
+TR_DIR = $$PWD/../../../translations
+TRANSLATIONS = \
+    $$TR_DIR/qt_help_cs.ts \
+    $$TR_DIR/qt_help_da.ts \
+    $$TR_DIR/qt_help_de.ts \
+    $$TR_DIR/qt_help_hu.ts \
+    $$TR_DIR/qt_help_ja.ts \
+    $$TR_DIR/qt_help_pl.ts \
+    $$TR_DIR/qt_help_ru.ts \
+    $$TR_DIR/qt_help_zh_CN.ts \
+    $$TR_DIR/qt_help_zh_TW.ts \
+    $$TR_DIR/qt_help_fr.ts
diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro
index d9aff7a..16a520e 100644
--- a/tools/assistant/tools/assistant/assistant.pro
+++ b/tools/assistant/tools/assistant/assistant.pro
@@ -108,3 +108,16 @@ contains(CONFIG, static): {
         DEFINES += USE_STATIC_SQLITE_PLUGIN
     }
 }
+
+TR_DIR = $$PWD/../../../../translations
+TRANSLATIONS = \
+    $$TR_DIR/assistant_cs.ts \
+    $$TR_DIR/assistant_da.ts \
+    $$TR_DIR/assistant_de.ts \
+    $$TR_DIR/assistant_fr.ts \
+    $$TR_DIR/assistant_hu.ts \
+    $$TR_DIR/assistant_ja.ts \
+    $$TR_DIR/assistant_pl.ts \
+    $$TR_DIR/assistant_ru.ts \
+    $$TR_DIR/assistant_zh_CN.ts \
+    $$TR_DIR/assistant_zh_TW.ts
diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro
deleted file mode 100644
index 6f66876..0000000
--- a/tools/assistant/translations/qt_help.pro
+++ /dev/null
@@ -1,53 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-SOURCES += ../lib/qhelpcollectionhandler.cpp \
-           ../lib/qhelpcontentwidget.cpp \
-           ../lib/qhelpdatainterface.cpp \
-           ../lib/qhelpdbreader.cpp \
-           ../lib/qhelpengine.cpp \
-           ../lib/qhelpenginecore.cpp \
-           ../lib/qhelpgenerator.cpp \
-           ../lib/qhelpindexwidget.cpp \
-           ../lib/qhelpprojectdata.cpp \
-           ../lib/qhelpsearchengine.cpp \
-           ../lib/qhelpsearchindexreader_clucene.cpp \
-           ../lib/qhelpsearchindexreader_default.cpp \
-           ../lib/qhelpsearchindexwriter_clucene.cpp \
-           ../lib/qhelpsearchindexwriter_default.cpp \
-           ../lib/qhelpsearchindex_default.cpp \
-           ../lib/qhelpsearchquerywidget.cpp \
-           ../lib/qhelpsearchresultwidget.cpp
-
-HEADERS += ../lib/qhelpcollectionhandler_p.h \
-           ../lib/qhelpcontentwidget.h \
-           ../lib/qhelpdatainterface_p.h \
-           ../lib/qhelpdbreader_p.h \
-           ../lib/qhelpengine.h \
-           ../lib/qhelpenginecore.h \
-           ../lib/qhelpengine_p.h \
-           ../lib/qhelpgenerator_p.h \
-           ../lib/qhelpindexwidget.h \
-           ../lib/qhelpprojectdata_p.h \
-           ../lib/qhelpsearchengine.h \
-           ../lib/qhelpsearchindexreader_clucene_p.h \
-           ../lib/qhelpsearchindexreader_default_p.h \
-           ../lib/qhelpsearchindexwriter_clucene_p.h \
-           ../lib/qhelpsearchindexwriter_default_p.h \
-           ../lib/qhelpsearchindex_default_p.h \
-           ../lib/qhelpsearchquerywidget.h \
-           ../lib/qhelpsearchresultwidget.h \
-           ../lib/qhelp_global.h
-
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/qt_help_cs.ts \
-    $$TR_DIR/qt_help_da.ts \
-    $$TR_DIR/qt_help_de.ts \
-    $$TR_DIR/qt_help_hu.ts \
-    $$TR_DIR/qt_help_ja.ts \
-    $$TR_DIR/qt_help_pl.ts \
-    $$TR_DIR/qt_help_ru.ts \
-    $$TR_DIR/qt_help_zh_CN.ts \
-    $$TR_DIR/qt_help_zh_TW.ts \
-    $$TR_DIR/qt_help_fr.ts
diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro
deleted file mode 100644
index c692262..0000000
--- a/tools/assistant/translations/translations.pro
+++ /dev/null
@@ -1,54 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-FORMS += ../tools/assistant/filternamedialog.ui \
-         ../tools/assistant/installdialog.ui \
-         ../tools/assistant/preferencesdialog.ui \
-         ../tools/assistant/topicchooser.ui \
-         ../tools/assistant/bookmarkdialog.ui
-
-SOURCES += ../tools/assistant/aboutdialog.cpp \
-           ../tools/assistant/bookmarkmanager.cpp \
-           ../tools/assistant/centralwidget.cpp \
-           ../tools/assistant/cmdlineparser.cpp \
-           ../tools/assistant/contentwindow.cpp \
-           ../tools/assistant/filternamedialog.cpp \
-           ../tools/assistant/helpviewer.cpp \
-           ../tools/assistant/indexwindow.cpp \
-           ../tools/assistant/installdialog.cpp \
-           ../tools/assistant/main.cpp \
-           ../tools/assistant/mainwindow.cpp \
-           ../tools/assistant/preferencesdialog.cpp \
-           ../tools/assistant/remotecontrol.cpp \
-           ../tools/assistant/searchwidget.cpp \
-           ../tools/assistant/topicchooser.cpp \
-
-SOURCES += ../../shared/fontpanel/fontpanel.cpp
-
-HEADERS += ../tools/assistant/aboutdialog.h \
-           ../tools/assistant/bookmarkmanager.h \
-           ../tools/assistant/centralwidget.h \
-           ../tools/assistant/cmdlineparser.h \
-           ../tools/assistant/contentwindow.h \
-           ../tools/assistant/filternamedialog.h \
-           ../tools/assistant/helpviewer.h \
-           ../tools/assistant/indexwindow.h \
-           ../tools/assistant/installdialog.h \
-           ../tools/assistant/mainwindow.h \
-           ../tools/assistant/preferencesdialog.h \
-           ../tools/assistant/remotecontrol.h \
-           ../tools/assistant/remotecontrol_win.h \
-           ../tools/assistant/searchwidget.h \
-           ../tools/assistant/topicchooser.h \
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/assistant_cs.ts \
-    $$TR_DIR/assistant_da.ts \
-    $$TR_DIR/assistant_de.ts \
-    $$TR_DIR/assistant_fr.ts \
-    $$TR_DIR/assistant_hu.ts \
-    $$TR_DIR/assistant_ja.ts \
-    $$TR_DIR/assistant_pl.ts \
-    $$TR_DIR/assistant_ru.ts \
-    $$TR_DIR/assistant_zh_CN.ts \
-    $$TR_DIR/assistant_zh_TW.ts
diff --git a/tools/designer/designer.pro b/tools/designer/designer.pro
index 721c4fc..31c8622 100644
--- a/tools/designer/designer.pro
+++ b/tools/designer/designer.pro
@@ -3,3 +3,16 @@ TEMPLATE = subdirs
 CONFIG += qt
 
 SUBDIRS = src
+
+TR_DIR = $$PWD/../../translations
+TRANSLATIONS = \
+    $$TR_DIR/designer_cs.ts \
+    $$TR_DIR/designer_de.ts \
+    $$TR_DIR/designer_fr.ts \
+    $$TR_DIR/designer_hu.ts \
+    $$TR_DIR/designer_ja.ts \
+    $$TR_DIR/designer_pl.ts \
+    $$TR_DIR/designer_ru.ts \
+    $$TR_DIR/designer_sl.ts \
+    $$TR_DIR/designer_zh_CN.ts \
+    $$TR_DIR/designer_zh_TW.ts
diff --git a/tools/designer/src/designer/designer.pro b/tools/designer/src/designer/designer.pro
index 51842c5..8564e96 100644
--- a/tools/designer/src/designer/designer.pro
+++ b/tools/designer/src/designer/designer.pro
@@ -88,4 +88,3 @@ INSTALLS += target
 include(../sharedcomponents.pri)
 
 unix:!mac:LIBS += -lm
-TRANSLATIONS = designer_de.ts
diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro
deleted file mode 100644
index 103c1fe..0000000
--- a/tools/designer/translations/translations.pro
+++ /dev/null
@@ -1,141 +0,0 @@
-include(../src/components/buddyeditor/buddyeditor.pri)
-include(../src/components/component.pri)
-include(../src/components/formeditor/formeditor.pri)
-include(../src/components/objectinspector/objectinspector.pri)
-include(../src/components/propertyeditor/propertyeditor.pri)
-include(../src/components/signalsloteditor/signalsloteditor.pri)
-include(../src/components/tabordereditor/tabordereditor.pri)
-include(../src/components/taskmenu/taskmenu.pri)
-include(../src/components/widgetbox/widgetbox.pri)
-include(../src/lib/extension/extension.pri)
-include(../src/lib/sdk/sdk.pri)
-include(../src/lib/shared/shared.pri)
-include(../src/lib/uilib/uilib.pri)
-include(../../shared/qttoolbardialog/qttoolbardialog.pri)
-include(../../shared/qtpropertybrowser/qtpropertybrowser.pri)
-include(../../shared/qtgradienteditor/qtgradienteditor.pri)
-
-# Include ActiveQt plugin
-SOURCES += ../src/plugins/activeqt/qaxwidgetextrainfo.cpp \
-           ../src/plugins/activeqt/qaxwidgetplugin.cpp \
-           ../src/plugins/activeqt/qaxwidgetpropertysheet.cpp \
-           ../src/plugins/activeqt/qaxwidgettaskmenu.cpp \
-           ../src/plugins/activeqt/qdesigneraxwidget.cpp
-
-HEADERS += ../src/plugins/activeqt/qaxwidgetextrainfo.h \
-           ../src/plugins/activeqt/qaxwidgetplugin.h \
-           ../src/plugins/activeqt/qaxwidgetpropertysheet.h \
-           ../src/plugins/activeqt/qaxwidgettaskmenu.h \
-           ../src/plugins/activeqt/qdesigneraxwidget.h \
-           ../../../src/activeqt/shared/qaxtypes.h
-
-
-# Include Qt3Support plugin
-
-SOURCES += ../src/plugins/widgets/qt3supportwidgets.cpp
-HEADERS += ../src/plugins/widgets/q3iconview/q3iconview_extrainfo.h \
-           ../src/plugins/widgets/q3iconview/q3iconview_plugin.h \
-           ../src/plugins/widgets/q3listview/q3listview_extrainfo.h \
-           ../src/plugins/widgets/q3listview/q3listview_plugin.h \
-           ../src/plugins/widgets/q3mainwindow/q3mainwindow_container.h \
-           ../src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h \
-           ../src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h \
-           ../src/plugins/widgets/q3toolbar/q3toolbar_plugin.h \
-           ../src/plugins/widgets/q3widgetstack/q3widgetstack_container.h \
-           ../src/plugins/widgets/q3widgetstack/q3widgetstack_plugin.h \
-           ../src/plugins/widgets/q3widgetstack/qdesigner_q3widgetstack_p.h \
-           ../src/plugins/widgets/q3wizard/q3wizard_container.h \
-           ../src/plugins/widgets/q3wizard/q3wizard_plugin.h \
-           ../src/plugins/widgets/q3listbox/q3listbox_extrainfo.h \
-           ../src/plugins/widgets/q3listbox/q3listbox_plugin.h \
-           ../src/plugins/widgets/q3table/q3table_extrainfo.h \
-           ../src/plugins/widgets/q3table/q3table_plugin.h \
-           ../src/plugins/widgets/q3textedit/q3textedit_extrainfo.h \
-           ../src/plugins/widgets/q3textedit/q3textedit_plugin.h \
-           ../src/plugins/widgets/q3widgets/q3widget_plugins.h
-
-SOURCES += ../src/plugins/widgets/q3iconview/q3iconview_extrainfo.cpp \
-           ../src/plugins/widgets/q3iconview/q3iconview_plugin.cpp \
-           ../src/plugins/widgets/q3listview/q3listview_extrainfo.cpp \
-           ../src/plugins/widgets/q3listview/q3listview_plugin.cpp \
-           ../src/plugins/widgets/q3mainwindow/q3mainwindow_container.cpp \
-           ../src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.cpp \
-           ../src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.cpp \
-           ../src/plugins/widgets/q3toolbar/q3toolbar_plugin.cpp \
-           ../src/plugins/widgets/q3widgetstack/q3widgetstack_container.cpp \
-           ../src/plugins/widgets/q3widgetstack/q3widgetstack_plugin.cpp \
-           ../src/plugins/widgets/q3widgetstack/qdesigner_q3widgetstack.cpp \
-           ../src/plugins/widgets/q3wizard/q3wizard_container.cpp \
-           ../src/plugins/widgets/q3wizard/q3wizard_plugin.cpp \
-           ../src/plugins/widgets/q3listbox/q3listbox_extrainfo.cpp \
-           ../src/plugins/widgets/q3listbox/q3listbox_plugin.cpp \
-           ../src/plugins/widgets/q3table/q3table_extrainfo.cpp \
-           ../src/plugins/widgets/q3table/q3table_plugin.cpp \
-           ../src/plugins/widgets/q3textedit/q3textedit_extrainfo.cpp \
-           ../src/plugins/widgets/q3textedit/q3textedit_plugin.cpp \
-           ../src/plugins/widgets/q3widgets/q3widget_plugins.cpp
-
-# Include those manually as they do not contain any directory specification
-APP_DIR=../src/designer
-SOURCES += $$APP_DIR/appfontdialog.cpp \
-           $$APP_DIR/assistantclient.cpp \
-           $$APP_DIR/main.cpp \
-           $$APP_DIR/mainwindow.cpp \
-           $$APP_DIR/newform.cpp \
-           $$APP_DIR/preferencesdialog.cpp \
-           $$APP_DIR/qdesigner_actions.cpp \
-           $$APP_DIR/qdesigner_appearanceoptions.cpp \
-           $$APP_DIR/qdesigner.cpp \
-           $$APP_DIR/qdesigner_formwindow.cpp \
-           $$APP_DIR/qdesigner_server.cpp \
-           $$APP_DIR/qdesigner_settings.cpp \
-           $$APP_DIR/qdesigner_toolwindow.cpp \
-           $$APP_DIR/qdesigner_workbench.cpp \
-           $$APP_DIR/saveformastemplate.cpp \
-           $$APP_DIR/versiondialog.cpp
-
-HEADERS+=  $$APP_DIR/appfontdialog.h \
-           $$APP_DIR/assistantclient.h \
-           $$APP_DIR/designer_enums.h \
-           $$APP_DIR/mainwindow.h \
-           $$APP_DIR/newform.h \
-           $$APP_DIR/preferencesdialog.h \
-           $$APP_DIR/qdesigner_actions.h \
-           $$APP_DIR/qdesigner_appearanceoptions.h \
-           $$APP_DIR/qdesigner_formwindow.h \
-           $$APP_DIR/qdesigner.h \
-           $$APP_DIR/qdesigner_pch.h \
-           $$APP_DIR/qdesigner_server.h \
-           $$APP_DIR/qdesigner_settings.h \
-           $$APP_DIR/qdesigner_toolwindow.h \
-           $$APP_DIR/qdesigner_workbench.h \
-           $$APP_DIR/saveformastemplate.h \
-           $$APP_DIR/versiondialog.h
-
-FORMS +=   $$APP_DIR/preferencesdialog.ui \
-           $$APP_DIR/qdesigner_appearanceoptions.ui \
-           $$APP_DIR/saveformastemplate.ui
-
-# Shared solutions
-SOURCES += ../../shared/fontpanel/fontpanel.cpp \
-           ../../shared/deviceskin/deviceskin.cpp \
-           ../../shared/findwidget/abstractfindwidget.cpp \
-           ../../shared/findwidget/itemviewfindwidget.cpp \
-           ../../shared/findwidget/texteditfindwidget.cpp \
-
-HEADERS += ../../shared/findwidget/abstractfindwidget.h \
-           ../../shared/findwidget/itemviewfindwidget.h \
-           ../../shared/findwidget/texteditfindwidget.h
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/designer_cs.ts \
-    $$TR_DIR/designer_de.ts \
-    $$TR_DIR/designer_fr.ts \
-    $$TR_DIR/designer_hu.ts \
-    $$TR_DIR/designer_ja.ts \
-    $$TR_DIR/designer_pl.ts \
-    $$TR_DIR/designer_ru.ts \
-    $$TR_DIR/designer_sl.ts \
-    $$TR_DIR/designer_zh_CN.ts \
-    $$TR_DIR/designer_zh_TW.ts
diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro
index d1fd320..3a24e85 100644
--- a/tools/qtconfig/qtconfig.pro
+++ b/tools/qtconfig/qtconfig.pro
@@ -29,3 +29,11 @@ target.path=$$[QT_INSTALL_BINS]
 INSTALLS        += target
 INCLUDEPATH        += .
 DBFILE                 = qtconfig.db
+
+TR_DIR = $$PWD/../../translations
+TRANSLATIONS = \
+    $$TR_DIR/qtconfig_hu.ts \
+    $$TR_DIR/qtconfig_pl.ts \
+    $$TR_DIR/qtconfig_ru.ts \
+    $$TR_DIR/qtconfig_zh_CN.ts \
+    $$TR_DIR/qtconfig_zh_TW.ts
diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro
deleted file mode 100644
index 5d35b6a..0000000
--- a/tools/qtconfig/translations/translations.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-SOURCES        += ../colorbutton.cpp ../main.cpp ../previewframe.cpp ../previewwidget.cpp ../mainwindow.cpp ../paletteeditoradvanced.cpp \
-    ../mainwindowbase.cpp ../paletteeditoradvancedbase.cpp ../previewwidgetbase.cpp
-HEADERS        += ../colorbutton.h ../previewframe.h ../previewwidget.h ../mainwindow.h ../paletteeditoradvanced.h \
-    ../mainwindowbase.h ../paletteeditoradvancedbase.h ../previewwidgetbase.h
-
-FORMS        = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwidgetbase.ui
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/qtconfig_hu.ts \
-    $$TR_DIR/qtconfig_pl.ts \
-    $$TR_DIR/qtconfig_ru.ts \
-    $$TR_DIR/qtconfig_zh_CN.ts \
-    $$TR_DIR/qtconfig_zh_TW.ts
diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro
index c101d00..df69817 100644
--- a/tools/qvfb/qvfb.pro
+++ b/tools/qvfb/qvfb.pro
@@ -62,3 +62,11 @@ unix:x11 {
 }
 
 RESOURCES	+= qvfb.qrc
+
+TR_DIR = $$PWD/../../translations
+TRANSLATIONS = \
+    $$TR_DIR/qvfb_hu.ts \
+    $$TR_DIR/qvfb_pl.ts \
+    $$TR_DIR/qvfb_ru.ts \
+    $$TR_DIR/qvfb_zh_CN.ts \
+    $$TR_DIR/qvfb_zh_TW.ts
diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro
deleted file mode 100644
index b0b1af4..0000000
--- a/tools/qvfb/translations/translations.pro
+++ /dev/null
@@ -1,35 +0,0 @@
-# Include those manually as they do not contain any directory specification
-
-FORMS    = ../config.ui
-HEADERS  = ../qvfb.h \
-           ../qvfbview.h \
-           ../qvfbratedlg.h \
-           ../qanimationwriter.h \
-           ../gammaview.h \
-           ../qvfbprotocol.h \
-           ../qvfbshmem.h \
-           ../qvfbmmap.h \
-           ../../../src/gui/embedded/qvfbhdr.h \
-           ../../../src/gui/embedded/qlock_p.h \
-           ../../../src/gui/embedded/qwssignalhandler_p.h \
-           ../../shared/deviceskin/deviceskin.h
-
-SOURCES =  ../qvfb.cpp \
-           ../qvfbview.cpp \
-           ../qvfbratedlg.cpp \
-           ../main.cpp \
-           ../qanimationwriter.cpp \
-           ../qvfbprotocol.cpp \
-           ../qvfbshmem.cpp \
-           ../qvfbmmap.cpp \
-           ../../../src/gui/embedded/qlock.cpp \
-           ../../../src/gui/embedded/qwssignalhandler.cpp \
-           ../../shared/deviceskin/deviceskin.cpp
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/qvfb_hu.ts \
-    $$TR_DIR/qvfb_pl.ts \
-    $$TR_DIR/qvfb_ru.ts \
-    $$TR_DIR/qvfb_zh_CN.ts \
-    $$TR_DIR/qvfb_zh_TW.ts
diff --git a/translations/translations.pri b/translations/translations.pri
index 9ab72fc..f5e54ca 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -40,7 +40,7 @@ ts-qt.depends = sub-tools
 ###### Designer
 
 ts-designer.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/designer/translations/translations.pro)
+                                    ../tools/designer/designer.pro)
 ts-designer.depends = sub-tools
 
 ###### Linguist
@@ -52,21 +52,21 @@ ts-linguist.depends = sub-tools
 ###### Assistant
 
 ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/assistant/translations/translations.pro \
+                                    ../tools/assistant/tools/assistant/assistant.pro \
                                     && $$LUPDATE \
-                                    ../tools/assistant/translations/qt_help.pro)
+                                    ../tools/assistant/lib/lib.pro)
 ts-assistant.depends = sub-tools
 
 ###### Qtconfig
 
 ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/qtconfig/translations/translations.pro)
+                                    ../tools/qtconfig/qtconfig.pro)
 ts-qtconfig.depends = sub-tools
 
 ###### Qvfp
 
 ts-qvfb.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/qvfb/translations/translations.pro)
+                                    ../tools/qvfb/qvfb.pro)
 ts-qvfb.depends = sub-tools
 
 ###### Overall Rules
-- 
cgit v0.12


From 69910bc33dc448a9aa81eb00ed45be6d0488e447 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Tue, 13 Jul 2010 09:43:08 +0200
Subject: qdoc: Fixed breadcrumbs for QML examples.

Task-number: QTBUG-11679
---
 tools/qdoc3/htmlgenerator.cpp | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index fc761e5..f3a9589 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1702,8 +1702,9 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
             }
         }
         else if (node->subType() == Node::Page) {
-            if (fn->name() == QString("examples.html")) {
-                out() << "              <li>Examples</li>";
+            if (fn->name() == QString("qdeclarativeexamples.html")) {
+                out() << "              <li><a href=\"all-examples.html\">Examples</a></li>";
+                out() << "              <li>QML Examples & Demos</li>";
             }
             else if (fn->name().startsWith("examples-")) {
                 out() << "              <li><a href=\"all-examples.html\">Examples</a></li>";
@@ -1723,10 +1724,14 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
         else if (node->subType() == Node::Example) {
             out() << "              <li><a href=\"all-examples.html\">Examples</a></li>";
             QStringList sl = fn->name().split('/');
-            QString name = "examples-" + sl.at(0) + ".html";
-            QString t = CodeParser::titleFromName(name);
-            out() << "              <li><a href=\"" << name << "\">"
-                  << t << "</a></li>";
+            if (sl.contains("declarative"))
+                out() << "              <li><a href=\"qdeclarativeexamples.html\">QML Examples & Demos</a></li>";
+            else {
+                QString name = "examples-" + sl.at(0) + ".html";
+                QString t = CodeParser::titleFromName(name);
+                out() << "              <li><a href=\"" << name << "\">"
+                      << t << "</a></li>";
+            }
             out() << "              <li>" << title << "</li>";
         }
     }
-- 
cgit v0.12


From 2c48de46fdfeb935d1f31ae18f13add52c162ac8 Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Tue, 13 Jul 2010 10:02:54 +0200
Subject: QSslSocket: fix documentation for QSslSocket::setPeerVerifyMode()

---
 src/network/ssl/qsslsocket.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index f85fa84..f73068e 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -574,7 +574,7 @@ void QSslSocket::setProtocol(QSsl::SslProtocol protocol)
     certificate is valid.
 
     The default mode is AutoVerifyPeer, which tells QSslSocket to use
-    VerifyPeer for clients, QueryPeer for clients.
+    VerifyPeer for clients and QueryPeer for servers.
 
     \sa setPeerVerifyMode(), peerVerifyDepth(), mode()
 */
@@ -594,7 +594,7 @@ QSslSocket::PeerVerifyMode QSslSocket::peerVerifyMode() const
     certificate is valid.
 
     The default mode is AutoVerifyPeer, which tells QSslSocket to use
-    VerifyPeer for clients, QueryPeer for clients.
+    VerifyPeer for clients and QueryPeer for servers.
 
     Setting this mode after encryption has started has no effect on the
     current connection.
-- 
cgit v0.12


From 1d3aa6681423d7a39a8ed375448a9418ef33a1f5 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Tue, 13 Jul 2010 10:18:39 +0200
Subject: qdoc: Fixed several <div> elements that had the "/>" ending.

---
 tools/qdoc3/htmlgenerator.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index f3a9589..8699cb2 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1347,7 +1347,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
 
     if (!inner->doc().isEmpty()) {
         //out() << "<hr />\n"
-        out() << "<div class=\"descr\"/>\n" // QTBUG-9504
+        out() << "<div class=\"descr\">\n" // QTBUG-9504
               << "<h2>" << "Detailed Description" << "</h2>\n";
         generateBody(inner, marker);
         out() << "</div>\n"; // QTBUG-9504
@@ -1359,7 +1359,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
     while (s != sections.end()) {
         //out() << "<hr />\n";
         if (!(*s).divClass.isEmpty())
-            out() << "<div class=\"" << (*s).divClass << "\"/>\n"; // QTBUG-9504
+            out() << "<div class=\"" << (*s).divClass << "\">\n"; // QTBUG-9504
         out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
 
         NodeList::ConstIterator m = (*s).members.begin();
@@ -1596,11 +1596,11 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
     Text brief = fake->doc().briefText();
     if (fake->subType() == Node::Module && !brief.isEmpty()) {
         out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
-        out() << "<div class=\"descr\"/>\n"; // QTBUG-9504
+        out() << "<div class=\"descr\">\n"; // QTBUG-9504
         out() << "<h2>" << "Detailed Description" << "</h2>\n";
     }
     else
-        out() << "<div class=\"descr\"/>\n"; // QTBUG-9504
+        out() << "<div class=\"descr\">\n"; // QTBUG-9504
 
     generateBody(fake, marker);
     out() << "</div>\n"; // QTBUG-9504
-- 
cgit v0.12


From a0fffeed6fceb8244328b649a3f6feb520493bc2 Mon Sep 17 00:00:00 2001
From: "Bradley T. Hughes" <bradley.hughes@nokia.com>
Date: Mon, 12 Jul 2010 14:18:29 +0200
Subject: Fix regression in tst_qrand::testqrand()

qrand() has seeded with a default value of 1 for quite a long time, and
is checked by the test mentioned above. The previous commit to change
the default seed value must be reverted to keep compatibility.

Change qrand() and qsrand() back to the way they were in 4.5. This fixes
the qrand() regression.

Change QUuid::createUuid() to seed exactly once per thread, which is a
change from 4.5, where QUuid would see only once per application. This
solves the original bug, QTBUG-3543, where multiple threads would
generate the same UUID sequences. This also fixes the regression
reported in QTBUG-11213, where seeding did not happen in certain cases.

Reviewed-by: Prasanth Ullattil
---
 src/corelib/global/qglobal.cpp |  9 +--------
 src/corelib/plugin/quuid.cpp   | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index b24ba38..12745e9 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2609,14 +2609,7 @@ int qrand()
         SeedStorageType *pseed = seedStorage->localData();
         if (!pseed) {
             seedStorage->setLocalData(pseed = new SeedStorageType);
-
-            // Seed the PRNG, but only if it has not already been seeded. The
-            // default seed is a combination of current time, a stack address
-            // and a serial counter (since thread stack addresses are re-used).
-            static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
-            *pseed = QDateTime::currentDateTime().toTime_t()
-                     + quintptr(&pseed)
-                     + serial.fetchAndAddRelaxed(1);
+            *pseed = 1;
         }
         return rand_r(pseed);
     } else {
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index f48cc2e..d0c59a4 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -577,6 +577,7 @@ QUuid QUuid::createUuid()
 
 QT_BEGIN_INCLUDE_NAMESPACE
 #include "qdatetime.h"
+#include "qthreadstorage.h"
 #include <stdlib.h> // for RAND_MAX
 QT_END_INCLUDE_NAMESPACE
 
@@ -591,6 +592,19 @@ QUuid QUuid::createUuid()
         randbits = r;
     }
 
+    static QThreadStorage<int *> uuidseed;
+    if (!uuidseed.hasLocalData()) {
+        // Seed the PRNG once per thread with a combination of current time, a
+        // stack address and a serial counter (since thread stack addresses are
+        // re-used).
+        int *pseed = new int;
+        static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
+        qsrand(*pseed = QDateTime::currentDateTime().toTime_t()
+                        + quintptr(&pseed)
+                        + serial.fetchAndAddRelaxed(1));
+        uuidseed.setLocalData(pseed);
+    }
+
     QUuid result;
     uint *data = &(result.data1);
     int chunks = 16 / sizeof(uint);
-- 
cgit v0.12


From a736d333aab9e2e97fdbb738b3f3f4646afe192e Mon Sep 17 00:00:00 2001
From: "Bradley T. Hughes" <bradley.hughes@nokia.com>
Date: Tue, 13 Jul 2010 12:23:05 +0200
Subject: Compile when bootstrapping qmake

QThreadStorage is not available when bootstrapping qmake, so fall back
to a simple static bool instead.

Reviewed-by: TrustMe
---
 src/corelib/plugin/quuid.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index d0c59a4..e1d4fc0 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -592,11 +592,13 @@ QUuid QUuid::createUuid()
         randbits = r;
     }
 
+    // Seed the PRNG once per thread with a combination of current time, a
+    // stack address and a serial counter (since thread stack addresses are
+    // re-used).
+#ifndef QT_BOOTSTRAPPED
     static QThreadStorage<int *> uuidseed;
-    if (!uuidseed.hasLocalData()) {
-        // Seed the PRNG once per thread with a combination of current time, a
-        // stack address and a serial counter (since thread stack addresses are
-        // re-used).
+    if (!uuidseed.hasLocalData())
+    {
         int *pseed = new int;
         static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
         qsrand(*pseed = QDateTime::currentDateTime().toTime_t()
@@ -604,6 +606,12 @@ QUuid QUuid::createUuid()
                         + serial.fetchAndAddRelaxed(1));
         uuidseed.setLocalData(pseed);
     }
+#else
+    static bool seeded = false;
+    if (!seeded)
+        qsrand(QDateTime::currentDateTime().toTime_t()
+               + quintptr(&seeded));
+#endif
 
     QUuid result;
     uint *data = &(result.data1);
-- 
cgit v0.12


From c25c7c9bdfade6b906f37ac8bad44f6f0de57597 Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Mon, 12 Jul 2010 18:32:06 +0200
Subject: QSslSocket: Improve error handling

Reviewed-by: Markus Goetz
Task-number: QT-3567
---
 src/network/ssl/qsslsocket_openssl.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 8dc1743..c297eea 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -971,8 +971,20 @@ void QSslSocketBackendPrivate::transmit()
 #endif
                 plainSocket->disconnectFromHost();
                 break;
+            case SSL_ERROR_SYSCALL: // some IO error
+            case SSL_ERROR_SSL: // error in the SSL library
+                // we do not know exactly what the error is, nor whether we can recover from it,
+                // so just return to prevent an endless loop in the outer "while" statement
+                q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
+                q->setSocketError(QAbstractSocket::UnknownSocketError);
+                emit q->error(QAbstractSocket::UnknownSocketError);
+                return;
             default:
-                // ### Handle errors better.
+                // SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT: can only happen with a
+                // BIO_s_connect() or BIO_s_accept(), which we do not call.
+                // SSL_ERROR_WANT_X509_LOOKUP: can only happen with a
+                // SSL_CTX_set_client_cert_cb(), which we do not call.
+                // So this default case should never be triggered.
                 q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
                 q->setSocketError(QAbstractSocket::UnknownSocketError);
                 emit q->error(QAbstractSocket::UnknownSocketError);
-- 
cgit v0.12


From 1199be3aa31bfe1d55799c6362b3e59601f99a8f Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Tue, 13 Jul 2010 13:07:25 +0200
Subject: doc: Fixed several qdoc warnings.

---
 src/corelib/global/qnamespace.qdoc | 5 +++--
 src/corelib/tools/qstring.cpp      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ed2ae6e..5cd7f0e 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -470,6 +470,7 @@
     \value TextIncludeTrailingSpaces Same as IncludeTrailingSpaces
     \value TextJustificationForced Ensures that text lines are justified.
 
+    \omitvalue TextBypassShaping
     \omitvalue BreakAnywhere
     \omitvalue DontClip
     \omitvalue DontPrint
@@ -1730,7 +1731,7 @@
     \value Key_MediaLast
     \value Key_unknown
 
-    \value Key_Call     A key to answer or initiate a call (see \l Key_ToggleCallHangup for a key to toggle current call state)
+    \value Key_Call     A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
     \value Key_Camera   A key to activate the camera shutter
     \value Key_CameraFocus  A key to focus the camera
     \value Key_Context1
@@ -1738,7 +1739,7 @@
     \value Key_Context3
     \value Key_Context4
     \value Key_Flip
-    \value Key_Hangup   A key to end an ongoing call (see \l Key_ToggleCallHangup for a key to toggle current call state)
+    \value Key_Hangup   A key to end an ongoing call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
     \value Key_No
     \value Key_Select
     \value Key_Yes
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 57f79a0..b2cf49b 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -6954,7 +6954,7 @@ bool QString::isRightToLeft() const
 
 /*! \fn bool QString::isRightToLeft() const
 
-    \internal
+    Returns true if the string is read right to left.
 */
 
 
-- 
cgit v0.12


From f7fe575bc5f628533aeeca3eb564af89a1a1426b Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Mon, 12 Jul 2010 18:32:06 +0200
Subject: QSslSocket: Improve error handling

Reviewed-by: Markus Goetz
Task-number: QT-3567
---
 src/network/ssl/qsslsocket_openssl.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index ce2aee1..6f77600 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -680,8 +680,20 @@ void QSslSocketBackendPrivate::transmit()
 #endif
                 plainSocket->disconnectFromHost();
                 break;
+            case SSL_ERROR_SYSCALL: // some IO error
+            case SSL_ERROR_SSL: // error in the SSL library
+                // we do not know exactly what the error is, nor whether we can recover from it,
+                // so just return to prevent an endless loop in the outer "while" statement
+                q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
+                q->setSocketError(QAbstractSocket::UnknownSocketError);
+                emit q->error(QAbstractSocket::UnknownSocketError);
+                return;
             default:
-                // ### Handle errors better.
+                // SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT: can only happen with a
+                // BIO_s_connect() or BIO_s_accept(), which we do not call.
+                // SSL_ERROR_WANT_X509_LOOKUP: can only happen with a
+                // SSL_CTX_set_client_cert_cb(), which we do not call.
+                // So this default case should never be triggered.
                 q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
                 q->setSocketError(QAbstractSocket::UnknownSocketError);
                 emit q->error(QAbstractSocket::UnknownSocketError);
-- 
cgit v0.12


From b2a4c7f0142a48f60e7ec4fc5866917e3da8b7c3 Mon Sep 17 00:00:00 2001
From: Pierre Rossi <pierre.rossi@nokia.com>
Date: Fri, 2 Jul 2010 19:31:51 +0200
Subject: Fix an Assert in QTextTable

The problem was caused by the fragment id being inserted
in front of a cell spanning over several rows instead of
the next logical cell (or fragment_end) in the cells structure.

Task-number: QTBUG-11282
Reviewed-by: Simon Hausmann
---
 src/gui/text/qtexttable.cpp              | 28 ++++++++++++++---
 tests/auto/qtexttable/tst_qtexttable.cpp | 54 ++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 5100176..e3985ce 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -754,19 +754,39 @@ void QTextTable::insertColumns(int pos, int num)
     QTextFormatCollection *c = p->formatCollection();
     p->beginEditBlock();
 
+    QList<int> extendedSpans;
     for (int i = 0; i < d->nRows; ++i) {
         int cell;
         if (i == d->nRows - 1 && pos == d->nCols)
             cell = d->fragment_end;
         else
             cell = d->grid[i*d->nCols + pos];
-        QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
-        QTextCharFormat fmt = c->charFormat(it->format);
         if (pos > 0 && pos < d->nCols && cell == d->grid[i*d->nCols + pos - 1]) {
             // cell spans the insertion place, extend it
-            fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
-            p->setCharFormat(it.position(), 1, fmt);
+            if (!extendedSpans.contains(cell)) {
+                QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+                QTextCharFormat fmt = c->charFormat(it->format);
+                fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
+                p->setCharFormat(it.position(), 1, fmt);
+                d->dirty = true;
+                extendedSpans << cell;
+            }
         } else {
+            /* If the next cell is spanned from the row above, we need to find the right position
+            to insert to */
+            if (i > 0 && pos < d->nCols && cell == d->grid[(i-1) * d->nCols + pos]) {
+                int gridIndex = i*d->nCols + pos;
+                const int gridEnd = d->nRows * d->nCols - 1;
+                while (gridIndex < gridEnd && cell == d->grid[gridIndex]) {
+                    ++gridIndex;
+                }
+                if (gridIndex == gridEnd)
+                    cell = d->fragment_end;
+                else
+                    cell = d->grid[gridIndex];
+            }
+            QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+            QTextCharFormat fmt = c->charFormat(it->format);
             fmt.setTableCellRowSpan(1);
             fmt.setTableCellColumnSpan(1);
             Q_ASSERT(fmt.objectIndex() == objectIndex());
diff --git a/tests/auto/qtexttable/tst_qtexttable.cpp b/tests/auto/qtexttable/tst_qtexttable.cpp
index 2e6007e..b0cb34d 100644
--- a/tests/auto/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/qtexttable/tst_qtexttable.cpp
@@ -48,9 +48,14 @@
 #include <qtexttable.h>
 #include <qdebug.h>
 #include <qtextcursor.h>
+#include <qtextdocument.h>
+#include <qtextedit.h>
 
 //TESTED_FILES=
 
+typedef QList<int> IntList;
+Q_DECLARE_METATYPE(IntList)
+
 QT_FORWARD_DECLARE_CLASS(QTextDocument)
 
 class tst_QTextTable : public QObject
@@ -78,6 +83,7 @@ private slots:
     void insertRows();
     void deleteInTable();
     void mergeCells();
+    void mergeAndInsert();
     void splitCells();
     void blocksForTableShouldHaveEmptyFormat();
     void removeTableByRemoveRows();
@@ -93,6 +99,8 @@ private slots:
     void removeColumns3();
     void removeColumns4();
     void removeColumns5();
+    void QTBUG11282_insertBeforeMergedEnding_data();
+    void QTBUG11282_insertBeforeMergedEnding();
 
 private:
     QTextTable *create2x2Table();
@@ -586,6 +594,16 @@ void tst_QTextTable::mergeCells()
     QVERIFY(table->cellAt(0, 1) == table->cellAt(1, 1));
 }
 
+void tst_QTextTable::mergeAndInsert()
+{
+    QTextTable *table = cursor.insertTable(4,3);
+    table->mergeCells(0,1,3,2);
+    table->mergeCells(3,0,1,3);
+    //Don't crash !
+    table->insertColumns(1,2);
+    QCOMPARE(table->columns(), 5);
+}
+
 void tst_QTextTable::splitCells()
 {
     QTextTable *table = create4x4Table();
@@ -931,5 +949,41 @@ void tst_QTextTable::removeColumns5()
     QCOMPARE(table->cellAt(3, 2).firstPosition(), 11);
 }
 
+void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding_data()
+{
+    QTest::addColumn<int>("rows");
+    QTest::addColumn<int>("columns");
+    QTest::addColumn<QList<int> >("merge");
+    QTest::addColumn<QList<int> >("insert");
+
+    QTest::newRow("2x3, merge two, insert one") << 2 << 3 << (QList<int>() << 1 << 2 << 2)
+            << (QList<int>() << 1 << 1) ;
+    QTest::newRow("3x4, merge three, insert one") << 3 << 4 << (QList<int>() << 1 << 3 << 3)
+            << (QList<int>() << 1 << 1) ;
+    QTest::newRow("4x3, merge two, insert two") << 4 << 3 << (QList<int>() << 1 << 4 << 2)
+            << (QList<int>() << 1 << 2) ;
+    QTest::newRow("4x4, merge middle two, insert one") << 4 << 4 << (QList<int>() << 1 << 4 << 2)
+            << (QList<int>() << 1 << 1) ;
+}
+
+void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding()
+{
+    QFETCH(int, rows);
+    QFETCH(int, columns);
+    QFETCH(QList<int>, merge);
+    QFETCH(QList<int>, insert);
+    QTextTable *table = cursor.insertTable(rows, columns);
+    QTextEdit *textEdit = new QTextEdit;
+    textEdit->setDocument(doc);
+    textEdit->show();
+    QTest::qWaitForWindowShown(textEdit);
+    table->mergeCells(0,merge.at(0), merge.at(1), merge.at(2));
+    //Don't crash !
+    table->insertColumns(insert.at(0), insert.at(1));
+    //Check that the final size is what we expected
+    QCOMPARE(table->rows(), rows);
+    QCOMPARE(table->columns(), columns + insert.at(1));
+}
+
 QTEST_MAIN(tst_QTextTable)
 #include "tst_qtexttable.moc"
-- 
cgit v0.12


From 079a4105aff9c63d4107762aec478ade9900c7c2 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Tue, 13 Jul 2010 15:28:14 +0200
Subject: doc: Fixed several qdoc warnings.

---
 doc/src/classes/phonon-api.qdoc             | 12 +-----------
 doc/src/platforms/symbian-introduction.qdoc | 17 +++++++++++++++++
 src/corelib/io/qprocess.cpp                 |  4 ++--
 src/gui/text/qtextcursor.cpp                |  6 +++---
 src/network/socket/qtcpserver.cpp           |  2 +-
 src/opengl/qgl.cpp                          | 14 ++++++++++----
 6 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/doc/src/classes/phonon-api.qdoc b/doc/src/classes/phonon-api.qdoc
index 641b936..6fe0223 100644
--- a/doc/src/classes/phonon-api.qdoc
+++ b/doc/src/classes/phonon-api.qdoc
@@ -1577,7 +1577,6 @@
     \since 4.4
     \brief The MediaObject class provides an interface for media playback.
 
-
     The media object manages a \l{Phonon::}{MediaSource}, which
     supplies the media object with multimedia content, e.g., from a
     file. A playback in Phonon is always started by calling the
@@ -1651,17 +1650,8 @@
     playback of the current source, but it is possible to try with a
     different one. A user readable error message is given by
     errorString().
-    \section1 Symbian Platform Security Requirements
-
-    On Symbian, processes which access media via the network must
-    have the \c NetworkServices platform security capability. If the client
-    process lacks this capability, operations will result in errors.
-    This failure is indicated by a state() of Phonon::ErrorState.
-
-    Platform security capabilities are added via the
-    \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY}
-    qmake variable.
 
+    \sa {Symbian Platform Security Requirements}
     \sa Phonon::MediaSource, Phonon::AudioOutput, VideoWidget,
     {Music Player Example}, {Phonon Overview}, Phonon::VideoPlayer,
     Phonon::createPlayer(), {Phonon Module}
diff --git a/doc/src/platforms/symbian-introduction.qdoc b/doc/src/platforms/symbian-introduction.qdoc
index 22d858f..afb17c4 100644
--- a/doc/src/platforms/symbian-introduction.qdoc
+++ b/doc/src/platforms/symbian-introduction.qdoc
@@ -51,6 +51,7 @@
         \o \l {Exception Safety with Symbian}
         \o \l {Platform Notes - Symbian} {Qt for the Symbian platform - state of support}
         \o \l {qmake Platform Notes#Symbian platform} {Qt for Symbian extensions for qmake}
+	\o \l {Symbian Platform Security Requirements} {Symbian Platform Security Requirements}
     \endlist
     \o
     \list
@@ -60,6 +61,22 @@
 */
 
 /*!
+    \page symbian-platform-security-requirements.html
+
+    \title Symbian Platform Security Requirements
+    \ingroup qtsymbian
+
+    On Symbian, processes that access media via the network must
+    have the \c NetworkServices platform security capability. If the client
+    process lacks this capability, operations will result in errors.
+    This failure is indicated by a state() of Phonon::ErrorState.
+
+    Platform security capabilities are added via the
+    \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY}
+    qmake variable.
+*/
+
+/*!
     \page symbian-with-qt-introduction.html
 
     \title The Symbian platform - Introduction to Qt
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 9bc4063..739ac4d 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1399,10 +1399,10 @@ QString QProcess::nativeArguments() const
     \since 4.7
     \overload
 
-    Sets additional native command line arguments for the program.
+    Sets additional native command line \a arguments for the program.
 
     On operating systems where the system API for passing command line
-    arguments to a subprocess natively uses a single string, one can
+    \a arguments to a subprocess natively uses a single string, one can
     conceive command lines which cannot be passed via QProcess's portable
     list-based API. In such cases this function must be used to set a
     string which is \e appended to the string composed from the usual
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index daa40a1..769ab2f 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1283,7 +1283,7 @@ void QTextCursor::setVisualNavigation(bool b)
 /*!
   \since 4.7
 
-  Sets the visual x position for vertical cursor movements.
+  Sets the visual x position for vertical cursor movements to \a x.
 
   The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept
   unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a
@@ -1335,8 +1335,8 @@ bool QTextCursor::keepPositionOnInsert() const
   Defines whether the cursor should keep its current position when text gets inserted at the current position of the
   cursor.
 
-  If \b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
-  If \b is false, the cursor moves along with the inserted text.
+  If \a b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
+  If \a b is false, the cursor moves along with the inserted text.
 
   The default is false.
 
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp
index 55f926d..0640c7c 100644
--- a/src/network/socket/qtcpserver.cpp
+++ b/src/network/socket/qtcpserver.cpp
@@ -577,7 +577,7 @@ void QTcpServer::incomingConnection(int socketDescriptor)
 
 /*!
     This function is called by QTcpServer::incomingConnection()
-    to add a socket to the list of pending incoming connections.
+    to add the \a socket to the list of pending incoming connections.
 
     \note Don't forget to call this member from reimplemented
     incomingConnection() if you do not want to break the
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index fc28a73..2fa33bf 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1334,6 +1334,10 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
 
     \value OpenGL_Version_3_2  OpenGL version 3.2 or higher is present.
 
+    \value OpenGL_Version_3_3  OpenGL version 3.3 or higher is present.
+
+    \value OpenGL_Version_4_0  OpenGL version 4.0 or higher is present.
+
     \value OpenGL_ES_CommonLite_Version_1_0  OpenGL ES version 1.0 Common Lite or higher is present.
 
     \value OpenGL_ES_Common_Version_1_0  OpenGL ES version 1.0 Common or higher is present.
@@ -5037,8 +5041,9 @@ void QGLWidget::deleteTexture(QMacCompatGLuint id)
 /*!
     \since 4.4
 
-    Calls the corresponding QGLContext::drawTexture() on
-    this widget's context.
+    Calls the corresponding QGLContext::drawTexture() with
+    \a target, \a textureId, and \a textureTarget for this
+    widget's context.
 */
 void QGLWidget::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget)
 {
@@ -5058,8 +5063,9 @@ void QGLWidget::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QM
 /*!
     \since 4.4
 
-    Calls the corresponding QGLContext::drawTexture() on
-    this widget's context.
+    Calls the corresponding QGLContext::drawTexture() with
+    \a point, \a textureId, and \a textureTarget for this
+    widget's context.
 */
 void QGLWidget::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget)
 {
-- 
cgit v0.12


From b8622b62289474c45d60eba110b201d400492ea3 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Tue, 13 Jul 2010 15:33:01 +0200
Subject: Updated WebKit from /home/shausman/src/webkit/trunk to
 qtwebkit/qtwebkit-4.6 ( 038b62085831eef4dee423361c65ecd55b7b9b1d )

Changes in WebKit/qt since the last update:

* backport: https://bugs.webkit.org/show_bug.cgi?id=30978 -- [Qt] ASSERT failure while running DRT
---
 src/3rdparty/webkit/VERSION                           |  2 +-
 src/3rdparty/webkit/WebCore/ChangeLog                 | 15 +++++++++++++++
 src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp |  8 ++++++++
 src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h    |  4 +++-
 4 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 354e21d..b6178b9 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
 
 and has the sha1 checksum
 
-        fc13f9b396e1448cd71266f56ba7a93de5cf6ed9
+        038b62085831eef4dee423361c65ecd55b7b9b1d
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 8a75d6b..3a9fce0 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-14  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] ASSERT failure while running DRT
+        https://bugs.webkit.org/show_bug.cgi?id=30978
+
+        Add needed Structure typeInfo flags to QtRuntimeObjectImpl and QtRuntimeMethod.
+        These flags are needed after r49649, where HasDefaultmark was changed to OverrideMarkChildren.
+
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtRuntimeObjectImp::createStructure):
+        * bridge/qt/qt_runtime.h:
+        (JSC::Bindings::QtRuntimeMethod::createStructure):
+
 2010-06-16  Dawit Alemayehu  <adawit@kde.org>
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
index ec362ec..c6185e9 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp
@@ -58,6 +58,14 @@ public:
             instance->markAggregate(markStack);
     }
 
+    static PassRefPtr<Structure> createStructure(JSValue prototype)
+    {
+        return Structure::create(prototype, TypeInfo(ObjectType,  StructureFlags));
+    }
+
+protected:
+    static const unsigned StructureFlags = RuntimeObjectImp::StructureFlags | OverridesMarkChildren;
+
 private:
     virtual const ClassInfo* classInfo() const { return &s_info; }
 };
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h
index f2ce954..dc55f61 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h
@@ -151,10 +151,12 @@ public:
 
     static PassRefPtr<Structure> createStructure(JSValue prototype)
     {
-        return Structure::create(prototype, TypeInfo(ObjectType,  OverridesGetOwnPropertySlot | OverridesMarkChildren));
+        return Structure::create(prototype, TypeInfo(ObjectType,  StructureFlags));
     }
 
 protected:
+    static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags | OverridesMarkChildren;
+
     QtRuntimeMethodData *d_func() const {return d_ptr;}
     QtRuntimeMethod(QtRuntimeMethodData *dd, ExecState *exec, const Identifier &n, PassRefPtr<QtInstance> inst);
     QtRuntimeMethodData *d_ptr;
-- 
cgit v0.12


From 5608f5c35dd3f4470f51436ead9a7048d561affa Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Tue, 13 Jul 2010 17:04:31 +0200
Subject: Doc: Reviewed Michael's model/view tutorial and overview document.

Reviewed-by: Trust Me
---
 doc/src/tutorials/modelview.qdoc                   | 791 +++++++++++++--------
 examples/tutorials/modelview/1_readonly/main.cpp   |   1 +
 .../tutorials/modelview/1_readonly/modelview.cpp   |   5 +-
 .../tutorials/modelview/1_readonly/modelview.h     |   6 +-
 .../tutorials/modelview/1_readonly/mymodel.cpp     |  14 +-
 examples/tutorials/modelview/1_readonly/mymodel.h  |   5 +-
 .../tutorials/modelview/2_formatting/modelview.cpp |   2 +-
 .../tutorials/modelview/2_formatting/mymodel.cpp   |  22 +-
 .../modelview/3_changingmodel/modelview.cpp        |   2 +-
 .../modelview/3_changingmodel/mymodel.cpp          |  16 +-
 .../tutorials/modelview/4_headers/modelview.cpp    |   2 +-
 examples/tutorials/modelview/4_headers/mymodel.cpp |  10 +-
 examples/tutorials/modelview/5_edit/modelview.cpp  |   6 +-
 examples/tutorials/modelview/5_edit/mymodel.cpp    |  21 +-
 examples/tutorials/modelview/5_edit/mymodel.h      |   9 +-
 .../tutorials/modelview/6_treeview/modelview.cpp   |   8 +-
 .../tutorials/modelview/6_treeview/modelview.h     |   2 +-
 .../tutorials/modelview/7_selections/modelview.cpp |   8 +-
 examples/tutorials/modelview/qmake.pro             |  10 -
 19 files changed, 564 insertions(+), 376 deletions(-)
 delete mode 100755 examples/tutorials/modelview/qmake.pro

diff --git a/doc/src/tutorials/modelview.qdoc b/doc/src/tutorials/modelview.qdoc
index bc03f44..98096a0 100755
--- a/doc/src/tutorials/modelview.qdoc
+++ b/doc/src/tutorials/modelview.qdoc
@@ -1,10 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 /*!
     \page modelview.html
 
     \startpage {index.html}{Qt Reference Documentation}
-    \contentspage {modelview-index.html}{ModelView Contents}
     \nextpage {modelview-part1.html}{Introduction}
-    \title ModelView Contents Page
+
+    \title Model/View Contents
     \brief An introduction to ModelView programming
 
     This tutorial gives an introduction to ModelView programming using the Qt
@@ -14,17 +41,17 @@
 
     \omit
     It doesn't cover everything; the emphasis is on teaching the programming
-    philosophy of ModelView programming, and Qt's features are introduced as needed.
-    Some commonly used features are never used in this tutorial.
+    philosophy of Model/View programming, and Qt's features are introduced as
+    needed. Some commonly used features are never used in this tutorial.
     \endomit
 
     In the process, we will learn about some basic technologies provided by Qt,
     such as:
 
     \list
-    \o The difference between standard and modelview widgets
+    \o The difference between standard and model/view widgets
     \o Adapters betweeen forms and models
-    \o Developing a simple Model/View application
+    \o Developing a simple model/view application
     \o Intermediate topics such as:
       \list
       \o Tree views
@@ -43,9 +70,9 @@
 
     \list 1
     \o \l{modelview-part1.html}{Introduction}
-    \o \l{modelview-part2.html}{Developing a simple ModelView application}
+    \o \l{modelview-part2.html}{Developing a Simple Model/View Application}
     \o \l{modelview-part3.html}{Intermediate Topics}
-    \o \l{modelview-part4.html}{Good Sources for Additional Information}
+    \o \l{modelview-part4.html}{Good Sources of Additional Information}
     \endlist
 
 
@@ -53,13 +80,18 @@
 
 /*!
     \page modelview-part1.html
+    \contentspage {modelview-index.html}{Model/View Contents}
+    \previouspage {modelview-index.html}{Model/View Contents}
+    \nextpage {modelview-part2.html}{Developing a Simple Model/View Application}
     \title An Introduction to Model/View Programming
 
-    \raw HTML
-            <br>
-    \endraw
-\section1 1 Introduction
-Model/View is a technology used to separate data from views in widgets that handle data sets. Standard Widgets are not designed for separating data from views and this is why Qt 4 has two different types of widgets. Both types of widgets look the same, but they interact with data differently.
+    \section1 1. Introduction
+
+    Model/View is a technology used to separate data from views in widgets that
+    handle data sets. Standard widgets are not designed for separating data
+    from views and this is why Qt 4 has two different types of widgets. Both
+    types of widgets look the same, but they interact with data differently.
+
     \table
         \row
             \o  Standard widgets use data that is part of the widget.
@@ -68,129 +100,193 @@ Model/View is a technology used to separate data from views in widgets that hand
             \o  View classes operate on external data (the model)
             \o  \image modelview.png
     \endtable
-\section2 1.1 Standard widgets
-Let's have a closer look at a standard table widget. A table widget is a 2D array of the data elements that the user can change. The table widget can be integrated into a program flow by reading and writing the data elements that the table widget provides. This method is very intuitive and useful in many applications.
 
-Displaying and editing a database table with a standard table widget can be problematic. Two copies of the data have to be coordinated: one outside the widget; one inside the widget. The developer needs to know where up-to-date data is so the both copies contain the most recent data. The tight coupling of presentation and data makes it harder to write unit tests.
+    \section2 1.1 Standard Widgets
+
+    Let's have a closer look at a standard table widget. A table widget is a 2D
+    array of the data elements that the user can change. The table widget can
+    be integrated into a program flow by reading and writing the data elements
+    that the table widget provides. This method is very intuitive and useful in
+    many applications.
+
+    Displaying and editing a database table with a standard table widget can be
+    problematic. Two copies of the data have to be coordinated: one outside the
+    widget; one inside the widget. The developer needs to know where up-to-date
+    data is so the both copies contain the most recent data. The tight coupling
+    of presentation and data makes it harder to write unit tests.
+
+    \section2 1.2 Model/View to the Rescue
+
+    Model/view stepped up to provide a solution that uses a more versatile
+    architecture. Model/view eliminates the data consistency problems that may
+    occur with standard widgets. Model/view also makes it easier to use more
+    than one view of the same data because one model can be passed on to many
+    views. The most important difference is that model/view widgets do not
+    store data behind the table cells. In fact, they operate directly from your
+    data. Since view classes do not know your data's structure, you need to
+    provide a wrapper to make your data conform to the QAbstractItemModel
+    interface. A view uses this interface to read from and write to your data
+    and any class that implements QAbstractItemModel is a model. Once the view
+    receives a pointer to a model, it will read and display its content and be
+    its editor.
+
+    \section2 1.3 Overview of the Model/View Widgets
 
-\section2 1.2 Model/View to the rescue
-Model/View stepped up to provide a solution that uses a more versatile architecture. Model/View eliminates the data consistency problems that may occur with standard widgets. Model/View also makes it easier to use more than one view of the same data because one model can be passed on to many views. The most important difference is that model/view widgets do not store data behind the table cells. In fact, they operate directly from your data. Since view classes do not know your data's structure, you need to provide a wrapper to make your data conform to the \l QAbstractItemModel interface. A view uses this interface to read from and write to your data and any class that implements \l QAbstractItemModel is a model. Once the view receives a pointer to a model, it will read and display its content and be its editor.
+    Here is an overview of the model/view widgets and their corresponding
+    standard widgets.
 
-\section2 1.3 Overview of  the model/view widgets
-Here is an overview of the model/view widgets and their corresponding standard widgets.
     \table
         \header
             \o  Widget
-            \o  Standard Widget
-(a convenience class with data in the widget)
+            \o  Standard Widget (a convenience class with data in
+                the widget)
             \o  Model/View View Class (for use with external data)
         \row
-            \o  \image listview.png
+            \o  \inlineimage listview.png
             \o  \l QListWidget
             \o  \l QListView
         \row
-            \o  \image tableview.png
+            \o  \inlineimage tableview.png
             \o  \l QTableWidget
             \o  \l QTableView
         \row
-            \o  \image treeview.png
+            \o  \inlineimage treeview.png
             \o  \l QTreeWidget
             \o  \l QTreeView
         \row
-            \o  \image columnview.png
-            \o   
+            \o  \inlineimage columnview.png
+            \o
             \o  \l QColumnView shows a tree as a hierarchy of lists
         \row
-            \o  \image combobox.png
-            \o {2, 1} \l QComboBox can work as both a view class and also as a traditional widget
+            \o  \inlineimage combobox.png
+            \o {2, 1} \l QComboBox can work as both a view class and also
+                      as a traditional widget
     \endtable
-\section2 1.4 Having adapters between forms and models can come in handy.
-We often prefer editing data stored in tables (e.g. in database tables) in forms rather than in tables. There is no direct model/view counterpart for separating data and views for widgets that operate on one value instead of a dataset, so we need an adapter in order to connect the form to the source of  data.
 
+    \section2 1.4 Using Adapters between Forms and Models
 
-\l QDataWidgetMapper is a great solution because it maps form widgets to a table row and it makes it very easy to build forms for database tables.
-\image widgetmapper.png
+    Having adapters between forms and models can come in handy.
 
+    We often prefer editing data stored in tables (e.g. in database tables) in
+    forms rather than in tables. There is no direct model/view counterpart for
+    separating data and views for widgets that operate on one value instead of
+    a dataset, so we need an adapter in order to connect the form to the source
+    of data.
 
-Another example of an adapter is \l QCompleter. Qt has QCompleter for providing auto completions in Qt widgets such as \l QComboBox and, as shown below, \l QLineEdit. \l QCompleter uses a model as its data source, so \l QCompleter, in itself, is a very handy adapter.
-\image qcompleter.png
+    \l QDataWidgetMapper is a great solution because it maps form widgets to a
+    table row and it makes it very easy to build forms for database tables.
 
+    \image widgetmapper.png
 
+    Another example of an adapter is QCompleter. Qt has QCompleter for
+    providing auto-completions in Qt widgets such as QComboBox and, as shown
+    below, QLineEdit. QCompleter uses a model as its data source, so QCompleter,
+    in itself, is a very handy adapter.
+
+    \image qcompleter.png
 */
 
 /*!
-
-
     \page modelview-part2-main-cpp.html
     \title main.cpp
     \quotefile tutorials/modelview/1_readonly/main.cpp
-
-
 */
 
 /*!
     \page modelview-part2.html
-    \title ModelView Chapter 2 - A Simple Model/View Application
-   
-    \raw HTML
-            <br>
-    \endraw
-    
-\section1 2 A Simple Model/View Application
-If you want to develop a model/view application, where should you start? We recommend starting with a simple example and extending it step-by-step. This makes understanding the architecture a lot easier. Trying to understand the model/view architecture in detail before invoking the IDE has proven to be less convenient for many developers. It is substantially easier to start with a simple model/view application that has demo data. Give it a try! Simply replace the data in the examples below with your own.
+    \contentspage {modelview-index.html}{Model/View Contents}
+    \previouspage {modelview-part1.html}{Introduction}
+    \nextpage {modelview-part3.html}{Intermediate Topics}
+    \title Model/View Chapter 2 - A Simple Model/View Application
+
+    \section1 2. A Simple Model/View Application
+
+    If you want to develop a model/view application, where should you start? We
+    recommend starting with a simple example and extending it step-by-step.
+    This makes understanding the architecture a lot easier. Trying to
+    understand the model/view architecture in detail before invoking the IDE
+    has proven to be less convenient for many developers. It is substantially
+    easier to start with a simple model/view application that has demo data.
+    Give it a try! Simply replace the data in the examples below with your own.
+
+    Below are 7 very simple and independent applications that show different
+    sides of model/view programming. The source code can be found inside the
+    \c{examples/tutorials/modelview} directory.
 
-Below are 7 very simple and independent applications that show different sides of model/view programming. The source code can be downloaded from  @todo___________paste link here_________________________
+    \section2 2.1 A Read Only Table
 
-\section2 2.1 A read only table
-We start with an application that uses a \l QTableView to show data. We will add editing capabilities later. 
+    We start with an application that uses a QTableView to show data. We will
+    add editing capabilities later. 
 
--------------------------------------------------------------main.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/main.cpp Quoting ModelView Tutorial
 
-We have the usual \l {modelview-part2-main-cpp.html}{main()} function;
--------------------------------------------------------------modelview.h---------------------
+    We have the usual \l {modelview-part2-main-cpp.html}{main()} function:
+
     \snippet examples/tutorials/modelview/1_readonly/modelview.h Quoting ModelView Tutorial
 
-The application is a \l QMainWindow that holds a \l QTableView.  
+    The application is a \l QMainWindow that holds a \l QTableView.  
 
--------------------------------------------------------------modelview.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/modelview.cpp Quoting ModelView Tutorial
 
-Here is the interesting part: We use \l{QTableView::setModel()}{tableView->setModel(new MyModel(this) );} to instantiate the Model and pass its pointer to \l {QTableView}{tableView()}.  \l {QTableView}{tableView} will invoke the methods of the pointer it has received to find out two things: 
+    Here is the interesting part: We use
+    \l{QTableView::setModel()}{tableView->setModel(new MyModel(this));} to
+    instantiate the Model and pass its pointer to \l {QTableView}{tableView()}.
+    \l{QTableView}{tableView} will invoke the methods of the pointer it has
+    received to find out two things:
+
     \list
        \o   How many rows and columns should be displayed
        \o   What content should be printed into each cell.
     \endlist
 
-The model needs some code to respond to this. 
+    The model needs some code to respond to this. 
 
-We have a table data set, so let's start with QAbstractTableModel since it is easier to use.
--------------------------------------------------------------mymodel.h---------------------
-    \snippet examples/tutorials/modelview/1_readonly/mymodel.h Quoting ModelView Tutorial
+    We have a table data set, so let's start with QAbstractTableModel since it
+    is easier to use.
 
-QAbstractTableModel requires the implementation of three abstract methods.
+    \snippet examples/tutorials/modelview/1_readonly/mymodel.h Quoting ModelView Tutorial
 
+    QAbstractTableModel requires the implementation of three abstract methods.
 
--------------------------------------------------------------mymodel.cpp---------------------
     \snippet examples/tutorials/modelview/1_readonly/mymodel.cpp Quoting ModelView Tutorial
 
-The number of rows and columns is set by \l{QAbstractItemModel::rowCount()}{MyModel::rowCount()} and \l{QAbstractItemModel::columnCount()}{MyModel::columnCount()}. 
-When the view has to know what the cell 's text is, it calls the  method. Row and column information is specified with parameter \c index and the role is set to \l{Qt::ItemDataRole}{Qt::DisplayRole}.  Other roles are covered in the next section. In our example, the data that should be displayed is generated. In a real application, \c MyModel would have a member called \c MyData, which serves as the target for all reading and writing operations. 
-
-This small example demonstrates the passive nature of a model. The model does not know when it will be used or which data is needed. It simply provides data each time the view requests it. 
-
-What happens when the model 's data needs to be changed? How does the view know when data changes and needs to be read again? The model has to emit a signal that indicates what range of cells has changed.  This will be demonstrated in section 2.3.
+    The number of rows and columns is set by
+    \l{QAbstractItemModel::rowCount()}{MyModel::rowCount()} and
+    \l{QAbstractItemModel::columnCount()}{MyModel::columnCount()}.
+    When the view has to know what the cell's text is, it calls the method.
+    Row and column information is specified with parameter \c index and the
+    role is set to \l{Qt::ItemDataRole}{Qt::DisplayRole}. Other roles are
+    covered in the next section. In our example, the data that should be
+    displayed is generated. In a real application, \c MyModel would have a
+    member called \c MyData, which serves as the target for all reading and
+    writing operations. 
+
+    This small example demonstrates the passive nature of a model. The model
+    does not know when it will be used or which data is needed. It simply
+    provides data each time the view requests it. 
+
+    What happens when the model 's data needs to be changed? How does the view
+    know when data changes and needs to be read again? The model has to emit a
+    signal that indicates what range of cells has changed.  This will be
+    demonstrated in section 2.3.
+
+    \section2 2.2 Extending the Read Only Example with Roles
+
+    In addition to controlling what text the view displays, the model also
+    controls the text's appearance. When we slightly change the model, we get
+    the following result: \image readonlytable_role.png
+
+    In fact, nothing except for the \l{QAbstractItemModel::}{data()}
+    method needs to be changed to set fonts, background colour, alignment and a
+    checkbox.
+    Here is the \l{QAbstractItemModel::data()}{data()} method that produces the
+    result shown above:
 
-\section2 2.2 Extending the read only example with roles
-In addition to controlling what text the view displays, the model also controls the text's appearance. When we slightly change the model, we get the following result: \image readonlytable_role.png
-
-
-In fact, nothing except for the \l{QAbstractItemModel::data()}{data()} method needs to be changed to set fonts, background colour, alignment and a checkbox. Here is the \l{QAbstractItemModel::data()}{data()} method that produces the result shown above:
-
--------------------------------------------------------------mymodel.cpp---------------------
     \snippet examples/tutorials/modelview/2_formatting/mymodel.cpp Quoting ModelView Tutorial
 
-Each formatting property will be requested from the model with a separate call to the \l{QAbstractItemModel::data()}{data()} method. The \c role parameter is used to let the model know which property is being requested:
+    Each formatting property will be requested from the model with a separate
+    call to the \l{QAbstractItemModel::data()}{data()} method. The \c role
+    parameter is used to let the model know which property is being requested:
 
     \table
         \header
@@ -214,114 +310,194 @@ Each formatting property will be requested from the model with a separate call t
             \o  text alignment
             \o  enum Qt::AlignmentFlag
         \row
-	    \o {1, 3} Qt::CheckStateRole
-	    \o {1, 3} suppresses checkboxes with \l{QVariant}{QVariant()}, sets checkboxes with Qt::Checked or Qt::Unchecked
-	    \o {1, 3} \l{Qt::ItemDataRole}{enum Qt::ItemDataRole}
-
+        \o {1, 3} Qt::CheckStateRole
+        \o {1, 3} suppresses checkboxes with \l{QVariant}{QVariant()},
+                  sets checkboxes with Qt::Checked or Qt::Unchecked
+        \o {1, 3} \l{Qt::ItemDataRole}{enum Qt::ItemDataRole}
     \endtable
 
-Refer to Qt documentation to learn more about enum Qt::ItemDataRole's capabilities.
+    Refer to the Qt namespace documentation to learn more about the
+    Qt::ItemDataRole enum's capabilities.
 
+    Now we need to determine how using a seperated model impacts the
+    application's performance, so let's trace how often the view calls the
+    \l{QAbstractItemModel::}{data()} method. In order to track how often
+    the view calls the model, we have put a debug statement in the
+    \l{QAbstractItemModel::}{data()} method, which logs onto stdio. In
+    our small example, \l{QAbstractItemModel::}{data()} will be called 42
+    times.
+    Each time you hover the cursor over the field,
+    \l{QAbstractItemModel::}{data()} will be called again \mdash 7 times for
+    each cell. That's why it is important to make sure that your data is
+    available when \l{QAbstractItemModel::}{data()} is invoked and expensive
+    lookup operations are cached.
 
-Now we need to determine how using a seperated model impacts the application's performance, so let's trace how often the view calls the \l{QAbstractItemModel::data()}{data()} method. In order to track how often the view calls the model, we have put a debug statement in the \l{QAbstractItemModel::data()}{data()} method, which logs onto stdio. In our small example, \l{QAbstractItemModel::data()}{data()} will be called 42 times. Each time you hover the cursor over the field, \l{QAbstractItemModel::data()}{data()} will be called again - 7 times for each cell. That's why it is  important to make sure that your data is available when \l{QAbstractItemModel::data()}{data()} is invoked and expensive lookup operations are cached.
+    \section2 2.3 A Clock inside a Table Cell
 
-\section2 2.3 A clock inside a table cell
-\image clock.png
+    \image clock.png
 
-We still have a read only table, but this time the content changes every second because we are showing the current time.
+    We still have a read only table, but this time the content changes every
+    second because we are showing the current time.
 
     \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_QVariant
 
-Something is missing to make the clock tick. We need to tell the view every second that the time has changed and that it needs to be read again. We do this with a timer. In the constructor, we set its interval to 1 second and it connect its timeout signal.
+    Something is missing to make the clock tick. We need to tell the view every
+    second that the time has changed and that it needs to be read again. We do
+    this with a timer. In the constructor, we set its interval to 1 second and
+    connect its timeout signal.
 
     \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_a
 
-Here is the corresponding slot:
+    Here is the corresponding slot:
 
     \snippet examples/tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_b
 
-We ask the view to read the data in the top left cell again by emitting the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal.  Note that we did not explicitly connect the \l{QAbstractItemModel::dataChanged()}{dataChanged()} signal to the view. This happened automatically when we called \l{QTableView::setModel()}{setModel()}.
+    We ask the view to read the data in the top left cell again by emitting the
+    \l{QAbstractItemModel::}{dataChanged()} signal.  Note that we did not
+    explicitly connect the \l{QAbstractItemModel::}{dataChanged()} signal to
+    the view. This happened automatically when we called
+    \l{QTableView::}{setModel()}.
 
-\section2 2.4 Setting up Headers for Columns and Rows
-Headers can be hidden via a view method. 
-\c tableView->verticalHeader()->hide();
-\image header.png
+    \section2 2.4 Setting up Headers for Columns and Rows
 
+    Headers can be hidden via a view method: \c{tableView->verticalHeader()->hide();}
+    \image header.png
 
-The header content, however, is set via the model, so we reimplement the \l{QAbstractItemModel::headerData()}{headerData()} method:
+    The header content, however, is set via the model, so we reimplement the
+    \l{QAbstractItemModel::headerData()}{headerData()} method:
 
     \snippet examples/tutorials/modelview/4_headers/mymodel.cpp quoting mymodel_c
 
 
-\section2 2.5 The minimal Editing example
-In this example, we are going to build an application that automatically populates a window title with content by repeating values entered into table cells.
+    \section2 2.5 The Minimal Editing Example
+
+    In this example, we are going to build an application that automatically
+    populates a window title with content by repeating values entered into
+    table cells.
+
+    The model decides whether editing capabilities are available . We only have
+    to modify the model in order for the available editing capabilities to be
+    enabled. This is done by reimplementing the following virtual methods:
+    \l{QAbstractItemModel::}{setData()} and \l{QAbstractItemModel::}{flags()}.
 
-The model decides whether editing capabilities are available . We only have to modify the model in order for the available editing capabilities to be enabled. This is done by reimplementing the following virtual methods:  \l{QAbstractItemModel::setData()}{setData()} and \l{QAbstractItemModel::flags()}{flags()}. 
--------------------------------------------------------------mymodel.h---------------------
     \snippet examples/tutorials/modelview/5_edit/mymodel.h Quoting ModelView Tutorial
 
-We use \c QStringList m_gridData to store our data. This makes \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We have also introduced the \l{QAbstractItemModel::editCompleted()}{editCompleted()} signal, which makes it possible to transfer the modified text to the window title. 
+    We use \c QStringList m_gridData to store our data. This makes
+    \c m_gridData the core of MyModel.  The rest of \c MyModel acts like a
+    wrapper and adapts \c m_gridData to the  QAbstractItemModel interface. We
+    have also introduced the \c editCompleted() signal,
+    which makes it possible to transfer the modified text to the window title.
 
     \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_d
 
-In the constructor, we fill \c QStringList gridData with 6 items. (one item for every field in the table)
+    In the constructor, we fill \c QStringList gridData with 6 items (one item
+    for every field in the table):
+
     \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_e
 
-\l{QAbstractItemModel::setData()}{setData()} will be called each time the user edits a cell. The \c index parameter tells us which field has been edited and \c value  provides the result of the editing process. The role will always be set to \c Qt::EditRole because our cells only contain text. If a checkbox were present and user permissions are set to allow the checkbox to be selected, calls would also be made with the role set to \c Qt::CheckStateRole. 
-    \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_f
+    \l{QAbstractItemModel::setData()}{setData()} will be called each time the
+    user edits a cell. The \c index parameter tells us which field has been
+    edited and \c value  provides the result of the editing process. The role
+    will always be set to \c Qt::EditRole because our cells only contain text.
+    If a checkbox were present and user permissions are set to allow the
+    checkbox to be selected, calls would also be made with the role set to
+    \c Qt::CheckStateRole.
 
-Various properties of a cell can be adjusted with \l{QAbstractItemModel::flags()}{flags()}. Returning \c Qt::ItemIsEditable | \c  Qt::ItemIsEnabled is enough to show an editor that a cell has been selected. If editing one cell modifies more data than the data in that particular cell, the model must emit a \l{QAbstractItemModel::dataChanged()}{dataChanged()}  signal in order for the data that has been changed to be read.
+    \snippet examples/tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_f
 
+    Various properties of a cell can be adjusted with
+    \l{QAbstractItemModel::flags()}{flags()}. Returning
+    \c Qt::ItemIsEditable | \c Qt::ItemIsEnabled is enough to show an editor
+    that a cell has been selected. If editing one cell modifies more data than
+    the data in that particular cell, the model must emit a
+    \l{QAbstractItemModel::}{dataChanged()} signal in order for the data that
+    has been changed to be read.
 */
 
 /*!
     \page modelview-part3.html
-    \title ModelView Chapter 3 - Intermediate Topics
-    \raw HTML
-            <br>
-    \endraw
-\section1 3 Intermediate Topics
-    \raw HTML
-            <br>
-    \endraw
-\section2 3.1 TreeView
+    \contentspage {modelview-index.html}{Model/View Contents}
+    \previouspage {modelview-part2.html}{Developing a Simple Model/View Application}
+    \nextpage {modelview-part4.html}{Good Sources of Additional Information}
+    \title Model/View Chapter 3 - Intermediate Topics
+
+    \section1 3. Intermediate Topics
+
+    \section2 3.1 TreeView
 
-You can convert the example above into an application with a tree view. Simply replace QTableView with QTreeView, which results in a read/write tree. No changes have to be made to the model. The tree won't have any hierarchies because there aren't any hierarchies in the model itself.
-\image dummy_tree.png
+    You can convert the example above into an application with a tree view.
+    Simply replace QTableView with QTreeView, which results in a read/write
+    tree. No changes have to be made to the model. The tree won't have any
+    hierarchies because there aren't any hierarchies in the model itself.
+    \image dummy_tree.png
 
 
-QListView, QTableView and QTreeView all use a model abstraction, which is a merged list, table and tree. This makes it possible to use several different types of view classes from the same model.
-\image list_table_tree.png
+    QListView, QTableView and QTreeView all use a model abstraction, which is a
+    merged list, table and tree. This makes it possible to use several different
+    types of view classes from the same model.
+    \image list_table_tree.png
 
 
-This is how our example model looks so far:
-\image example_model.png
+    This is how our example model looks so far:
+    \image example_model.png
 
 
-We want to present a real tree. We have wrapped our data in the examples above in order to make a model. This time we use QStandardItemModel, which is a container for hierarchical data that also implements QAbstractItemModel. To show a tree, QStandardItemModel must be populated with \l{QStandardItem}{QStandardItems}, which are able to hold all the standard properties of items like text, fonts, checkboxes or brushes. \image tree_2_with_algorithm.png
--------------------------------------------------------------modelview.cpp---------------------
+    We want to present a real tree. We have wrapped our data in the examples
+    above in order to make a model. This time we use QStandardItemModel, which
+    is a container for hierarchical data that also implements
+    QAbstractItemModel. To show a tree, QStandardItemModel must be populated
+    with \l{QStandardItem}{QStandardItems}, which are able to hold all the
+    standard properties of items like text, fonts, checkboxes or brushes.
+    \image tree_2_with_algorithm.png
+
     \snippet examples/tutorials/modelview/6_treeview/modelview.cpp Quoting ModelView Tutorial
 
-We simply instantiate a QStandardItemModel and add a couple of \l{QStandardItem}{QStandardItems} to the constructor. We can then make a hierarchical data structure because a QStandardItem can hold other \l{QStandardItem}{QStandardItems}. Nodes are collapsed and expanded within the view.
+    We simply instantiate a QStandardItemModel and add a couple of
+    \l{QStandardItem}{QStandardItems} to the constructor. We can then make a
+    hierarchical data structure because a QStandardItem can hold other
+    \l{QStandardItem}{QStandardItems}. Nodes are collapsed and expanded within
+    the view.
 
-\section2 3.2 Working with selection
+    \section2 3.2 Working with Selections
 
+    We want to access a selected item's content in order to output it into the
+    window title together with the hierarchy level.
+    \image selection2.png
 
-We want to access a selected item's content in order to output it into the window title together with the hierarchy level.
-\image selection2.png
+    So let's create a couple of items:
 
-So let's create a couple of items:
     \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_a
-Views manage selections within a separate selection model, which can be retrieved with the \l{QAbstractItemView::selectionModel()}{selectionModel()} method. We retrieve the selection Model in order to connect a slot to its \l{QAbstractItemView::selectionChanged()}{selectionChanged()} signal.
 
-    \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_b
+    Views manage selections within a separate selection model, which can be
+    retrieved with the \l{QAbstractItemView::}{selectionModel()}
+    method. We retrieve the selection Model in order to connect a slot to its
+    \l{QAbstractItemView::}{selectionChanged()} signal.
 
-We get the model index that corresponds to the selection by calling 
-\l{QItemSelectionModel::currentIndex()}{treeView->selectionModel()->currentIndex()} and we get the the field's string by using the model index. Then we just calculate the item's \c hierarchyLevel.  Top level items do not have parents and the \l{QAbstractItemModel::parent()}{parent()} method will return a default constructed \l{QModelIndex}{QModelIndex()}. This is why we use the \l{QAbstractItemModel::parent()}{parent()} method to iterate to the top level while counting the steps performed during iteration.
+    \snippet examples/tutorials/modelview/7_selections/modelview.cpp quoting modelview_b
 
-The selection model (as shown above) can be retrieved, but it can also be set with \l{QAbstractItemView}{QAbstractItemView::setSelectionModel}. This is how it's possible to have 3 view classes with synchronised selections because only one instance of a selection model is used. The instance of a selection model is retrieved from the first view class with \l{QAbstractItemView::selectionModel()}{selectionModel()} and the result is assigned to the second and third view class with \l{QAbstractItemView::setSelectionModel()}{setSelectionModel()};
-\section2 3.3 Predefined Models
-The typical way to use model/view is to wrap specific data to make it usable with view classes. Qt, however, also provides predefined models for common underlying data structures. If one of the available data structures is suitable for your application, a predefined model can be a good choice.
+    We get the model index that corresponds to the selection by calling 
+    \l{QItemSelectionModel::currentIndex()}{treeView->selectionModel()->currentIndex()}
+    and we get the the field's string by using the model index. Then we just
+    calculate the item's \c hierarchyLevel.  Top level items do not have
+    parents and the \l{QAbstractItemModel::}{parent()} method will return a
+    default constructed \l{QModelIndex}{QModelIndex()}. This is why we use the
+    \l{QAbstractItemModel::}{parent()} method to iterate to the top level while
+    counting the steps performed during iteration.
+
+    The selection model (as shown above) can be retrieved, but it can also be
+    set with \l{QAbstractItemView}{QAbstractItemView::setSelectionModel}. This
+    is how it's possible to have 3 view classes with synchronised selections
+    because only one instance of a selection model is used. The instance of a
+    selection model is retrieved from the first view class with
+    \l{QAbstractItemView::}{selectionModel()} and the result is assigned to the
+    second and third view class with \l{QAbstractItemView::}{setSelectionModel()}.
+
+    \section2 3.3 Predefined Models
+
+    The typical way to use model/view is to wrap specific data to make it
+    usable with view classes. Qt, however, also provides predefined models for
+    common underlying data structures. If one of the available data structures
+    is suitable for your application, a predefined model can be a good choice.
 
     \table
         \row
@@ -331,11 +507,8 @@ The typical way to use model/view is to wrap specific data to make it usable wit
             \o  QStandardItemModel
             \o  Stores arbitrary hierarchical items
         \row
-            \o  QFileSystemModel
-    \raw HTML
-            <br>
-    \endraw
-		QDirModel
+            \o  QFileSystemModel\br
+                QDirModel
             \o  Encapsulate the local file system
         \row
             \o  QSqlQueryModel
@@ -352,108 +525,144 @@ The typical way to use model/view is to wrap specific data to make it usable wit
 
     \endtable
 
-\section2 3.4 Delegates
-In all examples so far, data is presented as text or a checkbox in a cell and is edited as text or a checkbox. The component that provides these presentation and editing services is called a “delegate.” We are only just beginning to work with the delegate because the view uses a default delegate.  But imagine that we want to have a different editor.(e.g. a slider or a drop down list) Or imagine that we want to present data as graphics. Let's take a look at an example called Stardelegate, (  \l{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html}{http://qt.nokia.com/doc/4.6/itemviews-stardelegate.html} ) in which stars are used to show a rating: \image stardelegate.png
-
-The view has a method that replaces the default delegate and installs a custom delegate. This method is called \l{QAbstractItemView::setItemDelegate()}{setItemDelegate()}. A new delegate can be written by creating a class that inherits from QStyledItemDelegate. In order to write a delegate that displays stars and has no input capabilities, we only need to overwrite 2 methods.
-
-\code
- class StarDelegate : public QStyledItemDelegate
- {
-     Q_OBJECT
- public:
-     StarDelegate(QWidget *parent = 0); 
-     void paint(QPainter *painter, const QStyleOptionViewItem &option,
-                const QModelIndex &index) const;
-     QSize sizeHint(const QStyleOptionViewItem &option,
+    \section2 3.4 Delegates
+
+    In all examples so far, data is presented as text or a checkbox in a cell
+    and is edited as text or a checkbox. The component that provides these
+    presentation and editing services is called a \e delegate. We are only just
+    beginning to work with the delegate because the view uses a default
+    delegate.  But imagine that we want to have a different editor.(e.g. a
+    slider or a drop down list) Or imagine that we want to present data as
+    graphics. Let's take a look at an example called
+    \l{Star Delegate Example}{Star Delegate}, in which stars are used to show
+    a rating:
+    \image stardelegate.png
+
+    The view has a method that replaces the default delegate and installs a
+    custom delegate. This method is called
+    \l{QAbstractItemView::}{setItemDelegate()}. A new delegate can be written
+    by creating a class that inherits from QStyledItemDelegate. In order to
+    write a delegate that displays stars and has no input capabilities, we only
+    need to overwrite 2 methods.
+
+    \code
+     class StarDelegate : public QStyledItemDelegate
+     {
+         Q_OBJECT
+     public:
+         StarDelegate(QWidget *parent = 0); 
+         void paint(QPainter *painter, const QStyleOptionViewItem &option,
                     const QModelIndex &index) const;
- };
-
-\endcode
-
-\l{QStyledItemDelegate::paint()}{paint()} draws stars depending on the content of the underlying data.  The data can be looked up with parameter \l{QModelIndex::data()}{index.data()}. \l{QAbstractItemDelegate::sizeHint()}{sizeHint} specifies the stars dimensions so the the cell will provide  enough  height and width to accommodate the stars.
+         QSize sizeHint(const QStyleOptionViewItem &option,
+                        const QModelIndex &index) const;
+     };
+    \endcode
 
-Writing custom delegates is the right choice if you want to show your data with a custom graphical  representation inside the grid of the view class. If you want to leave the grid, you can write a custom view class.
+    \l{QStyledItemDelegate::}{paint()} draws stars depending on the content
+    of the underlying data.  The data can be looked up with parameter
+    \l{QModelIndex::data()}{index.data()}.
+    \l{QAbstractItemDelegate::}{sizeHint()} specifies each star's dimensions
+    so the the cell will provide enough height and width to accommodate the
+    stars.
 
-\section2 3.5 Debugging with ModelTest
-The passive nature of models provides new challenges for programmers. Inconsistencies in the model can cause the application to crash. Since the model is hit by numerous calls from the view, it is hard to find out which call has crashed the application and which operation has introduced the problem. 
+    Writing custom delegates is the right choice if you want to show your data
+    with a custom graphical representation inside the grid of the view class.
+    If you want to leave the grid, you can write a custom view class.
 
-Qt provides software called ModelTest, which checks models while your programming is running. Every time the model is changed, ModelTest scans the model and reports errors with an assert. This is especially important for tree models, since their hierarchical nature leaves many possibilities for subtle inconsistencies. \l http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest
+    \section2 3.5 Debugging with ModelTest
 
-Unlike view classes, ModelTest uses out of range indexes to test the model.  This means your application may crash with ModelTest even if it runs perfectly without it. So you also need to handle all of the indexes that are out of range when using ModelTest. 
+    The passive nature of models provides new challenges for programmers.
+    Inconsistencies in the model can cause the application to crash. Since the
+    model is hit by numerous calls from the view, it is hard to find out which
+    call has crashed the application and which operation has introduced the
+    problem. 
 
+    Qt provides software called
+    \l{http://labs.qt.nokia.com/page/Projects/Itemview/Modeltest}{ModelTest},
+    which checks models while your programming is running. Every time the model
+    is changed, ModelTest scans the model and reports errors with an assert.
+    This is especially important for tree models, since their hierarchical
+    nature leaves many possibilities for subtle inconsistencies.
 
-
-\raw HTML
-<br>
-\endraw
+    Unlike view classes, ModelTest uses out of range indexes to test the model.
+    This means your application may crash with ModelTest even if it runs
+    perfectly without it. So you also need to handle all of the indexes that
+    are out of range when using ModelTest. 
 
 
+    \section2 3.6 Model/View NG
 
+    \raw HTML
+    <table style="background-color:white;border:none;font: normal 13px/1.2 Verdana;">
+    <tr><td align="left" valign="top" style="background-color:white;border:none;padding:5px;">
+    \endraw
 
+    \raw HTML
+    <!-- wrap content table p has 0 padding and the padding for p outside of the table is 5px-->
+    \endraw
 
-\section2 3.6 Model/View NG
+    Model/View was introduced in Qt 4.0 and is a frequently used technology.
+    Feedback from developers and new development trends have shown that there
+    is a need to further develop the model/view technology. Therefore a
+    research project originated at Nokia is looking into ways to go beyond the
+    current implementation.
+
+    One limitation of model/view is that view classes are basically all fixed
+    grids. It is possible, but really hard to make a list view with icons
+    placed on a curve; or cells expanding on mouse over events to show
+    additional information.
+    In order to achieve graphically rich view experiences, Model/View NG will
+    use QGraphicsView to render elements. Nodel/View NG also aims to make
+    model/view programming more intuitive. One way to achieve this is to have
+    separate models for lists, tables and trees. The current model abstraction
+    is complex because it is capable of representing a list, a table or a tree.
+
+    Model/View NG is a research project. You are welcome to checkout the source
+    code, monitor progress and take part in discussions at the following
+    address: \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
 
-\raw HTML
-<table style="background-color:white;border:none;font: normal 13px/1.2 Verdana;">
-<tr><td align="left" valign="top" style="background-color:white;border:none;padding:5px;">
-\endraw
+    \raw HTML
+    </td><td align="right" valign="top">
+    \endraw
 
-\raw HTML
-<!-- wrap content table p has 0 padding and the padding for p outside of the table is 5px-->
-\endraw
+    \inlineimage path.png
 
-Model/View was introduced in Qt 4.0 and is a frequently used technology. Feedback from clients and new development trends have shown, that there is a need to further develop the model/view technology. Therefore a research project at Nokia is looking into ways to go beyond the current implementation.
-\raw HTML
-<br>
-\endraw
-One limitation of model/view is that view classes are basically all fixed grids. It is possible, but really hard to make a list view with icons placed on a curve; or cells expanding on mouse over events to show additional information. In order to achieve graphically rich view experiences, Model/View NG will use QGraphicsView to render elements. Nodel/View NG also aims to make model/view programming more intuitive. One way to achieve this is to have  separate models for lists, tables and trees. The current model abstraction is complex because it is capable of representing a list, a table or a tree. 
-\raw HTML
-<br>
-\endraw
-Model/View NG is a research project. You are welcome to checkout the source code, monitor progress and take part in discussions at the following address:  \l{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}{http://labs.qt.nokia.com/page/Projects/Itemview/ItemviewsNG}
+    \raw HTML
+    </td></tr></table>
+    \endraw
+*/
 
-\raw HTML
-</td><td align="right" valign="top">
-\endraw
+/*!
+    \page modelview-part4.html
+    \contentspage {modelview-index.html}{Model/View Contents}
+    \previouspage {modelview-part3.html}{Intermediate Topics}
+    \title Model/View Chapter 4 - Good Sources of Additional Information
 
-\inlineimage path.png
+    \section1 4. Good Sources of Additional Information
 
-\raw HTML
-</td></tr></table>
-\endraw
-\raw HTML
-<br>
-\endraw
+    \section2 4.1 Books
 
-*/
+    Model/View programming is covered quite extensively in the documentation of
+    Qt but also in several good books.
 
-/*!
-    \page modelview-part4.html
-    
-    \title ModelView Chapter 4 - Good Sources for Additional Information
-    
-    \raw HTML
-            <br>
-    \endraw
-\section1 4 Good Sources for Additional Information
-\raw HTML
-<br>
-\endraw
-\section2 4.1 Books
-Model/View programming is covered quite extensively in the documentation of Qt but also in several good books. 
     \list 1
-       \o  C++ GUI Programming with Qt 4 / Jasmin Blanchette, Mark Summerfield, Prentice Hall, 2nd edition, ISBN 0-13-235416-0
-also available in German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung, Addison-Wesley, ISBN 3-827327-29-6
-       \o  The Book of Qt4, The Art of Building Qt Applications / Daniel Molkentin,  Open Source Press ISBN 1-59327-147-6
-Translated from: Qt 4, Einführung in die Applikationsentwicklung, Open Source Press, ISBN 3-937514-12-0
-       \o  Foundations of Qt Development / Johan Thelin, Apress, ISBN 1-59059-831-8
+       \o \bold{C++ GUI Programming with Qt 4} / Jasmin Blanchette, Mark Summerfield,
+          \e{Prentice Hall, 2nd edition}, ISBN 0-13-235416-0. Also available in
+          German: C++ GUI Programmierung mit Qt 4: Die offizielle Einführung,
+          \e{Addison-Wesley}, ISBN 3-827327-29-6
+       \o \bold{The Book of Qt4, The Art of Building Qt Applications} / Daniel Molkentin,
+          \e{Open Source Press}, ISBN 1-59327-147-6.
+          Translated from \bold{Qt 4, Einführung in die Applikationsentwicklung},
+          \e{Open Source Press}, ISBN 3-937514-12-0.
+       \o \bold{Foundations of Qt Development} / Johan Thelin, \e{Apress}, ISBN 1-59059-831-8.
     \endlist
-\raw HTML
-<br>
-\endraw
 
-The following list provides an overview of example programs contained in the books above. Some of them make very good templates for developing similar applications. 
+    More information about these books is available on the
+    \l{Books about Qt Programming}{Qt Web site}.
+
+    The following list provides an overview of example programs contained in the
+    books above. Some of them make very good templates for developing similar
+    applications.
 
     \table
         \header
@@ -461,45 +670,45 @@ The following list provides an overview of example programs contained in the boo
             \o  view class used
             \o  model used
             \o  aspects touched
-            \o  
+            \o
         \row
             \o  Team Leaders
             \o  QListview
             \o  QStringListModel
-            \o  
+            \o
             \o  Book 1, Chapter 10, Figure 10.6
         \row
             \o  Directory Viewer
             \o  QTreeView
             \o  QDirModel
-            \o  
+            \o
             \o  Book 1, Chapter 10, Figure 10.7
         \row
             \o  Color Names
             \o  QListView
             \o  QSortFilterProxyModel
-applied to QStringListModel
-            \o  
+                applied to QStringListModel
+            \o
             \o  Book 1, Chapter 10, Figure 10.8
         \row
             \o  Currencies
             \o  QTableView
             \o  custom model based on
-QAbstractTableModel
+                QAbstractTableModel
             \o  read only
             \o  Book 1, Chapter 10, Figure 10.10
         \row
             \o  Cities
             \o  QTableView
             \o  custom model based on
-QAbstractTableModel
+                QAbstractTableModel
             \o  read / write
             \o  Book 1, Chapter 10, Figure 10.12
         \row
             \o  Boolean Parser
             \o  QTreeView
             \o  custom model based on
-QAbstractItemModel
+                QAbstractItemModel
             \o  read only
             \o  Book 1, Chapter 10, Figure 10.14
         \row
@@ -511,141 +720,129 @@ QAbstractItemModel
         \row
             \o  Four directory views
             \o  QListView
-QTableView
-QTreeView
+                QTableView
+                QTreeView
             \o  QDirModel
             \o  demonstrates the use of multiple views
             \o  Book2, Chapter 8.2
         \row
             \o  Address Book
             \o  QListView
-QTableView
-QTreeView
+                QTableView
+                QTreeView
             \o  custom model based on
-QAbstractTableModel
+                QAbstractTableModel
             \o  read / write
             \o  Book2, Chapter 8.4
         \row
             \o  Address Book with sorting
-            \o  
+            \o
             \o  QProxyModel
             \o  introducing sort and filter capabilities
             \o  Book2, Chapter 8.5
         \row
-            \o  Address Book 
-with checkboxes
-            \o  
-            \o  
-            \o  introducing checkboxes
-in model/view
+            \o  Address Book
+                with checkboxes
+            \o
+            \o
+            \o  introducing checkboxes in model/view
             \o  Book2, Chapter 8.6
         \row
-            \o  Address Book 
-with transposed grid
-            \o  
+            \o  Address Book with transposed grid
+            \o
             \o  custom proxy Model based on QAbstractProxyModel
             \o  introducing a custom model
             \o  Book2, Chapter 8.7
         \row
-            \o  Address Book
-with drag and drop
-            \o  
-            \o  
+            \o  Address Book with drag and drop
+            \o
+            \o
             \o  introducing drag and drop support
             \o  Book2, Chapter 8.8
         \row
             \o  Address Book with custom editor
-            \o  
-            \o  
+            \o
+            \o
             \o  introducing custom delegates
             \o  Book2, Chapter 8.9
         \row
             \o  Views
             \o  QListView
-QTableView
-QTreeView
+                QTableView
+                QTreeView
             \o  QStandardItemModel
             \o  read only
             \o  Book 3, Chapter 5, figure 5-3
         \row
             \o  Bardelegate
             \o  QTableView
-            \o  
+            \o
             \o  custom delegate for presentation based on QAbstractItemDelegate
             \o  Book 3, Chapter 5, figure 5-5
         \row
             \o  Editdelegate
             \o  QTableView
-            \o  
+            \o
             \o  custom delegate for editing based on QAbstractItemDelegate
             \o  Book 3, Chapter 5, figure 5-6
         \row
             \o  Singleitemview
-            \o  custom view based on 
-QAbstractItemView
-            \o  
+            \o  custom view based on QAbstractItemView
+            \o
             \o  custom view
             \o  Book 3,
-Chapter 5,
-figure 5-7
+                Chapter 5,
+                figure 5-7
         \row
             \o  listmodel
             \o  QTableView
-            \o  custom Model based on
-QAbstractTableModel
+            \o  custom Model based on QAbstractTableModel
             \o  read only
-            \o  Book 3,
-Chapter 5,
-Figure 5-8
+            \o  Book 3, Chapter 5, Figure 5-8
         \row
             \o  treemodel
             \o  QTreeView
-            \o  custom Model based on
-QAbstractItemModel
+            \o  custom Model based on QAbstractItemModel
             \o  read only
-            \o  Book 3,
-Chapter 5,
-Figure 5-10
+            \o  Book 3, Chapter 5, Figure 5-10
         \row
             \o  edit integers
             \o  QListView
-            \o  custom Model based on 
-QAbstractListModel
+            \o  custom Model based on QAbstractListModel
             \o  read / write
-            \o  Book 3,
-Chapter 5,
-Listing 5-37, Figure 5-11
+            \o  Book 3, Chapter 5, Listing 5-37, Figure 5-11
         \row
             \o  sorting
             \o  QTableView
-            \o  QSortFilterProxyModel
-applied to QStringListModel
+            \o  QSortFilterProxyModel applied to QStringListModel
             \o  demonstrates sorting
             \o  Book 3, Chapter 5, Figure 5-12
-
     \endtable
 
 
-\section2 4.2 Qt documentation
-Qt 4.6 comes with 17 examples and 2 Demonstrations for model/view.  The examples can be found here:  \l{http://doc.qt.nokia.com/4.6/examples-itemviews.html}{http://doc.qt.nokia.com/4.6/examples-itemviews.html}
+    \section2 4.2 Qt Documentation
+
+    Qt 4.7 comes with 17 examples and 2 Demonstrations for model/view.
+    The examples can be found here: \l{Item Views Examples}
     \table
         \header
-            \o  example name
-            \o  view class used
-            \o  model used
-            \o  aspects touched
+            \o  Example name
+            \o  View class used
+            \o  Model used
+            \o  Aspects touched
         \row
             \o  Address Book
             \o  QTableView
             \o  QAbstractTableModel
-QSortFilterProxyModel
-            \o  usage of  QSortFilterProxyModel to generate different subsets from one data pool
+                QSortFilterProxyModel
+            \o  usage of QSortFilterProxyModel to generate different
+                subsets from one data pool
         \row
             \o  Basic Sort/Filter Model
             \o  QTreeView
             \o  QStandardItemModel
-QSortFilterProxyModel
-            \o  
+                QSortFilterProxyModel
+            \o
         \row
             \o  Chart
             \o  custom view
@@ -664,9 +861,8 @@ QSortFilterProxyModel
             \o  Custom Sort/Filter Model
             \o  QTreeView
             \o  QStandardItemModel
-QSortFilterProxyModel
-            \o  subclass QSortFilterProxyModel
-for advanced sorting and filtering
+                QSortFilterProxyModel
+            \o  subclass QSortFilterProxyModel for advanced sorting and filtering
         \row
             \o  Dir View
             \o  QTreeView
@@ -676,17 +872,19 @@ for advanced sorting and filtering
             \o  Editable Tree Model
             \o  QTreeView
             \o  custom tree model
-            \o  comprehensive example for working with trees, demonstrates editing cells and tree structure with an underlying custom model  
+            \o  comprehensive example for working with trees, demonstrates
+                editing cells and tree structure with an underlying custom
+                model
         \row
             \o  Fetch More
             \o  QListView
             \o  custom list model
-            \o  dynamically changing model 
+            \o  dynamically changing model
         \row
             \o  Frozen Column
             \o  QTableView
             \o  QStandardItemModel
-            \o  
+            \o
         \row
             \o  Pixelator
             \o  QTableView
@@ -723,13 +921,18 @@ for advanced sorting and filtering
             \o  comprehensive custom delegate example. 
     \endtable
 
-Demonstrations are similar to examples except that no walk-through is provided  for the code lines. Demonstrations are also sometimes more feature rich. 
- \l{http://doc.qt.nokia.com/4.6/demos.html}{http://doc.qt.nokia.com/4.6/demos.html}
+    \l{Qt Demonstrations}{Demonstrations} are similar to examples except
+    that no walkthrough is provided for the code. Demonstrations are also
+    sometimes more feature rich.
+
     \list
-       \o   The \bold Interview demonstration shows the same model and selection being shared between three different views. 
-       \o   Demonstration \bold Spreadsheet demonstrates the use of a table view as a spreadsheet, using custom delegates to render each item according to the type of data it contains.
+       \o   The \bold Interview demonstration shows the same model and
+            selection being shared between three different views.
+       \o   Demonstration \bold Spreadsheet demonstrates the use of a
+            table view as a spreadsheet, using custom delegates to render
+            each item according to the type of data it contains.
     \endlist
 
-A reference documentation for model/view technology is also available. \l{http://doc.qt.nokia.com/4.6/model-view-programming.html}{http://doc.qt.nokia.com/4.6/model-view-programming.html}
-
-*/
\ No newline at end of file
+    A \l{Model/View Programming}{reference document} for model/view technology
+    is also available.
+*/
diff --git a/examples/tutorials/modelview/1_readonly/main.cpp b/examples/tutorials/modelview/1_readonly/main.cpp
index ad11f38..fb4726a 100755
--- a/examples/tutorials/modelview/1_readonly/main.cpp
+++ b/examples/tutorials/modelview/1_readonly/main.cpp
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 //! [Quoting ModelView Tutorial]
+// main.cpp
 #include <QtGui/QApplication>
 #include "modelview.h"
 
diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp
index 027be56..91a97bf 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.cpp
+++ b/examples/tutorials/modelview/1_readonly/modelview.cpp
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 //! [Quoting ModelView Tutorial]
+// modelview.cpp
 #include <QTableView>
 #include "modelview.h"
 #include "mymodel.h"
@@ -48,6 +49,6 @@ ModelView::ModelView(QWidget *parent)
 {
     tableView = new QTableView(this);
     setCentralWidget(tableView);
-    tableView->setModel(new MyModel(this) );
+    tableView->setModel(new MyModel(this));
 }
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
+//! [Quoting ModelView Tutorial]
diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h
index d0f96cd..9307083 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.h
+++ b/examples/tutorials/modelview/1_readonly/modelview.h
@@ -38,11 +38,11 @@
 **
 ****************************************************************************/
 
-//! [Quoting ModelView Tutorial]
 #ifndef MODELVIEW_H
 #define MODELVIEW_H
 
-
+//! [Quoting ModelView Tutorial]
+// modelview.h
 #include <QtGui/QMainWindow>
 
 class QTableView; //forward declaration
@@ -56,6 +56,6 @@ public:
     ModelView(QWidget *parent = 0);
 
 };
+//! [Quoting ModelView Tutorial]
 
 #endif // MODELVIEW_H
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.cpp b/examples/tutorials/modelview/1_readonly/mymodel.cpp
index c441720..394605a 100755
--- a/examples/tutorials/modelview/1_readonly/mymodel.cpp
+++ b/examples/tutorials/modelview/1_readonly/mymodel.cpp
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 //! [Quoting ModelView Tutorial]
+// mymodel.cpp
 #include "mymodel.h"
 
 MyModel::MyModel(QObject *parent)
@@ -46,22 +47,19 @@ MyModel::MyModel(QObject *parent)
 {
 }
 
-//-------------------------------------------------------
-int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
+int MyModel::rowCount(const QModelIndex & /*parent*/) const
 {
    return 2;
 }
 
-//-------------------------------------------------------
-int MyModel::columnCount(const QModelIndex & /*parent*/ ) const
+int MyModel::columnCount(const QModelIndex & /*parent*/) const
 {
     return 3;
 }
 
-//-------------------------------------------------------
-QVariant MyModel::data(const QModelIndex &index, int role ) const
+QVariant MyModel::data(const QModelIndex &index, int role) const
 {
-    if(role == Qt::DisplayRole)
+    if (role == Qt::DisplayRole)
     {
        return QString("Row%1, Column%2")
                    .arg(index.row() + 1)
@@ -69,4 +67,4 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
     }
     return QVariant();
 }
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
+//! [Quoting ModelView Tutorial]
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.h b/examples/tutorials/modelview/1_readonly/mymodel.h
index c0ddf4ac6..6065f6e 100755
--- a/examples/tutorials/modelview/1_readonly/mymodel.h
+++ b/examples/tutorials/modelview/1_readonly/mymodel.h
@@ -38,10 +38,11 @@
 **
 ****************************************************************************/
 
-//! [Quoting ModelView Tutorial]
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
+//! [Quoting ModelView Tutorial]
+// mymodel.h
 #include <QAbstractTableModel>
 
 class MyModel : public QAbstractTableModel
@@ -53,6 +54,6 @@ public:
     int columnCount(const QModelIndex &parent = QModelIndex()) const;
     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
 };
+//! [Quoting ModelView Tutorial]
 
 #endif // MYMODEL_H
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/2_formatting/modelview.cpp b/examples/tutorials/modelview/2_formatting/modelview.cpp
index 2b05d4c..9a5ce64 100755
--- a/examples/tutorials/modelview/2_formatting/modelview.cpp
+++ b/examples/tutorials/modelview/2_formatting/modelview.cpp
@@ -47,6 +47,6 @@ ModelView::ModelView(QWidget *parent)
 {
     tableView = new QTableView(this);
     setCentralWidget(tableView);
-    tableView->setModel(new MyModel(this) );
+    tableView->setModel(new MyModel(this));
 }
 
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
index e9e68de..e34e014 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -44,25 +44,23 @@
 #include <QDebug>
 
 //! [Quoting ModelView Tutorial]
+// mymodel.cpp
 MyModel::MyModel(QObject *parent)
     :QAbstractTableModel(parent)
 {
 }
 
-//-------------------------------------------------------
-int MyModel::rowCount(const QModelIndex  & /*parent */ ) const
+int MyModel::rowCount(const QModelIndex & /*parent */) const
 {
     return 2;
 }
 
-//-------------------------------------------------------
-int MyModel::columnCount(const QModelIndex  & /*parent */ ) const
+int MyModel::columnCount(const QModelIndex & /*parent */) const
 {
     return 3;
 }
 
-//-------------------------------------------------------
-QVariant MyModel::data(const QModelIndex &index, int role ) const
+QVariant MyModel::data(const QModelIndex &index, int role) const
 {
     int row = index.row();
     int col = index.column();
@@ -72,15 +70,15 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
 
     switch(role){
     case Qt::DisplayRole:
-        if(row == 0 && col == 1 )return QString("<--left");
-        if(row == 1 && col == 1 )return QString("right-->");
+        if (row == 0 && col == 1) return QString("<--left");
+        if (row == 1 && col == 1) return QString("right-->");
 
         return QString("Row%1, Column%2")
                 .arg(row + 1)
                 .arg(col +1);
         break;
     case Qt::FontRole:
-        if(row == 0 && col ==0 ) //change font only for cell(0,0)
+        if (row == 0 && col == 0) //change font only for cell(0,0)
         {
             QFont boldFont;
             boldFont.setBold(true);
@@ -89,7 +87,7 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
         break;
     case Qt::BackgroundRole:
 
-        if(row == 1 && col ==2 )  //change background only for cell(1,2)
+        if (row == 1 && col == 2)  //change background only for cell(1,2)
         {
             QBrush redBackground(QColor(Qt::red));
             return redBackground;
@@ -97,14 +95,14 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
         break;
     case Qt::TextAlignmentRole:
 
-        if(row == 1 && col ==1 ) //change text alignment only for cell(1,1)
+        if (row == 1 && col == 1) //change text alignment only for cell(1,1)
         {
             return Qt::AlignRight + Qt::AlignVCenter;
         }
         break;
     case Qt::CheckStateRole:
 
-        if(row == 1 && col ==0 ) //add a checkbox to cell(1,0)
+        if (row == 1 && col == 0) //add a checkbox to cell(1,0)
         {
             return Qt::Checked;
         }
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.cpp b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
index 2b05d4c..9a5ce64 100755
--- a/examples/tutorials/modelview/3_changingmodel/modelview.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
@@ -47,6 +47,6 @@ ModelView::ModelView(QWidget *parent)
 {
     tableView = new QTableView(this);
     setCentralWidget(tableView);
-    tableView->setModel(new MyModel(this) );
+    tableView->setModel(new MyModel(this));
 }
 
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
index d806945..42915b0 100755
--- a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
@@ -50,32 +50,32 @@ MyModel::MyModel(QObject *parent)
 //    selectedCell = 0;
     timer = new QTimer(this);
     timer->setInterval(1000);
-    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()) );
+    connect(timer, SIGNAL(timeout()) , this, SLOT(timerHit()));
     timer->start();
 }
 //! [quoting mymodel_a]
 //-------------------------------------------------------
-int MyModel::rowCount(const QModelIndex  & /*parent */ ) const
+int MyModel::rowCount(const QModelIndex & /*parent */) const
 {
     return 2;
 }
 
 //-------------------------------------------------------
-int MyModel::columnCount(const QModelIndex  & /*parent */ ) const
+int MyModel::columnCount(const QModelIndex & /*parent */) const
 {
     return 3;
 }
 
 //-------------------------------------------------------
 //! [quoting mymodel_QVariant ]
-QVariant MyModel::data(const QModelIndex &index, int role ) const
+QVariant MyModel::data(const QModelIndex &index, int role) const
 {
     int row = index.row();
     int col = index.column();
 
-    if(role == Qt::DisplayRole)
+    if (role == Qt::DisplayRole)
     {
-        if(row == 0 && col == 0 )
+        if (row == 0 && col == 0)
         {
             return QTime::currentTime().toString();
         }
@@ -88,8 +88,8 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
 void MyModel::timerHit()
 {
     //we identify the top left cell
-    QModelIndex topLeft = createIndex ( 0,0 );
+    QModelIndex topLeft = createIndex(0,0);
     //emit a signal to make the view reread identified data
-    emit dataChanged ( topLeft, topLeft );
+    emit dataChanged(topLeft, topLeft);
 }
 //! [quoting mymodel_b ]
diff --git a/examples/tutorials/modelview/4_headers/modelview.cpp b/examples/tutorials/modelview/4_headers/modelview.cpp
index f661ab5..449dbbc 100755
--- a/examples/tutorials/modelview/4_headers/modelview.cpp
+++ b/examples/tutorials/modelview/4_headers/modelview.cpp
@@ -48,7 +48,7 @@ ModelView::ModelView(QWidget *parent)
 {
     tableView = new QTableView(this);
     setCentralWidget(tableView);
-    tableView->setModel(new MyModel(this) );
+    tableView->setModel(new MyModel(this));
     tableView->verticalHeader()->hide();
 }
 
diff --git a/examples/tutorials/modelview/4_headers/mymodel.cpp b/examples/tutorials/modelview/4_headers/mymodel.cpp
index 94fde34..e6f977d 100755
--- a/examples/tutorials/modelview/4_headers/mymodel.cpp
+++ b/examples/tutorials/modelview/4_headers/mymodel.cpp
@@ -46,21 +46,21 @@ MyModel::MyModel(QObject *parent)
 }
 
 //-------------------------------------------------------
-int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
+int MyModel::rowCount(const QModelIndex & /*parent*/) const
 {
     return 2;
 }
 
 //-------------------------------------------------------
-int MyModel::columnCount(const QModelIndex & /*parent*/ ) const
+int MyModel::columnCount(const QModelIndex & /*parent*/) const
 {
     return 3;
 }
 
 //-------------------------------------------------------
-QVariant MyModel::data(const QModelIndex &index, int role ) const
+QVariant MyModel::data(const QModelIndex &index, int role) const
 {
-    if(role == Qt::DisplayRole)
+    if (role == Qt::DisplayRole)
     {
         return QString("Row%1, Column%2")
                 .arg(index.row() + 1)
@@ -88,4 +88,4 @@ QVariant MyModel::headerData(int section, Qt::Orientation orientation, int role)
     }
     return QVariant();
 }
-//! [quoting mymodel_c]
\ No newline at end of file
+//! [quoting mymodel_c]
diff --git a/examples/tutorials/modelview/5_edit/modelview.cpp b/examples/tutorials/modelview/5_edit/modelview.cpp
index d8853c9..a6c6ef5 100755
--- a/examples/tutorials/modelview/5_edit/modelview.cpp
+++ b/examples/tutorials/modelview/5_edit/modelview.cpp
@@ -48,13 +48,13 @@ ModelView::ModelView(QWidget *parent)
     tableView = new QTableView(this);
     setCentralWidget(tableView);
     QAbstractTableModel *myModel = new MyModel(this);
-    tableView->setModel( myModel );
+    tableView->setModel(myModel);
 
     //transfer changes to the model to the window title
-    connect(myModel, SIGNAL(editCompleted(const QString &) ), this, SLOT(setWindowTitle(const QString &)));
+    connect(myModel, SIGNAL(editCompleted(const QString &)), this, SLOT(setWindowTitle(const QString &)));
 }
 
 void ModelView::showWindowTitle(const QString & title)
 {
-setWindowTitle( title );
+setWindowTitle(title);
 }
diff --git a/examples/tutorials/modelview/5_edit/mymodel.cpp b/examples/tutorials/modelview/5_edit/mymodel.cpp
index 6007da1..67181ca 100755
--- a/examples/tutorials/modelview/5_edit/mymodel.cpp
+++ b/examples/tutorials/modelview/5_edit/mymodel.cpp
@@ -53,22 +53,19 @@ MyModel::MyModel(QObject *parent)
 //! [quoting mymodel_d]
 
 //! [quoting mymodel_e]
-//-------------------------------------------------------
-int MyModel::rowCount(const QModelIndex & /*parent*/ ) const
+int MyModel::rowCount(const QModelIndex & /*parent*/) const
 {
     return ROWS;
 }
 
-//-------------------------------------------------------
-int MyModel::columnCount(const QModelIndex & /*parent*/ ) const
+int MyModel::columnCount(const QModelIndex & /*parent*/) const
 {
     return COLS;
 }
 
-//-------------------------------------------------------
-QVariant MyModel::data(const QModelIndex &index, int role ) const
+QVariant MyModel::data(const QModelIndex &index, int role) const
 {
-    if(role == Qt::DisplayRole)
+    if (role == Qt::DisplayRole)
     {
         return m_gridData[modelIndexToOffset(index)];
     }
@@ -79,23 +76,21 @@ QVariant MyModel::data(const QModelIndex &index, int role ) const
 //-----------------------------------------------------------------
 
 //! [quoting mymodel_f]
-bool MyModel::setData ( const QModelIndex & index, const QVariant & value, int role  )
+bool MyModel::setData(const QModelIndex & index, const QVariant & value, int role)
 {
-    if(role == Qt::EditRole)
+    if (role == Qt::EditRole)
     {
         m_gridData[modelIndexToOffset(index)] = value.toString();
-        emit editCompleted(m_gridData.join(" | ") );
+        emit editCompleted(m_gridData.join(" | "));
     }
     return true;
 }
 
-//-----------------------------------------------------------------
-Qt::ItemFlags MyModel::flags ( const QModelIndex & /*index*/ ) const
+Qt::ItemFlags MyModel::flags(const QModelIndex & /*index*/) const
 {
     return Qt::ItemIsSelectable |  Qt::ItemIsEditable | Qt::ItemIsEnabled ;
 }
 
-//-----------------------------------------------------------------
 //convert row and column information to array offset
 int MyModel::modelIndexToOffset(const QModelIndex & index) const
 {
diff --git a/examples/tutorials/modelview/5_edit/mymodel.h b/examples/tutorials/modelview/5_edit/mymodel.h
index 54f2b30..0d2a1b8 100755
--- a/examples/tutorials/modelview/5_edit/mymodel.h
+++ b/examples/tutorials/modelview/5_edit/mymodel.h
@@ -38,10 +38,11 @@
 **
 ****************************************************************************/
 
-//! [Quoting ModelView Tutorial]
 #ifndef MYMODEL_H
 #define MYMODEL_H
 
+//! [Quoting ModelView Tutorial]
+// mymodel.h
 #include <QAbstractTableModel>
 #include <QStringList>
 
@@ -53,14 +54,14 @@ public:
     int rowCount(const QModelIndex &parent = QModelIndex()) const ;
     int columnCount(const QModelIndex &parent = QModelIndex()) const;
     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-    bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
-    Qt::ItemFlags flags ( const QModelIndex & index ) const ;
+    bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
+    Qt::ItemFlags flags(const QModelIndex & index) const ;
 private:
     QStringList m_gridData;  //holds text entered into QTableView
     int modelIndexToOffset(const QModelIndex & index) const;
 signals:
     void editCompleted(const QString &);
 };
+//! [Quoting ModelView Tutorial]
 
 #endif // MYMODEL_H
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
diff --git a/examples/tutorials/modelview/6_treeview/modelview.cpp b/examples/tutorials/modelview/6_treeview/modelview.cpp
index a25e4e9..772dbdd 100755
--- a/examples/tutorials/modelview/6_treeview/modelview.cpp
+++ b/examples/tutorials/modelview/6_treeview/modelview.cpp
@@ -39,6 +39,7 @@
 ****************************************************************************/
 
 //! [Quoting ModelView Tutorial]
+// modelview.cpp
 #include <QTreeView>
 #include <QStandardItemModel>
 #include <QStandardItem>
@@ -64,14 +65,13 @@ ModelView::ModelView(QWidget *parent)
     // adding a row to an item starts a subtree
     preparedColumn.first()->appendRow(secondRow);
 
-    treeView->setModel( standardModel );
+    treeView->setModel(standardModel);
     treeView->expandAll();
 }
 
-//---------------------------------------------------------------------------
 QList<QStandardItem *> ModelView::prepareColumn(const QString &first,
                                                 const QString &second,
-                                                const QString &third )
+                                                const QString &third)
 {
     QList<QStandardItem *> colItems;
     colItems << new QStandardItem(first);
@@ -79,4 +79,4 @@ QList<QStandardItem *> ModelView::prepareColumn(const QString &first,
     colItems << new QStandardItem(third);
     return colItems;
 }
-//! [Quoting ModelView Tutorial]
\ No newline at end of file
+//! [Quoting ModelView Tutorial]
diff --git a/examples/tutorials/modelview/6_treeview/modelview.h b/examples/tutorials/modelview/6_treeview/modelview.h
index 2329e89..a47111c 100755
--- a/examples/tutorials/modelview/6_treeview/modelview.h
+++ b/examples/tutorials/modelview/6_treeview/modelview.h
@@ -56,7 +56,7 @@ private:
     QStandardItemModel *standardModel;
     QList<QStandardItem *> prepareColumn(const QString &first,
                                          const QString &second,
-                                         const QString &third );
+                                         const QString &third);
 public:
     ModelView(QWidget *parent = 0);
 };
diff --git a/examples/tutorials/modelview/7_selections/modelview.cpp b/examples/tutorials/modelview/7_selections/modelview.cpp
index 2ef980d..3b373c6 100755
--- a/examples/tutorials/modelview/7_selections/modelview.cpp
+++ b/examples/tutorials/modelview/7_selections/modelview.cpp
@@ -74,13 +74,13 @@ ModelView::ModelView(QWidget *parent)
     italyItem->   appendRow(veronaItem);
     
     //register the model
-    treeView->setModel( standardModel );
+    treeView->setModel(standardModel);
     treeView->expandAll();
 
     //selection changes shall trigger a slot
     QItemSelectionModel *selectionModel= treeView->selectionModel();
-    connect(selectionModel, SIGNAL(selectionChanged ( const QItemSelection & , const QItemSelection & )),
-            this, SLOT(selectionChangedSlot(const QItemSelection & , const QItemSelection & )));
+    connect(selectionModel, SIGNAL(selectionChanged (const QItemSelection &, const QItemSelection &)),
+            this, SLOT(selectionChangedSlot(const QItemSelection &, const QItemSelection &)));
 }
 //! [quoting modelview_a]
 
@@ -93,7 +93,7 @@ void ModelView::selectionChangedSlot(const QItemSelection & /*newSelection*/, co
     QString selectedText = index.data(Qt::DisplayRole).toString();
     int hierarchyLevel=1;
     QModelIndex seekRoot = index;
-    while(seekRoot.parent() != QModelIndex() )
+    while(seekRoot.parent() != QModelIndex())
     {
         seekRoot = seekRoot.parent();
         hierarchyLevel++;
diff --git a/examples/tutorials/modelview/qmake.pro b/examples/tutorials/modelview/qmake.pro
deleted file mode 100755
index 7f684ba..0000000
--- a/examples/tutorials/modelview/qmake.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS = 1_readonly \
-          2_formatting \
-          3_changingmodel \
-          4_headers \
-          5_edit \
-          6_treeview \
-          7_selections
-
-- 
cgit v0.12


From 1404c38ad9d1bf5412ca49da7b2b50295d0ce0fb Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 13 Jul 2010 18:19:35 +0200
Subject: fix macx not having UNICODE in DEFINES any more

and make the cascade a bit nicer on the way ...
---
 src/sql/drivers/odbc/qsql_odbc.pri | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/sql/drivers/odbc/qsql_odbc.pri b/src/sql/drivers/odbc/qsql_odbc.pri
index 8394012..66a8d51 100644
--- a/src/sql/drivers/odbc/qsql_odbc.pri
+++ b/src/sql/drivers/odbc/qsql_odbc.pri
@@ -1,13 +1,13 @@
 HEADERS += $$PWD/qsql_odbc.h
 SOURCES += $$PWD/qsql_odbc.cpp
 
-mac {
-    !contains(LIBS, .*odbc.*):LIBS += -liodbc
-} else:unix {
+unix {
     DEFINES += UNICODE
-    !contains(LIBS, .*odbc.*):LIBS += $$QT_LFLAGS_ODBC
-} else:win32-borland {
-    LIBS *= $(BCB)/lib/PSDK/odbc32.lib
+    !contains(LIBS, .*odbc.*) {
+        macx:LIBS += -liodbc
+        else:LIBS += $$QT_LFLAGS_ODBC
+    }
 } else {
-    LIBS *= -lodbc32
+    win32-borland:LIBS *= $(BCB)/lib/PSDK/odbc32.lib
+    else:LIBS *= -lodbc32
 }
-- 
cgit v0.12


From 7acf2417bd2ae17c2e3c289c7caed84219e5fecd Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Tue, 13 Jul 2010 13:04:36 +0200
Subject: Fix last character being overwritten in password field

The temporary cursor position was not being updated after committing the
input (changing the cleartext into a *), as a result of which, the next
keypress was mistaken for a multitap input which should replace the last
character.

Task-number: QTBUG-11673
Reviewed-by: axis
---
 src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index d081cfd..999edda 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -294,6 +294,10 @@ void QCoeFepInputContext::commitTemporaryPreeditString()
         return;
 
     commitCurrentString(false);
+
+    //update cursor position, now this pre-edit text has been committed.
+    //this prevents next keypress overwriting it (QTBUG-11673)
+    m_cursorPos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
 }
 
 void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
-- 
cgit v0.12


From 05971cf88bf03f2cbf563cb194ebee62bb907394 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 14 Jul 2010 13:51:17 +1000
Subject: Attempt to fix build failure with msvc200{5,8} on Windows XP.

---
 tests/auto/qfileinfo/tst_qfileinfo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index 4c651bf..93b1891 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -1082,7 +1082,7 @@ void tst_QFileInfo::isHidden_data()
 
 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
     QVERIFY(QDir("./hidden-directory").exists() || QDir().mkdir("./hidden-directory"));
-    QVERIFY(SetFileAttributesW(QString("./hidden-directory").utf16(),FILE_ATTRIBUTE_HIDDEN));
+    QVERIFY(SetFileAttributesW(reinterpret_cast<LPCWSTR>(QString("./hidden-directory").utf16()),FILE_ATTRIBUTE_HIDDEN));
     QTest::newRow("C:/path/to/hidden-directory") << QDir::currentPath() + QString::fromLatin1("/hidden-directory") << true;
     QTest::newRow("C:/path/to/hidden-directory/.") << QDir::currentPath() + QString::fromLatin1("/hidden-directory/.") << true;
 #endif
-- 
cgit v0.12


From b2002d0814e18f7a50bdbf8d17c4bc1662fa70ee Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 14 Jul 2010 13:52:48 +1000
Subject: Revert "Fix an Assert in QTextTable"

This reverts commit b2a4c7f0142a48f60e7ec4fc5866917e3da8b7c3.

Unit test tst_qtexttable::QTBUG11282_insertBeforeMergedEnding
fails on mac and Linux, reverting for now.
---
 src/gui/text/qtexttable.cpp              | 28 +++--------------
 tests/auto/qtexttable/tst_qtexttable.cpp | 54 --------------------------------
 2 files changed, 4 insertions(+), 78 deletions(-)

diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index e3985ce..5100176 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -754,39 +754,19 @@ void QTextTable::insertColumns(int pos, int num)
     QTextFormatCollection *c = p->formatCollection();
     p->beginEditBlock();
 
-    QList<int> extendedSpans;
     for (int i = 0; i < d->nRows; ++i) {
         int cell;
         if (i == d->nRows - 1 && pos == d->nCols)
             cell = d->fragment_end;
         else
             cell = d->grid[i*d->nCols + pos];
+        QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+        QTextCharFormat fmt = c->charFormat(it->format);
         if (pos > 0 && pos < d->nCols && cell == d->grid[i*d->nCols + pos - 1]) {
             // cell spans the insertion place, extend it
-            if (!extendedSpans.contains(cell)) {
-                QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
-                QTextCharFormat fmt = c->charFormat(it->format);
-                fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
-                p->setCharFormat(it.position(), 1, fmt);
-                d->dirty = true;
-                extendedSpans << cell;
-            }
+            fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
+            p->setCharFormat(it.position(), 1, fmt);
         } else {
-            /* If the next cell is spanned from the row above, we need to find the right position
-            to insert to */
-            if (i > 0 && pos < d->nCols && cell == d->grid[(i-1) * d->nCols + pos]) {
-                int gridIndex = i*d->nCols + pos;
-                const int gridEnd = d->nRows * d->nCols - 1;
-                while (gridIndex < gridEnd && cell == d->grid[gridIndex]) {
-                    ++gridIndex;
-                }
-                if (gridIndex == gridEnd)
-                    cell = d->fragment_end;
-                else
-                    cell = d->grid[gridIndex];
-            }
-            QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
-            QTextCharFormat fmt = c->charFormat(it->format);
             fmt.setTableCellRowSpan(1);
             fmt.setTableCellColumnSpan(1);
             Q_ASSERT(fmt.objectIndex() == objectIndex());
diff --git a/tests/auto/qtexttable/tst_qtexttable.cpp b/tests/auto/qtexttable/tst_qtexttable.cpp
index b0cb34d..2e6007e 100644
--- a/tests/auto/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/qtexttable/tst_qtexttable.cpp
@@ -48,14 +48,9 @@
 #include <qtexttable.h>
 #include <qdebug.h>
 #include <qtextcursor.h>
-#include <qtextdocument.h>
-#include <qtextedit.h>
 
 //TESTED_FILES=
 
-typedef QList<int> IntList;
-Q_DECLARE_METATYPE(IntList)
-
 QT_FORWARD_DECLARE_CLASS(QTextDocument)
 
 class tst_QTextTable : public QObject
@@ -83,7 +78,6 @@ private slots:
     void insertRows();
     void deleteInTable();
     void mergeCells();
-    void mergeAndInsert();
     void splitCells();
     void blocksForTableShouldHaveEmptyFormat();
     void removeTableByRemoveRows();
@@ -99,8 +93,6 @@ private slots:
     void removeColumns3();
     void removeColumns4();
     void removeColumns5();
-    void QTBUG11282_insertBeforeMergedEnding_data();
-    void QTBUG11282_insertBeforeMergedEnding();
 
 private:
     QTextTable *create2x2Table();
@@ -594,16 +586,6 @@ void tst_QTextTable::mergeCells()
     QVERIFY(table->cellAt(0, 1) == table->cellAt(1, 1));
 }
 
-void tst_QTextTable::mergeAndInsert()
-{
-    QTextTable *table = cursor.insertTable(4,3);
-    table->mergeCells(0,1,3,2);
-    table->mergeCells(3,0,1,3);
-    //Don't crash !
-    table->insertColumns(1,2);
-    QCOMPARE(table->columns(), 5);
-}
-
 void tst_QTextTable::splitCells()
 {
     QTextTable *table = create4x4Table();
@@ -949,41 +931,5 @@ void tst_QTextTable::removeColumns5()
     QCOMPARE(table->cellAt(3, 2).firstPosition(), 11);
 }
 
-void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding_data()
-{
-    QTest::addColumn<int>("rows");
-    QTest::addColumn<int>("columns");
-    QTest::addColumn<QList<int> >("merge");
-    QTest::addColumn<QList<int> >("insert");
-
-    QTest::newRow("2x3, merge two, insert one") << 2 << 3 << (QList<int>() << 1 << 2 << 2)
-            << (QList<int>() << 1 << 1) ;
-    QTest::newRow("3x4, merge three, insert one") << 3 << 4 << (QList<int>() << 1 << 3 << 3)
-            << (QList<int>() << 1 << 1) ;
-    QTest::newRow("4x3, merge two, insert two") << 4 << 3 << (QList<int>() << 1 << 4 << 2)
-            << (QList<int>() << 1 << 2) ;
-    QTest::newRow("4x4, merge middle two, insert one") << 4 << 4 << (QList<int>() << 1 << 4 << 2)
-            << (QList<int>() << 1 << 1) ;
-}
-
-void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding()
-{
-    QFETCH(int, rows);
-    QFETCH(int, columns);
-    QFETCH(QList<int>, merge);
-    QFETCH(QList<int>, insert);
-    QTextTable *table = cursor.insertTable(rows, columns);
-    QTextEdit *textEdit = new QTextEdit;
-    textEdit->setDocument(doc);
-    textEdit->show();
-    QTest::qWaitForWindowShown(textEdit);
-    table->mergeCells(0,merge.at(0), merge.at(1), merge.at(2));
-    //Don't crash !
-    table->insertColumns(insert.at(0), insert.at(1));
-    //Check that the final size is what we expected
-    QCOMPARE(table->rows(), rows);
-    QCOMPARE(table->columns(), columns + insert.at(1));
-}
-
 QTEST_MAIN(tst_QTextTable)
 #include "tst_qtexttable.moc"
-- 
cgit v0.12


From d3a6f124dde7732311ad9312ebf41997712fc6bb Mon Sep 17 00:00:00 2001
From: Pierre Rossi <pierre.rossi@nokia.com>
Date: Fri, 2 Jul 2010 19:31:51 +0200
Subject: Fix an Assert in QTextTable

The problem was caused by the fragment id being inserted
in front of a cell spanning over several rows instead of
the next logical cell (or fragment_end) in the cells structure.

Task-number: QTBUG-11282
Reviewed-by: Simon Hausmann
---
 src/gui/text/qtexttable.cpp              | 28 +++++++++++++---
 tests/auto/qtexttable/tst_qtexttable.cpp | 55 ++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+), 4 deletions(-)

diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 5100176..e3985ce 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -754,19 +754,39 @@ void QTextTable::insertColumns(int pos, int num)
     QTextFormatCollection *c = p->formatCollection();
     p->beginEditBlock();
 
+    QList<int> extendedSpans;
     for (int i = 0; i < d->nRows; ++i) {
         int cell;
         if (i == d->nRows - 1 && pos == d->nCols)
             cell = d->fragment_end;
         else
             cell = d->grid[i*d->nCols + pos];
-        QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
-        QTextCharFormat fmt = c->charFormat(it->format);
         if (pos > 0 && pos < d->nCols && cell == d->grid[i*d->nCols + pos - 1]) {
             // cell spans the insertion place, extend it
-            fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
-            p->setCharFormat(it.position(), 1, fmt);
+            if (!extendedSpans.contains(cell)) {
+                QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+                QTextCharFormat fmt = c->charFormat(it->format);
+                fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
+                p->setCharFormat(it.position(), 1, fmt);
+                d->dirty = true;
+                extendedSpans << cell;
+            }
         } else {
+            /* If the next cell is spanned from the row above, we need to find the right position
+            to insert to */
+            if (i > 0 && pos < d->nCols && cell == d->grid[(i-1) * d->nCols + pos]) {
+                int gridIndex = i*d->nCols + pos;
+                const int gridEnd = d->nRows * d->nCols - 1;
+                while (gridIndex < gridEnd && cell == d->grid[gridIndex]) {
+                    ++gridIndex;
+                }
+                if (gridIndex == gridEnd)
+                    cell = d->fragment_end;
+                else
+                    cell = d->grid[gridIndex];
+            }
+            QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+            QTextCharFormat fmt = c->charFormat(it->format);
             fmt.setTableCellRowSpan(1);
             fmt.setTableCellColumnSpan(1);
             Q_ASSERT(fmt.objectIndex() == objectIndex());
diff --git a/tests/auto/qtexttable/tst_qtexttable.cpp b/tests/auto/qtexttable/tst_qtexttable.cpp
index 2e6007e..9dcc369 100644
--- a/tests/auto/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/qtexttable/tst_qtexttable.cpp
@@ -48,9 +48,14 @@
 #include <qtexttable.h>
 #include <qdebug.h>
 #include <qtextcursor.h>
+#include <qtextdocument.h>
+#include <qtextedit.h>
 
 //TESTED_FILES=
 
+typedef QList<int> IntList;
+Q_DECLARE_METATYPE(IntList)
+
 QT_FORWARD_DECLARE_CLASS(QTextDocument)
 
 class tst_QTextTable : public QObject
@@ -78,6 +83,7 @@ private slots:
     void insertRows();
     void deleteInTable();
     void mergeCells();
+    void mergeAndInsert();
     void splitCells();
     void blocksForTableShouldHaveEmptyFormat();
     void removeTableByRemoveRows();
@@ -93,6 +99,8 @@ private slots:
     void removeColumns3();
     void removeColumns4();
     void removeColumns5();
+    void QTBUG11282_insertBeforeMergedEnding_data();
+    void QTBUG11282_insertBeforeMergedEnding();
 
 private:
     QTextTable *create2x2Table();
@@ -586,6 +594,16 @@ void tst_QTextTable::mergeCells()
     QVERIFY(table->cellAt(0, 1) == table->cellAt(1, 1));
 }
 
+void tst_QTextTable::mergeAndInsert()
+{
+    QTextTable *table = cursor.insertTable(4,3);
+    table->mergeCells(0,1,3,2);
+    table->mergeCells(3,0,1,3);
+    //Don't crash !
+    table->insertColumns(1,2);
+    QCOMPARE(table->columns(), 5);
+}
+
 void tst_QTextTable::splitCells()
 {
     QTextTable *table = create4x4Table();
@@ -931,5 +949,42 @@ void tst_QTextTable::removeColumns5()
     QCOMPARE(table->cellAt(3, 2).firstPosition(), 11);
 }
 
+void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding_data()
+{
+    QTest::addColumn<int>("rows");
+    QTest::addColumn<int>("columns");
+    QTest::addColumn<QList<int> >("merge");
+    QTest::addColumn<QList<int> >("insert");
+
+    QTest::newRow("2x3, merge two, insert one") << 2 << 3 << (QList<int>() << 1 << 2 << 2)
+            << (QList<int>() << 1 << 1) ;
+    QTest::newRow("3x4, merge three, insert one") << 3 << 4 << (QList<int>() << 1 << 3 << 3)
+            << (QList<int>() << 1 << 1) ;
+    QTest::newRow("4x3, merge two, insert two") << 4 << 3 << (QList<int>() << 1 << 4 << 2)
+            << (QList<int>() << 1 << 2) ;
+    QTest::newRow("4x4, merge middle two, insert one") << 4 << 4 << (QList<int>() << 1 << 4 << 2)
+            << (QList<int>() << 1 << 1) ;
+}
+
+void tst_QTextTable::QTBUG11282_insertBeforeMergedEnding()
+{
+    QFETCH(int, rows);
+    QFETCH(int, columns);
+    QFETCH(QList<int>, merge);
+    QFETCH(QList<int>, insert);
+    QTextTable *table = cursor.insertTable(rows, columns);
+    QTextEdit *textEdit = new QTextEdit;
+    textEdit->setDocument(doc);
+    textEdit->show();
+    QTest::qWaitForWindowShown(textEdit);
+    table->mergeCells(0,merge.at(0), merge.at(1), merge.at(2));
+    //Don't crash !
+    table->insertColumns(insert.at(0), insert.at(1));
+    //Check that the final size is what we expected
+    QCOMPARE(table->rows(), rows);
+    QCOMPARE(table->columns(), columns + insert.at(1));
+    delete textEdit;
+}
+
 QTEST_MAIN(tst_QTextTable)
 #include "tst_qtexttable.moc"
-- 
cgit v0.12


From 852ba9a62f65a27e42648d4b28b68c76b1589e75 Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Wed, 14 Jul 2010 10:46:46 +0200
Subject: Silence warning when building with MSVC 2005

Reviewed-by: Eskil
---
 src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index ee49a3d..d3f6a29 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1128,7 +1128,7 @@ void QGL2PaintEngineEx::fill(const QVectorPath &path, const QBrush &brush)
     d->fill(path);
 }
 
-extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
+extern Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
 
 
 void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
-- 
cgit v0.12


From d3f67bfe7cd1cc39d25e6a7371b2b185591008c4 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Wed, 14 Jul 2010 10:47:58 +0200
Subject: qdoc: Removed navigation arrow that was causing display problems.

Task-number: QTBUG-12157, QTBUG-12148, QTBUG-12146
---
 tools/qdoc3/htmlgenerator.cpp | 30 ++++++++++++++++++------------
 tools/qdoc3/htmlgenerator.h   |  1 +
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 8699cb2..f281fd4 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -63,6 +63,12 @@ QT_BEGIN_NAMESPACE
 int HtmlGenerator::id = 0;
 bool HtmlGenerator::debugging_on = false;
 
+#if 0
+QString HtmlGenerator::divNavTop = "<div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>";
+#endif
+
+QString HtmlGenerator::divNavTop = "";
+
 QString HtmlGenerator::sinceTitles[] =
     {
         "    New Namespaces",
@@ -1055,11 +1061,11 @@ int HtmlGenerator::generateAtom(const Atom *atom,
                 }
                 sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1);
             }
-            out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+            out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a>" << divNavTop << "\n";
         }
 #else
         out() << "<a name=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString())
-              << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+              << "\"></a>" << divNavTop << "\n";
 #endif
         break;
     case Atom::SectionRight:
@@ -1307,7 +1313,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
                // out() << "<hr />\n";
                 out() << "<a name=\""
                       << registerRef((*s).name.toLower())
-                      << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+                      << "\"></a>" << divNavTop << "\n";
                 out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
                 generateSection(s->members, inner, marker, CodeMarker::Summary);
             }
@@ -1316,7 +1322,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
               //  out() << "<hr />\n";
                 out() << "<a name=\""
                       << registerRef(name.toLower())
-                      << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+                      << "\"></a>" << divNavTop << "\n";
                 out() << "<h2>" << protectEnc(name) << "</h2>\n";
                 generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
             }
@@ -1343,7 +1349,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
         out() << "</ul>\n";
     }
 
-    out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+    out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
 
     if (!inner->doc().isEmpty()) {
         //out() << "<hr />\n"
@@ -1483,12 +1489,12 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
         generateStatus(fake, marker);
 
         if (moduleNamespaceMap.contains(fake->name())) {
-            out() << "<a name=\"" << registerRef("namespaces") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+            out() << "<a name=\"" << registerRef("namespaces") << "\"></a>" << divNavTop << "\n";
             out() << "<h2>Namespaces</h2>\n";
             generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
         }
         if (moduleClassMap.contains(fake->name())) {
-            out() << "<a name=\"" << registerRef("classes") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+            out() << "<a name=\"" << registerRef("classes") << "\"></a>" << divNavTop << "\n";
             out() << "<h2>Classes</h2>\n";
             generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
         }
@@ -1551,13 +1557,13 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
         sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
         s = sections.begin();
         while (s != sections.end()) {
-            out() << "<a name=\"" << registerRef((*s).name) << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+            out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << "\n";
             out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
             generateQmlSummary(*s,fake,marker);
             ++s;
         }
 
-        out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+        out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
         out() << "<h2>" << "Detailed Description" << "</h2>\n";
         generateBody(fake, marker);
         if (cn)
@@ -1587,7 +1593,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
     sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay);
     s = sections.begin();
     while (s != sections.end()) {
-        out() << "<a name=\"" << registerRef((*s).name) << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+        out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << "\n";
         out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
         generateSectionList(*s, fake, marker, CodeMarker::Summary);
         ++s;
@@ -1595,7 +1601,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
 
     Text brief = fake->doc().briefText();
     if (fake->subType() == Node::Module && !brief.isEmpty()) {
-        out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+        out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
         out() << "<div class=\"descr\">\n"; // QTBUG-9504
         out() << "<h2>" << "Detailed Description" << "</h2>\n";
     }
@@ -3481,7 +3487,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
         out() << "<h3 class=\"fn\">";
         out() << "<a name=\"" + refForNode(node) + "\"></a>";
         generateSynopsis(node, relative, marker, CodeMarker::Detailed);
-        out() << "</h3><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
+        out() << "</h3>" << divNavTop << "\n";
     }
 
     generateStatus(node, marker);
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index abfca60..54032d3 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -324,6 +324,7 @@ class HtmlGenerator : public PageGenerator
     static int id;
  public:
     static bool debugging_on;
+    static QString divNavTop;
 };
 
 #define HTMLGENERATOR_ADDRESS           "address"
-- 
cgit v0.12


From ea6a5146397b668bf535ee7249bd4262d6185234 Mon Sep 17 00:00:00 2001
From: Andreas Aardal Hanssen <andreas.hanssen@tandberg.com>
Date: Wed, 14 Jul 2010 12:02:08 +0200
Subject: Work around memory leak issue in grid and linear layouts.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

These classes create a new QWidget and assign it to a static pointer
which is never cleaned up. Using Q_GLOBAL_STATIC ensures that they are
deleted on library unload. This is really just a cosmetic change that
removes a leak warning - the real fix should be to find a way to not
use a new QWidget like this. It seems odd that QGraphicsLayouts, which
don't use QWidget in any other way, should depend on QWidget like this.

Task-number: QTBUG-10768

Merge-request: 741
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
---
 src/gui/graphicsview/qgraphicsgridlayout.cpp                   | 7 +++----
 src/gui/graphicsview/qgraphicslinearlayout.cpp                 | 7 +++----
 tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp     | 7 +++++++
 tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp | 7 +++++++
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp
index 83db3ec..062b5ac 100644
--- a/src/gui/graphicsview/qgraphicsgridlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp
@@ -94,14 +94,13 @@ public:
 #endif
 };
 
+Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget);
+
 QLayoutStyleInfo QGraphicsGridLayoutPrivate::styleInfo() const
 {
-    static QWidget *wid = 0;
-    if (!wid)
-        wid = new QWidget;
     QGraphicsItem *item = parentItem();
     QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
-    return QLayoutStyleInfo(style, wid);
+    return QLayoutStyleInfo(style, globalStyleInfoWidget());
 }
 
 /*!
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp
index b828722..37408ef 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp
@@ -171,14 +171,13 @@ int QGraphicsLinearLayoutPrivate::gridColumn(int index) const
     return int(qMin(uint(index), uint(engine.columnCount())));
 }
 
+Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget)
+
 QLayoutStyleInfo QGraphicsLinearLayoutPrivate::styleInfo() const
 {
-    static QWidget *wid = 0;
-    if (!wid)
-        wid = new QWidget;
     QGraphicsItem *item = parentItem();
     QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style();
-    return QLayoutStyleInfo(style, wid);
+    return QLayoutStyleInfo(style, globalStyleInfoWidget());
 }
 
 /*!
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index b9a5c66..d1d6860 100644
--- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -105,6 +105,7 @@ private slots:
     void geometries_data();
     void geometries();
     void avoidRecursionInInsertItem();
+    void styleInfoLeak();
     void task236367_maxSizeHint();
 };
 
@@ -2196,6 +2197,12 @@ void tst_QGraphicsGridLayout::avoidRecursionInInsertItem()
     QCOMPARE(layout->count(), 0);
 }
 
+void tst_QGraphicsGridLayout::styleInfoLeak()
+{
+    QGraphicsGridLayout grid;
+    grid.horizontalSpacing();
+}
+
 void tst_QGraphicsGridLayout::task236367_maxSizeHint()
 {
     QGraphicsWidget *widget = new QGraphicsWidget;
diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index c26e5d4..6107fa1 100644
--- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -102,6 +102,7 @@ private slots:
     void layoutDirection();
     void removeLayout();
     void avoidRecursionInInsertItem();
+    void styleInfoLeak();
 
     // Task specific tests
     void task218400_insertStretchCrash();
@@ -1443,6 +1444,12 @@ void tst_QGraphicsLinearLayout::avoidRecursionInInsertItem()
     QCOMPARE(layout->count(), 0);
 }
 
+void tst_QGraphicsLinearLayout::styleInfoLeak()
+{
+    QGraphicsLinearLayout layout;
+    layout.spacing();
+}
+
 void tst_QGraphicsLinearLayout::task218400_insertStretchCrash()
 {
     QGraphicsScene *scene = new QGraphicsScene;
-- 
cgit v0.12


From b7f55ac9c1c6b87083c9dca3b5cbca211fdecaef Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Wed, 14 Jul 2010 11:53:07 +0200
Subject: fix warning directive on gnuc

---
 bin/syncqt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/syncqt b/bin/syncqt
index 11b1d72..c8cba30 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -843,7 +843,7 @@ foreach (@modules_to_sync) {
                                     my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
                                     $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
                                                       "    #if defined(__GNUC__)\n" .
-                                                      "        #pragma warning \"$warning_msg\"\n" .
+                                                      "        #warning \"$warning_msg\"\n" .
                                                       "    #elif defined(_MSC_VER)\n" .
                                                       "        #pragma message \"WARNING: $warning_msg\"\n" .
                                                       "    #endif\n".
-- 
cgit v0.12


From 74d0482c1690211a20bdfc996aa0ad30fdb9bb28 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Wed, 14 Jul 2010 11:55:27 +0200
Subject: fix qconfig.h aliased header creation

don't have configure create the forwarding headers (or symlinks on unix)
for qconfig.h, but instead have syncqt create forwarding headers for
not yet existing files.

Reviewed-by: joerg
---
 bin/syncqt                       |  2 ++
 configure                        |  5 -----
 tools/configure/configureapp.cpp | 10 ----------
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/bin/syncqt b/bin/syncqt
index c8cba30..fb5c8d8 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -691,6 +691,7 @@ my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dis
 my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );
 my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" );
 my %colliding_headers = ();
+my %inject_headers = ( "$basedir/src/corelib/global" => ( "qconfig.h" ) );
 
 foreach (@modules_to_sync) {
     #iteration info
@@ -800,6 +801,7 @@ foreach (@modules_to_sync) {
         foreach (@subdirs) {
             my $subdir = "$_";
             my @headers = findFiles("$subdir", "^[-a-z0-9_]*\\.h\$" , 0);
+            push @headers, $inject_headers{$subdir} if (defined $inject_headers{$subdir});
             foreach (@headers) {
                 my $header = "$_";
                 $header = 0 if("$header" =~ /^ui_.*.h/);
diff --git a/configure b/configure
index 166f201..62e0863 100755
--- a/configure
+++ b/configure
@@ -4481,11 +4481,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
     fi
 
     mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
-    for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
-        if [ '!' -f "$conf" ]; then
-            ln -s "$QCONFIG_H" "$conf"
-        fi
-    done
 
     #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
     rm -f mkspecs/default
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index d3dec3c..7f2d53b 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3164,16 +3164,6 @@ void Configure::generateConfigfiles()
         QFile::remove(outName);
         tmpFile.copy(outName);
         tmpFile.close();
-
-        if (!QFile::exists(buildPath + "/include/QtCore/qconfig.h")) {
-            if (!writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
-                             buildPath + "/include/QtCore/qconfig.h")
-            || !writeToFile("#include \"../../src/corelib/global/qconfig.h\"\n",
-                            buildPath + "/include/Qt/qconfig.h")) {
-                dictionary["DONE"] = "error";
-                return;
-            }
-        }
     }
 
     // Copy configured mkspec to default directory, but remove the old one first, if there is any
-- 
cgit v0.12


From 56e24c99ee7a1b5b127b93cbab98f88e008ec9b8 Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Wed, 14 Jul 2010 13:03:48 +0200
Subject: Crash while runnig tst_QMdiSubWindow::emittingOfSignals test on Cocoa

We were assuming that the native windows we create will always have a
corresponding QWidget. This is not the case for qt_root_win.

Reviewed-by: Carlos Duclos
---
 src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 8652816..6795149 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -85,6 +85,8 @@ QT_END_NAMESPACE
 - (BOOL)canBecomeKeyWindow
 {
     QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
+    if (!widget)
+        return NO; // This should happen only for qt_root_win
 
     bool isToolTip = (widget->windowType() == Qt::ToolTip);
     bool isPopup = (widget->windowType() == Qt::Popup);
@@ -94,6 +96,8 @@ QT_END_NAMESPACE
 - (BOOL)canBecomeMainWindow
 {
     QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
+    if (!widget)
+        return NO; // This should happen only for qt_root_win
 
     bool isToolTip = (widget->windowType() == Qt::ToolTip);
     bool isPopup = (widget->windowType() == Qt::Popup);
-- 
cgit v0.12


From 247e3637c41cc14d174a1170957274fb8a9400b4 Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Wed, 14 Jul 2010 13:52:39 +0200
Subject: Drag and drop cursor doesnot change on invalid drop areas (Cocoa)

Previos versions of Mac OS X (< 10.6) didn't have support for such 'Not
Allowed' cursors. 10.6 introduced a new method for NSCursor called
operationNotAllowedCursor. This fix uses the new cusor on available platforms.

Task-number: QTBUG-5186
Reviewed-by: Denis
---
 src/gui/kernel/qcocoaview_mac.mm  | 38 +++++++++++++++++++++++++++++++++++---
 src/gui/kernel/qcocoaview_mac_p.h |  1 +
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 5c90e2e..1935531 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -269,6 +269,28 @@ static int qCocoaViewCount = 0;
     dropData = new QCocoaDropData(dropPasteboard);
 }
 
+- (void)changeDraggingCursor:(NSDragOperation)newOperation
+{
+    static SEL action = nil;
+    static bool operationSupported = false;
+    if (action == nil) {
+        action = NSSelectorFromString(@"operationNotAllowedCursor");
+        if ([NSCursor respondsToSelector:action]) {
+            operationSupported = true;
+        }
+    }
+    if (operationSupported) {
+        NSCursor *notAllowedCursor = [NSCursor performSelector:action];
+        bool isNotAllowedCursor = ([NSCursor currentCursor] == notAllowedCursor);
+        if (newOperation == NSDragOperationNone && !isNotAllowedCursor) {
+            [notAllowedCursor push];
+        } else if (newOperation != NSDragOperationNone && isNotAllowedCursor) {
+            [notAllowedCursor pop];
+        }
+
+    }
+}
+
 - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
 {
     // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly
@@ -300,6 +322,7 @@ static int qCocoaViewCount = 0;
     if (!qDEEvent.isAccepted()) {
         // widget is not interested in this drag, so ignore this drop data.
         [self removeDropData];
+        [self changeDraggingCursor:NSDragOperationNone];
         return NSDragOperationNone;
     } else {
         // save the mouse position, used by draggingExited handler.
@@ -321,6 +344,7 @@ static int qCocoaViewCount = 0;
             nsActions = QT_PREPEND_NAMESPACE(qt_mac_mapDropAction)(qDMEvent.dropAction());
         }
         QT_PREPEND_NAMESPACE(qt_mac_copy_answer_rect)(qDMEvent);
+        [self changeDraggingCursor:nsActions];
         return nsActions;
     }
  }
@@ -335,16 +359,21 @@ static int qCocoaViewCount = 0;
     if (dragEnterSequence != [sender draggingSequenceNumber])
         [self draggingEntered:sender];
     // drag enter event was rejected, so ignore the move event.
-    if (dropData == 0)
+    if (dropData == 0) {
+        [self changeDraggingCursor:NSDragOperationNone];
         return NSDragOperationNone;
+    }
     // return last value, if we are still in the answerRect.
     NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint];
     NSPoint localPoint = [self convertPoint:windowPoint fromView:nil];
     NSDragOperation nsActions = [sender draggingSourceOperationMask];
     QPoint posDrag(localPoint.x, localPoint.y);
     if (qt_mac_mouse_inside_answer_rect(posDrag)
-        && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) == nsActions)
-        return QT_PREPEND_NAMESPACE(qt_mac_mapDropActions)(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastAction));
+        && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) == nsActions) {
+        NSDragOperation operation = QT_PREPEND_NAMESPACE(qt_mac_mapDropActions)(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastAction));
+        [self changeDraggingCursor:operation];
+        return operation;
+    }
     // send drag move event to the widget
     QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec.lastOperation) = nsActions;
     Qt::DropActions qtAllowed = QT_PREPEND_NAMESPACE(qt_mac_mapNSDragOperations)(nsActions);
@@ -373,6 +402,7 @@ static int qCocoaViewCount = 0;
         qDMEvent.setDropAction(Qt::IgnoreAction);
     }
     qt_mac_copy_answer_rect(qDMEvent);
+    [self changeDraggingCursor:operation];
     return operation;
 }
 
@@ -388,6 +418,8 @@ static int qCocoaViewCount = 0;
         QApplication::sendEvent(qwidget, &de);
         [self removeDropData];
     }
+    [self changeDraggingCursor:NSDragOperationEvery];
+
 }
 
 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index 33aaa24..b6b63ca 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -106,6 +106,7 @@ Q_GUI_EXPORT
 - (void) qt_clearQWidget;
 - (BOOL)qt_leftButtonIsRightButton;
 - (void)qt_setLeftButtonIsRightButton:(BOOL)isSwapped;
+- (void)changeDraggingCursor:(NSDragOperation)newOperation;
 + (DnDParams*)currentMouseEvent;
 
 @end
-- 
cgit v0.12


From 21fbfdb2acdc368c047d14004373d2d0baa6c0b1 Mon Sep 17 00:00:00 2001
From: Leandro Melo <leandro.melo@nokia.com>
Date: Wed, 14 Jul 2010 16:33:49 +0200
Subject: Docs: HTML comments marks so Creator can extract data efficiently.

Reviewed-by: Martin Smith
---
 tools/qdoc3/htmlgenerator.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++-
 tools/qdoc3/htmlgenerator.h   |  7 ++++++
 tools/qdoc3/node.cpp          | 18 ++++++++++++++++
 tools/qdoc3/node.h            |  1 +
 4 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 89b1e98..16c5eb2 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1382,12 +1382,14 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
     out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
 
     if (!inner->doc().isEmpty()) {
+        generateExtractionMark(inner, DetailedDescriptionMark);
         //out() << "<hr />\n"
         out() << "<div class=\"descr\"/>\n" // QTBUG-9504
               << "<h2>" << "Detailed Description" << "</h2>\n";
         generateBody(inner, marker);
         out() << "</div>\n"; // QTBUG-9504
         generateAlsoList(inner, marker);
+        generateExtractionMark(inner, EndMark);
     }
 
     sections = marker->sections(inner, CodeMarker::Detailed, CodeMarker::Okay);
@@ -1593,12 +1595,14 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
             ++s;
         }
 
+        generateExtractionMark(fake, DetailedDescriptionMark);
         out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
         out() << "<h2>" << "Detailed Description" << "</h2>\n";
         generateBody(fake, marker);
         if (cn)
             generateQmlText(cn->doc().body(), cn, marker, fake->name());
         generateAlsoList(fake, marker);
+        generateExtractionMark(fake, EndMark);
         //out() << "<hr />\n";
 
         sections = marker->qmlSections(qml_cn,CodeMarker::Detailed);
@@ -1631,16 +1635,20 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
 
     Text brief = fake->doc().briefText();
     if (fake->subType() == Node::Module && !brief.isEmpty()) {
+        generateExtractionMark(fake, DetailedDescriptionMark);
         out() << "<a name=\"" << registerRef("details") << "\"></a><div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>\n";
         out() << "<div class=\"descr\"/>\n"; // QTBUG-9504
         out() << "<h2>" << "Detailed Description" << "</h2>\n";
     }
-    else
+    else {
+        generateExtractionMark(fake, DetailedDescriptionMark);
         out() << "<div class=\"descr\"/>\n"; // QTBUG-9504
+    }
 
     generateBody(fake, marker);
     out() << "</div>\n"; // QTBUG-9504
     generateAlsoList(fake, marker);
+    generateExtractionMark(fake, EndMark);
 
     if (!fake->groupMembers().isEmpty()) {
         NodeMap groupMembersMap;
@@ -1913,6 +1921,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
 {
     Text brief = node->doc().briefText();
     if (!brief.isEmpty()) {
+        generateExtractionMark(node, BriefMark);
         out() << "<p>";
         generateText(brief, node, marker);
         if (!relative || node == relative)
@@ -1920,6 +1929,7 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
         else
             out() << " <a href=\"" << linkForNode(node, relative) << "#";
         out() << registerRef("details") << "\">More...</a></p>\n";
+        generateExtractionMark(node, EndMark);
     }
 }
 
@@ -3504,6 +3514,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
 #ifdef GENERATE_MAC_REFS    
     generateMacRef(node, marker);
 #endif    
+    generateExtractionMark(node, MemberMark);
     if (node->type() == Node::Enum
             && (enume = static_cast<const EnumNode *>(node))->flagsType()) {
 #ifdef GENERATE_MAC_REFS    
@@ -3566,6 +3577,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
         }
     }
     generateAlsoList(node, marker);
+    generateExtractionMark(node, EndMark);
 }
 
 void HtmlGenerator::findAllClasses(const InnerNode *node)
@@ -4148,6 +4160,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
 #ifdef GENERATE_MAC_REFS    
     generateMacRef(node, marker);
 #endif    
+    generateExtractionMark(node, MemberMark);
     out() << "<div class=\"qmlitem\">";
     if (node->subType() == Node::QmlPropertyGroup) {
         const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(node);
@@ -4219,6 +4232,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
     generateAlsoList(node, marker);
     out() << "</div>";
     out() << "</div>";
+    generateExtractionMark(node, EndMark);
 }
 
 /*!
@@ -4457,6 +4471,40 @@ void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marke
     file.close();
 }
 
+void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType markType)
+{
+    if (markType != EndMark) {
+        out() << "<!-- $$$" + node->name();
+        if (markType == MemberMark) {
+            if (node->type() == Node::Function) {
+                const FunctionNode *func = static_cast<const FunctionNode *>(node);
+                if (!func->associatedProperty()) {
+                    if (func->overloadNumber() == 1)
+                        out() << "[overload1]";
+                    out() << "$$$" + func->name() + func->rawParameters().remove(' ');
+                }
+            } else if (node->type() == Node::Property) {
+                const PropertyNode *prop = static_cast<const PropertyNode *>(node);
+                out() << "-prop";
+                const NodeList &list = prop->functions();
+                foreach (const Node *propFuncNode, list) {
+                    if (propFuncNode->type() == Node::Function) {
+                        const FunctionNode *func = static_cast<const FunctionNode *>(propFuncNode);
+                        out() << "$$$" + func->name() + func->rawParameters().remove(' ');
+                    }
+                }
+            }
+        } else if (markType == BriefMark) {
+            out() << "-brief";
+        } else if (markType == DetailedDescriptionMark) {
+            out() << "-description";
+        }
+        out() << " -->\n";
+    } else {
+        out() << "<!-- @@@" + node->name() + " -->\n";
+    }
+}
+
 #endif
 
 #if 0 // fossil removed for new doc format MWS 19/04/2010
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index 80341de..c8ede63 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -123,6 +123,12 @@ class HtmlGenerator : public PageGenerator
 
  private:
     enum SubTitleSize { SmallSubTitle, LargeSubTitle };
+    enum ExtractionMarkType {
+        BriefMark,
+        DetailedDescriptionMark,
+        MemberMark,
+        EndMark
+    };
 
     const QPair<QString,QString> anchorForNode(const Node *node);
     const Node *findNodeForTarget(const QString &target, 
@@ -268,6 +274,7 @@ class HtmlGenerator : public PageGenerator
                               CodeMarker* marker) const;
     void generatePageIndex(const QString& fileName, 
                            CodeMarker* marker) const;
+    void generateExtractionMark(const Node *node, ExtractionMarkType markType);
 
 #if 0
     NavigationBar currentNavigationBar;
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index b077074..af129ed 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1246,6 +1246,24 @@ QStringList FunctionNode::parameterNames() const
 }
 
 /*!
+  Returns a raw list of parameters. If \a names is true, the
+  names are included. If \a values is true, the default values
+  are included, if any are present.
+ */
+QString FunctionNode::rawParameters(bool names, bool values) const
+{
+    QString raw;
+    foreach (const Parameter &parameter, parameters()) {
+        raw += parameter.leftType() + parameter.rightType();
+        if (names)
+            raw += parameter.name();
+        if (values)
+            raw += parameter.defaultValue();
+    }
+    return raw;
+}
+
+/*!
   Returns the list of reconstructed parameters. If \a values
   is true, the default values are included, if any are present.
  */
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index e9f2d74..121b818 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -616,6 +616,7 @@ class FunctionNode : public LeafNode
     int numOverloads() const;
     const QList<Parameter>& parameters() const { return params; }
     QStringList parameterNames() const;
+    QString rawParameters(bool names = false, bool values = false) const;
     const FunctionNode* reimplementedFrom() const { return rf; }
     const QList<FunctionNode*> &reimplementedBy() const { return rb; }
     const PropertyNode* associatedProperty() const { return ap; }
-- 
cgit v0.12


From 00b7befbc003682a351c18d90436010efd26ece5 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Wed, 14 Jul 2010 16:26:19 +0200
Subject: fix qconfig.h reference for shadow builds

Reviewed-by: joerg
---
 bin/syncqt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/syncqt b/bin/syncqt
index fb5c8d8..03659d3 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -691,7 +691,7 @@ my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dis
 my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );
 my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" );
 my %colliding_headers = ();
-my %inject_headers = ( "$basedir/src/corelib/global" => ( "qconfig.h" ) );
+my %inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) );
 
 foreach (@modules_to_sync) {
     #iteration info
@@ -804,6 +804,7 @@ foreach (@modules_to_sync) {
             push @headers, $inject_headers{$subdir} if (defined $inject_headers{$subdir});
             foreach (@headers) {
                 my $header = "$_";
+                my $shadow = ($header =~ s/^\*//);
                 $header = 0 if("$header" =~ /^ui_.*.h/);
                 foreach (@ignore_headers) {
                     $header = 0 if("$header" eq "$_");
@@ -821,6 +822,7 @@ foreach (@modules_to_sync) {
                     }
 
                     my $iheader = $subdir . "/" . $header;
+                    $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
                     my @classes = $public_header ? classNames($iheader) : ();
                     if($showonly) {
                         print "$header [$lib]\n";
-- 
cgit v0.12


From 4e2eb2945dbc3865e2901f12d663ed89e8f0dfbf Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Wed, 14 Jul 2010 18:35:09 +0200
Subject: Compile with QT_NO_DEBUG_STREAM

Task-number: QTBUG-11510
---
 src/gui/styles/qstyle.cpp       | 4 ++--
 src/gui/styles/qstyle.h         | 2 ++
 src/gui/styles/qstyleoption.cpp | 6 ++----
 src/gui/styles/qstyleoption.h   | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index 4cfa93f..676483e 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -2421,9 +2421,9 @@ QT_BEGIN_INCLUDE_NAMESPACE
 #include <QDebug>
 QT_END_INCLUDE_NAMESPACE
 
+#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
 QDebug operator<<(QDebug debug, QStyle::State state)
 {
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
     debug << "QStyle::State(";
 
     QStringList states;
@@ -2455,9 +2455,9 @@ QDebug operator<<(QDebug debug, QStyle::State state)
     qSort(states);
     debug << states.join(QLatin1String(" | "));
     debug << ')';
-#endif
     return debug;
 }
+#endif
 
 /*!
     \since 4.6
diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h
index 439d626..1ee262d 100644
--- a/src/gui/styles/qstyle.h
+++ b/src/gui/styles/qstyle.h
@@ -878,7 +878,9 @@ private:
 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State)
 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls)
 
+#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
 Q_GUI_EXPORT QDebug operator<<(QDebug debug, QStyle::State state);
+#endif
 
 QT_END_NAMESPACE
 
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index c057a2b..eeab316 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -5419,9 +5419,9 @@ QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, T
     Returns a T or 0 depending on the type of \a hint.
 */
 
+#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
 QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
 {
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
     switch (optionType) {
     case QStyleOption::SO_Default:
         debug << "SO_Default"; break;
@@ -5482,21 +5482,19 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
     case QStyleOption::SO_GraphicsItem:
         debug << "SO_GraphicsItem"; break;
     }
-#endif
     return debug;
 }
 
 QDebug operator<<(QDebug debug, const QStyleOption &option)
 {
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
     debug << "QStyleOption(";
     debug << QStyleOption::OptionType(option.type);
     debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
     debug << ',' << option.state;
     debug << ',' << option.rect;
     debug << ')';
-#endif
     return debug;
 }
+#endif
 
 QT_END_NAMESPACE
diff --git a/src/gui/styles/qstyleoption.h b/src/gui/styles/qstyleoption.h
index 95de8d5..005b36a 100644
--- a/src/gui/styles/qstyleoption.h
+++ b/src/gui/styles/qstyleoption.h
@@ -958,8 +958,10 @@ T qstyleoption_cast(QStyleHintReturn *hint)
     return 0;
 }
 
+#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
 Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType);
 Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option);
+#endif
 
 QT_END_NAMESPACE
 
-- 
cgit v0.12


From 6536b6f16ff26579f191543e5d468a6382211a29 Mon Sep 17 00:00:00 2001
From: Robin Burchell <robin.burchell@collabora.co.uk>
Date: Wed, 14 Jul 2010 23:43:58 +0200
Subject: Add unit tests for QMimeData.

Merge-request: 2428
Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
---
 tests/auto/gui.pro                     |   1 +
 tests/auto/qmimedata/qmimedata.pro     |   4 +
 tests/auto/qmimedata/tst_qmimedata.cpp | 343 +++++++++++++++++++++++++++++++++
 3 files changed, 348 insertions(+)
 create mode 100644 tests/auto/qmimedata/qmimedata.pro
 create mode 100644 tests/auto/qmimedata/tst_qmimedata.cpp

diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index cfaa3fa..2d9ea93 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -112,6 +112,7 @@ SUBDIRS=\
     qmdisubwindow \
     qmessagebox \
     qmetaobject \
+    qmimedata \
     qmouseevent_modal \
     qmovie \
     qnetworkaccessmanager_and_qprogressdialog \
diff --git a/tests/auto/qmimedata/qmimedata.pro b/tests/auto/qmimedata/qmimedata.pro
new file mode 100644
index 0000000..13fbe65
--- /dev/null
+++ b/tests/auto/qmimedata/qmimedata.pro
@@ -0,0 +1,4 @@
+load(qttest_p4)
+SOURCES  += tst_qmimedata.cpp
+
+
diff --git a/tests/auto/qmimedata/tst_qmimedata.cpp b/tests/auto/qmimedata/tst_qmimedata.cpp
new file mode 100644
index 0000000..be7a654
--- /dev/null
+++ b/tests/auto/qmimedata/tst_qmimedata.cpp
@@ -0,0 +1,343 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+
+#include <QMimeData>
+
+class tst_QMimeData : public QObject
+{
+    Q_OBJECT
+public:
+    tst_QMimeData()
+    {
+    }
+
+private slots:
+    void clear() const;
+    void colorData() const;
+    void data() const;
+    void formats() const;
+    void hasColor() const;
+    void hasFormat() const;
+    void hasHtml() const;
+    void hasImage() const;
+    // hasText() covered by setText()
+    // hasUrls() covered by setUrls()
+    // html() covered by setHtml()
+    void imageData() const;
+    void removeFormat() const;
+    // setColorData() covered by hasColor()
+    // setData() covered in a few different tests
+    void setHtml() const;
+    // setImageData() covered in a few tests
+    void setText() const;
+    void setUrls() const;
+    // text() covered in setText()
+    // urls() covered by setUrls()
+};
+
+void tst_QMimeData::clear() const
+{
+    QMimeData mimeData;
+
+    // set, clear, verify empty
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasText());
+    mimeData.clear();
+    QVERIFY(mimeData.hasText() == false);
+
+    // repopulate, verify not empty
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasText());
+}
+
+void tst_QMimeData::colorData() const
+{
+    QMimeData mimeData;
+    QColor red = Qt::red;
+    QColor blue = Qt::blue;
+
+    // set, verify
+    mimeData.setColorData(red);
+    QVERIFY(mimeData.hasColor());
+    QCOMPARE(qvariant_cast<QColor>(mimeData.colorData()), red);
+
+    // change, verify
+    mimeData.setColorData(Qt::blue);
+    QVERIFY(mimeData.hasColor());
+    QCOMPARE(qvariant_cast<QColor>(mimeData.colorData()), blue);
+}
+
+void tst_QMimeData::data() const
+{
+    QMimeData mimeData;
+
+    // set text, verify
+    mimeData.setData("text/plain", "pirates");
+    QCOMPARE(mimeData.data("text/plain"), QByteArray("pirates"));
+    QVERIFY(mimeData.data("text/html").length() == 0);
+
+    // html time
+    mimeData.setData("text/html", "ninjas");
+    QCOMPARE(mimeData.data("text/html"), QByteArray("ninjas"));
+    QCOMPARE(mimeData.data("text/plain"), QByteArray("pirates")); // make sure text not damaged
+    QCOMPARE(mimeData.data("text/html"), mimeData.html().toLatin1());
+}
+
+void tst_QMimeData::formats() const
+{
+    QMimeData mimeData;
+
+    // set text, verify
+    mimeData.setData("text/plain", "pirates");
+    QCOMPARE(mimeData.formats(), QStringList() << "text/plain");
+
+    // set html, verify
+    mimeData.setData("text/html", "ninjas");
+    QCOMPARE(mimeData.formats(), QStringList() << "text/plain" << "text/html");
+
+    // clear, verify
+    mimeData.clear();
+    QCOMPARE(mimeData.formats(), QStringList());
+
+    // set an odd format, verify
+    mimeData.setData("foo/bar", "somevalue");
+    QCOMPARE(mimeData.formats(), QStringList() << "foo/bar");
+}
+
+void tst_QMimeData::hasColor() const
+{
+    QMimeData mimeData;
+
+    // initial state
+    QVERIFY(mimeData.hasColor() == false);
+
+    // set, verify
+    mimeData.setColorData(QColor(Qt::red));
+    QVERIFY(mimeData.hasColor());
+
+    // clear, verify
+    mimeData.clear();
+    QVERIFY(mimeData.hasColor() == false);
+
+    // set something else, verify
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasColor() == false);
+}
+
+void tst_QMimeData::hasFormat() const
+{
+    QMimeData mimeData;
+
+    // initial state
+    QVERIFY(mimeData.hasFormat("text/plain") == false);
+
+    // add, verify
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasFormat("text/plain"));
+    QVERIFY(mimeData.hasFormat("text/html") == false);
+
+    // clear, verify
+    mimeData.clear();
+    QVERIFY(mimeData.hasFormat("text/plain") == false);
+    QVERIFY(mimeData.hasFormat("text/html") == false);
+}
+
+void tst_QMimeData::hasHtml() const
+{
+    QMimeData mimeData;
+
+    // initial state
+    QVERIFY(mimeData.hasHtml() == false);
+
+    // add plain, verify false
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasHtml() == false);
+
+    // add html, verify
+    mimeData.setData("text/html", "ninjas");
+    QVERIFY(mimeData.hasHtml());
+
+    // clear, verify
+    mimeData.clear();
+    QVERIFY(mimeData.hasHtml() == false);
+
+    // readd, verify
+    mimeData.setData("text/html", "ninjas");
+    QVERIFY(mimeData.hasHtml());
+}
+
+void tst_QMimeData::hasImage() const
+{
+    QMimeData mimeData;
+
+    // initial state
+    QVERIFY(mimeData.hasImage() == false);
+
+    // add text, verify false
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasImage() == false);
+
+    // add image
+    mimeData.setImageData(QImage());
+    QVERIFY(mimeData.hasImage());
+
+    // clear, verify
+    mimeData.clear();
+    QVERIFY(mimeData.hasImage() == false);
+}
+
+void tst_QMimeData::imageData() const
+{
+    QMimeData mimeData;
+
+    // initial state
+    QCOMPARE(mimeData.imageData(), QVariant());
+
+    // set, test
+    mimeData.setImageData(QImage());
+    QVERIFY(mimeData.hasImage());
+    QCOMPARE(mimeData.imageData(), QVariant(QImage()));
+
+    // clear, verify
+    mimeData.clear();
+    QCOMPARE(mimeData.imageData(), QVariant());
+}
+
+void tst_QMimeData::removeFormat() const
+{
+    QMimeData mimeData;
+
+    // add, verify
+    mimeData.setData("text/plain", "pirates");
+    QVERIFY(mimeData.hasFormat("text/plain"));
+
+    // add another, verify
+    mimeData.setData("text/html", "ninjas");
+    QVERIFY(mimeData.hasFormat("text/html"));
+
+    // remove, verify
+    mimeData.removeFormat("text/plain");
+    QVERIFY(mimeData.hasFormat("text/plain") == false);
+    QVERIFY(mimeData.hasFormat("text/html"));
+
+    // remove, verify
+    mimeData.removeFormat("text/html");
+    QVERIFY(mimeData.hasFormat("text/plain") == false);
+    QVERIFY(mimeData.hasFormat("text/html") == false);
+}
+
+void tst_QMimeData::setHtml() const
+{
+    QMimeData mimeData;
+
+    // initial state
+    QVERIFY(mimeData.hasHtml() == false);
+
+    // add html, verify
+    mimeData.setHtml("ninjas");
+    QVERIFY(mimeData.hasHtml());
+    QCOMPARE(mimeData.html(), QLatin1String("ninjas"));
+
+    // reset html
+    mimeData.setHtml("pirates");
+    QVERIFY(mimeData.hasHtml());
+    QCOMPARE(mimeData.html(), QLatin1String("pirates"));
+}
+
+void tst_QMimeData::setText() const
+{
+    QMimeData mimeData;
+
+    // verify initial state
+    QCOMPARE(mimeData.text(), QLatin1String(""));
+    QVERIFY(mimeData.hasText() == false);
+
+    // set, verify
+    mimeData.setText("pirates");
+    QVERIFY(mimeData.hasText());
+    QCOMPARE(mimeData.text(), QLatin1String("pirates"));
+    QCOMPARE(mimeData.text().toLatin1(), mimeData.data("text/plain"));
+
+    // reset, verify
+    mimeData.setText("ninjas");
+    QVERIFY(mimeData.hasText());
+    QCOMPARE(mimeData.text(), QLatin1String("ninjas"));
+    QCOMPARE(mimeData.text().toLatin1(), mimeData.data("text/plain"));
+
+    // clear, verify
+    mimeData.clear();
+    QCOMPARE(mimeData.text(), QLatin1String(""));
+    QVERIFY(mimeData.hasText() == false);
+}
+
+void tst_QMimeData::setUrls() const
+{
+    QMimeData mimeData;
+    QList<QUrl> shortUrlList;
+    QList<QUrl> longUrlList;
+
+    // set up
+    shortUrlList += QUrl("http://qt.nokia.com");
+    longUrlList = shortUrlList;
+    longUrlList += QUrl("http://www.google.com");
+
+    // verify initial state
+    QVERIFY(mimeData.hasUrls() == false);
+
+    // set a few, verify
+    mimeData.setUrls(shortUrlList);
+    QCOMPARE(mimeData.urls(), shortUrlList);
+
+    // change them, verify
+    mimeData.setUrls(longUrlList);
+    QCOMPARE(mimeData.urls(), longUrlList);
+
+    // clear, verify
+    mimeData.clear();
+    QVERIFY(mimeData.hasUrls() == false);
+}
+
+
+QTEST_MAIN(tst_QMimeData)
+#include "tst_qmimedata.moc"
-- 
cgit v0.12


From 8ed72a96bc5c3af283f8ca4460adae9d4b466479 Mon Sep 17 00:00:00 2001
From: Yann Bodson <yann.bodson@nokia.com>
Date: Thu, 15 Jul 2010 09:48:45 +1000
Subject: Text element does not clip even with clip=true

Task: QTBUG-12201
Reviewed-by: Michael Brasser
---
 src/declarative/graphicsitems/qdeclarativeitem.cpp |  2 +-
 src/declarative/graphicsitems/qdeclarativetext.cpp | 20 +++++++++++++-------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 190b22c..ddaeb05 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -2503,7 +2503,7 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi
   \qmlproperty bool Item::clip
   This property holds whether clipping is enabled.
 
-  if clipping is enabled, an item will clip its own painting, as well
+  If clipping is enabled, an item will clip its own painting, as well
   as the painting of its children, to its bounding rectangle.
 
   Non-rectangular clipping regions are not supported for performance reasons.
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 9a281e5..ba4fa21 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1127,6 +1127,15 @@ int QDeclarativeText::resourcesLoading() const
     return d->doc ? d->doc->resourcesLoading() : 0;
 }
 
+/*!
+  \qmlproperty bool Text::clip
+  This property holds whether the text is clipped.
+
+  Note that if the text does not fit in the bounding rectangle it will be abruptly chopped.
+
+  If you want to display potentially long text in a limited space, you probably want to use \c elide instead.
+*/
+
 void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
 {
     Q_D(QDeclarativeText);
@@ -1146,13 +1155,10 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
         bool needClip = clip() && (d->imgCache.width() > width() ||
                                    d->imgCache.height() > height());
 
-        if (needClip) {
-            p->save();
-            p->setClipRect(boundingRect(), Qt::IntersectClip);
-        }
-        p->drawPixmap(br.x(), br.y(), d->imgCache);
         if (needClip)
-            p->restore();
+            p->drawPixmap(0, 0, width(), height(), d->imgCache, -br.x(), -br.y(), width(), height());
+        else
+            p->drawPixmap(br.x(), br.y(), d->imgCache);
 
         if (d->smooth) {
             p->setRenderHint(QPainter::Antialiasing, oldAA);
@@ -1166,7 +1172,7 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid
 
         if (needClip) {
             p->save();
-            p->setClipRect(boundingRect(), Qt::IntersectClip);
+            p->setClipRect(0, 0, width(), height(), Qt::IntersectClip);
         }
         if (d->richText) {
             QAbstractTextDocumentLayout::PaintContext context;
-- 
cgit v0.12


From b78e46817e5e2d9bd6a8d83b1447a6c4e941a5b3 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Thu, 15 Jul 2010 13:00:45 +1000
Subject: Change tutorial from using "Musician" etc. types to using "PieChart"
 etc. types to make a more practical example that shows how to do painting as
 well. Also includes some tutorial improvments.

---
 doc/src/declarative/extending-tutorial.qdoc        | 255 ++++++++++++---------
 .../tutorials/extending/chapter1-basics/app.qml    |  18 +-
 .../extending/chapter1-basics/chapter1-basics.pro  |   4 +-
 .../tutorials/extending/chapter1-basics/main.cpp   |   4 +-
 .../extending/chapter1-basics/musician.cpp         |  66 ------
 .../tutorials/extending/chapter1-basics/musician.h |  68 ------
 .../extending/chapter1-basics/piechart.cpp         |  81 +++++++
 .../tutorials/extending/chapter1-basics/piechart.h |  71 ++++++
 .../tutorials/extending/chapter2-methods/app.qml   |  24 +-
 .../chapter2-methods/chapter2-methods.pro          |   4 +-
 .../tutorials/extending/chapter2-methods/main.cpp  |   4 +-
 .../extending/chapter2-methods/musician.cpp        |  74 ------
 .../extending/chapter2-methods/musician.h          |  81 -------
 .../extending/chapter2-methods/piechart.cpp        |  87 +++++++
 .../extending/chapter2-methods/piechart.h          |  84 +++++++
 .../tutorials/extending/chapter3-bindings/app.qml  |  42 ++--
 .../chapter3-bindings/chapter3-bindings.pro        |   4 +-
 .../tutorials/extending/chapter3-bindings/main.cpp |   4 +-
 .../extending/chapter3-bindings/musician.cpp       |  76 ------
 .../extending/chapter3-bindings/musician.h         |  82 -------
 .../extending/chapter3-bindings/piechart.cpp       |  89 +++++++
 .../extending/chapter3-bindings/piechart.h         |  84 +++++++
 .../extending/chapter4-customPropertyTypes/app.qml |  18 +-
 .../chapter4-customPropertyTypes.pro               |   8 +-
 .../chapter4-customPropertyTypes/instrument.cpp    |  56 -----
 .../chapter4-customPropertyTypes/instrument.h      |  63 -----
 .../chapter4-customPropertyTypes/main.cpp          |   8 +-
 .../chapter4-customPropertyTypes/musician.cpp      |  67 ------
 .../chapter4-customPropertyTypes/musician.h        |  78 -------
 .../chapter4-customPropertyTypes/piechart.cpp      |  72 ++++++
 .../chapter4-customPropertyTypes/piechart.h        |  78 +++++++
 .../chapter4-customPropertyTypes/pieslice.cpp      |  68 ++++++
 .../chapter4-customPropertyTypes/pieslice.h        |  66 ++++++
 .../tutorials/extending/chapter5-plugins/app.qml   |  16 +-
 .../chapter5-plugins/chapter5-plugins.pro          |  12 +-
 .../extending/chapter5-plugins/chartsplugin.cpp    |  54 +++++
 .../extending/chapter5-plugins/chartsplugin.h      |  55 +++++
 .../extending/chapter5-plugins/instrument.cpp      |  56 -----
 .../extending/chapter5-plugins/instrument.h        |  61 -----
 .../extending/chapter5-plugins/musician.cpp        |  67 ------
 .../extending/chapter5-plugins/musician.h          |  68 ------
 .../extending/chapter5-plugins/musicplugin.cpp     |  54 -----
 .../extending/chapter5-plugins/musicplugin.h       |  55 -----
 .../extending/chapter5-plugins/piechart.cpp        |  68 ++++++
 .../extending/chapter5-plugins/piechart.h          |  68 ++++++
 .../extending/chapter5-plugins/pieslice.cpp        |  67 ++++++
 .../extending/chapter5-plugins/pieslice.h          |  64 ++++++
 47 files changed, 1401 insertions(+), 1252 deletions(-)
 delete mode 100644 examples/declarative/tutorials/extending/chapter1-basics/musician.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter1-basics/musician.h
 create mode 100644 examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter1-basics/piechart.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter2-methods/musician.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter2-methods/musician.h
 create mode 100644 examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter2-methods/piechart.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter3-bindings/musician.h
 create mode 100644 examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h
 create mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
 create mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
 create mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/instrument.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/musician.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h
 create mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/piechart.h
 create mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h

diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index 2cf00b9..9170c5c 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -59,61 +59,94 @@ Tutorial chapters:
 
 \example declarative/tutorials/extending/chapter1-basics
 
-Let's create a new QML type called "Musician" that has two properties: a name
-and an instrument.  We will make it available in a \l {Modules}{module} called "Music", with
+A common task when extending QML is to provide a new QML type that supports some
+ custom functionality beyond what is provided by the built-in \l {QML Elements}.
+For example, this could be done to implement particular data models, or provide
+elements with custom painting and drawing capabilities, or access system features
+like network programming that are not accessible through built-in QML features.
+
+In this tutorial, we will show how to use the C++ classes in the QtDeclarative
+module to extend QML. The end result will be a simple Pie Chart display implemented by
+several custom QML types connected together through QML features like bindings and 
+signals, and made available to the QML runtime through a plugin.
+
+To begin with, let's create a new QML type called "PieChart" that has two properties: a name
+and a color.  We will make it available in a \l {Modules}{module} called "Charts", with
 a module version of 1.0. 
-We want this \c Musician type to be usable from QML like this:
+
+We want this \c PieChart type to be usable from QML like this:
 
 \code
-    import Music 1.0
+    import Charts 1.0
     
-    Musician {
-        name: "Reddy the Rocker"
-        instrument: "Guitar"
+    PieChart {
+        width: 100; height: 100
+        name: "A simple pie chart"
+        color: "red"
     }
 \endcode
 
-To do this, we need a C++ class that encapsulates this \c Musician type and its two
-properties. Since QML relies heavily on Qt's \l{Meta-Object System}{meta object system},
+To do this, we need a C++ class that encapsulates this \c PieChart type and its two
+properties. Since QML makes extensive use of Qt's \l{Meta-Object System}{meta object system},
 this new class must:
 
 \list
-\o inherit from QObject
-\o declare its properties using the Q_PROPERTY() macro
+\o Inherit from QObject
+\o Declare its properties using the Q_PROPERTY macro
 \endlist
 
-Here is our \c Musician class, defined in \c musician.h:
+Here is our \c PieChart class, defined in \c piechart.h:
+
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.h 0
 
-\snippet declarative/tutorials/extending/chapter1-basics/musician.h 0
+The class inherits from QDeclarativeItem because we want to override 
+QDeclarativeItem::paint() in order to draw. If the class just represented some
+data type and was not an item that actually needed to be displayed, it could simply inherit
+from QObject. Or, if we want to extend the functionality of an existing QObject-based 
+class, it could inherit from that class instead.
 
-It defines the two properties, \c name and \c instrument, with the Q_PROPERTY() macro.
-The class implementation in \c musician.cpp simply sets and returns the \c m_name and
-\c m_instrument values as appropriate.
+The \c PieChart class defines the two properties, \c name and \c color, with the Q_PROPERTY macro,
+and overrides QDeclarativeItem::paint(). The class implementation in \c piechart.cpp 
+simply sets and returns the \c m_name and \c m_color values as appropriate, and 
+implements \c paint() to draw a simple pie chart. It also turns off the 
+QGraphicsItem::ItemHasNoContents flag to enable painting:
 
-Our QML file, \c app.qml, creates a \c Musician item and display the musician's details
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 0
+\dots 0
+\snippet declarative/tutorials/extending/chapter1-basics/piechart.cpp 1
+
+Now that we have defined the \c PieChart type, we will use it from QML. The \c app.qml
+file creates a \c PieChart item and display the pie chart's details
 using a standard QML \l Text item:
 
 \snippet declarative/tutorials/extending/chapter1-basics/app.qml 0
 
+Notice that although the color is specified as a string in QML, it is automatically
+converted to a QColor object for the PieChart \c color property. Automatic conversions are
+provided for various other \l {QML Basic Types}{basic types}; for example, a string
+like "640x480" can be automatically converted to a QSize value.
+
 We'll also create a C++ application that uses a QDeclarativeView to run and
-display \c app.qml. The application must register the \c Musician type
+display \c app.qml. The application must register the \c PieChart type
 using the qmlRegisterType() function, to allow it to be used from QML. If
-you don't register the type, \c app.qml won't be able to create a \c Musician.
+you don't register the type, \c app.qml won't be able to create a \c PieChart.
 
 Here is the application \c main.cpp:
 
 \snippet declarative/tutorials/extending/chapter1-basics/main.cpp 0
 
-This call to qmlRegisterType() registers the \c Musician type as a type called "Musician", in a module named "Music",
+This call to qmlRegisterType() registers the \c PieChart type as a type called "PieChart", in a module named "Charts",
 with a module version of 1.0.
 
 Lastly, we write a \c .pro project file that includes the files and the \c declarative library:
 
 \quotefile declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
 
-Now we can build and run the application. Try it yourself with the code in Qt's \c examples/tutorials/extending/chapter1-basics directory.
+Now we can build and run the application:
 
-\example declarative/tutorials/extending/chapter1-basics
+\image extending-tutorial-chapter1.png
+
+Try it yourself with the code in Qt's \c examples/tutorials/extending/chapter1-basics directory.
 
 At the moment, the \c app.qml is run from within a C++ application.
 This may seem odd if you're used to running QML files with the \l {QML Viewer}.
@@ -128,39 +161,40 @@ Later on, we'll show how to create a plugin so that you can run \c app.qml using
 
 \example declarative/tutorials/extending/chapter2-methods
 
-Suppose we want \c Musician to have a "perform" method that prints a message
-to the console and then emits a "performanceEnded" signal.
-Other elements would be able to call \c perform() and receive
-\c performanceEnded() signals like this:
+Suppose we want \c PieChart to have a "clearChart()" method that erases the
+chart and then emits a "chartCleared" signal. Our \c app.qml would be able 
+to call \c clearChart() and receive \c chartCleared() signals like this:
 
 \snippet declarative/tutorials/extending/chapter2-methods/app.qml 0
 
-To do this, we add a \c perform() method and a \c performanceEnded() signal
+\image extending-tutorial-chapter2.png
+
+To do this, we add a \c clearChart() method and a \c chartCleared() signal
 to our C++ class:
 
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 0
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 0
 \dots
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 1
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 1
 \dots
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 2
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 2
 \dots
-\snippet declarative/tutorials/extending/chapter2-methods/musician.h 3
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.h 3
 
-The use of Q_INVOKABLE makes the \c perform() method available to the
+The use of Q_INVOKABLE makes the \c clearChart() method available to the
 Qt Meta-Object system, and in turn, to QML. Note that it could have
 been declared as as a Qt slot instead of using Q_INVOKABLE, as
 slots are also callable from QML. Both of these approaches are valid.
 
-The \c perform() method simply prints a message to the console and
-then emits \c performanceEnded():
+The \c clearChart() method simply changes the color to Qt::transparent,
+repaints the chart, then emits the \c chartCleared() signal:
 
-\snippet declarative/tutorials/extending/chapter2-methods/musician.cpp 0
+\snippet declarative/tutorials/extending/chapter2-methods/piechart.cpp 0
 
-Now when we run the application and click the window, the application outputs:
+Now when we run the application and click the window, the pie chart
+disappears, and the application outputs:
 
 \code
-    "Reddy the Rocker" is playing the "Guitar"
-    The performance has now ended
+    The chart has been cleared
 \endcode
 
 Try out the example yourself with the updated code in Qt's \c examples/tutorials/extending/chapter2-methods directory.
@@ -174,45 +208,49 @@ Try out the example yourself with the updated code in Qt's \c examples/tutorials
 
 Property bindings is a powerful feature of QML that allows values of different
 elements to be synchronized automatically. It uses signals to notify and update
-other elements' values when property values change.
+other elements' values when property values are changed.
 
-Let's enable property bindings for the \c instrument property. That means 
+Let's enable property bindings for the \c color property. That means 
 if we have code like this:
 
 \snippet declarative/tutorials/extending/chapter3-bindings/app.qml 0
 
-The "instrument: reddy.instrument" statement binds the \c instrument value of
-\c craig to the \c instrument of \c reddy.
-Whenever \c reddy's \c instrument value changes, \c craig's \c instrument value
-updates to the same value. When the window is clicked, the application outputs:
+\image extending-tutorial-chapter3.png
 
-\code
-    "Reddy the Rocker" is playing the "Guitar"
-    "Craig the Copycat" is playing the "Guitar"
-    "Reddy the Rocker" is playing the "Drums"
-    "Craig the Copycat" is playing the "Drums"
-\endcode
+The "color: chartA.color" statement binds the \c color value of
+\c chartB to the \c color of \c chartA.
+Whenever \c chartA's \c color value changes, \c chartB's \c color value
+updates to the same value. When the window is clicked, the \c onClicked
+handler in the MouseArea changes the color of \c chartA, thereby changing
+both charts to the color blue.
 
-It's easy to enable property binding for the \c instrument property. 
-We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "instrumentChanged" signal
+It's easy to enable property binding for the \c color property. 
+We add a \l{Qt's Property System}{NOTIFY} feature to its Q_PROPERTY() declaration to indicate that a "colorChanged" signal
 is emitted whenever the value changes.
 
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 0
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 0
 \dots
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 1
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 1
 \dots
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 2
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 2
 \dots
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.h 3
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.h 3
 
-Then, we emit this signal in \c setInstrument():
+Then, we emit this signal in \c setPieSlice():
 
-\snippet declarative/tutorials/extending/chapter3-bindings/musician.cpp 0
+\snippet declarative/tutorials/extending/chapter3-bindings/piechart.cpp 0
 
-It's important for \c setInstrument() to check that the instrument value has actually changed
-before emitting \c instrumentChanged(). This ensures the signal is not emitted unnecessarily and
+It's important for \c setColor() to check that the color value has actually changed
+before emitting \c colorChanged(). This ensures the signal is not emitted unnecessarily and
 also prevents loops when other elements respond to the value change.
 
+The use of bindings is essential to QML. You should always add NOTIFY 
+signals for properties if they are able to be implemented, so that your
+properties can be used in bindings. Properties that cannot be bound cannot be
+automatically updated and cannot be used as flexibly in QML. Also, since
+bindings are invoked so often and relied upon in QML usage, users of your
+custom QML types may see unexpected behavior if bindings are not implemented.
+
 */
 
 /*!
@@ -220,19 +258,19 @@ also prevents loops when other elements respond to the value change.
 
 \example declarative/tutorials/extending/chapter4-customPropertyTypes
 
-The \c Musician type currently has two properties that are both strings. 
-It could have all sorts of other properties. For example, we could add an
-integer-type property to store the age of each musician:
+The \c PieChart type currently has a string-type property and a color-type property.
+It could have many other types of properties. For example, we could add an
+integer-type property to store an identifier for each pie chart:
 
 \code
-    class Musician : public QObject
+    class PieChart : public QDeclarativeItem
     {
         ...
-        Q_PROPERTY(int age READ age WRITE setAge)
+        Q_PROPERTY(int id READ id WRITE setId)
     public:
         ...
-        int age() const;
-        void setAge(int age);
+        int id() const;
+        void setId(int id);
         ...
     };
 \endcode
@@ -257,31 +295,39 @@ types:
 If we want to create a property whose type is not supported by QML by default,
 we need to register the type with QML.
 
-For example, let's change the type of the \c instrument property from a string to a
-new type called "Instrument". Instead of assigning a string value to \c instrument,
-we assign an \c Instrument value:
+For example, let's replace the use of the \c property with a type called 
+"PieSlice" that has a \c color property. Instead of assigning a color,
+we assign an \c PieSlice value which itself contains a \c color:
 
 \snippet declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml 0
 
-Like \c Musician, this new \c Instrument type has to inherit from QObject and declare
+Like \c PieChart, this new \c PieSlice type inherits from QDeclarativeItem and declares
 its properties with Q_PROPERTY():
 
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h 0
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h 0
 
-To use it from \c Musician, we modify the \c instrument property declaration
+To use it in \c PieChart, we modify the \c color property declaration
 and associated method signatures:
 
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 0
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 0
 \dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 1
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 1
 \dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 2
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 2
 \dots
-\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h 3
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h 3
+
+There is one thing to be aware of when implementing \c setPieSlice(). The \c PieSlice
+is a visual item, so it must be set as a child of the \c PieChart using
+QDeclarativeItem::setParentItem() so that the \c PieChart knows to paint this child
+item when its contents are drawn:
 
-Like the \c Musician type, the \c Instrument type has to be registered
-using qmlRegisterType() to be used from QML. As with \c Musician, we'll add the
-type to the "Music" module, version 1.0:
+\snippet declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp 0
+
+
+Like the \c PieChart type, the \c PieSlice type has to be registered
+using qmlRegisterType() to be used from QML. As with \c PieChart, we'll add the
+type to the "Charts" module, version 1.0:
 
 \snippet declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp 0
 \dots
@@ -298,10 +344,10 @@ Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-custom
 
 \example declarative/tutorials/extending/chapter5-plugins
 
-Currently the \c Musician and \c Instrument types are used by \c app.qml,
+Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
 which is displayed using a QDeclarativeView in a C++ application. An alternative
 way to use our QML extension is to create a plugin library to make it available
-to the QML engine. This means we could load \c app.qml using the \l {QML Viewer}
+to the QML engine. This allows us to load \c app.qml using the \l {QML Viewer}
 (or some other QML \l{Qt Declarative UI Runtime}{runtime} application) instead of writing a \c main.cpp file and
 loading our own C++ application.
 
@@ -313,17 +359,17 @@ To create a plugin library, we need:
 \o A "qmldir" file that tells the QML engine to load the plugin
 \endlist
 
-First, we create a plugin class named \c MusicPlugin. It subclasses QDeclarativeExtensionPlugin
+First, we create a plugin class named \c ChartsPlugin. It subclasses QDeclarativeExtensionPlugin
 and registers our QML types in the inherited \l{QDeclarativeExtensionPlugin::}{registerTypes()} method. It also calls
 Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}.
 
-Here is the \c MusicPlugin definition in \c musicplugin.h:
+Here is the \c ChartsPlugin definition in \c chartsplugin.h:
 
-\snippet declarative/tutorials/extending/chapter5-plugins/musicplugin.h 0
+\snippet declarative/tutorials/extending/chapter5-plugins/chartsplugin.h 0
 
-And its implementation in \c musicplugin.cpp:
+And its implementation in \c chartsplugin.cpp:
 
-\snippet declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp 0
+\snippet declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp 0
 
 Then, we write a \c .pro project file that defines the project as a plugin library
 and specifies with DESTDIR that library files should be built into a "lib" subdirectory:
@@ -345,9 +391,9 @@ the project and then load the QML file in the \l {QML Viewer}:
 
 (On Mac OS X, you can launch the "QMLViewer" application instead.)
 
-Notice the "import Music 1.0" statement has disappeared from \c app.qml. This is
+Notice the "import Charts 1.0" statement has disappeared from \c app.qml. This is
 because the \c qmldir file is in the same directory as \c app.qml: this is equivalent to
-having Musician.qml and Instrument.qml files inside the project directory, which could both
+having PieChart.qml and PieSlice.qml files inside the project directory, which could both
 be used by \c app.qml without import statements.
 */
 
@@ -367,42 +413,39 @@ In this tutorial, we've shown the basic steps for creating a QML extension:
 
 
 The \l {Extending QML in C++} reference documentation shows other useful features that can be added to
-QML extensions. For example, we could use \l{Object and List Property Types}{list properties} to allow multiple instruments for a \c Musician:
+QML extensions. For example, we could use \l{Object and List Property Types}{list properties} to allow multiple slices for a \c PieChart:
 
 \code
-    Musician {
-        instruments: [
-            Instrument { type: "Guitar" }
-            Instrument { type: "Drums" }
-            Instrument { type: "Keyboard" }
+    PieChart {
+        slices: [
+            PieSlice { color: "red" }
+            PieSlice { color: "blue" }
+            PieSlice { color: "yellow" }
         ]
     }
 \endcode
 
 Or use \l{Default Property}{default properties} and avoid an
-\c instruments property altogether:
+\c slices property altogether:
 
 \code
-    Musician {
-        Instrument { type: "Guitar" }
-        Instrument { type: "Drums" }
-        Instrument { type: "Keyboard" }
+    PieChart {
+        PieSlice { color: "red" }
+        PieSlice { color: "blue" }
+        PieSlice { color: "yellow" }
     }
 \endcode
 
-Or even change the \c instrument of a \c Musician from time to time using \l{Property Value Sources}{property value sources}:
+Or even change the \c color of a \c PieChart from time to time using \l{Property Value Sources}{property value sources}:
 
 \code
-    Musician {
-        InstrumentRandomizer on instrument {}
+    PieChart {
+        PieSliceRandomizer on color {}
     }
 \endcode
 
 
 See the \l{Extending QML in C++}{reference documentation} for more information.
 
-Additionally, \l {Integrating QML with existing Qt UI code} shows how to create
-and integrate with QML extensions that have drawing and graphical capabilities (through QGraphicsWidget).
-
 */
 
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/app.qml b/examples/declarative/tutorials/extending/chapter1-basics/app.qml
index 9af155c..ada088d 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/app.qml
+++ b/examples/declarative/tutorials/extending/chapter1-basics/app.qml
@@ -38,21 +38,23 @@
 **
 ****************************************************************************/
 //![0]
-import Music 1.0
+import Charts 1.0
 import Qt 4.7
 
-Rectangle {
+Item {
     width: 300; height: 200
 
-    Musician {
-        id: aMusician
-        name: "Reddy the Rocker"
-        instrument: "Guitar"
+    PieChart {
+        id: aPieChart
+        anchors.centerIn: parent
+        width: 100; height: 100
+        name: "A simple pie chart"
+        color: "red"
     }
 
     Text {
-        anchors.fill: parent
-        text: aMusician.name + " plays the " + aMusician.instrument
+        anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+        text: aPieChart.name
     }
 }
 //![0]
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
index bd05ebe..0f04167 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
+++ b/examples/declarative/tutorials/extending/chapter1-basics/chapter1-basics.pro
@@ -1,5 +1,5 @@
 QT += declarative
 
-HEADERS += musician.h
-SOURCES += musician.cpp \
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
            main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/main.cpp b/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
index 8ef6965..a5dbab3 100644
--- a/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter1-basics/main.cpp
@@ -38,7 +38,7 @@
 **
 ****************************************************************************/
 //![0]
-#include "musician.h"
+#include "piechart.h"
 #include <qdeclarative.h>
 #include <QDeclarativeView>
 #include <QApplication>
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
 
-    qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+    qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
 
     QDeclarativeView view;
     view.setSource(QUrl::fromLocalFile("app.qml"));
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/musician.cpp b/examples/declarative/tutorials/extending/chapter1-basics/musician.cpp
deleted file mode 100644
index 6c42f31..0000000
--- a/examples/declarative/tutorials/extending/chapter1-basics/musician.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musician.h"
-
-Musician::Musician(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Musician::name() const
-{
-    return m_name;
-}
-
-void Musician::setName(const QString &name)
-{
-    m_name = name;
-}
-
-QString Musician::instrument() const
-{
-    return m_instrument;
-}
-
-void Musician::setInstrument(const QString &instrument)
-{
-    m_instrument = instrument;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/musician.h b/examples/declarative/tutorials/extending/chapter1-basics/musician.h
deleted file mode 100644
index f9a0537..0000000
--- a/examples/declarative/tutorials/extending/chapter1-basics/musician.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
-
-//![0]
-#include <QObject>
-
-class Musician : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(QString name READ name WRITE setName)
-    Q_PROPERTY(QString instrument READ instrument WRITE setInstrument)
-
-public:
-    Musician(QObject *parent = 0);
-
-    QString name() const;
-    void setName(const QString &name);
-
-    QString instrument() const;
-    void setInstrument(const QString &instrument);
-
-private:
-    QString m_name;
-    QString m_instrument;
-};
-//![0]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp b/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
new file mode 100644
index 0000000..3b9ef71
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/piechart.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+
+//![0]
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+//![0]
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+QColor PieChart::color() const
+{
+    return m_color;
+}
+
+void PieChart::setColor(const QColor &color)
+{
+    m_color = color;
+}
+
+//![1]
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+//![1]
+
diff --git a/examples/declarative/tutorials/extending/chapter1-basics/piechart.h b/examples/declarative/tutorials/extending/chapter1-basics/piechart.h
new file mode 100644
index 0000000..aae7b26
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter1-basics/piechart.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+//![0]
+#include <QDeclarativeItem>
+#include <QColor>
+
+class PieChart : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QString name READ name WRITE setName)
+    Q_PROPERTY(QColor color READ color WRITE setColor)
+
+public:
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+    QColor color() const;
+    void setColor(const QColor &color);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+    QString m_name;
+    QColor m_color;
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/app.qml b/examples/declarative/tutorials/extending/chapter2-methods/app.qml
index 02d33c2..0b55f7c 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/app.qml
+++ b/examples/declarative/tutorials/extending/chapter2-methods/app.qml
@@ -38,23 +38,29 @@
 **
 ****************************************************************************/
 //![0]
-import Music 1.0
+import Charts 1.0
 import Qt 4.7
 
-Rectangle {
-    width: 200; height: 200
+Item {
+    width: 300; height: 200
 
-    Musician {
-        id: aMusician
-        name: "Reddy the Rocker"
-        instrument: "Guitar"
+    PieChart {
+        id: aPieChart
+        anchors.centerIn: parent
+        width: 100; height: 100
+        color: "red"
 
-        onPerformanceEnded: console.log("The performance has now ended")
+        onChartCleared: console.log("The chart has been cleared")
     }
 
     MouseArea {
         anchors.fill: parent
-        onClicked: aMusician.perform()
+        onClicked: aPieChart.clearChart()
+    }
+
+    Text {
+        anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+        text: "Click anywhere to clear the chart"
     }
 }
 //![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
index bd05ebe..0f04167 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
+++ b/examples/declarative/tutorials/extending/chapter2-methods/chapter2-methods.pro
@@ -1,5 +1,5 @@
 QT += declarative
 
-HEADERS += musician.h
-SOURCES += musician.cpp \
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
            main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/main.cpp b/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
index 8ef6965..a5dbab3 100644
--- a/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter2-methods/main.cpp
@@ -38,7 +38,7 @@
 **
 ****************************************************************************/
 //![0]
-#include "musician.h"
+#include "piechart.h"
 #include <qdeclarative.h>
 #include <QDeclarativeView>
 #include <QApplication>
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
 
-    qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+    qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
 
     QDeclarativeView view;
     view.setSource(QUrl::fromLocalFile("app.qml"));
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/musician.cpp b/examples/declarative/tutorials/extending/chapter2-methods/musician.cpp
deleted file mode 100644
index 0ce0022..0000000
--- a/examples/declarative/tutorials/extending/chapter2-methods/musician.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musician.h"
-#include <QDebug>
-
-Musician::Musician(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Musician::name() const
-{
-    return m_name;
-}
-
-void Musician::setName(const QString &name)
-{
-    m_name = name;
-}
-
-QString Musician::instrument() const
-{
-    return m_instrument;
-}
-
-void Musician::setInstrument(const QString &instrument)
-{
-    m_instrument = instrument;
-}
-
-//![0]
-void Musician::perform()
-{
-    qWarning() << m_name << "is playing the" << m_instrument;
-    emit performanceEnded();
-}
-//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/musician.h b/examples/declarative/tutorials/extending/chapter2-methods/musician.h
deleted file mode 100644
index 86849ba..0000000
--- a/examples/declarative/tutorials/extending/chapter2-methods/musician.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
-
-#include <QObject>
-
-//![0]
-class Musician : public QObject
-{
-//![0]
-    Q_OBJECT
-    Q_PROPERTY(QString name READ name WRITE setName)
-    Q_PROPERTY(QString instrument READ instrument WRITE setInstrument)
-
-//![1]
-public:
-//![1]
-
-    Musician(QObject *parent = 0);
-
-    QString name() const;
-    void setName(const QString &name);
-
-    QString instrument() const;
-    void setInstrument(const QString &instrument);
-
-//![2]
-    Q_INVOKABLE void perform();
-
-signals:
-    void performanceEnded();
-//![2]
-
-private:
-    QString m_name;
-    QString m_instrument;
-
-//![3]
-};
-//![3]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp b/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
new file mode 100644
index 0000000..11ff7c8
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/piechart.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+#include <QDebug>
+
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+QColor PieChart::color() const
+{
+    return m_color;
+}
+
+void PieChart::setColor(const QColor &color)
+{
+    m_color = color;
+}
+
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
+//![0]
+void PieChart::clearChart()
+{
+    setColor(QColor(Qt::transparent));
+    update();
+
+    emit chartCleared();
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter2-methods/piechart.h b/examples/declarative/tutorials/extending/chapter2-methods/piechart.h
new file mode 100644
index 0000000..246fd9f
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter2-methods/piechart.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+//![0]
+    Q_OBJECT
+    Q_PROPERTY(QString name READ name WRITE setName)
+    Q_PROPERTY(QColor color READ color WRITE setColor)
+
+//![1]
+public:
+//![1]
+
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+    QColor color() const;
+    void setColor(const QColor &color);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+//![2]
+    Q_INVOKABLE void clearChart();
+
+signals:
+    void chartCleared();
+//![2]
+
+private:
+    QString m_name;
+    QColor m_color;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
index 8bf6ecf..2ff6ae1 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/app.qml
@@ -38,35 +38,37 @@
 **
 ****************************************************************************/
 //![0]
-import Music 1.0
+import Charts 1.0
 import Qt 4.7
 
-Rectangle {
-    width: 200; height: 200
+Item {
+    width: 300; height: 200
 
-    Musician {
-        id: reddy
-        name: "Reddy the Rocker"
-        instrument: "Guitar"
-    }
+    Row {
+        anchors.centerIn: parent
+        spacing: 20
+
+        PieChart {
+            id: chartA
+            width: 100; height: 100
+            color: "red"
+        }
 
-    Musician {
-        id: craig
-        name: "Craig the Copycat"
-        instrument: reddy.instrument
+        PieChart {
+            id: chartB
+            width: 100; height: 100
+            color: chartA.color
+        }
     }
 
     MouseArea {
         anchors.fill: parent
-        onClicked: {
-            reddy.perform()
-            craig.perform()
-
-            reddy.instrument = "Drums"
+        onClicked: { chartA.color = "blue" }
+    }
 
-            reddy.perform()
-            craig.perform()
-        }
+    Text {
+        anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 20 }
+        text: "Click anywhere to change the chart color"
     }
 }
 //![0]
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
index bd05ebe..0f04167 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
@@ -1,5 +1,5 @@
 QT += declarative
 
-HEADERS += musician.h
-SOURCES += musician.cpp \
+HEADERS += piechart.h
+SOURCES += piechart.cpp \
            main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
index 8ef6965..a5dbab3 100644
--- a/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/main.cpp
@@ -38,7 +38,7 @@
 **
 ****************************************************************************/
 //![0]
-#include "musician.h"
+#include "piechart.h"
 #include <qdeclarative.h>
 #include <QDeclarativeView>
 #include <QApplication>
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
 
-    qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+    qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
 
     QDeclarativeView view;
     view.setSource(QUrl::fromLocalFile("app.qml"));
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp
deleted file mode 100644
index 5f9ead4..0000000
--- a/examples/declarative/tutorials/extending/chapter3-bindings/musician.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musician.h"
-#include <QDebug>
-
-Musician::Musician(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Musician::name() const
-{
-    return m_name;
-}
-
-void Musician::setName(const QString &name)
-{
-    m_name = name;
-}
-
-QString Musician::instrument() const
-{
-    return m_instrument;
-}
-
-//![0]
-void Musician::setInstrument(const QString &instrument)
-{
-    if (instrument != m_instrument) {
-        m_instrument = instrument;
-        emit instrumentChanged();
-    }
-}
-//![0]
-
-void Musician::perform()
-{
-    qWarning() << m_name << "is playing the" << m_instrument;
-}
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/musician.h b/examples/declarative/tutorials/extending/chapter3-bindings/musician.h
deleted file mode 100644
index 0b0addb..0000000
--- a/examples/declarative/tutorials/extending/chapter3-bindings/musician.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
-
-#include <QObject>
-
-//![0]
-class Musician : public QObject
-{
-//![0]
-    Q_OBJECT
-    Q_PROPERTY(QString name READ name WRITE setName)
-    Q_PROPERTY(QString instrument READ instrument WRITE setInstrument)
-
-//![1]
-    Q_PROPERTY(QString instrument READ instrument WRITE setInstrument NOTIFY instrumentChanged)
-public:
-//![1]
-
-    Musician(QObject *parent = 0);
-
-    QString name() const;
-    void setName(const QString &name);
-
-    QString instrument() const;
-    void setInstrument(const QString &instrument);
-
-    Q_INVOKABLE void perform();
-
-//![2]
-signals:
-    void instrumentChanged();
-//![2]
-
-private:
-    QString m_name;
-    QString m_instrument;
-
-//![3]
-};
-//![3]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
new file mode 100644
index 0000000..85a9762
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.cpp
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include <QPainter>
+#include <QDebug>
+
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+QColor PieChart::color() const
+{
+    return m_color;
+}
+
+//![0]
+void PieChart::setColor(const QColor &color)
+{
+    if (color != m_color) {
+        m_color = color;
+        update();   // repaint with the new color
+        emit colorChanged();
+    }
+}
+//![0]
+
+void PieChart::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
+void PieChart::clearChart()
+{
+    setColor(QColor(Qt::transparent));
+    update();
+}
diff --git a/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
new file mode 100644
index 0000000..164cebb
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter3-bindings/piechart.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+//![0]
+    Q_OBJECT
+    Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+public:
+//![1]
+
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+    QColor color() const;
+    void setColor(const QColor &color);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+    Q_INVOKABLE void clearChart();
+
+//![2]
+signals:
+    void colorChanged();
+//![2]
+
+private:
+    QString m_name;
+    QColor m_color;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
index d76f801..fcd3806 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/app.qml
@@ -38,17 +38,23 @@
 **
 ****************************************************************************/
 //![0]
-import Music 1.0
+import Charts 1.0
 import Qt 4.7
 
 Item {
+    width: 300; height: 200
 
-    Musician {
-        id: reddy
-        name: "Reddy the Rocker"
-        instrument: Instrument { type: "Guitar" }
+    PieChart {
+        id: chart
+        anchors.centerIn: parent
+        width: 100; height: 100
+
+        pieSlice: PieSlice { 
+            anchors.fill: parent
+            color: "red" 
+        }
     }
 
-    Component.onCompleted: console.log("Reddy plays the " + reddy.instrument.type)
+    Component.onCompleted: console.log("The pie is colored " + chart.pieSlice.color)
 }
 //![0]
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
index aea07a0..c3f5402 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
@@ -1,7 +1,7 @@
 QT += declarative
 
-HEADERS += musician.h \
-           instrument.h 
-SOURCES += musician.cpp \
-           instrument.cpp \
+HEADERS += piechart.h \
+           pieslice.h 
+SOURCES += piechart.cpp \
+           pieslice.cpp \
            main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp
deleted file mode 100644
index 9ca96f6..0000000
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "instrument.h"
-
-Instrument::Instrument(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Instrument::type() const
-{
-    return m_type;
-}
-
-void Instrument::setType(const QString &type)
-{
-    m_type = type;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h
deleted file mode 100644
index 9971207..0000000
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/instrument.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef INSTRUMENT_H
-#define INSTRUMENT_H
-
-#include <QObject>
-
-//![0]
-class Instrument : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(QString type READ type WRITE setType)
-
-public:
-    Instrument(QObject *parent = 0);
-
-    QString type() const;
-    void setType(const QString &type);
-
-private:
-    QString m_type;
-};
-//![0]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
index d94cb03..fd518a2 100644
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/main.cpp
@@ -37,8 +37,8 @@
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
-#include "musician.h"
-#include "instrument.h"
+#include "piechart.h"
+#include "pieslice.h"
 
 #include <qdeclarative.h>
 #include <QDeclarativeView>
@@ -50,10 +50,10 @@ int main(int argc, char *argv[])
 //![0]
     QApplication app(argc, argv);
 
-    qmlRegisterType<Musician>("Music", 1, 0, "Musician");
+    qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
 
 //![1]
-    qmlRegisterType<Instrument>("Music", 1, 0, "Instrument");
+    qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
 //![1]
 
     QDeclarativeView view;
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp
deleted file mode 100644
index e62efb1..0000000
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musician.h"
-#include "instrument.h"
-
-Musician::Musician(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Musician::name() const
-{
-    return m_name;
-}
-
-void Musician::setName(const QString &name)
-{
-    m_name = name;
-}
-
-Instrument *Musician::instrument() const
-{
-    return m_instrument;
-}
-
-void Musician::setInstrument(Instrument *instrument)
-{
-    m_instrument = instrument;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h
deleted file mode 100644
index 8f67f61..0000000
--- a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/musician.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
-
-#include <QObject>
-
-class Instrument;
-
-//![0]
-class Musician : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(Instrument* instrument READ instrument WRITE setInstrument)
-//![0]
-    Q_PROPERTY(QString name READ name WRITE setName)
-
-//![1]
-public:
-//![1]
-
-    Musician(QObject *parent = 0);
-
-    QString name() const;
-    void setName(const QString &name);
-
-//![2]
-    Instrument *instrument() const;
-    void setInstrument(Instrument *instrument);
-//![2]
-
-private:
-    QString m_name;
-    Instrument *m_instrument;
-
-//![3]
-};
-//![3]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
new file mode 100644
index 0000000..7098854
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // this doesn't need to disable QGraphicsItem::ItemHasNoContents
+    // anymore since the drawing is now done in PieSlice
+}
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+PieSlice *PieChart::pieSlice() const
+{
+    return m_pieSlice;
+}
+
+//![0]
+void PieChart::setPieSlice(PieSlice *pieSlice)
+{
+    m_pieSlice = pieSlice;
+    pieSlice->setParentItem(this);
+}
+//![0]
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
new file mode 100644
index 0000000..448ca7b
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/piechart.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice)
+//![0]
+    Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+public:
+//![1]
+
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+//![2]
+    PieSlice *pieSlice() const;
+    void setPieSlice(PieSlice *pieSlice);
+//![2]
+
+private:
+    QString m_name;
+    PieSlice *m_pieSlice;
+
+//![3]
+};
+//![3]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
new file mode 100644
index 0000000..7a420fd
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+    return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+    m_color = color;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
new file mode 100644
index 0000000..085a9b8
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter4-customPropertyTypes/pieslice.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieSlice : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QColor color READ color WRITE setColor)
+
+public:
+    PieSlice(QDeclarativeItem *parent = 0);
+
+    QColor color() const;
+    void setColor(const QColor &color);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+    QColor m_color;
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/app.qml b/examples/declarative/tutorials/extending/chapter5-plugins/app.qml
index 9c050b8..b06e399 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/app.qml
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/app.qml
@@ -41,13 +41,19 @@
 import Qt 4.7
 
 Item {
+    width: 300; height: 200
 
-    Musician {
-        id: reddy
-        name: "Reddy the Rocker"
-        instrument: Instrument { type: "Guitar" }
+    PieChart {
+        id: chart
+        anchors.centerIn: parent
+        width: 100; height: 100
+
+        pieSlice: PieSlice { 
+            anchors.fill: parent
+            color: "red" 
+        }
     }
 
-    Component.onCompleted: console.log("Reddy plays the " + reddy.instrument.type)
+    Component.onCompleted: console.log("The pie is colored " + chart.pieSlice.color)
 }
 
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro b/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
index 483da8f..1ffbf29 100644
--- a/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
@@ -6,13 +6,13 @@ DESTDIR = lib
 OBJECTS_DIR = tmp
 MOC_DIR = tmp
 
-HEADERS += musician.h \
-           instrument.h \
-           musicplugin.h
+HEADERS += piechart.h \
+           pieslice.h \
+           chartsplugin.h
 
-SOURCES += musician.cpp \
-           instrument.cpp \
-           musicplugin.cpp
+SOURCES += piechart.cpp \
+           pieslice.cpp \
+           chartsplugin.cpp
 
 symbian {
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp
new file mode 100644
index 0000000..5aa2a4b
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "chartsplugin.h"
+//![0]
+#include "piechart.h"
+#include "pieslice.h"
+#include <QtDeclarative/qdeclarative.h>
+
+void ChartsPlugin::registerTypes(const char *uri)
+{
+    qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
+    qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
+}
+
+Q_EXPORT_PLUGIN2(chartsplugin, ChartsPlugin);
+//![0]
+
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h b/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h
new file mode 100644
index 0000000..797d1e7
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef CHARTSPLUGIN_H
+#define CHARTSPLUGIN_H
+
+//![0]
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class ChartsPlugin : public QDeclarativeExtensionPlugin
+{
+    Q_OBJECT
+public:
+    void registerTypes(const char *uri);
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp
deleted file mode 100644
index 9ca96f6..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "instrument.h"
-
-Instrument::Instrument(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Instrument::type() const
-{
-    return m_type;
-}
-
-void Instrument::setType(const QString &type)
-{
-    m_type = type;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.h b/examples/declarative/tutorials/extending/chapter5-plugins/instrument.h
deleted file mode 100644
index ce1e7ce..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/instrument.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef INSTRUMENT_H
-#define INSTRUMENT_H
-
-#include <QObject>
-
-class Instrument : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(QString type READ type WRITE setType)
-
-public:
-    Instrument(QObject *parent = 0);
-
-    QString type() const;
-    void setType(const QString &type);
-
-private:
-    QString m_type;
-};
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp
deleted file mode 100644
index e62efb1..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musician.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musician.h"
-#include "instrument.h"
-
-Musician::Musician(QObject *parent)
-    : QObject(parent)
-{
-}
-
-QString Musician::name() const
-{
-    return m_name;
-}
-
-void Musician::setName(const QString &name)
-{
-    m_name = name;
-}
-
-Instrument *Musician::instrument() const
-{
-    return m_instrument;
-}
-
-void Musician::setInstrument(Instrument *instrument)
-{
-    m_instrument = instrument;
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musician.h b/examples/declarative/tutorials/extending/chapter5-plugins/musician.h
deleted file mode 100644
index b920631..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musician.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef MUSICIAN_H
-#define MUSICIAN_H
-
-#include <QObject>
-
-class Instrument;
-
-class Musician : public QObject
-{
-    Q_OBJECT
-    Q_PROPERTY(QString name READ name WRITE setName)
-    Q_PROPERTY(Instrument* instrument READ instrument WRITE setInstrument)
-
-public:
-    Musician(QObject *parent = 0);
-
-    QString name() const;
-    void setName(const QString &name);
-
-    Instrument *instrument() const;
-    void setInstrument(Instrument *instrument);
-
-private:
-    QString m_name;
-    Instrument *m_instrument;
-};
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp
deleted file mode 100644
index 76acf01..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "musicplugin.h"
-//![0]
-#include "musician.h"
-#include "instrument.h"
-#include <QtDeclarative/qdeclarative.h>
-
-void MusicPlugin::registerTypes(const char *uri)
-{
-    qmlRegisterType<Musician>(uri, 1, 0, "Musician");
-    qmlRegisterType<Instrument>(uri, 1, 0, "Instrument");
-}
-
-Q_EXPORT_PLUGIN2(musicplugin, MusicPlugin);
-//![0]
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h b/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h
deleted file mode 100644
index d6a5392..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/musicplugin.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef MUSICPLUGIN_H
-#define MUSICPLUGIN_H
-
-//![0]
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-
-class MusicPlugin : public QDeclarativeExtensionPlugin
-{
-    Q_OBJECT
-public:
-    void registerTypes(const char *uri);
-};
-//![0]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp
new file mode 100644
index 0000000..2d7acf7
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+}
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+PieSlice *PieChart::pieSlice() const
+{
+    return m_pieSlice;
+}
+
+void PieChart::setPieSlice(PieSlice *pieSlice)
+{
+    m_pieSlice = pieSlice;
+    m_pieSlice->setParentItem(this);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/piechart.h b/examples/declarative/tutorials/extending/chapter5-plugins/piechart.h
new file mode 100644
index 0000000..a8b5b6e
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/piechart.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+class PieChart : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QString name READ name WRITE setName)
+    Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice)
+
+public:
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+    PieSlice *pieSlice() const;
+    void setPieSlice(PieSlice *pieSlice);
+
+private:
+    QString m_name;
+    PieSlice *m_pieSlice;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp
new file mode 100644
index 0000000..a312da3
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+    return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+    m_color = color;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
+}
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h b/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h
new file mode 100644
index 0000000..6774731
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+class PieSlice : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QColor color READ color WRITE setColor)
+
+public:
+    PieSlice(QDeclarativeItem *parent = 0);
+
+    QColor color() const;
+    void setColor(const QColor &QColor);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+    QColor m_color;
+};
+
+#endif
+
-- 
cgit v0.12


From fb8869e00da635be7660d845d4cb631d230bed6e Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Thu, 15 Jul 2010 13:23:26 +1000
Subject: fix spelling

---
 src/declarative/qml/qdeclarativelist.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp
index 7c89672..9598d98 100644
--- a/src/declarative/qml/qdeclarativelist.cpp
+++ b/src/declarative/qml/qdeclarativelist.cpp
@@ -306,7 +306,7 @@ int QDeclarativeListReference::count() const
 /*!
 \class QDeclarativeListProperty
 \since 4.7
-\brief The QDeclarativeListProperty class allows applications to explose list-like 
+\brief The QDeclarativeListProperty class allows applications to expose list-like 
 properties to QML.
 
 QML has many list properties, where more than one object value can be assigned.
-- 
cgit v0.12


From 7d0b62158471d46db9902ce0d0d7b7244c743cce Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Thu, 15 Jul 2010 15:29:20 +1000
Subject: Add chapter on creating list property types

---
 doc/src/declarative/extending-tutorial.qdoc        | 103 ++++++++++++++-------
 .../pics/extending-tutorial-chapter1.png           | Bin 0 -> 6687 bytes
 .../pics/extending-tutorial-chapter2.png           | Bin 0 -> 7318 bytes
 .../pics/extending-tutorial-chapter3.png           | Bin 0 -> 8145 bytes
 .../pics/extending-tutorial-chapter5.png           | Bin 0 -> 5557 bytes
 .../tutorials/extending/chapter5-plugins/app.qml   |  59 ------------
 .../chapter5-plugins/chapter5-plugins.pro          |  20 ----
 .../extending/chapter5-plugins/chartsplugin.cpp    |  54 -----------
 .../extending/chapter5-plugins/chartsplugin.h      |  55 -----------
 .../extending/chapter5-plugins/piechart.cpp        |  68 --------------
 .../extending/chapter5-plugins/piechart.h          |  68 --------------
 .../extending/chapter5-plugins/pieslice.cpp        |  67 --------------
 .../extending/chapter5-plugins/pieslice.h          |  64 -------------
 .../tutorials/extending/chapter5-plugins/qmldir    |   1 -
 .../tutorials/extending/chapter6-plugins/app.qml   |  68 ++++++++++++++
 .../chapter6-plugins/chapter6-plugins.pro          |  20 ++++
 .../extending/chapter6-plugins/chartsplugin.cpp    |  54 +++++++++++
 .../extending/chapter6-plugins/chartsplugin.h      |  55 +++++++++++
 .../extending/chapter6-plugins/piechart.cpp        |  71 ++++++++++++++
 .../extending/chapter6-plugins/piechart.h          |  69 ++++++++++++++
 .../extending/chapter6-plugins/pieslice.cpp        |  88 ++++++++++++++++++
 .../extending/chapter6-plugins/pieslice.h          |  74 +++++++++++++++
 .../tutorials/extending/chapter6-plugins/qmldir    |   1 +
 23 files changed, 572 insertions(+), 487 deletions(-)
 create mode 100644 doc/src/declarative/pics/extending-tutorial-chapter1.png
 create mode 100644 doc/src/declarative/pics/extending-tutorial-chapter2.png
 create mode 100644 doc/src/declarative/pics/extending-tutorial-chapter3.png
 create mode 100644 doc/src/declarative/pics/extending-tutorial-chapter5.png
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/app.qml
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/piechart.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h
 delete mode 100644 examples/declarative/tutorials/extending/chapter5-plugins/qmldir
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/app.qml
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
 create mode 100644 examples/declarative/tutorials/extending/chapter6-plugins/qmldir

diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index 9170c5c..cc93e86 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -48,8 +48,9 @@ Tutorial chapters:
 \o \l{declarative/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals}
 \o \l{declarative/tutorials/extending/chapter3-bindings}{Adding Property Bindings}
 \o \l{declarative/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types}
-\o \l{declarative/tutorials/extending/chapter5-plugins}{Writing an Extension Plugin}
-\o \l{qml-extending-tutorial6.html}{In Summary}
+\o \l{declarative/tutorials/extending/chapter5-listproperties}{Using List Property Types}
+\o \l{declarative/tutorials/extending/chapter6-plugins}{Writing an Extension Plugin}
+\o \l{qml-extending-tutorial7.html}{In Summary}
 \endlist
 
 */
@@ -339,15 +340,65 @@ Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-custom
 
 */
 
+
+/*!
+\title Chapter 5: Using List Property Types
+
+\example declarative/tutorials/extending/chapter5-listproperties
+
+Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would
+have multiple slices, with different colors and sizes. To do this, we could
+have a \c slices property that accepts a list of \c PieSlice items:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/app.qml 0
+
+\image extending-tutorial-chapter5.png
+
+To do this, we replace the \c pieSlice property in \c PieChart with a \c slices property,
+declared as a QDeclarativeListProperty type. The QDeclarativeListProperty class enables the 
+creation of list properties in QML extensions. We replace the \c pieSlice()
+function with a \c slices() function that returns a list of slices, and add 
+an internal \c append_slice() function (discussed below). We also use a QList to 
+store the internal list of slices as \c m_slices:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 0
+\dots
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 1
+\dots
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.h 2
+
+Although the \c slices property does not have an associated \c WRITE function,
+it is still modifiable because of the way QDeclarativeListProperty works.
+In the \c PieChart implementation, we implement \c PieChart::slices() to
+return a QDeclarativeListProperty value and indicate that the internal
+\c PieChart::append_slice() function is to be called whenever a request is made from QML
+to add items to the list:
+
+\snippet declarative/tutorials/extending/chapter5-listproperties/piechart.cpp 0
+
+The \c append_slice() function simply sets the parent item as before,
+and adds the new item to the \c m_slices list. As you can see, the append function for a
+QDeclarativeListProperty is called with two arguments: the list property, and
+the item that is to be appended.
+
+The \c PieSlice class has also been modified to include \c fromAngle and \c angleSpan
+properties and to draw the slice according to these values. This is a straightforward
+modification if you have read the previous pages in this tutorial, so the code is not shown here.
+
+The complete code can be seen in the updated \c examples/tutorials/extending/chapter5-listproperties directory.
+
+*/
+
+
 /*!
-\title Chapter 5: Writing an Extension Plugin
+\title Chapter 6: Writing an Extension Plugin
 
-\example declarative/tutorials/extending/chapter5-plugins
+\example declarative/tutorials/extending/chapter6-plugins
 
 Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
 which is displayed using a QDeclarativeView in a C++ application. An alternative
 way to use our QML extension is to create a plugin library to make it available
-to the QML engine. This allows us to load \c app.qml using the \l {QML Viewer}
+to the QML engine. This allows \c app.qml to be loaded with the \l {QML Viewer}
 (or some other QML \l{Qt Declarative UI Runtime}{runtime} application) instead of writing a \c main.cpp file and
 loading our own C++ application.
 
@@ -365,22 +416,22 @@ Q_EXPORT_PLUGIN2 for Qt's \l{How to Create Qt Plugins}{plugin system}.
 
 Here is the \c ChartsPlugin definition in \c chartsplugin.h:
 
-\snippet declarative/tutorials/extending/chapter5-plugins/chartsplugin.h 0
+\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.h 0
 
 And its implementation in \c chartsplugin.cpp:
 
-\snippet declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp 0
+\snippet declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
 
 Then, we write a \c .pro project file that defines the project as a plugin library
 and specifies with DESTDIR that library files should be built into a "lib" subdirectory:
 
-\quotefile declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
+\quotefile declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
 
 Finally, we add a \c qmldir file that is automatically parsed by the QML engine.
-Here, we specify that a plugin named "chapter5-plugin" (the name
+Here, we specify that a plugin named "chapter6-plugin" (the name
 of the example project) can be found in the "lib" subdirectory:
 
-\quotefile declarative/tutorials/extending/chapter5-plugins/qmldir
+\quotefile declarative/tutorials/extending/chapter6-plugins/qmldir
 
 Now we have a plugin, and instead of having a main.cpp and an executable, we can build
 the project and then load the QML file in the \l {QML Viewer}:
@@ -397,9 +448,10 @@ having PieChart.qml and PieSlice.qml files inside the project directory, which c
 be used by \c app.qml without import statements.
 */
 
+
 /*!
-\page qml-extending-tutorial6.html
-\title Chapter 6: In Summary
+\page qml-extending-tutorial7.html
+\title Chapter 7: In Summary
 
 In this tutorial, we've shown the basic steps for creating a QML extension:
 
@@ -408,39 +460,28 @@ In this tutorial, we've shown the basic steps for creating a QML extension:
 \o Add callable methods using Q_INVOKABLE or Qt slots, and connect to Qt signals with an \c onSignal syntax
 \o Add property bindings by defining \l{Qt's Property System}{NOTIFY} signals
 \o Define custom property types if the built-in types are not sufficient
+\o Define list property types using QDeclarativeListProperty
 \o Create a plugin library by defining a Qt plugin and writing a \c qmldir file
 \endlist
 
 
 The \l {Extending QML in C++} reference documentation shows other useful features that can be added to
-QML extensions. For example, we could use \l{Object and List Property Types}{list properties} to allow multiple slices for a \c PieChart:
-
-\code
-    PieChart {
-        slices: [
-            PieSlice { color: "red" }
-            PieSlice { color: "blue" }
-            PieSlice { color: "yellow" }
-        ]
-    }
-\endcode
-
-Or use \l{Default Property}{default properties} and avoid an
-\c slices property altogether:
+QML extensions. For example, we could use \l{Default Property}{default properties} to allow 
+slices to be added without using the \c slices property:
 
 \code
     PieChart {
-        PieSlice { color: "red" }
-        PieSlice { color: "blue" }
-        PieSlice { color: "yellow" }
+        PieSlice { ... }
+        PieSlice { ... }
+        PieSlice { ... }
     }
 \endcode
 
-Or even change the \c color of a \c PieChart from time to time using \l{Property Value Sources}{property value sources}:
+Or randomly add and remove slices from time to time using \l{Property Value Sources}{property value sources}:
 
 \code
     PieChart {
-        PieSliceRandomizer on color {}
+        PieSliceRandomizer on slices {}
     }
 \endcode
 
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter1.png b/doc/src/declarative/pics/extending-tutorial-chapter1.png
new file mode 100644
index 0000000..9f5836b
Binary files /dev/null and b/doc/src/declarative/pics/extending-tutorial-chapter1.png differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter2.png b/doc/src/declarative/pics/extending-tutorial-chapter2.png
new file mode 100644
index 0000000..5c8f222
Binary files /dev/null and b/doc/src/declarative/pics/extending-tutorial-chapter2.png differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter3.png b/doc/src/declarative/pics/extending-tutorial-chapter3.png
new file mode 100644
index 0000000..825553f
Binary files /dev/null and b/doc/src/declarative/pics/extending-tutorial-chapter3.png differ
diff --git a/doc/src/declarative/pics/extending-tutorial-chapter5.png b/doc/src/declarative/pics/extending-tutorial-chapter5.png
new file mode 100644
index 0000000..0c2e69e
Binary files /dev/null and b/doc/src/declarative/pics/extending-tutorial-chapter5.png differ
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/app.qml b/examples/declarative/tutorials/extending/chapter5-plugins/app.qml
deleted file mode 100644
index b06e399..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/app.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt 4.7
-
-Item {
-    width: 300; height: 200
-
-    PieChart {
-        id: chart
-        anchors.centerIn: parent
-        width: 100; height: 100
-
-        pieSlice: PieSlice { 
-            anchors.fill: parent
-            color: "red" 
-        }
-    }
-
-    Component.onCompleted: console.log("The pie is colored " + chart.pieSlice.color)
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro b/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
deleted file mode 100644
index 1ffbf29..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/chapter5-plugins.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = lib
-CONFIG += qt plugin
-QT += declarative
-
-DESTDIR = lib
-OBJECTS_DIR = tmp
-MOC_DIR = tmp
-
-HEADERS += piechart.h \
-           pieslice.h \
-           chartsplugin.h
-
-SOURCES += piechart.cpp \
-           pieslice.cpp \
-           chartsplugin.cpp
-
-symbian {
-    include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-    TARGET.EPOCALLOWDLLDATA = 1
-}
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp
deleted file mode 100644
index 5aa2a4b..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "chartsplugin.h"
-//![0]
-#include "piechart.h"
-#include "pieslice.h"
-#include <QtDeclarative/qdeclarative.h>
-
-void ChartsPlugin::registerTypes(const char *uri)
-{
-    qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
-    qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
-}
-
-Q_EXPORT_PLUGIN2(chartsplugin, ChartsPlugin);
-//![0]
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h b/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h
deleted file mode 100644
index 797d1e7..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/chartsplugin.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef CHARTSPLUGIN_H
-#define CHARTSPLUGIN_H
-
-//![0]
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-
-class ChartsPlugin : public QDeclarativeExtensionPlugin
-{
-    Q_OBJECT
-public:
-    void registerTypes(const char *uri);
-};
-//![0]
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp
deleted file mode 100644
index 2d7acf7..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/piechart.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "piechart.h"
-#include "pieslice.h"
-
-PieChart::PieChart(QDeclarativeItem *parent)
-    : QDeclarativeItem(parent)
-{
-}
-
-QString PieChart::name() const
-{
-    return m_name;
-}
-
-void PieChart::setName(const QString &name)
-{
-    m_name = name;
-}
-
-PieSlice *PieChart::pieSlice() const
-{
-    return m_pieSlice;
-}
-
-void PieChart::setPieSlice(PieSlice *pieSlice)
-{
-    m_pieSlice = pieSlice;
-    m_pieSlice->setParentItem(this);
-}
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/piechart.h b/examples/declarative/tutorials/extending/chapter5-plugins/piechart.h
deleted file mode 100644
index a8b5b6e..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/piechart.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef PIECHART_H
-#define PIECHART_H
-
-#include <QDeclarativeItem>
-
-class PieSlice;
-
-class PieChart : public QDeclarativeItem
-{
-    Q_OBJECT
-    Q_PROPERTY(QString name READ name WRITE setName)
-    Q_PROPERTY(PieSlice* pieSlice READ pieSlice WRITE setPieSlice)
-
-public:
-    PieChart(QDeclarativeItem *parent = 0);
-
-    QString name() const;
-    void setName(const QString &name);
-
-    PieSlice *pieSlice() const;
-    void setPieSlice(PieSlice *pieSlice);
-
-private:
-    QString m_name;
-    PieSlice *m_pieSlice;
-};
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp b/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp
deleted file mode 100644
index a312da3..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "pieslice.h"
-
-#include <QPainter>
-
-PieSlice::PieSlice(QDeclarativeItem *parent)
-    : QDeclarativeItem(parent)
-{
-    // need to disable this flag to draw inside a QDeclarativeItem
-    setFlag(QGraphicsItem::ItemHasNoContents, false);
-}
-
-QColor PieSlice::color() const
-{
-    return m_color;
-}
-
-void PieSlice::setColor(const QColor &color)
-{
-    m_color = color;
-}
-
-void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
-    QPen pen(m_color, 2);
-    painter->setPen(pen);
-    painter->setRenderHints(QPainter::Antialiasing, true);
-    painter->drawPie(boundingRect(), 90 * 16, 290 * 16);
-}
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h b/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h
deleted file mode 100644
index 6774731..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/pieslice.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef PIESLICE_H
-#define PIESLICE_H
-
-#include <QDeclarativeItem>
-#include <QColor>
-
-class PieSlice : public QDeclarativeItem
-{
-    Q_OBJECT
-    Q_PROPERTY(QColor color READ color WRITE setColor)
-
-public:
-    PieSlice(QDeclarativeItem *parent = 0);
-
-    QColor color() const;
-    void setColor(const QColor &QColor);
-
-    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-
-private:
-    QColor m_color;
-};
-
-#endif
-
diff --git a/examples/declarative/tutorials/extending/chapter5-plugins/qmldir b/examples/declarative/tutorials/extending/chapter5-plugins/qmldir
deleted file mode 100644
index c3afd6b..0000000
--- a/examples/declarative/tutorials/extending/chapter5-plugins/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin chapter5-plugins lib
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/app.qml b/examples/declarative/tutorials/extending/chapter6-plugins/app.qml
new file mode 100644
index 0000000..38ceefa
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/app.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+Item {
+    width: 300; height: 200
+
+    PieChart {
+        anchors.centerIn: parent
+        width: 100; height: 100
+
+        slices: [
+            PieSlice { 
+                anchors.fill: parent
+                color: "red"
+                fromAngle: 0; angleSpan: 110 
+            },
+            PieSlice { 
+                anchors.fill: parent
+                color: "black"
+                fromAngle: 110; angleSpan: 50 
+            },
+            PieSlice { 
+                anchors.fill: parent
+                color: "blue"
+                fromAngle: 160; angleSpan: 100
+            }
+        ]
+    }
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
new file mode 100644
index 0000000..1ffbf29
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
@@ -0,0 +1,20 @@
+TEMPLATE = lib
+CONFIG += qt plugin
+QT += declarative
+
+DESTDIR = lib
+OBJECTS_DIR = tmp
+MOC_DIR = tmp
+
+HEADERS += piechart.h \
+           pieslice.h \
+           chartsplugin.h
+
+SOURCES += piechart.cpp \
+           pieslice.cpp \
+           chartsplugin.cpp
+
+symbian {
+    include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+    TARGET.EPOCALLOWDLLDATA = 1
+}
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
new file mode 100644
index 0000000..5aa2a4b
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "chartsplugin.h"
+//![0]
+#include "piechart.h"
+#include "pieslice.h"
+#include <QtDeclarative/qdeclarative.h>
+
+void ChartsPlugin::registerTypes(const char *uri)
+{
+    qmlRegisterType<PieChart>(uri, 1, 0, "PieChart");
+    qmlRegisterType<PieSlice>(uri, 1, 0, "PieSlice");
+}
+
+Q_EXPORT_PLUGIN2(chartsplugin, ChartsPlugin);
+//![0]
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
new file mode 100644
index 0000000..797d1e7
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef CHARTSPLUGIN_H
+#define CHARTSPLUGIN_H
+
+//![0]
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class ChartsPlugin : public QDeclarativeExtensionPlugin
+{
+    Q_OBJECT
+public:
+    void registerTypes(const char *uri);
+};
+//![0]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
new file mode 100644
index 0000000..4e6ee5c
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.cpp
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+}
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+QDeclarativeListProperty<PieSlice> PieChart::slices() 
+{
+    return QDeclarativeListProperty<PieSlice>(this, 0, &PieChart::append_slice);
+}
+
+void PieChart::append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice)
+{
+    PieChart *chart = qobject_cast<PieChart *>(list->object);
+    if (chart) {
+        slice->setParentItem(chart);
+        chart->m_slices.append(slice);
+    }
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
new file mode 100644
index 0000000..d6e4439
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/piechart.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+class PieChart : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QDeclarativeListProperty<PieSlice> slices READ slices)
+    Q_PROPERTY(QString name READ name WRITE setName)
+
+public:
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+    QDeclarativeListProperty<PieSlice> slices();
+
+private:
+    static void append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice);
+
+    QString m_name;
+    QList<PieSlice *> m_slices;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
new file mode 100644
index 0000000..65120f5
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+    return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+    m_color = color;
+}
+
+int PieSlice::fromAngle() const
+{
+    return m_fromAngle;
+}
+
+void PieSlice::setFromAngle(int angle)
+{
+    m_fromAngle = angle;
+}
+
+int PieSlice::angleSpan() const
+{
+    return m_angleSpan;
+}
+
+void PieSlice::setAngleSpan(int angle)
+{
+    m_angleSpan = angle;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), m_fromAngle * 16, m_angleSpan * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
new file mode 100644
index 0000000..a3afd25
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/pieslice.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+class PieSlice : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QColor color READ color WRITE setColor)
+    Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
+    Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+
+public:
+    PieSlice(QDeclarativeItem *parent = 0);
+
+    QColor color() const;
+    void setColor(const QColor &color);
+
+    int fromAngle() const;
+    void setFromAngle(int angle);
+
+    int angleSpan() const;
+    void setAngleSpan(int span);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+    QColor m_color;
+    int m_fromAngle;
+    int m_angleSpan;
+};
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/qmldir b/examples/declarative/tutorials/extending/chapter6-plugins/qmldir
new file mode 100644
index 0000000..a83bf85
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/qmldir
@@ -0,0 +1 @@
+plugin chapter6-plugins lib
-- 
cgit v0.12


From 5be65b4ce744945ba31f110660a4cf58c123742b Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Thu, 15 Jul 2010 16:36:26 +1000
Subject: fix doc link

---
 src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 110c970..fa422fd 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1732,7 +1732,7 @@ void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
     highlight is not moved by the view, and any movement must be implemented
     by the highlight.  
     
-    Here is a highlight with its motion defined by a \l {SpringAniamtion} item:
+    Here is a highlight with its motion defined by a \l {SpringAnimation} item:
 
     \snippet doc/src/snippets/declarative/listview/listview.qml highlightFollowsCurrentItem
 
-- 
cgit v0.12


From 14ad729f1e2f07a46cdb41f01a6e5267084b8816 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Thu, 15 Jul 2010 16:46:22 +1000
Subject: Add files missing from last commit

---
 .../extending/chapter5-listproperties/app.qml      | 70 +++++++++++++++++
 .../chapter5-listproperties.pro                    |  7 ++
 .../extending/chapter5-listproperties/main.cpp     | 58 ++++++++++++++
 .../extending/chapter5-listproperties/piechart.cpp | 72 ++++++++++++++++++
 .../extending/chapter5-listproperties/piechart.h   | 75 ++++++++++++++++++
 .../extending/chapter5-listproperties/pieslice.cpp | 88 ++++++++++++++++++++++
 .../extending/chapter5-listproperties/pieslice.h   | 76 +++++++++++++++++++
 7 files changed, 446 insertions(+)
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/app.qml
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
 create mode 100644 examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h

diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml b/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml
new file mode 100644
index 0000000..f759bc9
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/app.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Charts 1.0
+import Qt 4.7
+
+Item {
+    width: 300; height: 200
+
+    PieChart {
+        anchors.centerIn: parent
+        width: 100; height: 100
+
+        slices: [
+            PieSlice { 
+                anchors.fill: parent
+                color: "red"
+                fromAngle: 0; angleSpan: 110 
+            },
+            PieSlice { 
+                anchors.fill: parent
+                color: "black"
+                fromAngle: 110; angleSpan: 50 
+            },
+            PieSlice { 
+                anchors.fill: parent
+                color: "blue"
+                fromAngle: 160; angleSpan: 100
+            }
+        ]
+    }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
new file mode 100644
index 0000000..c3f5402
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
@@ -0,0 +1,7 @@
+QT += declarative
+
+HEADERS += piechart.h \
+           pieslice.h 
+SOURCES += piechart.cpp \
+           pieslice.cpp \
+           main.cpp
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
new file mode 100644
index 0000000..f73c49f
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+#include <qdeclarative.h>
+#include <QDeclarativeView>
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication app(argc, argv);
+
+    qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
+    qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
+
+    QDeclarativeView view;
+    view.setSource(QUrl::fromLocalFile("app.qml"));
+    view.show();
+    return app.exec();
+}
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
new file mode 100644
index 0000000..2515b64
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.cpp
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "piechart.h"
+#include "pieslice.h"
+
+PieChart::PieChart(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+}
+
+QString PieChart::name() const
+{
+    return m_name;
+}
+
+void PieChart::setName(const QString &name)
+{
+    m_name = name;
+}
+
+//![0]
+QDeclarativeListProperty<PieSlice> PieChart::slices() 
+{
+    return QDeclarativeListProperty<PieSlice>(this, 0, &PieChart::append_slice);
+}
+
+void PieChart::append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice)
+{
+    PieChart *chart = qobject_cast<PieChart *>(list->object);
+    if (chart) {
+        slice->setParentItem(chart);
+        chart->m_slices.append(slice);
+    }
+}
+//![0]
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
new file mode 100644
index 0000000..4424251
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/piechart.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIECHART_H
+#define PIECHART_H
+
+#include <QDeclarativeItem>
+
+class PieSlice;
+
+//![0]
+class PieChart : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QDeclarativeListProperty<PieSlice> slices READ slices)
+//![0]
+    Q_PROPERTY(QString name READ name WRITE setName)
+
+//![1]
+public:
+//![1]
+    PieChart(QDeclarativeItem *parent = 0);
+
+    QString name() const;
+    void setName(const QString &name);
+
+//![2]
+    QDeclarativeListProperty<PieSlice> slices();
+
+private:
+    static void append_slice(QDeclarativeListProperty<PieSlice> *list, PieSlice *slice);
+
+    QString m_name;
+    QList<PieSlice *> m_slices;
+};
+//![2]
+
+#endif
+
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
new file mode 100644
index 0000000..65120f5
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "pieslice.h"
+
+#include <QPainter>
+
+PieSlice::PieSlice(QDeclarativeItem *parent)
+    : QDeclarativeItem(parent)
+{
+    // need to disable this flag to draw inside a QDeclarativeItem
+    setFlag(QGraphicsItem::ItemHasNoContents, false);
+}
+
+QColor PieSlice::color() const
+{
+    return m_color;
+}
+
+void PieSlice::setColor(const QColor &color)
+{
+    m_color = color;
+}
+
+int PieSlice::fromAngle() const
+{
+    return m_fromAngle;
+}
+
+void PieSlice::setFromAngle(int angle)
+{
+    m_fromAngle = angle;
+}
+
+int PieSlice::angleSpan() const
+{
+    return m_angleSpan;
+}
+
+void PieSlice::setAngleSpan(int angle)
+{
+    m_angleSpan = angle;
+}
+
+void PieSlice::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    QPen pen(m_color, 2);
+    painter->setPen(pen);
+    painter->setRenderHints(QPainter::Antialiasing, true);
+    painter->drawPie(boundingRect(), m_fromAngle * 16, m_angleSpan * 16);
+}
+
diff --git a/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h
new file mode 100644
index 0000000..7cd0c74
--- /dev/null
+++ b/examples/declarative/tutorials/extending/chapter5-listproperties/pieslice.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef PIESLICE_H
+#define PIESLICE_H
+
+#include <QDeclarativeItem>
+#include <QColor>
+
+//![0]
+class PieSlice : public QDeclarativeItem
+{
+    Q_OBJECT
+    Q_PROPERTY(QColor color READ color WRITE setColor)
+    Q_PROPERTY(int fromAngle READ fromAngle WRITE setFromAngle)
+    Q_PROPERTY(int angleSpan READ angleSpan WRITE setAngleSpan)
+//![0]
+
+public:
+    PieSlice(QDeclarativeItem *parent = 0);
+
+    QColor color() const;
+    void setColor(const QColor &color);
+
+    int fromAngle() const;
+    void setFromAngle(int angle);
+
+    int angleSpan() const;
+    void setAngleSpan(int span);
+
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+private:
+    QColor m_color;
+    int m_fromAngle;
+    int m_angleSpan;
+};
+
+#endif
+
-- 
cgit v0.12


From 5893e05aa453f1ecbc0ee35d5fca5d671828dfc2 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Thu, 15 Jul 2010 16:48:30 +1000
Subject: Fix .pro file

---
 examples/declarative/tutorials/extending/extending.pro | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/declarative/tutorials/extending/extending.pro b/examples/declarative/tutorials/extending/extending.pro
index 0c86fed..967473f 100644
--- a/examples/declarative/tutorials/extending/extending.pro
+++ b/examples/declarative/tutorials/extending/extending.pro
@@ -5,5 +5,6 @@ SUBDIRS += \
     chapter2-methods \
     chapter3-bindings \
     chapter4-customPropertyTypes \
-    chapter5-plugins 
+    chapter5-listproperties \
+    chapter6-plugins 
 
-- 
cgit v0.12


From 6d29bcc28c4ee9b7583a62d23a931b9389004966 Mon Sep 17 00:00:00 2001
From: Jason Barron <jason.barron@nokia.com>
Date: Wed, 14 Jul 2010 16:12:04 +0200
Subject: Avoid a crash in the OpenVG paint engine when clipping to an empty
 path

The convertToPainterPath() function assumes that the QVectorPath
contains at least one path element when creating the QPainterPath. This
is not necessarily the case here though because if QVG_SCISSOR_CLIP is
defined and setClipPath() is called with an empty QPainterPath, this is
then converted to an empty QVectorPath in QPaintEngineEx::clip() which
then calls QVGPaintEngine::clip(). This function then goes on to
convert the QVectorPath back into a QPainterPath using the
aforementioned function which crashes when attempting to access the
first element of the path.

In case you are wondering why this seemingly redundant conversion
happens at all, it happens because when QVG_SCISSOR_CLIP is defined, we
attempt to convert the path to a series of rects for scissor clipping
and this conversion function operates on QPainterPath instead of
QVectorPath which is what this clip() function was designed to deal
with.

The fix is to skip over the path conversion for empty paths and go
directly to an empty QRegion.

Reviewed-by: Alessandro Portale
---
 src/openvg/qpaintengine_vg.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 7a050f6..7de09ce 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -1632,7 +1632,10 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
 
     // Try converting the path into a QRegion that tightly follows
     // the outline of the path we want to clip with.
-    QRegion region(path.convertToPainterPath().toFillPolygon(QTransform()).toPolygon());
+    QRegion region;
+    if (!path.isEmpty())
+        region = QRegion(path.convertToPainterPath().toFillPolygon(QTransform()).toPolygon());
+
     switch (op) {
         case Qt::NoClip:
         {
-- 
cgit v0.12


From 511985fa173daa9b8462dbb72c45a74626e8cba4 Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Thu, 15 Jul 2010 10:18:02 +0200
Subject: Fix for tst_qmdisubwindow::fixedMinMaxSize failure on Cocoa

We need to respect the size restrictions for all QWidgets. Previously
this was only applied to top levels.

Reviewed-by: Bradley T. Hughes
---
 src/gui/kernel/qwidget_mac.mm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index e57ec77..c788711 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -4389,6 +4389,13 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM
         data.window_state = data.window_state & ~Qt::WindowMaximized;
 
     const bool visible = q->isVisible();
+    // Apply size restrictions, applicable for Windows & Widgets.
+    if (QWExtra *extra = extraData()) {
+        w = qMin(w, extra->maxw);
+        h = qMin(h, extra->maxh);
+        w = qMax(w, extra->minw);
+        h = qMax(h, extra->minh);
+    }
     data.crect = QRect(x, y, w, h);
 
     if (realWindow) {
-- 
cgit v0.12


From 633349982422fec92df4ed06da5d2becf788c494 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Thu, 15 Jul 2010 10:39:40 +0200
Subject: Amend previous commit 4e2eb2945dbc3865e2901f12d663ed89e8f0dfbf to fix
 compilation with QT_NO_DEBUG_STREAM

Qt in debug need to stay binary compatible with Qt in release.

See also commit cbbd7e084c7e46fd906db26b13032b8368c59093 that
introduced the problem

Task-number: QTBUG-11510
---
 src/gui/styles/qstyle.cpp       | 4 +++-
 src/gui/styles/qstyle.h         | 2 +-
 src/gui/styles/qstyleoption.cpp | 6 +++++-
 src/gui/styles/qstyleoption.h   | 2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index 676483e..687e587 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -2421,9 +2421,10 @@ QT_BEGIN_INCLUDE_NAMESPACE
 #include <QDebug>
 QT_END_INCLUDE_NAMESPACE
 
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
 QDebug operator<<(QDebug debug, QStyle::State state)
 {
+#if !defined(QT_NO_DEBUG)
     debug << "QStyle::State(";
 
     QStringList states;
@@ -2455,6 +2456,7 @@ QDebug operator<<(QDebug debug, QStyle::State state)
     qSort(states);
     debug << states.join(QLatin1String(" | "));
     debug << ')';
+#endif
     return debug;
 }
 #endif
diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h
index 1ee262d..439901a 100644
--- a/src/gui/styles/qstyle.h
+++ b/src/gui/styles/qstyle.h
@@ -878,7 +878,7 @@ private:
 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State)
 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls)
 
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
 Q_GUI_EXPORT QDebug operator<<(QDebug debug, QStyle::State state);
 #endif
 
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index eeab316..4780edf 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -5419,9 +5419,10 @@ QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, T
     Returns a T or 0 depending on the type of \a hint.
 */
 
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
 QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
 {
+#if !defined(QT_NO_DEBUG)
     switch (optionType) {
     case QStyleOption::SO_Default:
         debug << "SO_Default"; break;
@@ -5482,17 +5483,20 @@ QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
     case QStyleOption::SO_GraphicsItem:
         debug << "SO_GraphicsItem"; break;
     }
+#endif
     return debug;
 }
 
 QDebug operator<<(QDebug debug, const QStyleOption &option)
 {
+#if !defined(QT_NO_DEBUG)
     debug << "QStyleOption(";
     debug << QStyleOption::OptionType(option.type);
     debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
     debug << ',' << option.state;
     debug << ',' << option.rect;
     debug << ')';
+#endif
     return debug;
 }
 #endif
diff --git a/src/gui/styles/qstyleoption.h b/src/gui/styles/qstyleoption.h
index 005b36a..e79d9a4 100644
--- a/src/gui/styles/qstyleoption.h
+++ b/src/gui/styles/qstyleoption.h
@@ -958,7 +958,7 @@ T qstyleoption_cast(QStyleHintReturn *hint)
     return 0;
 }
 
-#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
 Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType);
 Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option);
 #endif
-- 
cgit v0.12


From 910b8fe6222011b8f94259f165bcf4d4002172c0 Mon Sep 17 00:00:00 2001
From: Alexis Menard <alexis.menard@nokia.com>
Date: Thu, 15 Jul 2010 11:08:17 +0200
Subject: QFileDialog : Fix completer showing up on the MyComputer view.

Only complete if there is a text to complete

Reviewed-by:janarve
---
 src/gui/util/qcompleter.cpp                  |  4 +++-
 tests/auto/qfiledialog2/tst_qfiledialog2.cpp | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 1abc2d9..04d6de9 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -154,6 +154,7 @@
 #include "QtGui/qevent.h"
 #include "QtGui/qheaderview.h"
 #include "QtGui/qdesktopwidget.h"
+#include "QtGui/qlineedit.h"
 
 QT_BEGIN_NAMESPACE
 
@@ -920,8 +921,9 @@ void QCompleterPrivate::showPopup(const QRect& rect)
 void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path)
 {
     Q_Q(QCompleter);
+    QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget);
     //the path given by QFileSystemModel does not end with /
-    if (!q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
+    if (lineEdit && !lineEdit->text().isEmpty() && !q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
         q->complete();
 }
 
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
index eee495f..6299c24 100644
--- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
@@ -140,6 +140,7 @@ private slots:
     void QTBUG4419_lineEditSelectAll();
     void QTBUG6558_showDirsOnly();
     void QTBUG4842_selectFilterWithHideNameFilterDetails();
+    void dontShowCompleterOnRoot();
 
 private:
     QByteArray userSettings;
@@ -1194,5 +1195,26 @@ void tst_QFileDialog2::QTBUG4842_selectFilterWithHideNameFilterDetails()
 
 }
 
+void tst_QFileDialog2::dontShowCompleterOnRoot()
+{
+    QNonNativeFileDialog fd(0, "TestFileDialog");
+    fd.setAcceptMode(QFileDialog::AcceptSave);
+    fd.show();
+
+    QApplication::setActiveWindow(&fd);
+    QTest::qWaitForWindowShown(&fd);
+    QTRY_COMPARE(fd.isVisible(), true);
+    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+
+    fd.setDirectory("");
+    QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit");
+    QTRY_VERIFY(lineEdit->text().isEmpty());
+
+    //The gatherer thread will then return the result
+    QApplication::processEvents();
+
+    QTRY_VERIFY(lineEdit->completer()->popup()->isHidden());
+}
+
 QTEST_MAIN(tst_QFileDialog2)
 #include "tst_qfiledialog2.moc"
-- 
cgit v0.12


From 73473634b706548d603dafe22c9424a007d1bf3b Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Thu, 15 Jul 2010 11:20:07 +0200
Subject: Revert BIC change "Build Qt with option -Zc:wchar_t under MSVC"

This reverts commit a9c8decc741d8c2b340f38d7a854ef206672ab3e.

Postponed for Qt5. Or different makespecs.
---
 mkspecs/win32-msvc2005/qmake.conf | 2 +-
 mkspecs/win32-msvc2008/qmake.conf | 2 +-
 mkspecs/win32-msvc2010/qmake.conf | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf
index a5999cc..0406fd0 100644
--- a/mkspecs/win32-msvc2005/qmake.conf
+++ b/mkspecs/win32-msvc2005/qmake.conf
@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = byacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
 QMAKE_CFLAGS_WARN_ON    = -W3
 QMAKE_CFLAGS_WARN_OFF   = -W0
 QMAKE_CFLAGS_RELEASE    = -O2 -MD
diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf
index 1aab8e1..9805e90 100644
--- a/mkspecs/win32-msvc2008/qmake.conf
+++ b/mkspecs/win32-msvc2008/qmake.conf
@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = byacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
 QMAKE_CFLAGS_WARN_ON    = -W3
 QMAKE_CFLAGS_WARN_OFF   = -W0
 QMAKE_CFLAGS_RELEASE    = -O2 -MD
diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf
index 34a7782..28d4d3c 100644
--- a/mkspecs/win32-msvc2010/qmake.conf
+++ b/mkspecs/win32-msvc2010/qmake.conf
@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
 QMAKE_LEXFLAGS          =
 QMAKE_YACC              = byacc
 QMAKE_YACCFLAGS         = -d
-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t
+QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
 QMAKE_CFLAGS_WARN_ON    = -W3
 QMAKE_CFLAGS_WARN_OFF   = -W0
 QMAKE_CFLAGS_RELEASE    = -O2 -MD
-- 
cgit v0.12


From d52e3d553664f0fe9a5313908eeb10104f539249 Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Mon, 10 May 2010 16:45:05 +0100
Subject: Remove test cases which cause stack overflow

These test cases are not considered reasonable for a small screen device
(625 widgets). Patching the QWidget code to use iteration rather than
recursion is considered too risky, as the code is performance critical.

Task-number: QTBUG-8512
Reviewed-by: Bjoern Erik Nilsen
---
 tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
index 8c30be4..7015bd1 100644
--- a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
@@ -159,12 +159,17 @@ void tst_QWidget::update_data()
     QTest::newRow("10x10x1 opaque")        << 10 << 10 << 1   << true;
     QTest::newRow("10x10x10 opaque")       << 10 << 10 << 10  << true;
     QTest::newRow("10x10x100 opaque")      << 10 << 10 << 100 << true;
+#ifndef Q_OS_SYMBIAN
+    //These test cases cause stack overflow in QWidgetPrivate::paintSiblingsRecursive
+    //see http://bugreports.qt.nokia.com/browse/QTBUG-8512
+    //Symbian threads have a hard limit of 80kB user stack
     QTest::newRow("25x25x1 transparent ")  << 25 << 25 << 1   << false;
     QTest::newRow("25x25x10 transparent")  << 25 << 25 << 10  << false;
     QTest::newRow("25x25x100 transparent") << 25 << 25 << 100 << false;
     QTest::newRow("25x25x1 opaque")        << 25 << 25 << 1   << true;
     QTest::newRow("25x25x10 opaque")       << 25 << 25 << 10  << true;
     QTest::newRow("25x25x100 opaque")      << 25 << 25 << 100 << true;
+#endif
 }
 
 void tst_QWidget::update()
-- 
cgit v0.12


From 367aa34cbcfa109926087e89d49f9223c1409d44 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Wed, 14 Jul 2010 13:23:56 +0200
Subject: Add a QAuthenticatorPrivate parsing for the headers without
 QHttpResponseHeader

Reviewed-by: Markus Goetz
---
 src/network/access/qhttpnetworkconnection.cpp |  9 ++-----
 src/network/kernel/qauthenticator.cpp         | 39 ++++++++++++++++++---------
 src/network/kernel/qauthenticator_p.h         |  1 +
 3 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 1afabec..9e2b85e 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -286,13 +286,8 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
 
     resend = false;
     //create the response header to be used with QAuthenticatorPrivate.
-    QHttpResponseHeader responseHeader;
     QList<QPair<QByteArray, QByteArray> > fields = reply->header();
-    QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();
-    while (it != fields.constEnd()) {
-        responseHeader.addValue(QString::fromLatin1(it->first), QString::fromUtf8(it->second));
-        it++;
-    }
+
     //find out the type of authentication protocol requested.
     QAuthenticatorPrivate::Method authMethod = reply->d_func()->authenticationMethod(isProxy);
     if (authMethod != QAuthenticatorPrivate::None) {
@@ -310,7 +305,7 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
         if (auth->isNull())
             auth->detach();
         QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(*auth);
-        priv->parseHttpResponse(responseHeader, isProxy);
+        priv->parseHttpResponse(fields, isProxy);
 
         if (priv->phase == QAuthenticatorPrivate::Done) {
             if ((isProxy && pendingProxyAuthSignal) ||(!isProxy && pendingAuthSignal)) {
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index e7442c0..0ea4fd4 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -241,7 +241,20 @@ QAuthenticatorPrivate::QAuthenticatorPrivate()
 #ifndef QT_NO_HTTP
 void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header, bool isProxy)
 {
-    QList<QPair<QString, QString> > values = header.values();
+    const QList<QPair<QString, QString> > values = header.values();
+    QList<QPair<QByteArray, QByteArray> > rawValues;
+
+    QList<QPair<QString, QString> >::const_iterator it, end;
+    for (it = values.constBegin(), end = values.constEnd(); it != end; ++it)
+        rawValues.append(qMakePair(it->first.toLatin1(), it->second.toUtf8()));
+
+    // continue in byte array form
+    parseHttpResponse(rawValues, isProxy);
+}
+#endif
+
+void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByteArray> > &values, bool isProxy)
+{
     const char *search = isProxy ? "proxy-authenticate" : "www-authenticate";
 
     method = None;
@@ -255,24 +268,25 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
       authentication parameters.
     */
 
-    QString headerVal;
+    QByteArray headerVal;
     for (int i = 0; i < values.size(); ++i) {
-        const QPair<QString, QString> &current = values.at(i);
-        if (current.first.toLower() != QLatin1String(search))
+        const QPair<QByteArray, QByteArray> &current = values.at(i);
+        if (current.first.toLower() != search)
             continue;
-        QString str = current.second;
-        if (method < Basic && str.startsWith(QLatin1String("Basic"), Qt::CaseInsensitive)) {
-            method = Basic; headerVal = str.mid(6);
-        } else if (method < Ntlm && str.startsWith(QLatin1String("NTLM"), Qt::CaseInsensitive)) {
+        QByteArray str = current.second.toLower();
+        if (method < Basic && str.startsWith("basic")) {
+            method = Basic;
+            headerVal = current.second.mid(6);
+        } else if (method < Ntlm && str.startsWith("ntlm")) {
             method = Ntlm;
-            headerVal = str.mid(5);
-        } else if (method < DigestMd5 && str.startsWith(QLatin1String("Digest"), Qt::CaseInsensitive)) {
+            headerVal = current.second.mid(5);
+        } else if (method < DigestMd5 && str.startsWith("digest")) {
             method = DigestMd5;
-            headerVal = str.mid(7);
+            headerVal = current.second.mid(7);
         }
     }
 
-    challenge = headerVal.trimmed().toLatin1();
+    challenge = headerVal.trimmed();
     QHash<QByteArray, QByteArray> options = parseDigestAuthenticationChallenge(challenge);
 
     switch(method) {
@@ -300,7 +314,6 @@ void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header,
         phase = Invalid;
     }
 }
-#endif
 
 QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMethod, const QByteArray &path)
 {
diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index e9ce9ac..abb1cda 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -102,6 +102,7 @@ public:
 #ifndef QT_NO_HTTP
     void parseHttpResponse(const QHttpResponseHeader &, bool isProxy);
 #endif
+    void parseHttpResponse(const QList<QPair<QByteArray, QByteArray> >&, bool isProxy);
 
 };
 
-- 
cgit v0.12


From 69027cdb2ab9b89673edf29d5034bed33e614a05 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Wed, 14 Jul 2010 12:58:04 +0200
Subject: Expose the QAuthenticator map of options in the API.

Task-number: QT-3573
Reviewed-By: Markus Goetz
---
 src/network/kernel/qauthenticator.cpp | 45 +++++++++++++++++++++++++++++++++--
 src/network/kernel/qauthenticator.h   |  5 ++++
 src/network/kernel/qauthenticator_p.h |  3 ++-
 3 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 0ea4fd4..ca8ec1c 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -140,7 +140,8 @@ bool QAuthenticator::operator==(const QAuthenticator &other) const
     return d->user == other.d->user
         && d->password == other.d->password
         && d->realm == other.d->realm
-        && d->method == other.d->method;
+        && d->method == other.d->method
+        && d->options == other.d->options;
 }
 
 /*!
@@ -218,9 +219,49 @@ QString QAuthenticator::realm() const
     return d ? d->realm : QString();
 }
 
+/*!
+    \since 4.7
+    Returns the value related to option \a opt if it was set by the server.
+    See \l{QAuthenticator#Options} for more information on incoming options.
+    If option \a opt isn't found, an invalid QVariant will be returned.
+
+    \sa options(), QAuthenticator#Options
+*/
+QVariant QAuthenticator::option(const QString &opt) const
+{
+    return d ? d->options.value(opt) : QVariant();
+}
+
+/*!
+    \since 4.7
+    Returns all incoming options set in this QAuthenticator object by parsing
+    the server reply. See \l{QAuthenticator#Options} for more information
+    on incoming options.
+
+    \sa option(), QAuthenticator#Options
+*/
+QVariantHash QAuthenticator::options() const
+{
+    return d ? d->options : QVariantHash();
+}
+
+/*!
+    \since 4.7
+
+    Sets the outgoing option \a opt to value \a value.
+    See \l{QAuthenticator#Options} for more information on outgoing options.
+
+    \sa options(), option(), QAuthenticator#Options
+*/
+void QAuthenticator::setOption(const QString &opt, const QVariant &value)
+{
+    detach();
+    d->options.insert(opt, value);
+}
+
 
 /*!
-  returns true if the authenticator is null.
+    Returns true if the authenticator is null.
 */
 bool QAuthenticator::isNull() const
 {
diff --git a/src/network/kernel/qauthenticator.h b/src/network/kernel/qauthenticator.h
index 13ce593..983b7c0 100644
--- a/src/network/kernel/qauthenticator.h
+++ b/src/network/kernel/qauthenticator.h
@@ -43,6 +43,7 @@
 #define QAUTHENTICATOR_H
 
 #include <QtCore/qstring.h>
+#include <QtCore/qvariant.h>
 
 QT_BEGIN_HEADER
 
@@ -73,6 +74,10 @@ public:
 
     QString realm() const;
 
+    QVariant option(const QString &opt) const;
+    QVariantHash options() const;
+    void setOption(const QString &opt, const QVariant &value);
+
     bool isNull() const;
     void detach();
 private:
diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index abb1cda..665afef 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -57,6 +57,7 @@
 #include <qbytearray.h>
 #include <qstring.h>
 #include <qauthenticator.h>
+#include <qvariant.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -71,7 +72,7 @@ public:
     QAtomicInt ref;
     QString user;
     QString password;
-    QHash<QByteArray, QByteArray> options;
+    QVariantHash options;
     Method method;
     QString realm;
     QByteArray challenge;
-- 
cgit v0.12


From 1af3362a321dd055798173737d3aede367a1d30c Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Wed, 14 Jul 2010 13:01:33 +0200
Subject: Add documentation for the QAuthenticator options.

Task-number: QT-3573
Reviewed-by: Markus Goetz
---
 src/network/kernel/qauthenticator.cpp | 42 +++++++++++++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index ca8ec1c..d61c686 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -85,6 +85,44 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
 
   Note that, in particular, NTLM version 2 is not supported.
 
+  \section1 Options
+
+  In addition to the username and password required for authentication, a
+  QAuthenticator object can also contain additional options. The
+  options() function can be used to query incoming options sent by
+  the server; the setOption() function can
+  be used to set outgoing options, to be processed by the authenticator
+  calculation. The options accepted and provided depend on the authentication
+  type (see method()).
+
+  The following tables list known incoming options as well as accepted
+  outgoing options. The list of incoming options is not exhaustive, since
+  servers may include additional information at any time. The list of
+  outgoing options is exhaustive, however, and no unknown options will be
+  treated or sent back to the server.
+
+  \section2 Basic
+
+  \table
+    \header \o Option \o Direction \o Description
+    \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm()
+  \endtable
+
+  The Basic authentication mechanism supports no outgoing options.
+
+  \section2 NTLM version 1
+
+  The NTLM authentication mechanism currently supports no incoming or outgoing options.
+
+  \section2 Digest-MD5
+
+  \table
+    \header \o Option \o Direction \o Description
+    \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm()
+  \endtable
+
+  The Digest-MD5 authentication mechanism supports no outgoing options.
+
   \sa QSslSocket
 */
 
@@ -333,7 +371,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
     switch(method) {
     case Basic:
         if(realm.isEmpty())
-            realm = QString::fromLatin1(options.value("realm"));
+            this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
         if (user.isEmpty())
             phase = Done;
         break;
@@ -342,7 +380,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
         break;
     case DigestMd5: {
         if(realm.isEmpty())
-            realm = QString::fromLatin1(options.value("realm"));
+            this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
         if (options.value("stale").toLower() == "true")
             phase = Start;
         if (user.isEmpty())
-- 
cgit v0.12


From 648f8a05abac5fbf851fff18d1c34ff7c4a7a027 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Wed, 14 Jul 2010 17:21:25 +0200
Subject: Autotest: add a small, boring test for QAuthenticator

---
 src/network/kernel/qauthenticator_p.h            |   2 +-
 tests/auto/qauthenticator/qauthenticator.pro     |   5 +
 tests/auto/qauthenticator/tst_qauthenticator.cpp | 155 +++++++++++++++++++++++
 3 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100644 tests/auto/qauthenticator/qauthenticator.pro
 create mode 100644 tests/auto/qauthenticator/tst_qauthenticator.cpp

diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index 665afef..1096601 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
 
 class QHttpResponseHeader;
 
-class QAuthenticatorPrivate
+class Q_AUTOTEST_EXPORT QAuthenticatorPrivate
 {
 public:
     enum Method { None, Basic, Plain, Login, Ntlm, CramMd5, DigestMd5 };
diff --git a/tests/auto/qauthenticator/qauthenticator.pro b/tests/auto/qauthenticator/qauthenticator.pro
new file mode 100644
index 0000000..05f83bc
--- /dev/null
+++ b/tests/auto/qauthenticator/qauthenticator.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+requires(contains(QT_CONFIG,private_tests))
+QT = core network
+SOURCES  += tst_qauthenticator.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qauthenticator/tst_qauthenticator.cpp b/tests/auto/qauthenticator/tst_qauthenticator.cpp
new file mode 100644
index 0000000..37d6774
--- /dev/null
+++ b/tests/auto/qauthenticator/tst_qauthenticator.cpp
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtCore/QString>
+#include <QtTest/QtTest>
+#include <QtCore/QCoreApplication>
+#include <QtNetwork/QAuthenticator>
+
+#include <private/qauthenticator_p.h>
+
+class tst_QAuthenticator : public QObject
+{
+    Q_OBJECT
+
+public:
+    tst_QAuthenticator();
+
+private Q_SLOTS:
+    void basicAuth();
+    void basicAuth_data();
+
+    void ntlmAuth_data();
+    void ntlmAuth();
+};
+
+tst_QAuthenticator::tst_QAuthenticator()
+{
+}
+
+void tst_QAuthenticator::basicAuth_data()
+{
+    QTest::addColumn<QString>("data");
+    QTest::addColumn<QString>("realm");
+    QTest::addColumn<QString>("user");
+    QTest::addColumn<QString>("password");
+    QTest::addColumn<QByteArray>("expectedReply");
+
+    QTest::newRow("just-user") << "" << "" << "foo" << "" << QByteArray("foo:").toBase64();
+    QTest::newRow("user-password") << "" << "" << "foo" << "bar" << QByteArray("foo:bar").toBase64();
+    QTest::newRow("user-password-realm") << "realm=\"secure area\"" << "secure area" << "foo" << "bar" << QByteArray("foo:bar").toBase64();
+}
+
+void tst_QAuthenticator::basicAuth()
+{
+    QFETCH(QString, data);
+    QFETCH(QString, realm);
+    QFETCH(QString, user);
+    QFETCH(QString, password);
+    QFETCH(QByteArray, expectedReply);
+
+    QAuthenticator auth;
+    auth.detach();
+    QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
+    QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+
+    QList<QPair<QByteArray, QByteArray> > headers;
+    headers << qMakePair(QByteArray("WWW-Authenticate"), "Basic " + data.toUtf8());
+    priv->parseHttpResponse(headers, /*isProxy = */ false);
+
+    QCOMPARE(auth.realm(), realm);
+    QCOMPARE(auth.option("realm").toString(), realm);
+
+    auth.setUser(user);
+    auth.setPassword(password);
+
+    QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+
+    QCOMPARE(priv->calculateResponse("GET", "/").constData(), ("Basic " + expectedReply).constData());
+}
+
+void tst_QAuthenticator::ntlmAuth_data()
+{
+    QTest::addColumn<QString>("data");
+    QTest::addColumn<QString>("realm");
+
+    QTest::newRow("no-realm") << "TlRMTVNTUAACAAAAHAAcADAAAAAFAoEATFZ3OLRQADIAAAAAAAAAAJYAlgBMAAAAUQBUAC0AVABFAFMAVAAtAEQATwBNAEEASQBOAAIAHABRAFQALQBUAEUAUwBUAC0ARABPAE0AQQBJAE4AAQAcAFEAVAAtAFQARQBTAFQALQBTAEUAUgBWAEUAUgAEABYAcQB0AC0AdABlAHMAdAAtAG4AZQB0AAMANABxAHQALQB0AGUAcwB0AC0AcwBlAHIAdgBlAHIALgBxAHQALQB0AGUAcwB0AC0AbgBlAHQAAAAAAA==" << "";
+    QTest::newRow("with-realm") << "TlRMTVNTUAACAAAADAAMADgAAAAFAoECWCZkccFFAzwAAAAAAAAAAL4AvgBEAAAABQLODgAAAA9NAEcARABOAE8ASwACAAwATQBHAEQATgBPAEsAAQAcAE4ATwBLAC0AQQBNAFMAUwBTAEYARQAtADAAMQAEACAAbQBnAGQAbgBvAGsALgBuAG8AawBpAGEALgBjAG8AbQADAD4AbgBvAGsALQBhAG0AcwBzAHMAZgBlAC0AMAAxAC4AbQBnAGQAbgBvAGsALgBuAG8AawBpAGEALgBjAG8AbQAFACAAbQBnAGQAbgBvAGsALgBuAG8AawBpAGEALgBjAG8AbQAAAAAA" << "NOE";
+}
+
+void tst_QAuthenticator::ntlmAuth()
+{
+    QFETCH(QString, data);
+    QFETCH(QString, realm);
+
+    QAuthenticator auth;
+    auth.detach();
+    QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
+    QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+
+    QList<QPair<QByteArray, QByteArray> > headers;
+
+    // NTLM phase 1: negotiate
+    // This phase of NTLM contains no information, other than what we're willing to negotiate
+    // Current implementation uses flags:
+    //  NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET
+    headers << qMakePair<QByteArray, QByteArray>("WWW-Authenticate", "NTLM");
+    priv->parseHttpResponse(headers, /*isProxy = */ false);
+    QCOMPARE(priv->calculateResponse("GET", "/").constData(), "NTLM TlRMTVNTUAABAAAABQIAAAAAAAAAAAAAAAAAAAAAAAA=");
+
+    // NTLM phase 2: challenge
+    headers.clear();
+    headers << qMakePair(QByteArray("WWW-Authenticate"), "NTLM " + data.toUtf8());
+    priv->parseHttpResponse(headers, /*isProxy = */ false);
+
+    QEXPECT_FAIL("with-realm", "NTLM authentication code doesn't extract the realm", Continue);
+    QCOMPARE(auth.realm(), realm);
+
+    auth.setUser("unimportant");
+    auth.setPassword("unimportant");
+
+    QVERIFY(!priv->calculateResponse("GET", "/").isEmpty());
+}
+
+QTEST_MAIN(tst_QAuthenticator);
+
+#include "tst_qauthenticator.moc"
-- 
cgit v0.12


From 01978218333aab792e32d7c69bbaea849b3b8d15 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@nokia.com>
Date: Wed, 14 Jul 2010 17:19:27 +0200
Subject: Autotest: reenable the NTLM proxy test on tst_QTcpSocket

---
 tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index 31cae40..e3b2ca5 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -275,7 +275,7 @@ void tst_QTcpSocket::initTestCase_data()
 
     QTest::newRow("WithHttpProxy") << true << int(HttpProxy) << false;
     QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic) << false;
-//    QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm) << false;
+    QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm) << false;
 
 #ifndef QT_NO_OPENSSL
     QTest::newRow("WithoutProxy SSL") << false << 0 << true;
@@ -284,7 +284,7 @@ void tst_QTcpSocket::initTestCase_data()
 
     QTest::newRow("WithHttpProxy SSL") << true << int(HttpProxy) << true;
     QTest::newRow("WithHttpProxyBasicAuth SSL") << true << int(HttpProxy | AuthBasic) << true;
-//    QTest::newRow("WithHttpProxyNtlmAuth SSL") << true << int(HttpProxy | AuthNtlm) << true;
+    QTest::newRow("WithHttpProxyNtlmAuth SSL") << true << int(HttpProxy | AuthNtlm) << true;
 #endif
 }
 
-- 
cgit v0.12


From b9c2853a0fd1876f30a410fe8dac5c477cef9d0e Mon Sep 17 00:00:00 2001
From: Robin Burchell <robin.burchell@collabora.co.uk>
Date: Thu, 15 Jul 2010 14:08:20 +0200
Subject: Add a testcase for QTBUG-11213 to prevent future regressions.

Merge-request: 2427
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
---
 tests/auto/quuid/quuid.pro                         |  9 ++--
 tests/auto/quuid/test/test.pro                     | 29 ++++++++++
 tests/auto/quuid/testProcessUniqueness/main.cpp    | 62 ++++++++++++++++++++++
 .../testProcessUniqueness.pro                      |  8 +++
 tests/auto/quuid/tst_quuid.cpp                     | 29 ++++++++++
 5 files changed, 134 insertions(+), 3 deletions(-)
 create mode 100644 tests/auto/quuid/test/test.pro
 create mode 100644 tests/auto/quuid/testProcessUniqueness/main.cpp
 create mode 100644 tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro

diff --git a/tests/auto/quuid/quuid.pro b/tests/auto/quuid/quuid.pro
index f7608fa..25e2456 100644
--- a/tests/auto/quuid/quuid.pro
+++ b/tests/auto/quuid/quuid.pro
@@ -1,3 +1,6 @@
-load(qttest_p4)
-QT = core
-SOURCES += tst_quuid.cpp
+TEMPLATE = subdirs
+
+SUBDIRS = testProcessUniqueness
+
+SUBDIRS += test
+
diff --git a/tests/auto/quuid/test/test.pro b/tests/auto/quuid/test/test.pro
new file mode 100644
index 0000000..123aa50
--- /dev/null
+++ b/tests/auto/quuid/test/test.pro
@@ -0,0 +1,29 @@
+load(qttest_p4)
+
+QT = core
+SOURCES += ../tst_quuid.cpp
+TARGET = tst_quuid
+
+CONFIG(debug_and_release_target) {
+  CONFIG(debug, debug|release) {
+    DESTDIR = ../debug
+  } else {
+    DESTDIR = ../release
+  }
+} else {
+  DESTDIR = ..
+}
+
+wince* {
+   addFile_processUniqueness.sources = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe 
+   addFile_processUniqueness.path = testProcessUniqueness
+
+   DEPLOYMENT += addFile_processUniqueness
+}
+
+symbian {
+   binDep.sources = testProcessUniqueness.exe
+   binDep.path = \\sys\\bin
+
+   DEPLOYMENT += binDep
+}
diff --git a/tests/auto/quuid/testProcessUniqueness/main.cpp b/tests/auto/quuid/testProcessUniqueness/main.cpp
new file mode 100644
index 0000000..4d33c84
--- /dev/null
+++ b/tests/auto/quuid/testProcessUniqueness/main.cpp
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdio.h>
+#include <QUuid>
+
+// This is a testcase for QTBUG-11213
+int main(int argc, char **argv)
+{
+    Q_UNUSED(argc)
+    Q_UNUSED(argv)
+    
+    // First, break QUuid.
+    qrand();
+
+    // Now print a few uuids.
+    printf("%s", qPrintable(QUuid::createUuid().toString()));
+    printf("%s", qPrintable(QUuid::createUuid().toString()));
+    printf("%s", qPrintable(QUuid::createUuid().toString()));
+
+    // Done
+    return 0;
+}
+
diff --git a/tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro b/tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro
new file mode 100644
index 0000000..88df1a2
--- /dev/null
+++ b/tests/auto/quuid/testProcessUniqueness/testProcessUniqueness.pro
@@ -0,0 +1,8 @@
+SOURCES = main.cpp
+CONFIG += console
+
+DESTDIR = ./
+
+# no install rule for application used by test
+INSTALLS =
+
diff --git a/tests/auto/quuid/tst_quuid.cpp b/tests/auto/quuid/tst_quuid.cpp
index 47f356a..409d8cf 100644
--- a/tests/auto/quuid/tst_quuid.cpp
+++ b/tests/auto/quuid/tst_quuid.cpp
@@ -73,6 +73,7 @@ private slots:
     void versions();
 
     void threadUniqueness();
+    void processUniqueness();
 
 public:
     // Variables
@@ -196,5 +197,33 @@ void tst_QUuid::threadUniqueness()
     qDeleteAll(threads);
 }
 
+void tst_QUuid::processUniqueness()
+{
+    QProcess process;
+    QString processOneOutput;
+    QString processTwoOutput;
+
+    // Start it once
+#ifdef Q_OS_MAC
+    process.start("testProcessUniqueness/testProcessUniqueness.app");
+#else
+    process.start("testProcessUniqueness/testProcessUniqueness");
+#endif
+    QVERIFY(process.waitForFinished());
+    processOneOutput = process.readAllStandardOutput();
+
+    // Start it twice
+#ifdef Q_OS_MAC
+    process.start("testProcessUniqueness/testProcessUniqueness.app");
+#else
+    process.start("testProcessUniqueness/testProcessUniqueness");
+#endif
+    QVERIFY(process.waitForFinished());
+    processTwoOutput = process.readAllStandardOutput();
+
+    // They should be *different*!
+    QVERIFY(processOneOutput != processTwoOutput);
+}
+
 QTEST_MAIN(tst_QUuid)
 #include "tst_quuid.moc"
-- 
cgit v0.12


From 1c34bf050da3c4d6c303e1dd1dad9eb99e7ccbf4 Mon Sep 17 00:00:00 2001
From: Markus Goetz <Markus.Goetz@nokia.com>
Date: Thu, 15 Jul 2010 14:56:54 +0200
Subject: QNAM HTTP: Fix problem with cached files and metaDataChanged()

Reviewed-by: Peter Hartmann
---
 src/network/access/qnetworkaccesshttpbackend.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index a6c5c02..f617244 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -944,10 +944,10 @@ bool QNetworkAccessHttpBackend::sendCacheContents(const QNetworkCacheMetaData &m
 
     checkForRedirect(status);
 
-    emit metaDataChanged();
-
-    // invoke this asynchronously, else Arora/QtDemoBrowser don't like cached downloads
-    // see task 250221 / 251801
+    // This needs to be emitted in the event loop because it can be reached at
+    // the direct code path of qnam.get(...) before the user has a chance
+    // to connect any signals.
+    QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);
     qRegisterMetaType<QIODevice*>("QIODevice*");
     QMetaObject::invokeMethod(this, "writeDownstreamData", Qt::QueuedConnection, Q_ARG(QIODevice*, contents));
 
-- 
cgit v0.12


From 30630cf2bf8c7604efc3a52f74983c2237f309c3 Mon Sep 17 00:00:00 2001
From: Harald Fernengel <harald.fernengel@nokia.com>
Date: Thu, 15 Jul 2010 16:50:28 +0200
Subject: Unbreak the Maemo 5 build after the Symbian fix

Reviewed-by: Robert Griebl
---
 tools/qml/qml.pri | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri
index fcd0c33..80afb45 100644
--- a/tools/qml/qml.pri
+++ b/tools/qml/qml.pri
@@ -17,16 +17,16 @@ SOURCES += $$PWD/qmlruntime.cpp \
            $$PWD/loggerwidget.cpp
 
 RESOURCES = $$PWD/qmlruntime.qrc
-maemo5 {
+symbian:!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
+   SOURCES += $$PWD/deviceorientation_symbian.cpp
+   FORMS = $$PWD/recopts.ui \
+           $$PWD/proxysettings.ui
+} else:maemo5 {
     QT += dbus
     HEADERS += $$PWD/texteditautoresizer_maemo5.h
     SOURCES += $$PWD/deviceorientation_maemo5.cpp
     FORMS = $$PWD/recopts_maemo5.ui \
             $$PWD/proxysettings_maemo5.ui
-} symbian:!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) {
-    SOURCES += $$PWD/deviceorientation_symbian.cpp
-    FORMS = $$PWD/recopts.ui \
-            $$PWD/proxysettings.ui
 } else {
     SOURCES += $$PWD/deviceorientation.cpp
     FORMS = $$PWD/recopts.ui \
-- 
cgit v0.12


From b863daec96868731412bd8f89b960bc7395911ae Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 13 Jul 2010 11:34:44 +0200
Subject: split qt_help out into an own ts target

the combined target would be too hard to transform in the next commit
---
 translations/translations.pri | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/translations/translations.pri b/translations/translations.pri
index f5e54ca..6a13dff 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -52,11 +52,15 @@ ts-linguist.depends = sub-tools
 ###### Assistant
 
 ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/assistant/tools/assistant/assistant.pro \
-                                    && $$LUPDATE \
-                                    ../tools/assistant/lib/lib.pro)
+                                    ../tools/assistant/tools/assistant/assistant.pro)
 ts-assistant.depends = sub-tools
 
+###### Qt Help Lib
+
+ts-qt_help.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
+                                    ../tools/assistant/lib/lib.pro)
+ts-qt_help.depends = sub-tools
+
 ###### Qtconfig
 
 ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
@@ -71,10 +75,10 @@ ts-qvfb.depends = sub-tools
 
 ###### Overall Rules
 
-ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb
+ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qt_help ts-qtconfig ts-qvfb
 
 check-ts.commands = (cd $$PWD && perl check-ts.pl)
 check-ts.depends = ts
 
-QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb \
+QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qt_help ts-qtconfig ts-qvfb \
                        ts check-ts
-- 
cgit v0.12


From 807bc3aca8a0b07ee1dfe1e398044d32756e5de0 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 13 Jul 2010 12:55:31 +0200
Subject: more fine-grained ts targets

there are now per-language ts-<package>-<lang> and ts-<lang> targets to
update only the files relevant for a given language.
there is also a ts-all target which does what the old ts target did.
the ts-<package> targets are now named ts-<package>-all and should not
be used manually - they exist for the convenience of the ts-all target.
the ts target is now only a help blurb.
---
 tools/assistant/lib/lib.pro                   |  13 ---
 tools/assistant/tools/assistant/assistant.pro |  13 ---
 tools/designer/designer.pro                   |  13 ---
 tools/linguist/linguist/linguist.pro          |  12 ---
 tools/qtconfig/qtconfig.pro                   |   8 --
 tools/qvfb/qvfb.pro                           |   8 --
 translations/translations.pri                 | 132 +++++++++++---------------
 7 files changed, 56 insertions(+), 143 deletions(-)

diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro
index e84cf31..26d3456 100644
--- a/tools/assistant/lib/lib.pro
+++ b/tools/assistant/lib/lib.pro
@@ -69,16 +69,3 @@ HEADERS += qhelpenginecore.h \
 # access to clucene
 HEADERS += qhelpsearchindexwriter_clucene_p.h \
     qhelpsearchindexreader_clucene_p.h
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/qt_help_cs.ts \
-    $$TR_DIR/qt_help_da.ts \
-    $$TR_DIR/qt_help_de.ts \
-    $$TR_DIR/qt_help_hu.ts \
-    $$TR_DIR/qt_help_ja.ts \
-    $$TR_DIR/qt_help_pl.ts \
-    $$TR_DIR/qt_help_ru.ts \
-    $$TR_DIR/qt_help_zh_CN.ts \
-    $$TR_DIR/qt_help_zh_TW.ts \
-    $$TR_DIR/qt_help_fr.ts
diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro
index 16a520e..d9aff7a 100644
--- a/tools/assistant/tools/assistant/assistant.pro
+++ b/tools/assistant/tools/assistant/assistant.pro
@@ -108,16 +108,3 @@ contains(CONFIG, static): {
         DEFINES += USE_STATIC_SQLITE_PLUGIN
     }
 }
-
-TR_DIR = $$PWD/../../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/assistant_cs.ts \
-    $$TR_DIR/assistant_da.ts \
-    $$TR_DIR/assistant_de.ts \
-    $$TR_DIR/assistant_fr.ts \
-    $$TR_DIR/assistant_hu.ts \
-    $$TR_DIR/assistant_ja.ts \
-    $$TR_DIR/assistant_pl.ts \
-    $$TR_DIR/assistant_ru.ts \
-    $$TR_DIR/assistant_zh_CN.ts \
-    $$TR_DIR/assistant_zh_TW.ts
diff --git a/tools/designer/designer.pro b/tools/designer/designer.pro
index 31c8622..721c4fc 100644
--- a/tools/designer/designer.pro
+++ b/tools/designer/designer.pro
@@ -3,16 +3,3 @@ TEMPLATE = subdirs
 CONFIG += qt
 
 SUBDIRS = src
-
-TR_DIR = $$PWD/../../translations
-TRANSLATIONS = \
-    $$TR_DIR/designer_cs.ts \
-    $$TR_DIR/designer_de.ts \
-    $$TR_DIR/designer_fr.ts \
-    $$TR_DIR/designer_hu.ts \
-    $$TR_DIR/designer_ja.ts \
-    $$TR_DIR/designer_pl.ts \
-    $$TR_DIR/designer_ru.ts \
-    $$TR_DIR/designer_sl.ts \
-    $$TR_DIR/designer_zh_CN.ts \
-    $$TR_DIR/designer_zh_TW.ts
diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro
index 4f7ed8a..ce8d585 100644
--- a/tools/linguist/linguist/linguist.pro
+++ b/tools/linguist/linguist/linguist.pro
@@ -94,15 +94,3 @@ FORMS += statistics.ui \
     translationsettings.ui \
     finddialog.ui
 RESOURCES += linguist.qrc
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
-    $$TR_DIR/linguist_cs.ts \
-    $$TR_DIR/linguist_de.ts \
-    $$TR_DIR/linguist_fr.ts \
-    $$TR_DIR/linguist_hu.ts \
-    $$TR_DIR/linguist_ja.ts \
-    $$TR_DIR/linguist_pl.ts \
-    $$TR_DIR/linguist_ru.ts \
-    $$TR_DIR/linguist_zh_CN.ts \
-    $$TR_DIR/linguist_zh_TW.ts
diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro
index 3a24e85..d1fd320 100644
--- a/tools/qtconfig/qtconfig.pro
+++ b/tools/qtconfig/qtconfig.pro
@@ -29,11 +29,3 @@ target.path=$$[QT_INSTALL_BINS]
 INSTALLS        += target
 INCLUDEPATH        += .
 DBFILE                 = qtconfig.db
-
-TR_DIR = $$PWD/../../translations
-TRANSLATIONS = \
-    $$TR_DIR/qtconfig_hu.ts \
-    $$TR_DIR/qtconfig_pl.ts \
-    $$TR_DIR/qtconfig_ru.ts \
-    $$TR_DIR/qtconfig_zh_CN.ts \
-    $$TR_DIR/qtconfig_zh_TW.ts
diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro
index df69817..c101d00 100644
--- a/tools/qvfb/qvfb.pro
+++ b/tools/qvfb/qvfb.pro
@@ -62,11 +62,3 @@ unix:x11 {
 }
 
 RESOURCES	+= qvfb.qrc
-
-TR_DIR = $$PWD/../../translations
-TRANSLATIONS = \
-    $$TR_DIR/qvfb_hu.ts \
-    $$TR_DIR/qvfb_pl.ts \
-    $$TR_DIR/qvfb_ru.ts \
-    $$TR_DIR/qvfb_zh_CN.ts \
-    $$TR_DIR/qvfb_zh_TW.ts
diff --git a/translations/translations.pri b/translations/translations.pri
index 6a13dff..b41f2a0 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -1,84 +1,64 @@
-defineReplace(prependAll) {
-    prepend = $$1
-    arglist = $$2
-    append  = $$3
-    for(a,arglist) {
-      result += $${prepend}$${a}$${append}
-    }
-    return ($$result)
-}
-
 qtPrepareTool(LUPDATE, lupdate)
 LUPDATE += -locations relative -no-ui-lines
 
-###### Qt Libraries
-
-QT_TS        = ar cs da de es fr he hu ja pl pt ru sk sl sv uk zh_CN zh_TW
-
-ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                -I../include -I../include/Qt \
-                                    3rdparty/phonon \
-                                    3rdparty/webkit \
-                                    activeqt \
-                                    corelib \
-                                    declarative \
-                                    gui \
-                                    multimedia \
-                                    network \
-                                    opengl \
-                                    plugins \
-                                    qt3support \
-                                    script \
-                                    scripttools \
-                                    sql \
-                                    svg \
-                                    xml \
-                                    xmlpatterns \
-                                -ts $$prependAll($$QT_SOURCE_TREE/translations/qt_,$$QT_TS,.ts))
-ts-qt.depends = sub-tools
-
-###### Designer
-
-ts-designer.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/designer/designer.pro)
-ts-designer.depends = sub-tools
-
-###### Linguist
-
-ts-linguist.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/linguist/linguist/linguist.pro)
-ts-linguist.depends = sub-tools
-
-###### Assistant
-
-ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/assistant/tools/assistant/assistant.pro)
-ts-assistant.depends = sub-tools
-
-###### Qt Help Lib
-
-ts-qt_help.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/assistant/lib/lib.pro)
-ts-qt_help.depends = sub-tools
-
-###### Qtconfig
-
-ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/qtconfig/qtconfig.pro)
-ts-qtconfig.depends = sub-tools
-
-###### Qvfp
-
-ts-qvfb.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
-                                    ../tools/qvfb/qvfb.pro)
-ts-qvfb.depends = sub-tools
+TS_TARGETS =
+
+# meta target name, target name, lupdate base options, files
+defineTest(addTsTarget) {
+    cv = $${2}.commands
+    dv = $${2}.depends
+    $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
+    $$dv = sub-tools
+    export($$cv)
+    export($$dv)
+    dv = $${1}.depends
+    $$dv += $$2
+    export($$dv)
+    TS_TARGETS += $$1 $$2
+    export(TS_TARGETS)
+}
 
-###### Overall Rules
+# target basename, lupdate base options
+defineTest(addTsTargets) {
+    files = $$files($$PWD/$${1}_??.ts) $$files($$PWD/$${1}_??_??.ts)
+    for(file, files) {
+        lang = $$replace(file, .*_((.._)?..)\\.ts$, \\1)
+        addTsTarget(ts-$$lang, ts-$$1-$$lang, $$2, $$file)
+    }
+    addTsTarget(ts-all, ts-$$1-all, $$2, $$files)
+}
 
-ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qt_help ts-qtconfig ts-qvfb
+addTsTargets(qt, -I../include -I../include/Qt \
+    3rdparty/phonon \
+    3rdparty/webkit \
+    activeqt \
+    corelib \
+    declarative \
+    gui \
+    multimedia \
+    network \
+    opengl \
+    plugins \
+    qt3support \
+    script \
+    scripttools \
+    sql \
+    svg \
+    xml \
+    xmlpatterns \
+)
+addTsTargets(designer, ../tools/designer/designer.pro)
+addTsTargets(linguist, ../tools/linguist/linguist/linguist.pro)
+addTsTargets(assistant, ../tools/assistant/tools/assistant/assistant.pro)
+addTsTargets(qt_help, ../tools/assistant/lib/lib.pro)
+addTsTargets(qtconfig, ../tools/qtconfig/qtconfig.pro)
+addTsTargets(qvfb, ../tools/qvfb/qvfb.pro)
 
 check-ts.commands = (cd $$PWD && perl check-ts.pl)
-check-ts.depends = ts
+check-ts.depends = ts-all
+
+ts.commands = \
+    @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
+    echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead.\"
 
-QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qt_help ts-qtconfig ts-qvfb \
-                       ts check-ts
+QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts check-ts
-- 
cgit v0.12


From 511a838afdb1d028bf184bb56c9ead39312987ca Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 13 Jul 2010 12:57:07 +0200
Subject: (re-)add 'untranslated' ts targets

these files are not meant for commit, but it's good to have a quick way
to create templates.
---
 .gitignore                    | 1 +
 translations/check-ts.pl      | 2 +-
 translations/translations.pri | 6 ++++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index fdb6843..4d5aa9b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -114,6 +114,7 @@ tools/qtestlib/chart/chart*
 tools/qtestlib/updater/updater*
 tools/activeqt/testcon/testcon.tlb
 translations/*.qm
+translations/*_untranslated.ts
 qrc_*.cpp
 
 # xemacs temporary files
diff --git a/translations/check-ts.pl b/translations/check-ts.pl
index 5f38703..0ff9d17 100755
--- a/translations/check-ts.pl
+++ b/translations/check-ts.pl
@@ -49,7 +49,7 @@ my @groups = ("assistant", "designer", "linguist", "qt_help", "qtconfig", "qvfb"
 my %scores = ();
 my %langs = ();
 
-my $files = join("\n", <*.ts>);
+my $files = join("\n", <*_??.ts>);
 my $res = `xmlpatterns -param files=\"$files\" check-ts.xq`;
 for my $i (split(/ /, $res)) {
   $i =~ /^([^.]+).ts:(.*)$/;
diff --git a/translations/translations.pri b/translations/translations.pri
index b41f2a0..735411e 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -25,7 +25,8 @@ defineTest(addTsTargets) {
         lang = $$replace(file, .*_((.._)?..)\\.ts$, \\1)
         addTsTarget(ts-$$lang, ts-$$1-$$lang, $$2, $$file)
     }
-    addTsTarget(ts-all, ts-$$1-all, $$2, $$files)
+    addTsTarget(ts-untranslated, ts-$$1-untranslated, $$2, $$PWD/$${1}_untranslated.ts)
+    addTsTarget(ts-all, ts-$$1-all, $$2, $$PWD/$${1}_untranslated.ts $$files)
 }
 
 addTsTargets(qt, -I../include -I../include/Qt \
@@ -59,6 +60,7 @@ check-ts.depends = ts-all
 
 ts.commands = \
     @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
-    echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead.\"
+    echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead. To add a language,\" && \
+    echo \"use \'untranslated\' for <lang>, rename the files and re-run \'qmake\'.\"
 
 QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts check-ts
-- 
cgit v0.12


From 468eb186427067549191f3b921c9f9d75a6947ef Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 13 Jul 2010 20:39:37 +0200
Subject: add commit-ts target to commit ts files without line number info

it is pretty pointless to commit the extracted line number information,
as it needs to be refreshed after pulling source code changes anyway. on
top of it, it bloats the repository.
---
 translations/translations.pri | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/translations/translations.pri b/translations/translations.pri
index 735411e..c27e955 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -1,3 +1,4 @@
+qtPrepareTool(LCONVERT, lconvert)
 qtPrepareTool(LUPDATE, lupdate)
 LUPDATE += -locations relative -no-ui-lines
 
@@ -58,9 +59,25 @@ addTsTargets(qvfb, ../tools/qvfb/qvfb.pro)
 check-ts.commands = (cd $$PWD && perl check-ts.pl)
 check-ts.depends = ts-all
 
+isEqual(QMAKE_DIR_SEP, /) {
+    commit-ts.commands = \
+        cd $$PWD/..; \
+        for f in `git diff-files --name-only translations/*_??.ts`; do \
+            $$LCONVERT -locations none -i \$\$f -o \$\$f; \
+        done; \
+        git add translations/*_??.ts && git commit
+} else {
+    wd = $$replace(PWD, /, \\)\\..
+    commit-ts.commands = \
+        cd $$wd && \
+        for /f usebackq %%f in (`git diff-files --name-only translations/*_??.ts`) do \
+            $$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
+        cd $$wd && git add translations/*_??.ts && git commit
+}
+
 ts.commands = \
     @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
     echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead. To add a language,\" && \
     echo \"use \'untranslated\' for <lang>, rename the files and re-run \'qmake\'.\"
 
-QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts check-ts
+QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts commit-ts check-ts
-- 
cgit v0.12


From 63f1fc5e7aac3b9b088b90577a2c5208be571183 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Wed, 14 Jul 2010 11:21:11 +0200
Subject: remove dependency of ts targets on sub-tools

it is pretty pointless, really. these are manual targets, so if they
fail because of missing tools, the user can just make sub-tools
manually. way better than wasting time waiting for make to run through
the whole qt tree each time.
---
 translations/translations.pri | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/translations/translations.pri b/translations/translations.pri
index c27e955..fbc1596 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -7,11 +7,8 @@ TS_TARGETS =
 # meta target name, target name, lupdate base options, files
 defineTest(addTsTarget) {
     cv = $${2}.commands
-    dv = $${2}.depends
     $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
-    $$dv = sub-tools
     export($$cv)
-    export($$dv)
     dv = $${1}.depends
     $$dv += $$2
     export($$dv)
-- 
cgit v0.12


From 4fc1008163907459d921c4089512268495245976 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Thu, 15 Jul 2010 18:42:28 +0200
Subject: cosmetics: quote the dot in the regexp

---
 translations/check-ts.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/translations/check-ts.pl b/translations/check-ts.pl
index 0ff9d17..500be15 100755
--- a/translations/check-ts.pl
+++ b/translations/check-ts.pl
@@ -52,7 +52,7 @@ my %langs = ();
 my $files = join("\n", <*_??.ts>);
 my $res = `xmlpatterns -param files=\"$files\" check-ts.xq`;
 for my $i (split(/ /, $res)) {
-  $i =~ /^([^.]+).ts:(.*)$/;
+  $i =~ /^([^.]+)\.ts:(.*)$/;
   my ($fn, $pc) = ($1, $2);
   for my $g (@groups) {
     if ($fn =~ /^${g}_(.*)$/) {
-- 
cgit v0.12


From 40d2b2e30a526b46b17072ba8bdc38f30cd3c624 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Thu, 15 Jul 2010 18:44:18 +0200
Subject: remove nasty hack by using a stricter regexp (for language codes)

---
 translations/check-ts.pl | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/translations/check-ts.pl b/translations/check-ts.pl
index 500be15..067cad8 100755
--- a/translations/check-ts.pl
+++ b/translations/check-ts.pl
@@ -43,8 +43,7 @@
 
 use strict;
 
-# "qt" must come last to avoid prefix matching.
-my @groups = ("assistant", "designer", "linguist", "qt_help", "qtconfig", "qvfb", "qt");
+my @groups = ("qt", "assistant", "designer", "linguist", "qt_help", "qtconfig", "qvfb");
 
 my %scores = ();
 my %langs = ();
@@ -55,7 +54,7 @@ for my $i (split(/ /, $res)) {
   $i =~ /^([^.]+)\.ts:(.*)$/;
   my ($fn, $pc) = ($1, $2);
   for my $g (@groups) {
-    if ($fn =~ /^${g}_(.*)$/) {
+    if ($fn =~ /^${g}_((.._)?..)$/) {
       my $lang = $1;
       $scores{$g}{$lang} = $pc;
       $langs{$lang} = 1;
@@ -64,10 +63,6 @@ for my $i (split(/ /, $res)) {
   }
 }
 
-# now we move "qt" to the front, as it should be the first column.
-pop @groups;
-unshift @groups, "qt";
-
 my $code = "";
 
 print "L10n  ";
-- 
cgit v0.12


From 062a504010534d5e899f042b27c8ace82b556426 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Fri, 16 Jul 2010 09:56:19 +1000
Subject: Fixed tst_maketestselftest::tests_pro_files failure

Add qauthenticator to tests/auto/network.pro
---
 tests/auto/network.pro | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/auto/network.pro b/tests/auto/network.pro
index 4f205fe..e1898f1 100644
--- a/tests/auto/network.pro
+++ b/tests/auto/network.pro
@@ -7,6 +7,7 @@ SUBDIRS=\
     networkselftest \
     qabstractnetworkcache \
     qabstractsocket \
+    qauthenticator \
     qeventloop \
     qftp \
     qhostaddress \
@@ -36,6 +37,7 @@ SUBDIRS=\
     qsslsocket \
 
 contains(QT_CONFIG, private_tests): SUBDIRS -= \
+    qauthenticator \
     qhttpnetworkconnection \
     qhttpnetworkreply \
     qnativesocketengine \
-- 
cgit v0.12


From f90ce20ad1c7feec9b72fdeda42ab56fe7c079c5 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Fri, 16 Jul 2010 10:03:17 +1000
Subject: Fixed some network tests never being run.

This logic for private_tests was the opposite of what it should be,
meaning that network tests which use Q_AUTOTEST_EXPORTs have not been
run for some time :-(
---
 tests/auto/network.pro | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/auto/network.pro b/tests/auto/network.pro
index bda03d3..c3ca58a 100644
--- a/tests/auto/network.pro
+++ b/tests/auto/network.pro
@@ -31,7 +31,7 @@ SUBDIRS=\
     qsslkey \
     qsslsocket \
 
-contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!contains(QT_CONFIG, private_tests): SUBDIRS -= \
     qhttpnetworkconnection \
     qhttpnetworkreply \
     qnativesocketengine \
-- 
cgit v0.12


From 3a51462bfb3cca8c90e1c690cf045b371d2ab393 Mon Sep 17 00:00:00 2001
From: Charles Yin <charles.yin@nokia.com>
Date: Fri, 16 Jul 2010 11:17:02 +1000
Subject: Fixes the Oracle invalid date bug when date is greater or equal to
 2800 By converting the char into unsigned char to avoid the overflow when
 getting the century from a char for years greater or equal to 2800.

Task-number: QTBUG-8210
Reviewed-by: Michael Goddard
---
 src/sql/drivers/oci/qsql_oci.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index 2f0cfdc..c56b995 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -648,7 +648,7 @@ QByteArray qMakeOraDate(const QDateTime& dt)
 
 QDateTime qMakeDate(const char* oraDate)
 {
-    int century = oraDate[0];
+    int century = uchar(oraDate[0]);
     if(century >= 100){
         int year    = uchar(oraDate[1]);
         year = ((century-100)*100) + (year-100);
-- 
cgit v0.12


From 6771ce532f8b61499c998a502ea8c73e8e42262b Mon Sep 17 00:00:00 2001
From: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Date: Fri, 16 Jul 2010 14:06:03 +1000
Subject: Added a QPixmap based QAbstractVideoBuffer HandleType.

It can be used for example when the hw video decoder can use
X11 pixmaps as a rendering target.

Reviewed-by: Justin McPherson
---
 src/multimedia/video/qabstractvideobuffer.cpp | 1 +
 src/multimedia/video/qabstractvideobuffer.h   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/multimedia/video/qabstractvideobuffer.cpp b/src/multimedia/video/qabstractvideobuffer.cpp
index e9d30d0..db05ee5 100644
--- a/src/multimedia/video/qabstractvideobuffer.cpp
+++ b/src/multimedia/video/qabstractvideobuffer.cpp
@@ -73,6 +73,7 @@ QT_BEGIN_NAMESPACE
     \value GLTextureHandle The handle of the buffer is an OpenGL texture ID.
     \value XvShmImageHandle The handle contains pointer to shared memory XVideo image.
     \value CoreImageHandle The handle contains pointer to Mac OS X CIImage.
+    \value QPixmapHandle The handle of the buffer is a QPixmap.
     \value UserHandle Start value for user defined handle types.
 
     \sa handleType()
diff --git a/src/multimedia/video/qabstractvideobuffer.h b/src/multimedia/video/qabstractvideobuffer.h
index a8389db..98e12da 100644
--- a/src/multimedia/video/qabstractvideobuffer.h
+++ b/src/multimedia/video/qabstractvideobuffer.h
@@ -63,6 +63,7 @@ public:
         GLTextureHandle,
         XvShmImageHandle,
         CoreImageHandle,
+        QPixmapHandle,
         UserHandle = 1000
     };
 
-- 
cgit v0.12


From 875ae40157aa9a34e0b74941fa905f7445c365df Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Fri, 16 Jul 2010 15:56:42 +1000
Subject: Minor animation doc improvement

---
 doc/src/declarative/animation.qdoc             | 4 +++-
 src/declarative/util/qdeclarativeanimation.cpp | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc
index c5333df..401cf16 100644
--- a/doc/src/declarative/animation.qdoc
+++ b/doc/src/declarative/animation.qdoc
@@ -67,7 +67,9 @@ A property animation can also be specified as a resource that is manipulated fro
 \snippet doc/src/snippets/declarative/animation.qml property-anim-3
 
 As can be seen, when an animation is used like this (as opposed to as a value source) you will need
-to explicitly set the \c target and \c property to animate.
+to explicitly set the \c target and \c property to animate.  This also the only case where
+an animation needs to be started explictly by either setting the \c running property to
+true or calling the \c start() method.
 
 Animations can be joined into a group using SequentialAnimation and ParallelAnimation.
 
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index bdb9510..5005746 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -1671,6 +1671,9 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
     different. For more information see the individual property documentation, as well
     as the \l{QML Animation} introduction.
 
+    Note that PropertyAnimation inherits the abstract \l Animation element.
+    This includes additional properties and methods for controlling the animation.
+
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
 
-- 
cgit v0.12


From 6d5d19b5d92868ed1cd53ea9e6bf8b1119d0da10 Mon Sep 17 00:00:00 2001
From: Warwick Allison <warwick.allison@nokia.com>
Date: Fri, 16 Jul 2010 16:32:27 +1000
Subject: Allow test to pass on smaller screens (eg. 480 high).

---
 .../qdeclarativeviewer/tst_qdeclarativeviewer.cpp  | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index b08da0f..de8d222 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -152,16 +152,16 @@ void tst_QDeclarativeViewer::loading()
 
     TEST_INITIAL_SIZES(viewer);
 
-    viewer->resize(QSize(400, 500));
+    viewer->resize(QSize(250, 350));
     qApp->processEvents();
 
     // window resized
-    QTRY_COMPARE(rootItem->width(), 400.0);
-    QTRY_COMPARE(rootItem->height(), 500.0 - MENUBAR_HEIGHT(viewer));
-    QCOMPARE(viewer->view()->size(), QSize(400, 500 - MENUBAR_HEIGHT(viewer)));
+    QTRY_COMPARE(rootItem->width(), 250.0);
+    QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+    QCOMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
     QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
-    QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500 - MENUBAR_HEIGHT(viewer)));
-    QCOMPARE(viewer->size(), QSize(400, 500));
+    QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
+    QCOMPARE(viewer->size(), QSize(250, 350));
     QCOMPARE(viewer->size(), viewer->sizeHint());
 
     viewer->reload();
@@ -177,16 +177,16 @@ void tst_QDeclarativeViewer::loading()
     QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
     QCOMPARE(viewer->size(), viewer->sizeHint());
 
-    viewer->resize(QSize(400, 500));
+    viewer->resize(QSize(250, 350));
     qApp->processEvents();
 
     // window resized again
-    QTRY_COMPARE(rootItem->width(), 400.0);
-    QTRY_COMPARE(rootItem->height(), 500.0 - MENUBAR_HEIGHT(viewer));
-    QCOMPARE(viewer->view()->size(), QSize(400, 500 - MENUBAR_HEIGHT(viewer)));
+    QTRY_COMPARE(rootItem->width(), 250.0);
+    QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+    QCOMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
     QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
-    QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500 - MENUBAR_HEIGHT(viewer)));
-    QCOMPARE(viewer->size(), QSize(400, 500));
+    QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
+    QCOMPARE(viewer->size(), QSize(250, 350));
     QCOMPARE(viewer->size(), viewer->sizeHint());
 
     viewer->open(SRCDIR "/data/orientation.qml");
-- 
cgit v0.12


From 571b85896ee3663479b4a10d2418e2e19b3639f3 Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Fri, 16 Jul 2010 08:58:04 +0200
Subject: Fix compilation after merge

Reviewed-by: TrustMe
---
 src/gui/dialogs/qfontdialog.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp
index 5859e63..b159fa7 100644
--- a/src/gui/dialogs/qfontdialog.cpp
+++ b/src/gui/dialogs/qfontdialog.cpp
@@ -334,7 +334,6 @@ void QFontDialogPrivate::init()
 
     familyList->setFocus();
     retranslateStrings();
-    nativeDialogInUse = false;
 }
 
 /*!
-- 
cgit v0.12


From ae39a510f86fd13d6d41bc85d4f5c243eca45eab Mon Sep 17 00:00:00 2001
From: Lasse Holmstedt <lasse.holmstedt@nokia.com>
Date: Wed, 14 Jul 2010 15:17:35 +0200
Subject: Fixed debugger's evaluation of dynamic properties in context

Reviewed-by: Aaron Kennedy
---
 src/declarative/qml/qdeclarativeenginedebug.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 001da46..008d054 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -495,7 +495,7 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId,
                 QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
             } else {
                 QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
-                QDeclarativeProperty property(object, propertyName);
+                QDeclarativeProperty property(object, propertyName, context);
                 binding->setTarget(property);
                 binding->setNotifyOnValueChanged(true);
                 QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
-- 
cgit v0.12


From bca7646d81d8c580820cf5f6e52122da6d984c6b Mon Sep 17 00:00:00 2001
From: Markus Goetz <Markus.Goetz@nokia.com>
Date: Fri, 16 Jul 2010 09:34:51 +0200
Subject: Network Proxy Query: Fix memleak on OS X

Task-number: QTBUG-12106
---
 src/network/kernel/qnetworkproxy_mac.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp
index 1e22212..4139a7e 100644
--- a/src/network/kernel/qnetworkproxy_mac.cpp
+++ b/src/network/kernel/qnetworkproxy_mac.cpp
@@ -157,8 +157,10 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
         return result;          // failed
     }
 
-    if (isHostExcluded(dict, query.peerHostName()))
+    if (isHostExcluded(dict, query.peerHostName())) {
+        CFRelease(dict);
         return result;          // no proxy for this host
+    }
 
     // is there a PAC enabled? If so, use it first.
     CFNumberRef pacEnabled;
@@ -222,6 +224,7 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
             result << https;
     }
 
+    CFRelease(dict);
     return result;
 }
 
-- 
cgit v0.12


From 1ea53e6055a7c4e9677a5003725785ad503bb242 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Fri, 16 Jul 2010 18:11:36 +1000
Subject: fixes, improvements for various docs and example code

---
 doc/src/declarative/qdeclarativemodels.qdoc        |  16 +-
 doc/src/snippets/declarative/coloranimation.qml    |  52 +++++++
 doc/src/snippets/declarative/numberanimation.qml   |  52 +++++++
 doc/src/snippets/declarative/propertyanimation.qml | 101 +++++++++++++
 doc/src/snippets/declarative/smoothedanimation.qml |  69 +++++++++
 doc/src/snippets/declarative/springanimation.qml   |  65 ++++++++
 doc/src/snippets/declarative/state.qml             |  23 +--
 .../snippets/declarative/transition-from-to.qml    |  62 ++++++++
 .../snippets/declarative/transition-reversible.qml |  65 ++++++++
 doc/src/snippets/declarative/transition.qml        |  59 ++++++++
 .../modelviews/abstractitemmodel/model.cpp         |   2 +
 .../graphicsitems/qdeclarativeborderimage.cpp      |   2 +
 src/declarative/util/qdeclarativeanimation.cpp     | 163 ++++++++++++++-------
 .../util/qdeclarativesmoothedanimation.cpp         |  44 ++----
 .../util/qdeclarativespringanimation.cpp           |  32 +++-
 src/declarative/util/qdeclarativestate.cpp         |  24 ++-
 src/declarative/util/qdeclarativetransition.cpp    |  96 ++++++++++--
 17 files changed, 805 insertions(+), 122 deletions(-)
 create mode 100644 doc/src/snippets/declarative/coloranimation.qml
 create mode 100644 doc/src/snippets/declarative/numberanimation.qml
 create mode 100644 doc/src/snippets/declarative/propertyanimation.qml
 create mode 100644 doc/src/snippets/declarative/smoothedanimation.qml
 create mode 100644 doc/src/snippets/declarative/springanimation.qml
 create mode 100644 doc/src/snippets/declarative/transition-from-to.qml
 create mode 100644 doc/src/snippets/declarative/transition-reversible.qml
 create mode 100644 doc/src/snippets/declarative/transition.qml

diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc
index b44e6f2..e02575d 100644
--- a/doc/src/declarative/qdeclarativemodels.qdoc
+++ b/doc/src/declarative/qdeclarativemodels.qdoc
@@ -208,7 +208,10 @@ Models can be defined in C++ and then made available to QML. This is useful
 for exposing existing C++ data models or otherwise complex datasets to QML.
 
 A C++ model class can be defined as a QStringList, a QList<QObject*> or a
-QAbstractItemModel. 
+QAbstractItemModel. The first two are useful for exposing simpler datasets,
+while QAbstractItemModel provides a more flexible solution for more complex
+models.
+
 
 \section2 QStringList
 
@@ -268,7 +271,10 @@ the model by calling QDeclarativeContext::setContextProperty() again.
 
 \section2 QAbstractItemModel
 
-A model can be defined by subclassing QAbstractItemModel.
+A model can be defined by subclassing QAbstractItemModel. This is the
+best approach if you have a more complex model that cannot be supported
+by the other approaches. A QAbstractItemModel can also automatically 
+notify a QML view when the model data has changed.
 
 The roles of a QAbstractItemModel subclass can be exposed to QML by calling 
 QAbstractItemModel::setRoleNames(). The default role names set by Qt are:
@@ -305,6 +311,12 @@ roles:
 
 \snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0
 
+QML views are automatically updated when the model changes. Remember the model
+must follow the standard rules for model changes and notify the view when
+the model has changed by using QAbstractItemModel::dataChanged(), 
+QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for
+more information.
+
 The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory.
 
 QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML
diff --git a/doc/src/snippets/declarative/coloranimation.qml b/doc/src/snippets/declarative/coloranimation.qml
new file mode 100644
index 0000000..4e35f22
--- /dev/null
+++ b/doc/src/snippets/declarative/coloranimation.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    width: 100; height: 100
+    color: "red"
+
+    ColorAnimation on color { to: "yellow"; duration: 1000 }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/numberanimation.qml b/doc/src/snippets/declarative/numberanimation.qml
new file mode 100644
index 0000000..57d23b1
--- /dev/null
+++ b/doc/src/snippets/declarative/numberanimation.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    width: 100; height: 100
+    color: "red"
+
+    NumberAnimation on x { to: 50; duration: 1000 }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/propertyanimation.qml b/doc/src/snippets/declarative/propertyanimation.qml
new file mode 100644
index 0000000..059cde5
--- /dev/null
+++ b/doc/src/snippets/declarative/propertyanimation.qml
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Row {
+
+//![transition]
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    states: State {
+        name: "moved"
+        PropertyChanges { target: rect; x: 50 }
+    }
+
+    transitions: Transition { 
+        PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } 
+    }
+}
+//![transition]
+
+//![behavior]
+Rectangle {
+    width: 100; height: 100
+    color: "red"
+
+    Behavior on x { PropertyAnimation {} }
+
+    MouseArea { anchors.fill: parent; onClicked: parent.x = 50 }
+}
+//![behavior]
+
+//![propertyvaluesource]
+Rectangle {
+    width: 100; height: 100
+    color: "red"
+
+    SequentialAnimation on x {
+        loops: Animation.Infinite
+        PropertyAnimation { to: 50 }
+        PropertyAnimation { to: 0 }
+    }
+}
+//![propertyvaluesource]
+
+//![standalone]
+Rectangle {
+    id: theRect
+    width: 100; height: 100
+    color: "red"
+
+    // this is a standalone animation, it's not running by default
+    PropertyAnimation { id: animation; target: theRect; property: "width"; to: 30; duration: 500 }
+
+    MouseArea { anchors.fill: parent; onClicked: animation.running = true }
+}
+//![standalone]
+
+
+}
diff --git a/doc/src/snippets/declarative/smoothedanimation.qml b/doc/src/snippets/declarative/smoothedanimation.qml
new file mode 100644
index 0000000..20c90b5
--- /dev/null
+++ b/doc/src/snippets/declarative/smoothedanimation.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    width: 800; height: 600
+    color: "blue"
+
+    Rectangle {
+        width: 60; height: 60
+        x: rect1.x - 5; y: rect1.y - 5
+        color: "green"
+
+        Behavior on x { SmoothedAnimation { velocity: 200 } }
+        Behavior on y { SmoothedAnimation { velocity: 200 } }
+    }
+
+    Rectangle {
+        id: rect1
+        width: 50; height: 50
+        color: "red"
+    }
+
+    focus: true
+    Keys.onRightPressed: rect1.x = rect1.x + 100
+    Keys.onLeftPressed: rect1.x = rect1.x - 100
+    Keys.onUpPressed: rect1.y = rect1.y - 100
+    Keys.onDownPressed: rect1.y = rect1.y + 100
+}
+//![0]
diff --git a/doc/src/snippets/declarative/springanimation.qml b/doc/src/snippets/declarative/springanimation.qml
new file mode 100644
index 0000000..b73a9d2
--- /dev/null
+++ b/doc/src/snippets/declarative/springanimation.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    width: 300; height: 300
+
+    Rectangle {
+        id: rect
+        width: 50; height: 50
+        color: "red"
+
+        Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } }
+        Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } }
+    }
+
+    MouseArea {
+        anchors.fill: parent
+        onClicked: {
+            rect.x = mouse.x
+            rect.y = mouse.y
+        }
+    }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/state.qml b/doc/src/snippets/declarative/state.qml
index a99c2e2..af6b103 100644
--- a/doc/src/snippets/declarative/state.qml
+++ b/doc/src/snippets/declarative/state.qml
@@ -44,26 +44,13 @@ import Qt 4.7
 Rectangle {
     id: myRect
     width: 100; height: 100
-    color: "black"
+    color: "red"
 
-    states: [
-        State {
-            name: "clicked"
-            PropertyChanges {
-                target: myRect
-                color: "red"
-            }
-        }
-    ]
+    MouseArea { id: mouseArea; anchors.fill: parent }
 
-    MouseArea {
-        anchors.fill: parent
-        onClicked: {
-            if (myRect.state == "")     // i.e. the default state
-                myRect.state = "clicked";
-            else
-                myRect.state = "";
-        }
+    states: State {
+        name: "hidden"; when: mouseArea.pressed
+        PropertyChanges { target: myRect; opacity: 0 }
     }
 }
 //![0]
diff --git a/doc/src/snippets/declarative/transition-from-to.qml b/doc/src/snippets/declarative/transition-from-to.qml
new file mode 100644
index 0000000..615de17
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-from-to.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+//![0]
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    MouseArea { id: mouseArea; anchors.fill: parent }
+
+    states: State {
+        name: "brighter"; when: mouseArea.pressed
+        PropertyChanges { target: rect; color: "yellow" }
+    }
+
+    transitions: Transition { 
+        ColorAnimation { duration: 1000 }
+    }
+}
+//![0]
+
+
diff --git a/doc/src/snippets/declarative/transition-reversible.qml b/doc/src/snippets/declarative/transition-reversible.qml
new file mode 100644
index 0000000..8a7b69a
--- /dev/null
+++ b/doc/src/snippets/declarative/transition-reversible.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import Qt 4.7
+
+//![0]
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    MouseArea { id: mouseArea; anchors.fill: parent }
+
+    states: State {
+        name: "brighter"
+        when: mouseArea.pressed
+        PropertyChanges { target: rect; color: "yellow"; x: 50 }
+    }
+
+    transitions: Transition { 
+        SequentialAnimation {
+            PropertyAnimation { property: "x"; duration: 1000 }
+            ColorAnimation { duration: 1000 }
+        }
+    }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/transition.qml b/doc/src/snippets/declarative/transition.qml
new file mode 100644
index 0000000..b884750
--- /dev/null
+++ b/doc/src/snippets/declarative/transition.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    states: State {
+        name: "moved"
+        PropertyChanges { target: rect; x: 50; y: 50 }
+    }
+
+    transitions: Transition { 
+        PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } 
+    }
+}
+//![0]
+
diff --git a/examples/declarative/modelviews/abstractitemmodel/model.cpp b/examples/declarative/modelviews/abstractitemmodel/model.cpp
index d0e0971..940a44d 100644
--- a/examples/declarative/modelviews/abstractitemmodel/model.cpp
+++ b/examples/declarative/modelviews/abstractitemmodel/model.cpp
@@ -67,7 +67,9 @@ AnimalModel::AnimalModel(QObject *parent)
 
 void AnimalModel::addAnimal(const Animal &animal)
 {
+    beginInsertRows(QModelIndex(), rowCount(), rowCount());
     m_animals << animal;
+    endInsertRows();
 }
 
 int AnimalModel::rowCount(const QModelIndex & parent) const {
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index 44c206b..4881248 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -149,6 +149,8 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
     \endqml
 
     The URL may be absolute, or relative to the URL of the component.
+
+    \sa QDeclarativeImageProvider
 */
 void QDeclarativeBorderImage::setSource(const QUrl &url)
 {
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 5005746..88ec5ba 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -634,13 +634,23 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
     \inherits PropertyAnimation
     \brief The ColorAnimation element allows you to animate color changes.
 
-    \code
-    ColorAnimation { from: "white"; to: "#c0c0c0"; duration: 100 }
-    \endcode
+    ColorAnimation defines an animation to be applied when a color value 
+    changes.
+
+    Here is a ColorAnimation applied to the \c color property of a \l Rectangle 
+    as a property value source:
+
+    \snippet doc/src/snippets/declarative/coloranimation.qml 0
+
+    Like any other animation element, a NumberAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
 
     When used in a transition, ColorAnimation will by default animate
-    all properties of type color that are changing. If a property or properties
-    are explicitly set for the animation, then those will be used instead.
+    all properties of type color that have changed. If a \l{PropertyAnimation::}{property} 
+    or \l{PropertyAnimation::}{properties} are explicitly set for the animation, 
+    then those are used instead.
 
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -665,6 +675,17 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
 /*!
     \qmlproperty color ColorAnimation::from
     This property holds the starting color.
+
+    For example, the following animation is not applied until a color value
+    has reached "#c0c0c0":
+
+    Item {
+        states: [ ... ]
+
+        transition: Transition {
+            NumberAnimation { from: "#c0c0c0"; duration: 2000 }
+        }
+    }
 */
 QColor QDeclarativeColorAnimation::from() const
 {
@@ -1098,11 +1119,22 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
     \inherits PropertyAnimation
     \brief The NumberAnimation element allows you to animate changes in properties of type qreal.
 
-    For example, to animate a set of properties over 200ms, from their values in the start state to
-    their values in the end state of the transition:
-    \code
-    NumberAnimation { properties: "x,y,scale"; duration: 200 }
-    \endcode
+    NumberAnimation defines an animation to be applied when a numerical value 
+    changes.
+
+    Here is a NumberAnimation applied to the \c x property of a \l Rectangle 
+    as a property value source:
+
+    \snippet doc/src/snippets/declarative/numberanimation.qml 0
+
+    Like any other animation element, a NumberAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
+
+    Note that NumberAnimation may not animate smoothly if there are irregular
+    changes in the number value that it is tracking. If this is the case, use
+    SmoothedAnimation instead.
 
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -1137,9 +1169,23 @@ void QDeclarativeNumberAnimation::init()
 
 /*!
     \qmlproperty real NumberAnimation::from
-    This property holds the starting value.
-    If not set, then the value defined in the start state of the transition.
+    This property holds the starting number value.
+
+    For example, the following animation is not applied until the \c x value
+    has reached 100:
+
+    Item {
+        states: [ ... ]
+
+        transition: Transition {
+            NumberAnimation { properties: "x"; from: 100; duration: 200 }
+        }
+    }
+
+    If this value is not set, it defaults to the value defined in the start 
+    state of the \l Transition.
 */
+
 qreal QDeclarativeNumberAnimation::from() const
 {
     Q_D(const QDeclarativePropertyAnimation);
@@ -1153,8 +1199,10 @@ void QDeclarativeNumberAnimation::setFrom(qreal f)
 
 /*!
     \qmlproperty real NumberAnimation::to
-    This property holds the ending value.
-    If not set, then the value defined in the end state of the transition or Behavior.
+    This property holds the ending number value.
+
+    If this value is not set, it defaults to the value defined in the end 
+    state of the \l Transition or \l Behavior.
 */
 qreal QDeclarativeNumberAnimation::to() const
 {
@@ -1199,7 +1247,9 @@ QDeclarativeVector3dAnimation::~QDeclarativeVector3dAnimation()
 /*!
     \qmlproperty real Vector3dAnimation::from
     This property holds the starting value.
-    If not set, then the value defined in the start state of the transition.
+
+    If this value is not set, it defaults to the value defined in the start 
+    state of the \l Transition.
 */
 QVector3D QDeclarativeVector3dAnimation::from() const
 {
@@ -1215,7 +1265,9 @@ void QDeclarativeVector3dAnimation::setFrom(QVector3D f)
 /*!
     \qmlproperty real Vector3dAnimation::to
     This property holds the ending value.
-    If not set, then the value defined in the end state of the transition or Behavior.
+
+    If this value is not set, it defaults to the value defined in the end 
+    state of the \l Transition or \l Behavior.
 */
 QVector3D QDeclarativeVector3dAnimation::to() const
 {
@@ -1320,8 +1372,21 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
 
 /*!
     \qmlproperty real RotationAnimation::from
-    This property holds the starting value.
-    If not set, then the value defined in the start state of the transition.
+    This property holds the starting number value.
+
+    For example, the following animation is not applied until the \c angle value
+    has reached 100:
+
+    Item {
+        states: [ ... ]
+
+        transition: Transition {
+            RotationAnimation { properties: "angle"; from: 100; duration: 2000 }
+        }
+    }
+
+    If this value is not set, it defaults to the value defined in the start 
+    state of the \l Transition.
 */
 qreal QDeclarativeRotationAnimation::from() const
 {
@@ -1337,7 +1402,9 @@ void QDeclarativeRotationAnimation::setFrom(qreal f)
 /*!
     \qmlproperty real RotationAnimation::to
     This property holds the ending value.
-    If not set, then the value defined in the end state of the transition or Behavior.
+
+    If this value is not set, it defaults to the value defined in the end 
+    state of the \l Transition or \l Behavior.
 */
 qreal QDeclarativeRotationAnimation::to() const
 {
@@ -1620,51 +1687,49 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
     \inherits Animation
     \brief The PropertyAnimation element allows you to animate property changes.
 
-    PropertyAnimation provides a way to animate changes to a property's value. It can
-    be used in many different situations:
+    PropertyAnimation provides a way to animate changes to a property's value. 
+
+    It can be used to define animations in a number of ways:
+   
     \list
-    \o In a Transition
+    \o In a \l Transition
+
+    For example, to animate any objects that have changed their \c x or \c y properties 
+    as a result of a state change, using an \c InOutQuad easing curve:
+
+    \snippet doc/src/snippets/declarative/propertyanimation.qml transition
+
+
+    \o In a \l Behavior
+
+    For example, to animate all changes to a rectangle's \c x property:
+
+    \snippet doc/src/snippets/declarative/propertyanimation.qml behavior
 
-    Animate any objects that have changed their x or y properties in the target state using
-    an InOutQuad easing curve:
-    \qml
-    Transition { PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } }
-    \endqml
-    \o In a Behavior
 
-    Animate all changes to a rectangle's x property.
-    \qml
-    Rectangle {
-        Behavior on x { PropertyAnimation {} }
-    }
-    \endqml
     \o As a property value source
 
-    Repeatedly animate the rectangle's x property.
-    \qml
-    Rectangle {
-        SequentialAnimation on x {
-            loops: Animation.Infinite
-            PropertyAnimation { to: 50 }
-            PropertyAnimation { to: 0 }
-        }
-    }
-    \endqml
+    For example, to repeatedly animate the rectangle's \c x property:
+
+    \snippet doc/src/snippets/declarative/propertyanimation.qml propertyvaluesource
+
+
     \o In a signal handler
 
-    Fade out \c theObject when clicked:
+    For example, to fade out \c theObject when clicked:
     \qml
     MouseArea {
         anchors.fill: theObject
         onClicked: PropertyAnimation { target: theObject; property: "opacity"; to: 0 }
     }
     \endqml
+
     \o Standalone
 
-    Animate \c theObject's size property over 200ms, from its current size to 20-by-20:
-    \qml
-    PropertyAnimation { target: theObject; property: "size"; to: "20x20"; duration: 200 }
-    \endqml
+    For example, to animate \c rect's \c width property over 500ms, from its current width to 30:
+
+    \snippet doc/src/snippets/declarative/propertyanimation.qml standalone
+
     \endlist
 
     Depending on how the animation is used, the set of properties normally used will be
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index 5d47c30..e0d1097 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -272,33 +272,8 @@ void QSmoothedAnimation::init()
     with both a velocity of 200 and a duration of 8000 set.
 
     The follow example shows one rectangle tracking the position of another.
-\code
-import Qt 4.7
-
-Rectangle {
-    width: 800; height: 600; color: "blue"
-
-    Rectangle {
-        color: "green"
-        width: 60; height: 60;
-        x: rect1.x - 5; y: rect1.y - 5;
-        Behavior on x { SmoothedAnimation { velocity: 200 } }
-        Behavior on y { SmoothedAnimation { velocity: 200 } }
-    }
-
-    Rectangle {
-        id: rect1
-        color: "red"
-        width: 50; height: 50;
-    }
 
-    focus: true
-    Keys.onRightPressed: rect1.x = rect1.x + 100
-    Keys.onLeftPressed: rect1.x = rect1.x - 100
-    Keys.onUpPressed: rect1.y = rect1.y - 100
-    Keys.onDownPressed: rect1.y = rect1.y + 100
-}
-\endcode
+    \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
 
     The default velocity of SmoothedAnimation is 200 units/second.  Note that if the range of the
     value being animated is small, then the velocity will need to be adjusted
@@ -307,6 +282,11 @@ Rectangle {
     set to a value such as 0.5 units/second.  Animating from 0 to 1.0 with a velocity
     of 0.5 will take 2000 ms to complete.
 
+    Like any other animation element, a SmoothedAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
+
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
 
@@ -388,11 +368,13 @@ void QDeclarativeSmoothedAnimation::transition(QDeclarativeStateActions &actions
 
     Sets how the SmoothedAnimation behaves if an animation direction is reversed.
 
-    If reversing mode is \c SmoothedAnimation.Eased, the animation will smoothly decelerate, and
-    then reverse direction.  If the reversing mode is \c SmoothedAnimation.Immediate, the
-    animation will immediately begin accelerating in the reverse direction,
-    begining with a velocity of 0.  If the reversing mode is \c SmoothedAnimation.Sync, the
-    property is immediately set to the target value.
+    Possible values are:
+
+    \list
+    \o SmoothedAnimation.Eased (default) - the animation will smoothly decelerate, and then reverse direction
+    \o SmoothedAnimation.Immediate - the animation will immediately begin accelerating in the reverse direction, begining with a velocity of 0
+    \o SmoothedAnimation.Sync - the property is immediately set to the target value
+    \endlist
 */
 QDeclarativeSmoothedAnimation::ReversingMode QDeclarativeSmoothedAnimation::reversingMode() const
 {
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index 4cf2fc0..be0af6d 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -207,14 +207,24 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
     \qmlclass SpringAnimation QDeclarativeSpringAnimation
     \since 4.7
 
-    \brief The SpringAnimation element allows a property to track a value in a spring-like motion
+    \brief The SpringAnimation element allows a property to track a value in a spring-like motion.
 
     SpringAnimation mimics the oscillatory behavior of a spring, with the appropriate \l spring constant to
     control the acceleration and the \l damping to control how quickly the effect dies away.
 
     You can also limit the maximum \l velocity of the animation.
 
+    The following \l Rectangle moves to the position of the mouse using a 
+    SpringAnimation when the mouse is clicked:
 
+    \snippet doc/src/snippets/declarative/springanimation.qml 0
+
+    Like any other animation element, a SpringAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
+
+    \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example}
 */
 
 QDeclarativeSpringAnimation::QDeclarativeSpringAnimation(QObject *parent)
@@ -244,6 +254,11 @@ qreal QDeclarativeSpringAnimation::to() const
 
 /*!
     \qmlproperty real SpringAnimation::to
+
+    This property holds the value at which the animation will end.
+
+    If not set, the animation will continue until it reaches the
+    value that is being tracked.
 */
 
 void QDeclarativeSpringAnimation::setTo(qreal value)
@@ -266,6 +281,11 @@ qreal QDeclarativeSpringAnimation::from() const
 
 /*!
     \qmlproperty real SpringAnimation::from
+
+    This property holds the value from which the animation will begin.
+
+    If not set, the animation will start regardless of the 
+    value being tracked.
 */
 
 void QDeclarativeSpringAnimation::setFrom(qreal value)
@@ -325,10 +345,12 @@ void QDeclarativeSpringAnimation::setSpring(qreal spring)
 
 /*!
     \qmlproperty real SpringAnimation::damping
-    This property holds the spring damping constant
+    This property holds the spring damping value.
+
+    This value describes how quickly a sprung follower comes to rest.
 
-    The damping constant describes how quickly a sprung follower comes to rest.
-    Useful range is 0 - 1.0
+    The useful range is 0 - 1.0. The lower the value, the faster the
+    follower comes to rest.
 */
 qreal QDeclarativeSpringAnimation::damping() const
 {
@@ -348,7 +370,7 @@ void QDeclarativeSpringAnimation::setDamping(qreal damping)
 
 /*!
     \qmlproperty real SpringAnimation::epsilon
-    This property holds the spring epsilon
+    This property holds the spring epsilon.
 
     The epsilon is the rate and amount of change in the value which is close enough
     to 0 to be considered equal to zero. This will depend on the usage of the value.
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index ae19a9c..9f4cc39 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -144,7 +144,7 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje
     can, for example, be used to apply different sets of property values or execute
     different scripts.
 
-    The following example displays a single Rectangle. In the default state, the rectangle
+    The following example displays a single \l Rectangle. In the default state, the rectangle
     is colored black. In the "clicked" state, a PropertyChanges element changes the
     rectangle's color to red. Clicking within the MouseArea toggles the rectangle's state
     between the default state and the "clicked" state, thus toggling the color of the
@@ -157,7 +157,7 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje
     States are commonly used together with \l {state-transitions}{Transitions} to provide
     animations when state changes occur.
 
-    \note setting the state of an object from within another state of the same object is
+    \note Setting the state of an object from within another state of the same object is
     not allowed.
 
     \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, QtDeclarative
@@ -194,7 +194,7 @@ QDeclarativeState::~QDeclarativeState()
     \qmlproperty string State::name
     This property holds the name of the state.
 
-    Each state should have a unique name.
+    Each state should have a unique name within its item.
 */
 QString QDeclarativeState::name() const
 {
@@ -226,7 +226,23 @@ bool QDeclarativeState::isWhenKnown() const
     This property holds when the state should be applied.
 
     This should be set to an expression that evaluates to \c true when you want the state to
-    be applied.
+    be applied. For example, the following \l Rectangle changes in and out of the "hidden"
+    state when the \l MouseArea is pressed:
+
+    \qml
+    Rectangle {
+        id: myRect
+        width: 100; height: 100
+        color: "red"
+
+        MouseArea { id: mouseArea; anchors.fill: parent }
+
+        states: State {
+            name: "hidden"; when: mouseArea.pressed
+            PropertyChanges { target: myRect; opacity: 0 }
+        }
+    }
+    \endqml
 
     If multiple states in a group have \c when clauses that evaluate to \c true at the same time,
     the first matching state will be applied. For example, in the following snippet
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 38ed97e..34e1e2b 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -56,6 +56,30 @@ QT_BEGIN_NAMESPACE
     \since 4.7
     \brief The Transition element defines animated transitions that occur on state changes.
 
+    A Transition defines the animations to be applied when a \l State change occurs.
+
+    For example, the following \l Rectangle has two states: the default state, and
+    an added "moved" state. In the "moved state, the rectangle's position changes 
+    to (50, 50).  The added \l Transition specifies that when the rectangle
+    changes between the default and the "moved" state, any changes
+    to the \c x and \c y properties should be animated, using an \c Easing.InOutQuad.
+   
+    \snippet doc/src/snippets/declarative/transition.qml 0
+
+    Items can have multiple transitions, if 
+
+    To specify multiple transitions, specify \l Item::transitions as a list:
+
+    \qml
+    Item {
+        ...
+        transitions: [
+            Transition { ... }
+            Transition { ... }
+        ]
+    }
+    |endqml
+
     \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative}
 */
 
@@ -171,18 +195,31 @@ void QDeclarativeTransition::prepare(QDeclarativeStateOperation::ActionList &act
 /*!
     \qmlproperty string Transition::from
     \qmlproperty string Transition::to
-    These properties are selectors indicating which state changes should trigger the transition.
 
-    from is used in conjunction with to to determine when a transition should
-    be applied. By default from and to are both "*" (any state). In the following example,
-    the transition is applied when changing from state1 to state2.
-    \code
-    Transition {
-        from: "state1"
-        to: "state2"
-        ...
+    These properties indicate the state changes that trigger the transition.
+
+    The default values for these properties is "*" (that is, any state).
+
+    For example, the following transition has not set the \c to and \c from
+    properties, so the animation is always applied when changing between
+    the two states (i.e. when the mouse is pressed and released).
+
+    \snippet doc/src/snippets/declarative/transition-from-to.qml 0
+
+    If the transition was changed to this:
+
+    \qml
+        transitions: Transition { 
+            to: "brighter"
+            ColorAnimation { duration: 1000 }
+        }
     }
-    \endcode
+    \endqml
+
+    The animation would only be applied when changing from the default state to
+    the "brighter" state (i.e. when the mouse is pressed, but not on release).
+
+    \sa reversible
 */
 QString QDeclarativeTransition::fromState() const
 {
@@ -205,6 +242,24 @@ void QDeclarativeTransition::setFromState(const QString &f)
     This property holds whether the transition should be automatically reversed when the conditions that triggered this transition are reversed.
 
     The default value is false.
+
+    By default, transitions run in parallel and are applied to all state
+    changes if the \l from and \l to states have not been set. In this
+    situation, the transition is automatically applied when a state change
+    is reversed, and it is not necessary to set this property to reverse
+    the transition.
+
+    However, if a SequentialAnimation is used, or if the \l from or \l to 
+    properties have been set, this property will need to be set to reverse
+    a transition when a state change is reverted. For example, the following
+    transition applies a sequential animation when the mouse is pressed,
+    and reverses the sequence of the animation when the mouse is released:
+
+    \snippet doc/src/snippets/declarative/transition-reversible.qml 0
+
+    If the transition did not set the \c to and \c reversible values, then 
+    on the mouse release, the transition would play the PropertyAnimation
+    before the ColorAnimation instead of reversing the sequence.
 */
 bool QDeclarativeTransition::reversible() const
 {
@@ -241,12 +296,27 @@ void QDeclarativeTransition::setToState(const QString &t)
 /*!
     \qmlproperty list<Animation> Transition::animations
     \default
+
     This property holds a list of the animations to be run for this transition.
 
+    \qml
+    Transition {
+        PropertyAnimation { ... }
+        NumberAnimation { ... }
+    }
+    \endqml
+
     The top-level animations are run in parallel. To run them sequentially,
-    you can create a single SequentialAnimation which contains all the animations,
-    and assign that to animations the animations property.
-    \default
+    define them within a SequentialAnimation:
+
+    \qml
+    Transition {
+        SequentialAnimation {
+            PropertyAnimation { ... }
+            NumberAnimation { ... }
+        }
+    }
+    \endqml
 */
 QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeTransition::animations()
 {
-- 
cgit v0.12


From 11f5b578e398c99570215facb905f1d82f6d6817 Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Fri, 16 Jul 2010 10:33:26 +0200
Subject: update def files for 69027cdb2ab9b89673edf29d5034bed33e614a05

Reviewed-by: Trust Me
---
 src/s60installs/bwins/QtNetworku.def | 3 +++
 src/s60installs/eabi/QtNetworku.def  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def
index 9d4507b..9911b36 100644
--- a/src/s60installs/bwins/QtNetworku.def
+++ b/src/s60installs/bwins/QtNetworku.def
@@ -1144,4 +1144,7 @@ EXPORTS
 	?startPolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1143 NONAME ; void QNetworkConfigurationManagerPrivate::startPolling(void)
 	?capabilities@QNetworkConfigurationManagerPrivate@@QAE?AV?$QFlags@W4Capability@QNetworkConfigurationManager@@@@XZ @ 1144 NONAME ; class QFlags<enum QNetworkConfigurationManager::Capability> QNetworkConfigurationManagerPrivate::capabilities(void)
 	?addPendingConnection@QTcpServer@@IAEXPAVQTcpSocket@@@Z @ 1145 NONAME ; void QTcpServer::addPendingConnection(class QTcpSocket *)
+	?option@QAuthenticator@@QBE?AVQVariant@@ABVQString@@@Z @ 1146 NONAME ; class QVariant QAuthenticator::option(class QString const &) const
+	?options@QAuthenticator@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 1147 NONAME ; class QHash<class QString, class QVariant> QAuthenticator::options(void) const
+	?setOption@QAuthenticator@@QAEXABVQString@@ABVQVariant@@@Z @ 1148 NONAME ; void QAuthenticator::setOption(class QString const &, class QVariant const &)
 
diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def
index 3cc3644..eb30832 100644
--- a/src/s60installs/eabi/QtNetworku.def
+++ b/src/s60installs/eabi/QtNetworku.def
@@ -1164,4 +1164,7 @@ EXPORTS
 	_ZTV35QNetworkConfigurationManagerPrivate @ 1163 NONAME
 	_ZThn8_N19QBearerEnginePluginD0Ev @ 1164 NONAME
 	_ZThn8_N19QBearerEnginePluginD1Ev @ 1165 NONAME
+	_ZN14QAuthenticator9setOptionERK7QStringRK8QVariant @ 1166 NONAME
+	_ZNK14QAuthenticator6optionERK7QString @ 1167 NONAME
+	_ZNK14QAuthenticator7optionsEv @ 1168 NONAME
 
-- 
cgit v0.12


From 70ffe96013dcf7b4be11d1fbe850b9bbcf37c741 Mon Sep 17 00:00:00 2001
From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Date: Fri, 16 Jul 2010 10:40:55 +0200
Subject: Added LatinAmericaAndTheCaribbean country to the doc.

Task-number: QTBUG-12063
Reviewed-by: trustme
---
 src/corelib/tools/qlocale.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index a51ee81..6b1de5e 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2096,6 +2096,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l)
     \value Serbia
     \value SaintBarthelemy
     \value SaintMartin
+    \value LatinAmericaAndTheCaribbean
     \omitvalue LastCountry
 
     \sa country()
-- 
cgit v0.12


From 4942890f85e5fa74bf8c37cf7f53f6f3eaf40596 Mon Sep 17 00:00:00 2001
From: Fabien Freling <fabien.freling@nokia.com>
Date: Mon, 31 May 2010 11:03:24 +0200
Subject: Revert the change in applicationShouldTerminate(). It used to fix an
 issue during logout but it seems to be fine now.

Related issue: QTBUG-6296

Task-number: QTBUG-10993
Reviewed-by: Morten Sorvig
---
 src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
index 5dcf613..7a9dc70 100644
--- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
+++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm
@@ -196,7 +196,6 @@ static void cleanupCocoaApplicationDelegate()
             qAppInstance()->quit();
             startedQuit = false;
         }
-        return NSTerminateNow;
     }
 
     if (qtPrivate->threadData->eventLoops.size() == 0) {
-- 
cgit v0.12


From 7a0b487ec10abd71bda6053021749740dc0ac545 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Fri, 16 Jul 2010 10:15:49 +0200
Subject: unused struct DIBINFO removed from qguifunctions_wince.cpp

Reviewed-by: Martin Petersson
---
 src/gui/kernel/qguifunctions_wince.cpp | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index f5004b0..cafddbf 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -131,15 +131,6 @@ static void resolveAygLibs()
     }
 }
 
-struct DIBINFO : public BITMAPINFO
-{
-    RGBQUAD arColors[255];
-
-    operator LPBITMAPINFO() { return (LPBITMAPINFO) this; }
-    operator LPBITMAPINFOHEADER() { return &bmiHeader; }
-    RGBQUAD* ColorTable() { return bmiColors; }
-};
-
 int qt_wince_GetDIBits(HDC /*hdc*/ , HBITMAP hSourceBitmap, uint, uint, LPVOID lpvBits, LPBITMAPINFO, uint)
 {
     if (!lpvBits) {
-- 
cgit v0.12


From 5f76c2b168ded91835d5d161b738a5dc03556cf6 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Fri, 16 Jul 2010 10:17:32 +0200
Subject: Windows mobile: show the [X] button in the taskbar when maximizing

We're now showing the cancel button explicitly in the taskbar on
maximize, if the widget does not have the widget flags
CancelButtonHint and OKButtonHint.

Task-number: QTBUG-8408
Reviewed-by: Martin Petersson
---
 src/gui/kernel/qguifunctions_wince.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index cafddbf..bdaed65 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -314,6 +314,8 @@ void qt_wince_maximize(QWidget *widget)
             shidi.dwFlags |= SHIDIF_CANCELBUTTON;
         if (widget->windowFlags() & Qt::WindowOkButtonHint)
             shidi.dwFlags |= SHIDIF_DONEBUTTON;
+        if (!(widget->windowFlags() & (Qt::WindowCancelButtonHint | Qt::WindowOkButtonHint)))
+            shidi.dwFlags |= SHIDIF_CANCELBUTTON;
         resolveAygLibs();
         if (ptrAygInitDialog)
             ptrAygInitDialog(&shidi);
-- 
cgit v0.12


From 2c1aafa47b8915ea8aae8da229d65086e42543b3 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Fri, 16 Jul 2010 10:37:58 +0200
Subject: Windows mobile: the [X] button in the taskbar minimizes the widget

The [X] or cancel button in the task bar shall just "minimize" the
widget on Windows mobile. A press on this button results in a
WM_COMMAND, IDCANCEL message. Before this patch we just sent a
QCloseEvent to the widget, which had basically no effect.
Now, we're calling showMinimzed(), which is the desired behaviour.

Task-number: QTBUG-8408
Reviewed-by: Martin Petersson
---
 src/gui/kernel/qapplication_win.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 9e8a128..ec26e81 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2485,7 +2485,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
             if (OkCommand)
                 QApplication::postEvent(widget, new QEvent(QEvent::OkRequest));
             if (CancelCommand)
-                QApplication::postEvent(widget, new QEvent(QEvent::Close));
+                widget->showMinimized();
             else
 #ifndef QT_NO_MENUBAR
                 QMenuBar::wceCommands(LOWORD(wParam));
-- 
cgit v0.12


From ad4aff6e2d188d88a2c6b4b692932adb08491d22 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Fri, 16 Jul 2010 10:43:14 +0200
Subject: Windows mobile: hide [X] button in task bar on unmaximize

When calling showNormal on a window that was maximized, we must remove
the [X] button from the task bar. But only if it was added by
qt_wince_maximize.

Task-number: QTBUG-8408
Reviewed-by: Martin Petersson
---
 src/gui/kernel/qguifunctions_wince.cpp | 17 +++++++++++++++++
 src/gui/kernel/qwidget_win.cpp         |  1 +
 src/gui/kernel/qwidget_wince.cpp       |  1 +
 3 files changed, 19 insertions(+)

diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp
index bdaed65..377dfe3 100644
--- a/src/gui/kernel/qguifunctions_wince.cpp
+++ b/src/gui/kernel/qguifunctions_wince.cpp
@@ -76,6 +76,10 @@ struct AygSIPINFO
 #define SHIDIF_SIZEDLGFULLSCREEN 0x0004
 #endif
 
+#ifndef SHDB_HIDE
+#define SHDB_HIDE 0x0002
+#endif
+
 #ifndef SHFS_SHOWTASKBAR
 #define SHFS_SHOWTASKBAR 0x0001
 #endif
@@ -112,10 +116,12 @@ struct AygSIPINFO
 typedef BOOL (*AygInitDialog)(AygSHINITDLGINFO*);
 typedef BOOL (*AygFullScreen)(HWND, DWORD);
 typedef BOOL (*AygSHSipInfo)(UINT, UINT, PVOID, UINT);
+typedef BOOL (*AygSHDoneButton)(HWND, DWORD);
 
 static AygInitDialog ptrAygInitDialog = 0;
 static AygFullScreen ptrAygFullScreen = 0;
 static AygSHSipInfo  ptrAygSHSipInfo  = 0;
+static AygSHDoneButton ptrAygSHDoneButton = 0;
 static bool aygResolved = false;
 
 static void resolveAygLibs()
@@ -128,6 +134,7 @@ static void resolveAygLibs()
         ptrAygInitDialog = (AygInitDialog) ayglib.resolve("SHInitDialog");
         ptrAygFullScreen = (AygFullScreen) ayglib.resolve("SHFullScreen");
         ptrAygSHSipInfo  = (AygSHSipInfo)  ayglib.resolve("SHSipInfo");
+        ptrAygSHDoneButton = (AygSHDoneButton) ayglib.resolve("SHDoneButton");
     }
 }
 
@@ -327,6 +334,16 @@ void qt_wince_maximize(QWidget *widget)
     }
 }
 
+void qt_wince_unmaximize(QWidget *widget)
+{
+    if (ptrAygSHDoneButton && qt_wince_is_mobile()
+        && !(widget->windowFlags() & (Qt::WindowCancelButtonHint | Qt::WindowOkButtonHint)))
+    {
+        // Hide the [X] button, we've added in qt_wince_maximize.
+        ptrAygSHDoneButton(widget->winId(), SHDB_HIDE);
+    }
+}
+
 void qt_wince_minimize(HWND hwnd)
 {
 #ifdef Q_OS_WINCE_WM
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 0f05c6b..23f57da 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -70,6 +70,7 @@
 #include "qguifunctions_wince.h"
 QT_USE_NAMESPACE
 extern void qt_wince_maximize(QWidget *widget);                          //defined in qguifunctions_wince.cpp
+extern void qt_wince_unmaximize(QWidget *widget);                        //defined in qguifunctions_wince.cpp
 extern void qt_wince_minimize(HWND hwnd);                                //defined in qguifunctions_wince.cpp
 extern void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf); //defined in qguifunctions_wince.cpp
 extern bool qt_wince_is_mobile();                                        //defined in qguifunctions_wince.cpp
diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp
index fc1e52c..76532ed 100644
--- a/src/gui/kernel/qwidget_wince.cpp
+++ b/src/gui/kernel/qwidget_wince.cpp
@@ -498,6 +498,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
                 int style = GetWindowLong(internalWinId(), GWL_STYLE) | WS_BORDER | WS_POPUP | WS_CAPTION;
                 SetWindowLong(internalWinId(), GWL_STYLE, style);
                 SetWindowLong(internalWinId(), GWL_EXSTYLE, GetWindowLong (internalWinId(), GWL_EXSTYLE) & ~ WS_EX_NODRAG);
+                qt_wince_unmaximize(this);
             }
             if (isVisible() && newstate & Qt::WindowMaximized)
                 qt_wince_maximize(this);
-- 
cgit v0.12


From 975b1913e44128a3e9b9055f9bf2ff40d86adf2a Mon Sep 17 00:00:00 2001
From: mae <qt-info@nokia.com>
Date: Fri, 16 Jul 2010 11:42:16 +0200
Subject: Fix RightBearing confusion in text layout

Negative RightBearing was wrongly taken into
account when calculating the line wrap

Reviewed-by: Eskil Abrahamsen Blomfeldt
---
 src/gui/text/qtextlayout.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index d6535ea..674064e 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1935,7 +1935,7 @@ void QTextLine::layout_helper(int maxGlyphs)
             // We ignore the right bearing if the minimum negative bearing is too little to
             // expand the text beyond the edge.
             if (sb_or_ws|breakany) {
-                if (lbh.calculateNewWidth(line) + lbh.minimumRightBearing > line.width)
+                if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width)
                     lbh.adjustRightBearing();
                 if (lbh.checkFullOtherwiseExtend(line)) {
                     if (!breakany) {
-- 
cgit v0.12


From 0f4dc1226bcc1204a2b11d737fbcb4b58acfaf08 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Wed, 14 Jul 2010 14:07:33 +0200
Subject: QDeclarativeDebugTrace: Do not send message if the client did not
 enabled CanvasFrameRate

This silents a lot of warnings in creator.

Reviewed-by: Aaron Kennedy
---
 src/declarative/debugger/qdeclarativedebugtrace.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/declarative/debugger/qdeclarativedebugtrace.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp
index 5e6d5e7..b2b0c8a 100644
--- a/src/declarative/debugger/qdeclarativedebugtrace.cpp
+++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp
@@ -78,6 +78,9 @@ void QDeclarativeDebugTrace::endRange(RangeType t)
 
 void QDeclarativeDebugTrace::addEventImpl(EventType event)
 {
+    if (!isEnabled())
+        return;
+
     QByteArray data;
     QDataStream ds(&data, QIODevice::WriteOnly);
     ds << m_timer.elapsed() << (int)Event << (int)event;
@@ -86,6 +89,9 @@ void QDeclarativeDebugTrace::addEventImpl(EventType event)
 
 void QDeclarativeDebugTrace::startRangeImpl(RangeType range)
 {
+    if (!isEnabled())
+        return;
+
     QByteArray data;
     QDataStream ds(&data, QIODevice::WriteOnly);
     ds << m_timer.elapsed() << (int)RangeStart << (int)range;
@@ -94,6 +100,9 @@ void QDeclarativeDebugTrace::startRangeImpl(RangeType range)
 
 void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &u)
 {
+    if (!isEnabled())
+        return;
+
     QByteArray data;
     QDataStream ds(&data, QIODevice::WriteOnly);
     ds << m_timer.elapsed() << (int)RangeData << (int)range << (QString)u.toString();
@@ -102,6 +111,9 @@ void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &u)
 
 void QDeclarativeDebugTrace::endRangeImpl(RangeType range)
 {
+    if (!isEnabled())
+        return;
+
     QByteArray data;
     QDataStream ds(&data, QIODevice::WriteOnly);
     ds << m_timer.elapsed() << (int)RangeEnd << (int)range;
-- 
cgit v0.12


From 790417ac69cd4fa780d6e298567908fc3d7ef6d0 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 16 Jul 2010 15:33:59 +0200
Subject: Doc: Fixed whitespace issues.

Reviewed-by: Trust Me
---
 examples/itemviews/addressbook/addresswidget.cpp |  2 +-
 examples/itemviews/addressbook/tablemodel.cpp    | 48 ++++++++++++------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/examples/itemviews/addressbook/addresswidget.cpp b/examples/itemviews/addressbook/addresswidget.cpp
index e226643..22dfae3 100644
--- a/examples/itemviews/addressbook/addresswidget.cpp
+++ b/examples/itemviews/addressbook/addresswidget.cpp
@@ -230,7 +230,7 @@ void AddressWidget::writeToFile(QString fileName)
         return;
     }
 
-    QList< QPair<QString, QString> > pairs = table->getList();    
+    QList< QPair<QString, QString> > pairs = table->getList();
     QDataStream out(&file);
     out << pairs;
 }
diff --git a/examples/itemviews/addressbook/tablemodel.cpp b/examples/itemviews/addressbook/tablemodel.cpp
index 603c926..e9a08f0 100644
--- a/examples/itemviews/addressbook/tablemodel.cpp
+++ b/examples/itemviews/addressbook/tablemodel.cpp
@@ -72,13 +72,13 @@ QVariant TableModel::data(const QModelIndex &index, int role) const
 {
     if (!index.isValid())
         return QVariant();
-    
+
     if (index.row() >= listOfPairs.size() || index.row() < 0)
         return QVariant();
-    
+
     if (role == Qt::DisplayRole) {
         QPair<QString, QString> pair = listOfPairs.at(index.row());
-        
+
         if (index.column() == 0)
             return pair.first;
         else if (index.column() == 1)
@@ -93,15 +93,15 @@ QVariant TableModel::headerData(int section, Qt::Orientation orientation, int ro
 {
     if (role != Qt::DisplayRole)
         return QVariant();
-    
+
     if (orientation == Qt::Horizontal) {
         switch (section) {
             case 0:
                 return tr("Name");
-                
+
             case 1:
                 return tr("Address");
-                
+
             default:
                 return QVariant();
         }
@@ -115,7 +115,7 @@ bool TableModel::insertRows(int position, int rows, const QModelIndex &index)
 {
     Q_UNUSED(index);
     beginInsertRows(QModelIndex(), position, position+rows-1);
-    
+
     for (int row=0; row < rows; row++) {
         QPair<QString, QString> pair(" ", " ");
         listOfPairs.insert(position, pair);
@@ -129,9 +129,9 @@ bool TableModel::insertRows(int position, int rows, const QModelIndex &index)
 //! [5]
 bool TableModel::removeRows(int position, int rows, const QModelIndex &index)
 {
-    Q_UNUSED(index);    
+    Q_UNUSED(index);
     beginRemoveRows(QModelIndex(), position, position+rows-1);
-    
+
     for (int row=0; row < rows; ++row) {
         listOfPairs.removeAt(position);
     }
@@ -144,25 +144,25 @@ bool TableModel::removeRows(int position, int rows, const QModelIndex &index)
 //! [6]
 bool TableModel::setData(const QModelIndex &index, const QVariant &value, int role)
 {
-	if (index.isValid() && role == Qt::EditRole) {
-		int row = index.row();
-				
-		QPair<QString, QString> p = listOfPairs.value(row);
-		
-		if (index.column() == 0)
-			p.first = value.toString();
-		else if (index.column() == 1)
-			p.second = value.toString();
+    if (index.isValid() && role == Qt::EditRole) {
+        int row = index.row();
+
+        QPair<QString, QString> p = listOfPairs.value(row);
+
+        if (index.column() == 0)
+            p.first = value.toString();
+        else if (index.column() == 1)
+            p.second = value.toString();
         else
             return false;
-            
+
         listOfPairs.replace(row, p);
-		emit(dataChanged(index, index));
-		
+        emit(dataChanged(index, index));
+
         return true;
-	}
+    }
 
-	return false;
+    return false;
 }
 //! [6]
 
@@ -171,7 +171,7 @@ Qt::ItemFlags TableModel::flags(const QModelIndex &index) const
 {
     if (!index.isValid())
         return Qt::ItemIsEnabled;
-    
+
     return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;
 }
 //! [7]
-- 
cgit v0.12


From 3db1408bb63ada82fb9d5adb4c082e5525d46ab0 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 16 Jul 2010 15:36:27 +0200
Subject: Doc: Whitespace fixes.

Reviewed-by: Trust Me
---
 doc/src/index.qdoc           | 32 ++++++++---------
 tools/qdoc3/test/qt.qdocconf | 82 ++++++++++++++++++++++----------------------
 2 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 42fd4fc..ca7fef5 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -56,29 +56,29 @@
             <div class="indexboxcont indexboxbar ">
               <div class="sectionlist tricol">
                 <ul>
-					<li><a href="classes.html">Class index</a></li>
-					<li><a href="functions.html">Function index</a></li>
-					<li><a href="modules.html">Modules</a></li>
-					<li><a href="namespaces.html">Namespaces</a></li>
-					<li><a href="qtglobal.html">Global Declarations</a></li>
+                    <li><a href="classes.html">Class index</a></li>
+                    <li><a href="functions.html">Function index</a></li>
+                    <li><a href="modules.html">Modules</a></li>
+                    <li><a href="namespaces.html">Namespaces</a></li>
+                    <li><a href="qtglobal.html">Global Declarations</a></li>
                 </ul>
               </div>
               <div class="sectionlist  tricol">
                 <ul>
-					<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
-					<li><a href="qt-basic-concepts.html">Qt Architecture</a></li>
-					<li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
-					<li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
-					<li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
+                    <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
+                    <li><a href="qt-basic-concepts.html">Qt Architecture</a></li>
+                    <li><a href="developing-with-qt.html">Cross-platform &amp; Platform-specific Development</a></li>
+                    <li><a href="technology-apis.html">Qt &amp; standard technologies </a></li>
+                    <li><a href="best-practices.html">Qt How-to's &amp; best practices</a></li>
                 </ul>
               </div>
               <div class="sectionlist">
                 <ul>
-					<li><a href="declarativeui.html">Qt Quick</a></li>
-					<li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
-					<li><a href="qdeclarativeelements.html">QML Elements</a></li>
-					<li><a href="qt-gui-concepts.html">UI components</a></li>
-					<li><a href="declarativeui.html">Qt & GUI design</a></li>
+                    <li><a href="declarativeui.html">Qt Quick</a></li>
+                    <li><a href="qdeclarativeintroduction.html">Introduction to QML</a></li>
+                    <li><a href="qdeclarativeelements.html">QML Elements</a></li>
+                    <li><a href="qt-gui-concepts.html">UI components</a></li>
+                    <li><a href="declarativeui.html">Qt & GUI design</a></li>
                 </ul>
               </div>
             </div>
@@ -103,7 +103,7 @@
                 </ul>
               </div>
             </div>
-		  </div>
+          </div>
     \endraw
 
 */
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index d132771..e4ed1bc 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -9,7 +9,7 @@ versionsym              =
 version                 = %VERSION%
 description             = Qt Reference Documentation
 url                     = http://qt.nokia.com/doc/4.7
-online			= true
+online                  = true
 
 sourceencoding          = UTF-8
 outputencoding          = UTF-8
@@ -26,46 +26,46 @@ qhp.Qt.indexRoot           =
 # Files not referenced in any qdoc file (last four are needed by qtdemo)
 # See also extraimages.HTML
 qhp.Qt.extraFiles          = index.html \
-			     images/bg_l.png \
-			     images/bg_l_blank.png \
-			     images/bg_ll_blank.png \
-			     images/bg_ul_blank.png \
-			     images/header_bg.png \
+                 images/bg_l.png \
+                 images/bg_l_blank.png \
+                 images/bg_ll_blank.png \
+                 images/bg_ul_blank.png \
+                 images/header_bg.png \
                  images/bg_r.png \
-			     images/box_bg.png \
-			     images/breadcrumb.png \
-			     images/bullet_gt.png \
-			     images/bullet_dn.png \
-			     images/bullet_sq.png \
-			     images/bullet_up.png \
-			     images/arrow_down.png \
-			     images/feedbackground.png \
-			     images/horBar.png \
-			     images/page.png \
-			     images/page_bg.png \
-			     images/sprites-combined.png \
-			     images/spinner.gif \
-			     images/stylesheet-coffee-plastique.png \
-			     images/taskmenuextension-example.png \
-			     images/coloreditorfactoryimage.png \
-			     images/dynamiclayouts-example.png \
-			     scripts/functions.js \
-			     scripts/jquery.js \
-			     scripts/shBrushCpp.js \
-			     scripts/shCore.js \
-			     scripts/shLegacy.js \
-			     scripts/narrow.js \
-			     scripts/superfish.js \
-			     style/shCore.css \
-			     style/shThemeDefault.css \
-			     style/narrow.css \
-			     style/superfish.css \
-			     style/superfish_skin.css \
-  				style/OfflineStyle.css \
-			     style/style_ie6.css \
-			     style/style_ie7.css \
-			     style/style_ie8.css \
-			     style/style.css
+                 images/box_bg.png \
+                 images/breadcrumb.png \
+                 images/bullet_gt.png \
+                 images/bullet_dn.png \
+                 images/bullet_sq.png \
+                 images/bullet_up.png \
+                 images/arrow_down.png \
+                 images/feedbackground.png \
+                 images/horBar.png \
+                 images/page.png \
+                 images/page_bg.png \
+                 images/sprites-combined.png \
+                 images/spinner.gif \
+                 images/stylesheet-coffee-plastique.png \
+                 images/taskmenuextension-example.png \
+                 images/coloreditorfactoryimage.png \
+                 images/dynamiclayouts-example.png \
+                 scripts/functions.js \
+                 scripts/jquery.js \
+                 scripts/shBrushCpp.js \
+                 scripts/shCore.js \
+                 scripts/shLegacy.js \
+                 scripts/narrow.js \
+                 scripts/superfish.js \
+                 style/shCore.css \
+                 style/shThemeDefault.css \
+                 style/narrow.css \
+                 style/superfish.css \
+                 style/superfish_skin.css \
+                 style/OfflineStyle.css \
+                 style/style_ie6.css \
+                 style/style_ie7.css \
+                 style/style_ie8.css \
+                 style/style.css
 
 qhp.Qt.filterAttributes    = qt 4.7.0 qtrefdoc
 qhp.Qt.customFilters.Qt.name = Qt 4.7.0
@@ -146,7 +146,7 @@ exampledirs             = $QTDIR/doc/src \
 imagedirs               = $QTDIR/doc/src/images \
                           $QTDIR/examples \
                           $QTDIR/doc/src/declarative/pics \
-			  $QTDIR/doc/src/template/images
+                          $QTDIR/doc/src/template/images
 outputdir               = $QTDIR/doc/html
 tagfile                 = $QTDIR/doc/html/qt.tags
 base                    = file:$QTDIR/doc/html
-- 
cgit v0.12


From eef1d13743baddf41bd135d98fc2ad12944b8477 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 16 Jul 2010 16:09:20 +0200
Subject: Doc: Excluded the QML documentation from the Qt-only set.

Reviewed-by: Trust Me
---
 tools/qdoc3/test/qt-api-only.qdocconf       | 7 +++++++
 tools/qdoc3/test/qt-api-only_ja_JP.qdocconf | 7 +++++++
 tools/qdoc3/test/qt-api-only_zh_CN.qdocconf | 7 +++++++
 3 files changed, 21 insertions(+)

diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf
index 10b7be5..bf6c0dc 100644
--- a/tools/qdoc3/test/qt-api-only.qdocconf
+++ b/tools/qdoc3/test/qt-api-only.qdocconf
@@ -25,6 +25,13 @@ qhp.Qt.excluded  += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
                     $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \
                     $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
 
+# Remove the QML documentation from the Qt-only documentation.
+
+excludedirs += $QT_SOURCE_TREE/src/declarative \
+               $QT_SOURCE_TREE/src/imports \
+               $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative \
+               $QT_SOURCE_TREE/doc/src/declarative
+
 outputdir         = $QT_BUILD_TREE/doc-build/html-qt
 tagfile           = $QT_BUILD_TREE/doc-build/html-qt/qt.tags
 base              = file:$QT_BUILD_TREE/doc-build/html-qt
diff --git a/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf b/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf
index aa3ab01..70e0235 100644
--- a/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf
+++ b/tools/qdoc3/test/qt-api-only_ja_JP.qdocconf
@@ -25,6 +25,13 @@ qhp.Qt.excluded  += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
                     $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \
                     $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
 
+# Remove the QML documentation from the Qt-only documentation.
+
+excludedirs += $QT_SOURCE_TREE/src/declarative \
+               $QT_SOURCE_TREE/src/imports \
+               $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative \
+               $QT_SOURCE_TREE/doc/src/declarative
+
 outputdir         = $QT_BUILD_TREE/doc-build/html-qt_ja_JP
 tagfile           = $QT_BUILD_TREE/doc-build/html-qt_ja_JP/qt.tags
 base              = file:$QT_BUILD_TREE/doc-build/html-qt_ja_JP
diff --git a/tools/qdoc3/test/qt-api-only_zh_CN.qdocconf b/tools/qdoc3/test/qt-api-only_zh_CN.qdocconf
index c722ee8..d6bf410 100644
--- a/tools/qdoc3/test/qt-api-only_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-api-only_zh_CN.qdocconf
@@ -25,6 +25,13 @@ qhp.Qt.excluded  += $QT_SOURCE_TREE/doc/src/development/assistant-manual.qdoc \
                     $QT_SOURCE_TREE/doc/src/examples/trollprint.qdoc \
                     $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
 
+# Remove the QML documentation from the Qt-only documentation.
+
+excludedirs += $QT_SOURCE_TREE/src/declarative \
+               $QT_SOURCE_TREE/src/imports \
+               $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative \
+               $QT_SOURCE_TREE/doc/src/declarative
+
 outputdir         = $QT_BUILD_TREE/doc-build/html-qt_zh_CN
 tagfile           = $QT_BUILD_TREE/doc-build/html-qt_zh_CN/qt.tags
 base              = file:$QT_BUILD_TREE/doc-build/html-qt_zh_CN
-- 
cgit v0.12


From f231bd03007484d239cb5456db9e20a1f9ab7a63 Mon Sep 17 00:00:00 2001
From: Petri Latvala <ext-petri.latvala@nokia.com>
Date: Wed, 7 Jul 2010 16:30:14 +0300
Subject: Link to the unsinstalled libraries first.

Task-number: QT-3371
Reviewed-by: Harald Fernengel
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 62e0863..fb544bd 100755
--- a/configure
+++ b/configure
@@ -7746,7 +7746,7 @@ EOF
 
 # Ensure we can link to uninistalled libraries
 if [ "$XPLATFORM_MINGW" != "yes" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then
-    echo "QMAKE_LFLAGS    += -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib" >> "$CACHEFILE.tmp"
+    echo "QMAKE_LFLAGS    = -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib \$\$QMAKE_LFLAGS" >> "$CACHEFILE.tmp"
 fi
 
 if [ -n "$QT_CFLAGS_PSQL" ]; then
-- 
cgit v0.12


From ab4dde176cfa314522964e5e5fbf9f2d388f8fdf Mon Sep 17 00:00:00 2001
From: Jukka Rissanen <jukka.rissanen@nokia.com>
Date: Tue, 29 Jun 2010 09:29:29 +0300
Subject: Do not crash if addrinfo signal does not contain ip address
 information.

Fixes: NB#176643 - Segmentation fault occurs while using networking
Reviewed-by: Adrian Constantin
---
 src/plugins/bearer/icd/qnetworksession_impl.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index e375b4f..aeac620 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -620,6 +620,9 @@ static QString get_network_interface()
 	return iface;
     }
 
+    if (addr_results.first().ip_info.isEmpty())
+	return QString();
+
     const char *address = addr_results.first().ip_info.first().address.toAscii().constData();
     struct in_addr addr;
     if (inet_aton(address, &addr) == 0) {
-- 
cgit v0.12


From bba06aacb84b5ae9fc286345e721cab639db35c8 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 16 Jul 2010 18:20:49 +0200
Subject: Doc: Added license documentation for 3rd party code and data.

Task-number: QT-3585
Pre-approved-by: Legal
Reviewed-by: Trust Me
---
 doc/src/legal/3rdparty.qdoc | 234 +++++++++++++++++++++++++++++++++++++++++---
 doc/src/legal/licenses.qdoc |  49 +++++++++-
 2 files changed, 267 insertions(+), 16 deletions(-)

diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc
index 110dac7..e7133e3 100644
--- a/doc/src/legal/3rdparty.qdoc
+++ b/doc/src/legal/3rdparty.qdoc
@@ -194,16 +194,16 @@
     \hr
 
     copyright (C) 1999 by Willem van Schaik <willem@schaik.com>
-    
+
     version 1.0 - 1999.10.15 - First version.
-    
+
     Permission to use, copy, modify, and distribute this software and
     its documentation for any purpose and without fee is hereby granted,
     provided that the above copyright notice appear in all copies and
     that both that copyright notice and this permission notice appear in
     supporting documentation. This software is provided "as is" without
     express or implied warranty.
-    
+
     \hr
 
     Copyright (c) 1998-2001 Greg Roelofs.  All rights reserved.
@@ -293,7 +293,7 @@
 
     Copyright (c) 1987, 1993, 1994\br
     The Regents of the University of California.  All rights reserved.
-    
+
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:\br
@@ -305,7 +305,7 @@
     3. Neither the name of the University nor the names of its contributors
        may be used to endorse or promote products derived from this software
        without specific prior written permission.
-    
+
     THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -336,7 +336,7 @@
     Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>\br
     Copyright (c( 1996 USAF Phillips Laboratory\br
     Additions (c) Richard Nolde 2006-2009
-    
+
     Permission to use, copy, modify, distribute, and sell this software and 
     its documentation for any purpose is hereby granted without fee, provided
     that (i) the above copyright notices and this permission notice appear in
@@ -344,11 +344,11 @@
     Sam Leffler and Silicon Graphics may not be used in any advertising or
     publicity relating to the software without the specific, prior written
     permission of Sam Leffler and Silicon Graphics.
-    
+
     THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
     EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
     WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
-    
+
     IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
     ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
     OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
@@ -360,11 +360,11 @@
 
     Copyright (c) 1985, 1986 The Regents of the University of California.\br
     All rights reserved.
-    
+
     This code is derived from software contributed to Berkeley by
     James A. Woods, derived from original work by Spencer Thomas
     and Joseph Orost.
-    
+
     Redistribution and use in source and binary forms are permitted
     provided that the above copyright notice and this paragraph are
     duplicated in all such forms and that any documentation,
@@ -381,7 +381,7 @@
 
     Copyright (c) 1996-1997 Sam Leffler\br
     Copyright (c) 1996 Pixar
-    
+
     Permission to use, copy, modify, distribute, and sell this software and 
     its documentation for any purpose is hereby granted without fee, provided
     that (i) the above copyright notices and this permission notice appear in
@@ -389,11 +389,11 @@
     Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or
     publicity relating to the software without the specific, prior written
     permission of Pixar, Sam Leffler and Silicon Graphics.
-    
+
     THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
     EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
     WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
-    
+
     IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
     ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
     OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
@@ -423,8 +423,6 @@
 
     \section1 JavaScriptCore
 
-    \hr
-
     Copyright (c) 1991, 2000, 2001 by Lucent Technologies.\br
     Copyright (C) 2002, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
 
@@ -441,6 +439,60 @@
 
     See \c src/3rdparty/webkit/JavaScriptCore/wtf/dtoa.cpp for license details.
 
+    \hr
+
+    Copyright (C) 2009 Company 100, Inc. All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:\br
+    1. Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.\br
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+    OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+    \hr
+
+    Copyright (C) 2009 Apple Inc. All rights reserved.\br
+    Copyright (C) 2009 University of Szeged\br
+    All rights reserved.\br
+    Copyright (C) 2010 MIPS Technologies, Inc. All rights reserved.\br
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:\br
+    1. Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.\br
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY MIPS TECHNOLOGIES, INC. ``AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL MIPS TECHNOLOGIES, INC. OR
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+    OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
     \section1 Pixman (\c pixman) version 0.17.11
 
     \e{pixman is a library that provides low-level pixel manipulation
@@ -479,4 +531,156 @@
 
     See \c src/3rdparty/pixman/pixman-arm-neon-asm.h and
     \c src/3rdparty/pixman/pixman-arm-neon-asm.S
+
+    \section1 WebCore (WebKit)
+
+    Copyright (C) 2009 Ericsson AB\br
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    1. Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.\br
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer
+       in the documentation and/or other materials provided with the
+       distribution.\br
+    3. Neither the name of Ericsson nor the names of its contributors
+       may be used to endorse or promote products derived from this
+       software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+    \hr
+
+    Copyright (C) 2004, Apple Computer, Inc. and The Mozilla Foundation.\br
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are
+    met:
+
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.\br
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.\br
+    3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla
+    Foundation ("Mozilla") nor the names of their contributors may be used
+    to endorse or promote products derived from this software without
+    specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS
+    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR
+    THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+    \hr
+
+    Copyright (C) 2009 Igalia S.L.\br
+    Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org>\br
+    Copyright (C) 2008 Christian Dywan <christian@imendio.com>\br
+    Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>\br
+    Copyright (C) 2006 Charles Samuels <charles@kde.org>\br
+    Copyright (C) 2009 Dominik Röttsches <dominik.roettsches@access-company.com>\br
+    Copyright (C) 2009 Brent Fulgham\br
+    Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>\br
+    Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>\br
+    Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>\br
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:\br
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.\br
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+    OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+    \hr
+
+    Copyright (C) 2007, 2008 Apple Inc.  All rights reserved.\br
+    Copyright (C) IBM Corp. 2009  All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    1.  Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.\br
+    2.  Redistributions in binary form must reproduce the above copyright
+        notice, this list of conditions and the following disclaimer in the
+        documentation and/or other materials provided with the distribution.\br
+    3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+        its contributors may be used to endorse or promote products derived
+        from this software without specific prior written permission.\br
+
+    THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+    \hr
+
+    Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.\br
+    Copyright (C) 2010 François Sausset (sausset@gmail.com). All rights reserved\br
+    Copyright (C) 2007 Marius Renn <damarvy@gmail.com> All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:\br
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.\br
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
diff --git a/doc/src/legal/licenses.qdoc b/doc/src/legal/licenses.qdoc
index 96d5d29..a04a256 100644
--- a/doc/src/legal/licenses.qdoc
+++ b/doc/src/legal/licenses.qdoc
@@ -328,7 +328,7 @@
     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-    
+
     \list
     \o Parts of WebKit used by the QtWebKit module
     \endlist
@@ -716,6 +716,53 @@
     \list
     \o Parts of WebKit used by the QtWebKit module
     \endlist
+
+    \hr
+
+    Copyright (c) 1991-2009 Unicode, Inc. All rights reserved.
+    Distributed under the Terms of Use in
+    http://www.unicode.org/copyright.html.
+
+    Permission is hereby granted, free of charge, to any person
+    obtaining a copy of the Unicode data files and any associated
+    documentation (the "Data Files") or Unicode software and any
+    associated documentation (the "Software") to deal in the Data
+    Files or Software without restriction, including without
+    limitation the rights to use, copy, modify, merge, publish,
+    distribute, and/or sell copies of the Data Files or Software,
+    and to permit persons to whom the Data Files or Software are
+    furnished to do so, provided that (a) the above copyright
+    notice(s) and this permission notice appear with all copies
+    of the Data Files or Software, (b) both the above copyright
+    notice(s) and this permission notice appear in associated
+    documentation, and (c) there is clear notice in each modified
+    Data File or in the Software as well as in the documentation
+    associated with the Data File(s) or Software that the data or
+    software has been modified.
+
+    THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT
+    WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+    LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+    PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+    IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED
+    IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
+    OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+    CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES
+    OR SOFTWARE.
+
+    Except as contained in this notice, the name of a copyright
+    holder shall not be used in advertising or otherwise to promote
+    the sale, use or other dealings in these Data Files or Software
+    without prior written authorization of the copyright holder.
+
+    \list
+    \o Included in \c{util/unicode/data},
+    \c{tests/auto/qtextboundaryfinder/data} and
+    \c{tests/auto/qchar}
+    \o Parts of the \l makeqpf tool
+    \endlist
 */
 
 /*!
-- 
cgit v0.12


From 3c11c0a8f2a99cb3734a24d9d6c43977807471d7 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Fri, 16 Jul 2010 20:32:38 +0200
Subject: Used aligned load and store when possible for the blending of ARGB32

Unaligned load and store can be costly. This patch mitigate the problem
by aligning the destination before using SSE2. The destination is
aligned because it is used by load and store, while the source is only
use by load.

On Atom, the blending test is 7% faster for ARGB32.

Reviewed-by: Andreas Kling
---
 src/gui/painting/qdrawingprimitive_sse2_p.h | 34 ++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 3c96946..65292bc 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -43,6 +43,7 @@
 #define QDRAWINGPRIMITIVE_SSE2_P_H
 
 #include <private/qsimd_p.h>
+#include <stdint.h>
 
 #ifdef QT_HAVE_SSE2
 
@@ -141,12 +142,24 @@ QT_BEGIN_NAMESPACE
 // with shortcuts if fully opaque or fully transparent.
 #define BLEND_SOURCE_OVER_ARGB32_SSE2(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
     int x = 0; \
+\
+    /* First, get dst aligned. */ \
+    const int offsetToAlignOn16Bytes = (4 - (reinterpret_cast<uintptr_t>(dst) >> 2 & 0x3)) & 0x3;\
+    const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
+    for (; x < prologLength; ++x) { \
+        uint s = src[x]; \
+        if (s >= 0xff000000) \
+            dst[x] = s; \
+        else if (s != 0) \
+            dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+    } \
+\
     for (; x < length-3; x += 4) { \
         const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); \
         const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
         if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
             /* all opaque */ \
-            _mm_storeu_si128((__m128i *)&dst[x], srcVector); \
+            _mm_store_si128((__m128i *)&dst[x], srcVector); \
         } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
             /* not fully transparent */ \
             /* extract the alpha channel on 2 x 16 bits */ \
@@ -157,13 +170,13 @@ QT_BEGIN_NAMESPACE
             alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); \
             alphaChannel = _mm_sub_epi16(one, alphaChannel); \
  \
-            const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); \
+            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
             __m128i destMultipliedByOneMinusAlpha; \
             BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
  \
             /* result = s + d * (1-alpha) */\
             const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
-            _mm_storeu_si128((__m128i *)&dst[x], result); \
+            _mm_store_si128((__m128i *)&dst[x], result); \
         } \
     } \
     for (; x < length; ++x) { \
@@ -189,6 +202,17 @@ QT_BEGIN_NAMESPACE
 #define BLEND_SOURCE_OVER_ARGB32_WITH_CONST_ALPHA_SSE2(dst, src, length, nullVector, half, one, colorMask, constAlphaVector) \
 { \
     int x = 0; \
+\
+    const int offsetToAlignOn16Bytes = (4 - (reinterpret_cast<uintptr_t>(dst) >> 2 & 0x3)) & 0x3;\
+    const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
+    for (; x < prologLength; ++x) { \
+        uint s = src[x]; \
+        if (s >= 0xff000000) \
+            dst[x] = s; \
+        else if (s != 0) \
+            dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+    } \
+\
     for (; x < length-3; x += 4) { \
         __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); \
         if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) { \
@@ -198,12 +222,12 @@ QT_BEGIN_NAMESPACE
             alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); \
             alphaChannel = _mm_sub_epi16(one, alphaChannel); \
  \
-            const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); \
+            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
             __m128i destMultipliedByOneMinusAlpha; \
             BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
  \
             const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
-            _mm_storeu_si128((__m128i *)&dst[x], result); \
+            _mm_store_si128((__m128i *)&dst[x], result); \
         } \
     } \
     for (; x < length; ++x) { \
-- 
cgit v0.12


From 956081702b5701ec570085174878a264c86c136b Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Sat, 17 Jul 2010 12:08:52 +1000
Subject: Rebuild configure.exe.

---
 configure.exe | Bin 1318912 -> 1318400 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/configure.exe b/configure.exe
index 6817331..0863ecc 100755
Binary files a/configure.exe and b/configure.exe differ
-- 
cgit v0.12


From 0e74ba543228b541394b95b477008aaea89549c1 Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Sat, 17 Jul 2010 12:49:42 +1000
Subject: Revert "Used aligned load and store when possible for the blending of
 ARGB32"

This reverts commit 3c11c0a8f2a99cb3734a24d9d6c43977807471d7, which
breaks compilation on some platforms.
---
 src/gui/painting/qdrawingprimitive_sse2_p.h | 34 +++++------------------------
 1 file changed, 5 insertions(+), 29 deletions(-)

diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 65292bc..3c96946 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -43,7 +43,6 @@
 #define QDRAWINGPRIMITIVE_SSE2_P_H
 
 #include <private/qsimd_p.h>
-#include <stdint.h>
 
 #ifdef QT_HAVE_SSE2
 
@@ -142,24 +141,12 @@ QT_BEGIN_NAMESPACE
 // with shortcuts if fully opaque or fully transparent.
 #define BLEND_SOURCE_OVER_ARGB32_SSE2(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
     int x = 0; \
-\
-    /* First, get dst aligned. */ \
-    const int offsetToAlignOn16Bytes = (4 - (reinterpret_cast<uintptr_t>(dst) >> 2 & 0x3)) & 0x3;\
-    const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
-    for (; x < prologLength; ++x) { \
-        uint s = src[x]; \
-        if (s >= 0xff000000) \
-            dst[x] = s; \
-        else if (s != 0) \
-            dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
-    } \
-\
     for (; x < length-3; x += 4) { \
         const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); \
         const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
         if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
             /* all opaque */ \
-            _mm_store_si128((__m128i *)&dst[x], srcVector); \
+            _mm_storeu_si128((__m128i *)&dst[x], srcVector); \
         } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
             /* not fully transparent */ \
             /* extract the alpha channel on 2 x 16 bits */ \
@@ -170,13 +157,13 @@ QT_BEGIN_NAMESPACE
             alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); \
             alphaChannel = _mm_sub_epi16(one, alphaChannel); \
  \
-            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
+            const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); \
             __m128i destMultipliedByOneMinusAlpha; \
             BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
  \
             /* result = s + d * (1-alpha) */\
             const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
-            _mm_store_si128((__m128i *)&dst[x], result); \
+            _mm_storeu_si128((__m128i *)&dst[x], result); \
         } \
     } \
     for (; x < length; ++x) { \
@@ -202,17 +189,6 @@ QT_BEGIN_NAMESPACE
 #define BLEND_SOURCE_OVER_ARGB32_WITH_CONST_ALPHA_SSE2(dst, src, length, nullVector, half, one, colorMask, constAlphaVector) \
 { \
     int x = 0; \
-\
-    const int offsetToAlignOn16Bytes = (4 - (reinterpret_cast<uintptr_t>(dst) >> 2 & 0x3)) & 0x3;\
-    const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
-    for (; x < prologLength; ++x) { \
-        uint s = src[x]; \
-        if (s >= 0xff000000) \
-            dst[x] = s; \
-        else if (s != 0) \
-            dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
-    } \
-\
     for (; x < length-3; x += 4) { \
         __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); \
         if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) { \
@@ -222,12 +198,12 @@ QT_BEGIN_NAMESPACE
             alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); \
             alphaChannel = _mm_sub_epi16(one, alphaChannel); \
  \
-            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
+            const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); \
             __m128i destMultipliedByOneMinusAlpha; \
             BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
  \
             const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
-            _mm_store_si128((__m128i *)&dst[x], result); \
+            _mm_storeu_si128((__m128i *)&dst[x], result); \
         } \
     } \
     for (; x < length; ++x) { \
-- 
cgit v0.12


From 11c80193772b51575a8c59d59215a8b9523647ea Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Sat, 17 Jul 2010 16:50:25 +1000
Subject: Remove license headers from .pro files in new modelview examples.

This commit attempts to fix the latest staging failure.

According to Nokia Legal, .pro files are not copyrightable and thus need
not carry license headers.  In any case, C-style comments aren't valid
for .pro files and broke the build.
---
 .../tutorials/modelview/1_readonly/1_readonly.pro  | 40 ----------------------
 .../modelview/2_formatting/2_formatting.pro        | 40 ----------------------
 .../modelview/3_changingmodel/3_changingmodel.pro  | 40 ----------------------
 .../tutorials/modelview/4_headers/4_headers.pro    | 40 ----------------------
 examples/tutorials/modelview/5_edit/5_edit.pro     | 40 ----------------------
 .../tutorials/modelview/6_treeview/6_treeview.pro  | 40 ----------------------
 .../modelview/7_selections/7_selections.pro        | 40 ----------------------
 7 files changed, 280 deletions(-)

diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro
index 8528cde..1162d5a 100755
--- a/examples/tutorials/modelview/1_readonly/1_readonly.pro
+++ b/examples/tutorials/modelview/1_readonly/1_readonly.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET =   mv_readonly
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.pro b/examples/tutorials/modelview/2_formatting/2_formatting.pro
index cdf72bf..7e70d81 100755
--- a/examples/tutorials/modelview/2_formatting/2_formatting.pro
+++ b/examples/tutorials/modelview/2_formatting/2_formatting.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET = mv_formatting
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
index 8b217cb..d61ee4c 100755
--- a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
+++ b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET = mv_changingmodel
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/4_headers/4_headers.pro b/examples/tutorials/modelview/4_headers/4_headers.pro
index 13b0b1d..d6f8d23 100755
--- a/examples/tutorials/modelview/4_headers/4_headers.pro
+++ b/examples/tutorials/modelview/4_headers/4_headers.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET = mv_headers
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/5_edit/5_edit.pro b/examples/tutorials/modelview/5_edit/5_edit.pro
index d0a2571..e18c596 100755
--- a/examples/tutorials/modelview/5_edit/5_edit.pro
+++ b/examples/tutorials/modelview/5_edit/5_edit.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET = mv_edit
 
 TEMPLATE = app
diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.pro b/examples/tutorials/modelview/6_treeview/6_treeview.pro
index fa27c3a..6d078be 100755
--- a/examples/tutorials/modelview/6_treeview/6_treeview.pro
+++ b/examples/tutorials/modelview/6_treeview/6_treeview.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET = mv_tree
 TEMPLATE = app
 SOURCES += main.cpp \
diff --git a/examples/tutorials/modelview/7_selections/7_selections.pro b/examples/tutorials/modelview/7_selections/7_selections.pro
index 671dc24..952641c6 100755
--- a/examples/tutorials/modelview/7_selections/7_selections.pro
+++ b/examples/tutorials/modelview/7_selections/7_selections.pro
@@ -1,43 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
 TARGET = mv_selections
 TEMPLATE = app
 SOURCES += main.cpp \
-- 
cgit v0.12


From 9427b4c8f3b557524cda3f72cf81f68940cb7246 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Fri, 16 Jul 2010 20:32:38 +0200
Subject: Used aligned load and store when possible for the blending of ARGB32

Unaligned load and store can be costly. This patch mitigate the problem
by aligning the destination before using SSE2. The destination is
aligned because it is used by load and store, while the source is only
use by load.

On Atom, the blending test is 7% faster for ARGB32.

Re-pushing that patch, thanks to awesome policies...

Reviewed-by: Andreas Kling
---
 src/gui/painting/qdrawingprimitive_sse2_p.h | 33 ++++++++++++++++++++++++-----
 1 file changed, 28 insertions(+), 5 deletions(-)

diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 3c96946..b1f8306 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -141,12 +141,24 @@ QT_BEGIN_NAMESPACE
 // with shortcuts if fully opaque or fully transparent.
 #define BLEND_SOURCE_OVER_ARGB32_SSE2(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
     int x = 0; \
+\
+    /* First, get dst aligned. */ \
+    const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\
+    const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
+    for (; x < prologLength; ++x) { \
+        uint s = src[x]; \
+        if (s >= 0xff000000) \
+            dst[x] = s; \
+        else if (s != 0) \
+            dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+    } \
+\
     for (; x < length-3; x += 4) { \
         const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); \
         const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
         if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
             /* all opaque */ \
-            _mm_storeu_si128((__m128i *)&dst[x], srcVector); \
+            _mm_store_si128((__m128i *)&dst[x], srcVector); \
         } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
             /* not fully transparent */ \
             /* extract the alpha channel on 2 x 16 bits */ \
@@ -157,13 +169,13 @@ QT_BEGIN_NAMESPACE
             alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); \
             alphaChannel = _mm_sub_epi16(one, alphaChannel); \
  \
-            const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); \
+            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
             __m128i destMultipliedByOneMinusAlpha; \
             BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
  \
             /* result = s + d * (1-alpha) */\
             const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
-            _mm_storeu_si128((__m128i *)&dst[x], result); \
+            _mm_store_si128((__m128i *)&dst[x], result); \
         } \
     } \
     for (; x < length; ++x) { \
@@ -189,6 +201,17 @@ QT_BEGIN_NAMESPACE
 #define BLEND_SOURCE_OVER_ARGB32_WITH_CONST_ALPHA_SSE2(dst, src, length, nullVector, half, one, colorMask, constAlphaVector) \
 { \
     int x = 0; \
+\
+    const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\
+    const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
+    for (; x < prologLength; ++x) { \
+        uint s = src[x]; \
+        if (s >= 0xff000000) \
+            dst[x] = s; \
+        else if (s != 0) \
+            dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+    } \
+\
     for (; x < length-3; x += 4) { \
         __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]); \
         if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) { \
@@ -198,12 +221,12 @@ QT_BEGIN_NAMESPACE
             alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16)); \
             alphaChannel = _mm_sub_epi16(one, alphaChannel); \
  \
-            const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]); \
+            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
             __m128i destMultipliedByOneMinusAlpha; \
             BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
  \
             const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
-            _mm_storeu_si128((__m128i *)&dst[x], result); \
+            _mm_store_si128((__m128i *)&dst[x], result); \
         } \
     } \
     for (; x < length; ++x) { \
-- 
cgit v0.12


From 23ea4340a622cbfed81eb7afb2e09ec64b0ebef8 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Sun, 18 Jul 2010 07:30:35 +0200
Subject: Corrected BLEND_SOURCE_OVER_ARGB32_WITH_CONST_ALPHA_SSE2

The unaligned prologue was processed without using the const alpha.
Regressed with 9427b4c8f3b5.
---
 src/gui/painting/qdrawingprimitive_sse2_p.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index b1f8306..18355c2 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -205,11 +205,11 @@ QT_BEGIN_NAMESPACE
     const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\
     const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
     for (; x < prologLength; ++x) { \
-        uint s = src[x]; \
-        if (s >= 0xff000000) \
-            dst[x] = s; \
-        else if (s != 0) \
+        quint32 s = src[x]; \
+        if (s != 0) { \
+            s = BYTE_MUL(s, const_alpha); \
             dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+        } \
     } \
 \
     for (; x < length-3; x += 4) { \
-- 
cgit v0.12


From c6812138900b05012831e0f94d7d00aeac86cc2f Mon Sep 17 00:00:00 2001
From: Robin Burchell <robin.burchell@collabora.co.uk>
Date: Sun, 18 Jul 2010 23:05:44 +0200
Subject: Remove qMemCopy() usage from all .cpp files of Qt itself.

This is (supposedly) more efficient as the compiler can optimise it to a
builtin, per Thiago.

Merge-request: 2430
Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
---
 src/corelib/tools/qbytearray.cpp                   |  6 +++---
 src/corelib/tools/qbytearraymatcher.cpp            |  2 +-
 src/corelib/tools/qstring.cpp                      |  6 +++---
 src/corelib/tools/qstringmatcher.cpp               |  2 +-
 src/gui/text/qfontengine_s60.cpp                   |  4 ++--
 src/gui/text/qstatictext.cpp                       | 12 ++++++------
 src/gui/text/qtextdocument_p.cpp                   |  2 +-
 tests/auto/compiler/tst_compiler.cpp               |  2 +-
 tools/assistant/tools/assistant/helpviewer_qwv.cpp |  2 +-
 tools/makeqpf/qpf2.cpp                             |  2 +-
 10 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index b46af1f..a5cb16a 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -2152,18 +2152,18 @@ QByteArray QByteArray::repeated(int times) const
     if (result.d->alloc != resultSize)
         return QByteArray(); // not enough memory
 
-    qMemCopy(result.d->data, d->data, d->size);
+    memcpy(result.d->data, d->data, d->size);
 
     int sizeSoFar = d->size;
     char *end = result.d->data + sizeSoFar;
 
     const int halfResultSize = resultSize >> 1;
     while (sizeSoFar <= halfResultSize) {
-        qMemCopy(end, result.d->data, sizeSoFar);
+        memcpy(end, result.d->data, sizeSoFar);
         end += sizeSoFar;
         sizeSoFar <<= 1;
     }
-    qMemCopy(end, result.d->data, resultSize - sizeSoFar);
+    memcpy(end, result.d->data, resultSize - sizeSoFar);
     result.d->data[resultSize] = '\0';
     result.d->size = resultSize;
     return result;
diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp
index d5a59c9..f8504f0 100644
--- a/src/corelib/tools/qbytearraymatcher.cpp
+++ b/src/corelib/tools/qbytearraymatcher.cpp
@@ -171,7 +171,7 @@ QByteArrayMatcher::~QByteArrayMatcher()
 QByteArrayMatcher &QByteArrayMatcher::operator=(const QByteArrayMatcher &other)
 {
     q_pattern = other.q_pattern;
-    qMemCopy(&p, &other.p, sizeof(p));
+    memcpy(&p, &other.p, sizeof(p));
     return *this;
 }
 
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index b2cf49b..b5651de 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -6156,18 +6156,18 @@ QString QString::repeated(int times) const
     if (result.d->alloc != resultSize)
         return QString(); // not enough memory
 
-    qMemCopy(result.d->data, d->data, d->size * sizeof(ushort));
+    memcpy(result.d->data, d->data, d->size * sizeof(ushort));
 
     int sizeSoFar = d->size;
     ushort *end = result.d->data + sizeSoFar;
 
     const int halfResultSize = resultSize >> 1;
     while (sizeSoFar <= halfResultSize) {
-        qMemCopy(end, result.d->data, sizeSoFar * sizeof(ushort));
+        memcpy(end, result.d->data, sizeSoFar * sizeof(ushort));
         end += sizeSoFar;
         sizeSoFar <<= 1;
     }
-    qMemCopy(end, result.d->data, (resultSize - sizeSoFar) * sizeof(ushort));
+    memcpy(end, result.d->data, (resultSize - sizeSoFar) * sizeof(ushort));
     result.d->data[resultSize] = '\0';
     result.d->size = resultSize;
     return result;
diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/tools/qstringmatcher.cpp
index ff13624..80a8457 100644
--- a/src/corelib/tools/qstringmatcher.cpp
+++ b/src/corelib/tools/qstringmatcher.cpp
@@ -208,7 +208,7 @@ QStringMatcher &QStringMatcher::operator=(const QStringMatcher &other)
     if (this != &other) {
         q_pattern = other.q_pattern;
         q_cs = other.q_cs;
-        qMemCopy(q_data, other.q_data, sizeof(q_data));
+        memcpy(q_data, other.q_data, sizeof(q_data));
     }
     return *this;
 }
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index f691413..74ef646 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -94,7 +94,7 @@ bool QSymbianTypeFaceExtras::getSfntTableData(uint tag, uchar *buffer, uint *len
     } else {
         *length = tableByteLength;
         if (buffer)
-            qMemCopy(buffer, fontTable.TableContent(), tableByteLength);
+            memcpy(buffer, fontTable.TableContent(), tableByteLength);
     }
 
     fontTable.Close();
@@ -146,7 +146,7 @@ bool QSymbianTypeFaceExtras::getSfntTableData(uint tag, uchar *buffer, uint *len
     } else {
         *length = tableByteLength;
         if (buffer)
-            qMemCopy(buffer, table, tableByteLength);
+            memcpy(buffer, table, tableByteLength);
     }
 
     m_trueTypeExtension->ReleaseTrueTypeTable(table);
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 91a6612..ab518d0 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -465,13 +465,13 @@ namespace {
             m_chars.resize(m_chars.size() + ti.num_chars);
 
             glyph_t *glyphsDestination = m_glyphs.data() + currentItem.glyphOffset;
-            qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * currentItem.numGlyphs);
+            memcpy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * currentItem.numGlyphs);
 
             QFixedPoint *positionsDestination = m_positions.data() + currentItem.positionOffset;
-            qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * currentItem.numGlyphs);
+            memcpy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * currentItem.numGlyphs);
 
             QChar *charsDestination = m_chars.data() + currentItem.charOffset;
-            qMemCopy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
+            memcpy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
 
             m_items.append(currentItem);
         }                
@@ -681,13 +681,13 @@ void QStaticTextPrivate::init()
     items = new QStaticTextItem[itemCount];
 
     glyphPool = new glyph_t[glyphs.size()];
-    qMemCopy(glyphPool, glyphs.constData(), glyphs.size() * sizeof(glyph_t));
+    memcpy(glyphPool, glyphs.constData(), glyphs.size() * sizeof(glyph_t));
 
     positionPool = new QFixedPoint[positions.size()];
-    qMemCopy(positionPool, positions.constData(), positions.size() * sizeof(QFixedPoint));
+    memcpy(positionPool, positions.constData(), positions.size() * sizeof(QFixedPoint));
 
     charPool = new QChar[chars.size()];
-    qMemCopy(charPool, chars.constData(), chars.size() * sizeof(QChar));
+    memcpy(charPool, chars.constData(), chars.size() * sizeof(QChar));
 
     for (int i=0; i<itemCount; ++i) {
         items[i] = deviceItems.at(i);
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 7b3f985..213db7e 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -1649,7 +1649,7 @@ void QTextDocumentPrivate::compressPieceTable()
     int newLen = 0;
 
     for (FragmentMap::Iterator it = fragments.begin(); !it.atEnd(); ++it) {
-        qMemCopy(newTextPtr, text.constData() + it->stringPosition, it->size_array[0] * sizeof(QChar));
+        memcpy(newTextPtr, text.constData() + it->stringPosition, it->size_array[0] * sizeof(QChar));
         it->stringPosition = newLen;
         newTextPtr += it->size_array[0];
         newLen += it->size_array[0];
diff --git a/tests/auto/compiler/tst_compiler.cpp b/tests/auto/compiler/tst_compiler.cpp
index 368620d..90eb357 100644
--- a/tests/auto/compiler/tst_compiler.cpp
+++ b/tests/auto/compiler/tst_compiler.cpp
@@ -640,7 +640,7 @@ static inline double qt_inf()
 #endif
 
     union { uchar c[8]; double d; } returnValue;
-    qMemCopy(returnValue.c, bytes, sizeof(returnValue.c));
+    memcpy(returnValue.c, bytes, sizeof(returnValue.c));
     return returnValue.d;
 }
 
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index dcbbf2c..221e1b8 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -101,7 +101,7 @@ qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen)
     TRACE_OBJ
     qint64 len = qMin(qint64(data.length()), maxlen);
     if (len) {
-        qMemCopy(buffer, data.constData(), len);
+        memcpy(buffer, data.constData(), len);
         data.remove(0, len);
     }
     if (!data.length())
diff --git a/tools/makeqpf/qpf2.cpp b/tools/makeqpf/qpf2.cpp
index ab57cea..cafdb79 100644
--- a/tools/makeqpf/qpf2.cpp
+++ b/tools/makeqpf/qpf2.cpp
@@ -543,7 +543,7 @@ void QPF::addGlyphs(QFontEngine *fe, const QList<CharacterRange> &ranges)
                         ;
                 }
 
-                qMemCopy(data, img.bits(), img.byteCount());
+                memcpy(data, img.bits(), img.byteCount());
             }
         }
     }
-- 
cgit v0.12


From d191c5bd1d0e3963dc8a4f3ffdba80af0800ec22 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Tue, 13 Jul 2010 16:53:27 +1000
Subject: Fix build on Symbian.

---
 examples/network/network-chat/chatdialog.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/examples/network/network-chat/chatdialog.cpp b/examples/network/network-chat/chatdialog.cpp
index 14fabaa..2bab535 100644
--- a/examples/network/network-chat/chatdialog.cpp
+++ b/examples/network/network-chat/chatdialog.cpp
@@ -53,9 +53,6 @@ ChatDialog::ChatDialog(QWidget *parent)
     listWidget->setFocusPolicy(Qt::NoFocus);
 
     connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
-#ifdef Q_OS_SYMBIAN
-    connect(sendButton, SIGNAL(clicked()), this, SLOT(returnPressed()));
-#endif
     connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
     connect(&client, SIGNAL(newMessage(QString,QString)),
             this, SLOT(appendMessage(QString,QString)));
-- 
cgit v0.12


From 192a3c6d69b42f02aa9033c30502a6930cceb8f7 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 12 Jul 2010 15:12:48 +1000
Subject: Fixes deployment rules for embedded qml demos application.

The deployment rules for the qml resources in the embedded qml demo
applications were not being generated correctly as data_caging_paths was
not being loaded.
---
 demos/embedded/qmlcalculator/deployment.pri  | 1 +
 demos/embedded/qmlclocks/deployment.pri      | 1 +
 demos/embedded/qmldialcontrol/deployment.pri | 1 +
 demos/embedded/qmleasing/deployment.pri      | 1 +
 demos/embedded/qmlflickr/deployment.pri      | 1 +
 demos/embedded/qmlphotoviewer/deployment.pri | 1 +
 demos/embedded/qmltwitter/deployment.pri     | 1 +
 7 files changed, 7 insertions(+)

diff --git a/demos/embedded/qmlcalculator/deployment.pri b/demos/embedded/qmlcalculator/deployment.pri
index 53c6dbf..a31303d 100644
--- a/demos/embedded/qmlcalculator/deployment.pri
+++ b/demos/embedded/qmlcalculator/deployment.pri
@@ -1,5 +1,6 @@
 qmlcalculator_src = $$PWD/../../declarative/calculator
 symbian {
+    load(data_caging_paths)
     qmlcalculator_uid3 = A000E3FB
     qmlcalculator_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlcalculator_uid3
 }
diff --git a/demos/embedded/qmlclocks/deployment.pri b/demos/embedded/qmlclocks/deployment.pri
index 03ba129..0946733 100644
--- a/demos/embedded/qmlclocks/deployment.pri
+++ b/demos/embedded/qmlclocks/deployment.pri
@@ -1,5 +1,6 @@
 qmlclocks_src = $$PWD/../../../examples/declarative/toys/clocks
 symbian {
+    load(data_caging_paths)
     qmlclocks_uid3 = A000E3FC
     qmlclocks_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlclocks_uid3
 }
diff --git a/demos/embedded/qmldialcontrol/deployment.pri b/demos/embedded/qmldialcontrol/deployment.pri
index 097c74c..e0e72e6 100644
--- a/demos/embedded/qmldialcontrol/deployment.pri
+++ b/demos/embedded/qmldialcontrol/deployment.pri
@@ -1,5 +1,6 @@
 qmldialcontrol_src = $$PWD/../../../examples/declarative/ui-components/dialcontrol
 symbian {
+    load(data_caging_paths)
     qmldialcontrol_uid3 = A000E3FD
     qmldialcontrol_files.path = $$APP_PRIVATE_DIR_BASE/$$qmldialcontrol_uid3
 }
diff --git a/demos/embedded/qmleasing/deployment.pri b/demos/embedded/qmleasing/deployment.pri
index 47192e6..984f5c8 100644
--- a/demos/embedded/qmleasing/deployment.pri
+++ b/demos/embedded/qmleasing/deployment.pri
@@ -1,5 +1,6 @@
 qmleasing_src = $$PWD/../../../examples/declarative/animation/easing
 symbian {
+    load(data_caging_paths)
     qmleasing_uid3 = A000E3FE
     qmleasing_files.path = $$APP_PRIVATE_DIR_BASE/$$qmleasing_uid3
 }
diff --git a/demos/embedded/qmlflickr/deployment.pri b/demos/embedded/qmlflickr/deployment.pri
index c8fef1a..b508292 100644
--- a/demos/embedded/qmlflickr/deployment.pri
+++ b/demos/embedded/qmlflickr/deployment.pri
@@ -1,5 +1,6 @@
 qmlflickr_src = $$PWD/../../declarative/flickr
 symbian {
+    load(data_caging_paths)
     qmlflickr_uid3 = A000E3FF
     qmlflickr_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlflickr_uid3
 }
diff --git a/demos/embedded/qmlphotoviewer/deployment.pri b/demos/embedded/qmlphotoviewer/deployment.pri
index 128a1f7..35937a8 100644
--- a/demos/embedded/qmlphotoviewer/deployment.pri
+++ b/demos/embedded/qmlphotoviewer/deployment.pri
@@ -1,5 +1,6 @@
 qmlphotoviewer_src = $$PWD/../../declarative/photoviewer
 symbian {
+    load(data_caging_paths)
     qmlphotoviewer_uid3 = A000E400
     qmlphotoviewer_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlphotoviewer_uid3
 }
diff --git a/demos/embedded/qmltwitter/deployment.pri b/demos/embedded/qmltwitter/deployment.pri
index 40c53ad..4404e33 100644
--- a/demos/embedded/qmltwitter/deployment.pri
+++ b/demos/embedded/qmltwitter/deployment.pri
@@ -1,5 +1,6 @@
 qmltwitter_src = $$PWD/../../declarative/twitter
 symbian {
+    load(data_caging_paths)
     qmltwitter_uid3 = A000E401
     qmltwitter_files.path = $$APP_PRIVATE_DIR_BASE/$$qmltwitter_uid3
 }
-- 
cgit v0.12


From 75db37022a9fd479e2a446b57e774eaf8e3e73ea Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 7 Jul 2010 16:28:45 +1000
Subject: Convert examples and demos to use Bearer Management.

Task-number: QTBUG-10439
---
 demos/embedded/anomaly/anomaly.pro               |   2 -
 demos/embedded/anomaly/src/BrowserView.cpp       |  33 +-
 demos/embedded/anomaly/src/BrowserView.h         |   3 -
 demos/embedded/lightmaps/lightmaps.cpp           |  49 ++-
 demos/embedded/lightmaps/lightmaps.pro           |   2 -
 demos/embedded/qmlflickr/qmlflickr.cpp           |  63 +--
 demos/embedded/qmlflickr/qmlflickr.pro           |   2 -
 demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp |  63 +--
 demos/embedded/qmlphotoviewer/qmlphotoviewer.pro |   2 -
 demos/embedded/qmltwitter/qmltwitter.cpp         |  63 +--
 demos/embedded/qmltwitter/qmltwitter.pro         |   2 -
 examples/network/fortuneclient/client.cpp        |  65 ++-
 examples/network/fortuneclient/client.h          |   7 +-
 examples/network/fortuneclient/fortuneclient.pro |   2 -
 examples/network/fortuneserver/fortuneserver.pro |   2 -
 examples/network/fortuneserver/main.cpp          |   7 -
 examples/network/fortuneserver/server.cpp        |  96 +++--
 examples/network/fortuneserver/server.h          |   3 +
 examples/network/network-chat/main.cpp           |  48 ++-
 examples/network/network-chat/network-chat.pro   |   2 -
 examples/network/qftp/ftpwindow.cpp              |  56 ++-
 examples/network/qftp/ftpwindow.h                |   6 +-
 examples/network/qftp/qftp.pro                   |   2 -
 examples/network/qftp/sym_iap_util.h             | 519 -----------------------
 24 files changed, 388 insertions(+), 711 deletions(-)
 delete mode 100644 examples/network/qftp/sym_iap_util.h

diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro
index 584e5cd..a786b46 100644
--- a/demos/embedded/anomaly/anomaly.pro
+++ b/demos/embedded/anomaly/anomaly.pro
@@ -26,8 +26,6 @@ RESOURCES += src/anomaly.qrc
 symbian {
     TARGET.UID3 = 0xA000CF71
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = NetworkServices
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp
index a6e6f7a..73d0b70 100644
--- a/demos/embedded/anomaly/src/BrowserView.cpp
+++ b/demos/embedded/anomaly/src/BrowserView.cpp
@@ -51,10 +51,6 @@
 #include "webview.h"
 #include "ZoomStrip.h"
 
-#if defined (Q_OS_SYMBIAN)
-#include "sym_iap_util.h"
-#endif
-
 BrowserView::BrowserView(QWidget *parent)
     : QWidget(parent)
     , m_titleBar(0)
@@ -71,6 +67,26 @@ BrowserView::BrowserView(QWidget *parent)
     m_zoomLevels << 100;
     m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
 
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id =
+            settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system
+        // default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        m_webView->page()->networkAccessManager()->setConfiguration(config);
+    }
+
     QTimer::singleShot(0, this, SLOT(initialize()));
 }
 
@@ -100,9 +116,6 @@ void BrowserView::initialize()
     m_webView->setHtml("about:blank");
     m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
     m_webView->setFocus();
-#ifdef Q_OS_SYMBIAN
-    QTimer::singleShot(0, this, SLOT(setDefaultIap()));
-#endif
 }
 
 void BrowserView::start()
@@ -173,12 +186,6 @@ void BrowserView::resizeEvent(QResizeEvent *event)
     int zh = m_zoomStrip->sizeHint().height();
     m_zoomStrip->move(width() - zw, (height() - zh) / 2);
 }
-#ifdef Q_OS_SYMBIAN
-void BrowserView::setDefaultIap()
-{
-    qt_SetDefaultIap();
-}
-#endif
 
 void BrowserView::navigate(const QUrl &url)
 {
diff --git a/demos/embedded/anomaly/src/BrowserView.h b/demos/embedded/anomaly/src/BrowserView.h
index 5ab1dd7..8981582 100644
--- a/demos/embedded/anomaly/src/BrowserView.h
+++ b/demos/embedded/anomaly/src/BrowserView.h
@@ -63,9 +63,6 @@ public slots:
     void navigate(const QUrl &url);
     void zoomIn();
     void zoomOut();
-#ifdef Q_OS_SYMBIAN
-    void setDefaultIap();
-#endif
 
 private slots:
     void initialize();
diff --git a/demos/embedded/lightmaps/lightmaps.cpp b/demos/embedded/lightmaps/lightmaps.cpp
index c76aed0..2eb1733 100644
--- a/demos/embedded/lightmaps/lightmaps.cpp
+++ b/demos/embedded/lightmaps/lightmaps.cpp
@@ -43,10 +43,6 @@
 #include <QtGui>
 #include <QtNetwork>
 
-#if defined (Q_OS_SYMBIAN)
-#include "sym_iap_util.h"
-#endif
-
 #include <math.h>
 
 #ifndef M_PI
@@ -490,6 +486,7 @@ class MapZoom : public QMainWindow
 
 private:
     LightMaps *map;
+    QNetworkSession *networkSession;
 
 public:
     MapZoom(): QMainWindow(0) {
@@ -526,15 +523,49 @@ public:
         menu->addAction(osmAction);
 #endif
 
-        QTimer::singleShot(0, this, SLOT(delayedInit()));
+        QNetworkConfigurationManager manager;
+        if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+            // Get saved network configuration
+            QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+            settings.beginGroup(QLatin1String("QtNetwork"));
+            const QString id =
+                settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+            settings.endGroup();
+
+            // If the saved network configuration is not currently discovered use the system
+            // default
+            QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+            if ((config.state() & QNetworkConfiguration::Discovered) !=
+                QNetworkConfiguration::Discovered) {
+                config = manager.defaultConfiguration();
+            }
+
+            networkSession = new QNetworkSession(config, this);
+            connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
+
+            networkSession->open();
+        } else {
+            networkSession = 0;
+        }
     }
 
 private slots:
 
-    void delayedInit() {
-#if defined(Q_OS_SYMBIAN)
-        qt_SetDefaultIap();
-#endif
+    void sessionOpened() {
+        // Save the used configuration
+        QNetworkConfiguration config = networkSession->configuration();
+        QString id;
+        if (config.type() == QNetworkConfiguration::UserChoice) {
+            id = networkSession->sessionProperty(
+                    QLatin1String("UserChoiceConfiguration")).toString();
+        } else {
+            id = config.identifier();
+        }
+
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+        settings.endGroup();
     }
 
     void chooseOslo() {
diff --git a/demos/embedded/lightmaps/lightmaps.pro b/demos/embedded/lightmaps/lightmaps.pro
index ee4cc5a..9d83721 100644
--- a/demos/embedded/lightmaps/lightmaps.pro
+++ b/demos/embedded/lightmaps/lightmaps.pro
@@ -5,8 +5,6 @@ QT += network
 symbian {
     TARGET.UID3 = 0xA000CF75
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = NetworkServices
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/demos/embedded/qmlflickr/qmlflickr.cpp b/demos/embedded/qmlflickr/qmlflickr.cpp
index 6f0c528..7068f88 100644
--- a/demos/embedded/qmlflickr/qmlflickr.cpp
+++ b/demos/embedded/qmlflickr/qmlflickr.cpp
@@ -40,41 +40,59 @@
 ****************************************************************************/
 
 #include <QtCore/QFileInfo>
+#include <QtCore/QSettings>
 #include <QtGui/QApplication>
 #include <QtDeclarative/QDeclarativeView>
 #include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
+#include <QtNetwork/QNetworkConfiguration>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkAccessManager>
 
-#if defined(Q_OS_SYMBIAN)
-#include <QtCore/QTextCodec>
-#include <QtCore/QTimer>
-#include "sym_iap_util.h"
-
-class QmlAppView : public QDeclarativeView
+// Factory to create QNetworkAccessManagers that use the saved network configuration; otherwise
+// the system default.
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
 {
-Q_OBJECT
 public:
-    QmlAppView(QWidget *parent = 0)
-        : QDeclarativeView(parent)
-    {
-        QTimer::singleShot(0, this, SLOT(setDefaultIap()));
-    }
+    ~NetworkAccessManagerFactory() { }
 
-private slots:
-    void setDefaultIap()
-    {
-        qt_SetDefaultIap();
-    }
+    QNetworkAccessManager *create(QObject *parent);
 };
-#else // Q_OS_SYMBIAN
-typedef QDeclarativeView QmlAppView;
-#endif // Q_OS_SYMBIAN
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+    QNetworkAccessManager *accessManager = new QNetworkAccessManager(parent);
+
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        accessManager->setConfiguration(config);
+    }
+
+    return accessManager;
+}
 
 int main(int argc, char *argv[])
 {
     QApplication application(argc, argv);
 
+    NetworkAccessManagerFactory networkAccessManagerFactory;
+
     const QString mainQmlApp = QLatin1String("flickr.qml");
-    QmlAppView view;
+    QDeclarativeView view;
+    view.engine()->setNetworkAccessManagerFactory(&networkAccessManagerFactory);
     view.setSource(QUrl(mainQmlApp));
     view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
 
@@ -87,6 +105,3 @@ int main(int argc, char *argv[])
     return application.exec();
 }
 
-#if defined(Q_OS_SYMBIAN)
-#include "qmlflickr.moc"
-#endif // Q_OS_SYMBIAN
diff --git a/demos/embedded/qmlflickr/qmlflickr.pro b/demos/embedded/qmlflickr/qmlflickr.pro
index e706134..39b316a 100644
--- a/demos/embedded/qmlflickr/qmlflickr.pro
+++ b/demos/embedded/qmlflickr/qmlflickr.pro
@@ -7,8 +7,6 @@ include($$PWD/deployment.pri)
 symbian {
     TARGET.UID3 = 0x$$qmlflickr_uid3 # defined in deployment.pri
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = NetworkServices
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp b/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp
index 7889842..2b9db5e 100644
--- a/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp
+++ b/demos/embedded/qmlphotoviewer/qmlphotoviewer.cpp
@@ -40,41 +40,59 @@
 ****************************************************************************/
 
 #include <QtCore/QFileInfo>
+#include <QtCore/QSettings>
 #include <QtGui/QApplication>
 #include <QtDeclarative/QDeclarativeView>
 #include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
+#include <QtNetwork/QNetworkConfiguration>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkAccessManager>
 
-#if defined(Q_OS_SYMBIAN)
-#include <QtCore/QTextCodec>
-#include <QtCore/QTimer>
-#include "sym_iap_util.h"
-
-class QmlAppView : public QDeclarativeView
+// Factory to create QNetworkAccessManagers that use the saved network configuration; otherwise
+// the system default.
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
 {
-Q_OBJECT
 public:
-    QmlAppView(QWidget *parent = 0)
-        : QDeclarativeView(parent)
-    {
-        QTimer::singleShot(0, this, SLOT(setDefaultIap()));
-    }
+    ~NetworkAccessManagerFactory() { }
 
-private slots:
-    void setDefaultIap()
-    {
-        qt_SetDefaultIap();
-    }
+    QNetworkAccessManager *create(QObject *parent);
 };
-#else // Q_OS_SYMBIAN
-typedef QDeclarativeView QmlAppView;
-#endif // Q_OS_SYMBIAN
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+    QNetworkAccessManager *accessManager = new QNetworkAccessManager(parent);
+
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        accessManager->setConfiguration(config);
+    }
+
+    return accessManager;
+}
 
 int main(int argc, char *argv[])
 {
     QApplication application(argc, argv);
 
+    NetworkAccessManagerFactory networkAccessManagerFactory;
+
     const QString mainQmlApp = QLatin1String("photoviewer.qml");
-    QmlAppView view;
+    QDeclarativeView view;
+    view.engine()->setNetworkAccessManagerFactory(&networkAccessManagerFactory);
     view.setSource(QUrl(mainQmlApp));
     view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
 
@@ -87,6 +105,3 @@ int main(int argc, char *argv[])
     return application.exec();
 }
 
-#if defined(Q_OS_SYMBIAN)
-#include "qmlphotoviewer.moc"
-#endif // Q_OS_SYMBIAN
diff --git a/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro b/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro
index ead5e67..a4234cf 100644
--- a/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro
+++ b/demos/embedded/qmlphotoviewer/qmlphotoviewer.pro
@@ -7,8 +7,6 @@ include($$PWD/deployment.pri)
 symbian {
     TARGET.UID3 = 0x$$qmlphotoviewer_uid3 # defined in deployment.pri
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = NetworkServices
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/demos/embedded/qmltwitter/qmltwitter.cpp b/demos/embedded/qmltwitter/qmltwitter.cpp
index e30ab24..c53098a4 100644
--- a/demos/embedded/qmltwitter/qmltwitter.cpp
+++ b/demos/embedded/qmltwitter/qmltwitter.cpp
@@ -40,41 +40,59 @@
 ****************************************************************************/
 
 #include <QtCore/QFileInfo>
+#include <QtCore/QSettings>
 #include <QtGui/QApplication>
 #include <QtDeclarative/QDeclarativeView>
 #include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeNetworkAccessManagerFactory>
+#include <QtNetwork/QNetworkConfiguration>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkAccessManager>
 
-#if defined(Q_OS_SYMBIAN)
-#include <QtCore/QTextCodec>
-#include <QtCore/QTimer>
-#include "sym_iap_util.h"
-
-class QmlAppView : public QDeclarativeView
+// Factory to create QNetworkAccessManagers that use the saved network configuration; otherwise
+// the system default.
+class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
 {
-Q_OBJECT
 public:
-    QmlAppView(QWidget *parent = 0)
-        : QDeclarativeView(parent)
-    {
-        QTimer::singleShot(0, this, SLOT(setDefaultIap()));
-    }
+    ~NetworkAccessManagerFactory() { }
 
-private slots:
-    void setDefaultIap()
-    {
-        qt_SetDefaultIap();
-    }
+    QNetworkAccessManager *create(QObject *parent);
 };
-#else // Q_OS_SYMBIAN
-typedef QDeclarativeView QmlAppView;
-#endif // Q_OS_SYMBIAN
+
+QNetworkAccessManager *NetworkAccessManagerFactory::create(QObject *parent)
+{
+    QNetworkAccessManager *accessManager = new QNetworkAccessManager(parent);
+
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        accessManager->setConfiguration(config);
+    }
+
+    return accessManager;
+}
 
 int main(int argc, char *argv[])
 {
     QApplication application(argc, argv);
 
+    NetworkAccessManagerFactory networkAccessManagerFactory;
+
     const QString mainQmlApp = QLatin1String("twitter.qml");
-    QmlAppView view;
+    QDeclarativeView view;
+    view.engine()->setNetworkAccessManagerFactory(&networkAccessManagerFactory);
     view.setSource(QUrl(mainQmlApp));
     view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
 
@@ -87,6 +105,3 @@ int main(int argc, char *argv[])
     return application.exec();
 }
 
-#if defined(Q_OS_SYMBIAN)
-#include "qmltwitter.moc"
-#endif // Q_OS_SYMBIAN
diff --git a/demos/embedded/qmltwitter/qmltwitter.pro b/demos/embedded/qmltwitter/qmltwitter.pro
index 7f9be57..7bd4617 100644
--- a/demos/embedded/qmltwitter/qmltwitter.pro
+++ b/demos/embedded/qmltwitter/qmltwitter.pro
@@ -7,8 +7,6 @@ include($$PWD/deployment.pri)
 symbian {
     TARGET.UID3 = 0x$$qmltwitter_uid3 # defined in deployment.pri
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = NetworkServices
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/examples/network/fortuneclient/client.cpp b/examples/network/fortuneclient/client.cpp
index b9a85c4..fe35906 100644
--- a/examples/network/fortuneclient/client.cpp
+++ b/examples/network/fortuneclient/client.cpp
@@ -43,13 +43,9 @@
 
 #include "client.h"
 
-#ifdef Q_OS_SYMBIAN
-#include "sym_iap_util.h"
-#endif
-
 //! [0]
 Client::Client(QWidget *parent)
-    : QDialog(parent)
+:   QDialog(parent), networkSession(0)
 {
 //! [0]
     hostLabel = new QLabel(tr("&Server name:"));
@@ -121,9 +117,28 @@ Client::Client(QWidget *parent)
     setWindowTitle(tr("Fortune Client"));
     portLineEdit->setFocus();
 
-#ifdef Q_OS_SYMBIAN
-    isDefaultIapSet = false;
-#endif
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        networkSession = new QNetworkSession(config, this);
+        connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
+
+        getFortuneButton->setEnabled(false);
+        statusLabel->setText(tr("Opening network session."));
+        networkSession->open();
+    }
 //! [5]
 }
 //! [5]
@@ -132,12 +147,6 @@ Client::Client(QWidget *parent)
 void Client::requestNewFortune()
 {
     getFortuneButton->setEnabled(false);
-#ifdef Q_OS_SYMBIAN
-    if(!isDefaultIapSet) {
-        qt_SetDefaultIap();
-        isDefaultIapSet = true;
-    }
-#endif
     blockSize = 0;
     tcpSocket->abort();
 //! [7]
@@ -214,6 +223,30 @@ void Client::displayError(QAbstractSocket::SocketError socketError)
 
 void Client::enableGetFortuneButton()
 {
-    getFortuneButton->setEnabled(!hostLineEdit->text().isEmpty()
-                                 && !portLineEdit->text().isEmpty());
+    getFortuneButton->setEnabled((!networkSession || networkSession->isOpen()) &&
+                                 !hostLineEdit->text().isEmpty() &&
+                                 !portLineEdit->text().isEmpty());
+
 }
+
+void Client::sessionOpened()
+{
+    // Save the used configuration
+    QNetworkConfiguration config = networkSession->configuration();
+    QString id;
+    if (config.type() == QNetworkConfiguration::UserChoice)
+        id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
+    else
+        id = config.identifier();
+
+    QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+    settings.beginGroup(QLatin1String("QtNetwork"));
+    settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+    settings.endGroup();
+
+    statusLabel->setText(tr("This examples requires that you run the "
+                            "Fortune Server example as well."));
+
+    enableGetFortuneButton();
+}
+
diff --git a/examples/network/fortuneclient/client.h b/examples/network/fortuneclient/client.h
index 50a9037..d0c0718 100644
--- a/examples/network/fortuneclient/client.h
+++ b/examples/network/fortuneclient/client.h
@@ -50,6 +50,7 @@ class QLabel;
 class QLineEdit;
 class QPushButton;
 class QTcpSocket;
+class QNetworkSession;
 QT_END_NAMESPACE
 
 //! [0]
@@ -65,6 +66,7 @@ private slots:
     void readFortune();
     void displayError(QAbstractSocket::SocketError socketError);
     void enableGetFortuneButton();
+    void sessionOpened();
 
 private:
     QLabel *hostLabel;
@@ -79,9 +81,8 @@ private:
     QTcpSocket *tcpSocket;
     QString currentFortune;
     quint16 blockSize;
-#ifdef Q_OS_SYMBIAN
-    bool isDefaultIapSet;
-#endif
+
+    QNetworkSession *networkSession;
 };
 //! [0]
 
diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro
index edbf14d..f79679d 100644
--- a/examples/network/fortuneclient/fortuneclient.pro
+++ b/examples/network/fortuneclient/fortuneclient.pro
@@ -11,8 +11,6 @@ INSTALLS += target sources
 
 symbian {
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index 474ec11..e13f309 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -12,8 +12,6 @@ INSTALLS += target sources
 symbian {
     TARGET.UID3 = 0xA000CF71
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     TARGET.CAPABILITY = "NetworkServices ReadUserData"
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
 }
diff --git a/examples/network/fortuneserver/main.cpp b/examples/network/fortuneserver/main.cpp
index 29fe777..53149c0 100644
--- a/examples/network/fortuneserver/main.cpp
+++ b/examples/network/fortuneserver/main.cpp
@@ -45,15 +45,8 @@
 
 #include "server.h"
 
-#ifdef Q_OS_SYMBIAN
-#include "sym_iap_util.h"
-#endif
-
 int main(int argc, char *argv[])
 {
-#ifdef Q_OS_SYMBIAN
-    qt_SetDefaultIap();
-#endif
     QApplication app(argc, argv);
     Server server;
 #ifdef Q_OS_SYMBIAN
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index 98234e0..b931b96 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -46,12 +46,79 @@
 #include "server.h"
 
 Server::Server(QWidget *parent)
-    : QDialog(parent)
+:   QDialog(parent), tcpServer(0), networkSession(0)
 {
     statusLabel = new QLabel;
     quitButton = new QPushButton(tr("Quit"));
     quitButton->setAutoDefault(false);
 
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        networkSession = new QNetworkSession(config, this);
+        connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
+
+        statusLabel->setText(tr("Opening network session."));
+        networkSession->open();
+    } else {
+        sessionOpened();
+    }
+
+    //! [2]
+        fortunes << tr("You've been leading a dog's life. Stay off the furniture.")
+                 << tr("You've got to think about tomorrow.")
+                 << tr("You will be surprised by a loud noise.")
+                 << tr("You will feel hungry again in another hour.")
+                 << tr("You might have mail.")
+                 << tr("You cannot kill time without injuring eternity.")
+                 << tr("Computers are not intelligent. They only think they are.");
+    //! [2]
+
+        connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+    //! [3]
+        connect(tcpServer, SIGNAL(newConnection()), this, SLOT(sendFortune()));
+    //! [3]
+
+        QHBoxLayout *buttonLayout = new QHBoxLayout;
+        buttonLayout->addStretch(1);
+        buttonLayout->addWidget(quitButton);
+        buttonLayout->addStretch(1);
+
+        QVBoxLayout *mainLayout = new QVBoxLayout;
+        mainLayout->addWidget(statusLabel);
+        mainLayout->addLayout(buttonLayout);
+        setLayout(mainLayout);
+
+        setWindowTitle(tr("Fortune Server"));
+}
+
+void Server::sessionOpened()
+{
+    // Save the used configuration
+    QNetworkConfiguration config = networkSession->configuration();
+    QString id;
+    if (config.type() == QNetworkConfiguration::UserChoice)
+        id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
+    else
+        id = config.identifier();
+
+    QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+    settings.beginGroup(QLatin1String("QtNetwork"));
+    settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+    settings.endGroup();
+
 //! [0] //! [1]
     tcpServer = new QTcpServer(this);
     if (!tcpServer->listen()) {
@@ -79,33 +146,6 @@ Server::Server(QWidget *parent)
                             "Run the Fortune Client example now.")
                          .arg(ipAddress).arg(tcpServer->serverPort()));
 //! [1]
-
-//! [2]
-    fortunes << tr("You've been leading a dog's life. Stay off the furniture.")
-             << tr("You've got to think about tomorrow.")
-             << tr("You will be surprised by a loud noise.")
-             << tr("You will feel hungry again in another hour.")
-             << tr("You might have mail.")
-             << tr("You cannot kill time without injuring eternity.")
-             << tr("Computers are not intelligent. They only think they are.");
-//! [2]
-
-    connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
-//! [3]
-    connect(tcpServer, SIGNAL(newConnection()), this, SLOT(sendFortune()));
-//! [3]
-
-    QHBoxLayout *buttonLayout = new QHBoxLayout;
-    buttonLayout->addStretch(1);
-    buttonLayout->addWidget(quitButton);
-    buttonLayout->addStretch(1);
-
-    QVBoxLayout *mainLayout = new QVBoxLayout;
-    mainLayout->addWidget(statusLabel);
-    mainLayout->addLayout(buttonLayout);
-    setLayout(mainLayout);
-
-    setWindowTitle(tr("Fortune Server"));
 }
 
 //! [4]
diff --git a/examples/network/fortuneserver/server.h b/examples/network/fortuneserver/server.h
index 2d8d116..9d9ef62 100644
--- a/examples/network/fortuneserver/server.h
+++ b/examples/network/fortuneserver/server.h
@@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE
 class QLabel;
 class QPushButton;
 class QTcpServer;
+class QNetworkSession;
 QT_END_NAMESPACE
 
 //! [0]
@@ -58,6 +59,7 @@ public:
     Server(QWidget *parent = 0);
 
 private slots:
+    void sessionOpened();
     void sendFortune();
 
 private:
@@ -65,6 +67,7 @@ private:
     QPushButton *quitButton;
     QTcpServer *tcpServer;
     QStringList fortunes;
+    QNetworkSession *networkSession;
 };
 //! [0]
 
diff --git a/examples/network/network-chat/main.cpp b/examples/network/network-chat/main.cpp
index 7226217..e3db74b 100644
--- a/examples/network/network-chat/main.cpp
+++ b/examples/network/network-chat/main.cpp
@@ -41,16 +41,52 @@
 #include <QApplication>
 
 #include "chatdialog.h"
-#ifdef Q_OS_SYMBIAN
-#include "sym_iap_util.h"
-#endif
+
+#include <QtCore/QSettings>
+#include <QtNetwork/QNetworkConfigurationManager>
+#include <QtNetwork/QNetworkSession>
 
 int main(int argc, char *argv[])
 {
-#ifdef Q_OS_SYMBIAN
-    qt_SetDefaultIap();
-#endif
     QApplication app(argc, argv);
+
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        QNetworkSession *networkSession = new QNetworkSession(config, &app);
+        networkSession->open();
+        networkSession->waitForOpened();
+
+        if (networkSession->isOpen()) {
+            // Save the used configuration
+            QNetworkConfiguration config = networkSession->configuration();
+            QString id;
+            if (config.type() == QNetworkConfiguration::UserChoice) {
+                id = networkSession->sessionProperty(
+                        QLatin1String("UserChoiceConfiguration")).toString();
+            } else {
+                id = config.identifier();
+            }
+
+            QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+            settings.beginGroup(QLatin1String("QtNetwork"));
+            settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+            settings.endGroup();
+        }
+    }
+
     ChatDialog dialog;
 #ifdef Q_OS_SYMBIAN
     // Make application better looking and more usable on small screen
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index 1215aea..b3d429e 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -20,8 +20,6 @@ INSTALLS += target sources
 
 symbian {
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-    INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/
-    LIBS += -lesock -lcommdb -linsock # For IAP selection
     LIBS += -lcharconv
     TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
     TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp
index 635b679..f39f9a0 100644
--- a/examples/network/qftp/ftpwindow.cpp
+++ b/examples/network/qftp/ftpwindow.cpp
@@ -43,12 +43,8 @@
 
 #include "ftpwindow.h"
 
-#ifdef Q_OS_SYMBIAN
-#include "sym_iap_util.h"
-#endif
-
 FtpWindow::FtpWindow(QWidget *parent)
-    : QDialog(parent), ftp(0)
+    : QDialog(parent), ftp(0), networkSession(0)
 {
     ftpServerLabel = new QLabel(tr("Ftp &server:"));
     ftpServerLineEdit = new QLineEdit("ftp.qt.nokia.com");
@@ -118,9 +114,28 @@ FtpWindow::FtpWindow(QWidget *parent)
     mainLayout->addWidget(buttonBox);
     setLayout(mainLayout);
 
-#ifdef Q_OS_SYMBIAN
-    bDefaultIapSet = false;
-#endif
+    QNetworkConfigurationManager manager;
+    if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
+        // Get saved network configuration
+        QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+        settings.beginGroup(QLatin1String("QtNetwork"));
+        const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
+        settings.endGroup();
+
+        // If the saved network configuration is not currently discovered use the system default
+        QNetworkConfiguration config = manager.configurationFromIdentifier(id);
+        if ((config.state() & QNetworkConfiguration::Discovered) !=
+            QNetworkConfiguration::Discovered) {
+            config = manager.defaultConfiguration();
+        }
+
+        networkSession = new QNetworkSession(config, this);
+        connect(networkSession, SIGNAL(opened()), this, SLOT(enableConnectButton()));
+
+        connectButton->setEnabled(false);
+        statusLabel->setText(tr("Opening network session."));
+        networkSession->open();
+    }
 
     setWindowTitle(tr("FTP"));
 }
@@ -133,12 +148,6 @@ QSize FtpWindow::sizeHint() const
 //![0]
 void FtpWindow::connectOrDisconnect()
 {
-#ifdef Q_OS_SYMBIAN
-   if(!bDefaultIapSet) {
-       qt_SetDefaultIap();
-       bDefaultIapSet = true;
-   }
-#endif
     if (ftp) {
         ftp->abort();
         ftp->deleteLater();
@@ -377,3 +386,22 @@ void FtpWindow::enableDownloadButton()
 }
 //![14]
 
+void FtpWindow::enableConnectButton()
+{
+    // Save the used configuration
+    QNetworkConfiguration config = networkSession->configuration();
+    QString id;
+    if (config.type() == QNetworkConfiguration::UserChoice)
+        id = networkSession->sessionProperty(QLatin1String("UserChoiceConfiguration")).toString();
+    else
+        id = config.identifier();
+
+    QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+    settings.beginGroup(QLatin1String("QtNetwork"));
+    settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
+    settings.endGroup();
+
+    connectButton->setEnabled(networkSession->isOpen());
+    statusLabel->setText(tr("Please enter the name of an FTP server."));
+}
+
diff --git a/examples/network/qftp/ftpwindow.h b/examples/network/qftp/ftpwindow.h
index 25a7a56..9f39ccd 100644
--- a/examples/network/qftp/ftpwindow.h
+++ b/examples/network/qftp/ftpwindow.h
@@ -55,6 +55,7 @@ class QTreeWidgetItem;
 class QProgressDialog;
 class QPushButton;
 class QUrlInfo;
+class QNetworkSession;
 QT_END_NAMESPACE
 
 class FtpWindow : public QDialog
@@ -78,6 +79,7 @@ private slots:
     void updateDataTransferProgress(qint64 readBytes,
                                     qint64 totalBytes);
     void enableDownloadButton();
+    void enableConnectButton();
 //![0]
 
 private:
@@ -98,9 +100,7 @@ private:
     QFtp *ftp;
     QFile *file;
 
-#ifdef Q_OS_SYMBIAN
-    bool bDefaultIapSet;
-#endif
+    QNetworkSession *networkSession;
 //![1]
 };
 
diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro
index b3106c3..232e8eb 100644
--- a/examples/network/qftp/qftp.pro
+++ b/examples/network/qftp/qftp.pro
@@ -13,8 +13,6 @@ INSTALLS += target sources
 symbian {
     TARGET.UID3 = 0xA000A648
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
-    HEADERS +=  sym_iap_util.h
     INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
     TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData"
-    LIBS+=-lesock -lcommdb -linsock # For IAP selection
 }
diff --git a/examples/network/qftp/sym_iap_util.h b/examples/network/qftp/sym_iap_util.h
deleted file mode 100644
index bea447c..0000000
--- a/examples/network/qftp/sym_iap_util.h
+++ /dev/null
@@ -1,519 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QSYM_IAP_UTIL_H
-#define QSYM_IAP_UTIL_H
-
-// Symbian
-#include <utf.h>
-#include <es_sock.h>
-#include <in_sock.h>
-#include <es_enum.h>
-#include <in_iface.h>
-#include <commdbconnpref.h>
-#include <e32cmn.h>
-
-// OpenC
-#include <sys/socket.h>
-#include <net/if.h>
-
-//Qt
-#include <QSettings>
-#include <QStringList>
-//#include <QTextCodec>
-
-_LIT(KIapNameSetting, "IAP\\Name");             // text - mandatory
-_LIT(KIapTableIdField, "IAP\\Id");
-_LIT(KIapDialogPref, "IAP\\DialogPref");        // TUnit32 - optional
-_LIT(KIapService, "IAP\\IAPService");           // TUnit32 - mandatory
-_LIT(KIapServiceType, "IAP\\IAPServiceType");   // text - mandatory
-_LIT(KIapBearer, "IAP\\IAPBearer");             // TUint32 - optional
-_LIT(KIapBearerType, "IAP\\IAPBearerType");     // text - optional
-_LIT(KIapNetwork, "IAP\\IAPNetwork");           // TUint32 - optional
-
-const QLatin1String qtOrganizationTag("Trolltech");
-const QLatin1String qtNetworkModuleTag("QtNetwork");
-const QLatin1String iapGroupTag("IAP");
-const QLatin1String iapNamesArrayTag("Names");
-const QLatin1String iapNameItemTag("Name");
-
-static QTextCodec *utf16LETextCodec = 0;
-
-void clearIapNamesSettings(QSettings &settings) {
-    settings.beginGroup(qtNetworkModuleTag);
-        settings.beginGroup(iapGroupTag);
-           settings.remove(iapNamesArrayTag);
-        settings.endGroup();
-    settings.endGroup();
-}
-
-void writeIapNamesSettings(QSettings &settings, const QStringList& iapNames) {
-    clearIapNamesSettings(settings);
-    settings.beginGroup(qtNetworkModuleTag);
-        settings.beginGroup(iapGroupTag);
-            settings.beginWriteArray(iapNamesArrayTag);
-            for (int index = 0; index < iapNames.size(); ++index) {
-                settings.setArrayIndex(index);
-                settings.setValue(iapNameItemTag, iapNames.at(index));
-            }
-            settings.endArray();
-        settings.endGroup();
-    settings.endGroup();
-}
-
-void readIapNamesSettings(QSettings &settings, QStringList& iapNames) {
-    settings.beginGroup(qtNetworkModuleTag);
-        settings.beginGroup(iapGroupTag);
-            int last = settings.beginReadArray(iapNamesArrayTag);
-            for (int index = 0; index < last; ++index) {
-                settings.setArrayIndex(index);
-                iapNames.append(settings.value(iapNameItemTag).toString());
-            }
-            settings.endArray();
-        settings.endGroup();
-    settings.endGroup();
-}
-
-static QString qt_TNameToQString(TName data) {
-    if(utf16LETextCodec == 0)
-        utf16LETextCodec = QTextCodec::codecForName("UTF-16LE");
-
-    QByteArray tmpByteArray = QByteArray::fromRawData((char*)(data.PtrZ()), data.Length() * 2);
-    return utf16LETextCodec->toUnicode(tmpByteArray);
-}
-
-static QString qt_InterfaceInfoL()
-{
-    QString output;
-
-    TBuf8<512> buffer;
-    TBuf<128> t;
-    TAutoClose<RSocketServ> ss;
-    User::LeaveIfError(ss.iObj.Connect());
-    ss.PushL();
-
-    TAutoClose<RSocket> sock;
-    User::LeaveIfError(sock.iObj.Open(ss.iObj, _L("udp")));
-    sock.PushL();
-
-    User::LeaveIfError(sock.iObj.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl));
-
-    TProtocolDesc in;
-    User::LeaveIfError(sock.iObj.Info(in));
-    printf("EPOC32 IP Configuration TCPIP Version %d.%d.%d\n", in.iVersion.iMajor, in.iVersion.iMinor, in.iVersion.iBuild);
-
-    TPckgBuf<TSoInetInterfaceInfo> info, next;
-
-    TInt res=sock.iObj.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, info);
-    if(res!=KErrNone)
-        User::Leave(res);
-    TInt count = 0;
-    while(res==KErrNone) {
-        res=sock.iObj.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, next);
-
-        if(info().iName != _L("") && info().iName != _L("loop6") && info().iName != _L("loop4")) {
-            printf("Interface %d\n", count++);
-
-            printf("Name \"%s\"\n", qt_TNameToQString(info().iName).toLatin1().data());
-            printf("NIF tag \"%s\"\n", qt_TNameToQString(info().iTag).toLatin1().data());
-
-            printf("State ");
-            switch (info().iState)
-            {
-                case EIfPending:
-                    printf("pending\n");
-                    break;
-                case EIfUp:
-                    printf("up\n");
-                    break;
-                case EIfBusy:
-                    printf("busy\n");
-                    break;
-                default:
-                    printf("down\n");
-                    break;
-            }
-
-            printf("Mtu %d\n", info().iMtu);
-            printf("Speed Metric %d\n", info().iSpeedMetric);
-
-            printf("Features:");
-            info().iFeatures & KIfIsLoopback         ? printf(" loopback") : printf("");
-            info().iFeatures & KIfIsDialup           ? printf(" dialup") : printf("");
-            info().iFeatures & KIfIsPointToPoint     ? printf(" pointtopoint") : printf("");
-            info().iFeatures & KIfCanBroadcast       ? printf(" canbroadcast") : printf("");
-            info().iFeatures & KIfCanMulticast       ? printf(" canmulticast") : printf("");
-            info().iFeatures & KIfCanSetMTU          ? printf(" cansetmtu") : printf("");
-            info().iFeatures & KIfHasHardwareAddr    ? printf(" hardwareaddr") : printf("");
-            info().iFeatures & KIfCanSetHardwareAddr ? printf(" cansethardwareaddr") : printf("");
-            printf("\n");
-
-            TName address;
-            info().iAddress.Output(address);
-            printf("Addr: %s\n", qt_TNameToQString(address).toLatin1().data());
-
-            if(info().iAddress.IsLinkLocal()) {
-                printf("  -link local\n");
-            } else if(info().iAddress.IsSiteLocal()) {
-                printf("  -site local\n");
-            } else {
-                printf("  -global\n");
-            }
-
-            info().iNetMask.Output(address);
-            printf("Netmask %s\n", qt_TNameToQString(address).toLatin1().data());
-
-            info().iBrdAddr.Output(address);
-            printf("Broadcast address %s\n", qt_TNameToQString(address).toLatin1().data());
-
-            info().iDefGate.Output(address);
-            printf("Gatew: %s\n", qt_TNameToQString(address).toLatin1().data());
-
-            info().iNameSer1.Output(address);
-            printf("DNS 1: %s\n", qt_TNameToQString(address).toLatin1().data());
-
-            info().iNameSer2.Output(address);
-            printf("DNS 2: %s\n", qt_TNameToQString(address).toLatin1().data());
-
-            if (info().iHwAddr.Family() != KAFUnspec) {
-                printf("Hardware address ");
-                TUint j;
-                for(j = sizeof(SSockAddr) ; j < sizeof(SSockAddr) + 6 ; ++j) {
-                    if(j < (TUint)info().iHwAddr.Length()) {
-                        printf("%02X", info().iHwAddr[j]);
-                    } else {
-                        printf("??");
-                    }
-                    if(j < sizeof(SSockAddr) + 5)
-                        printf("-");
-                    else
-                        printf("\n");
-                    }
-                }
-            }
-        if(res == KErrNone) {
-            info = next;
-            printf("\n");
-        } else {
-            printf("\n");
-        }
-    }
-
-    sock.Pop();
-    ss.Pop();
-
-    return output;
-}
-
-static QString qt_RouteInfoL() {
-    QString output;
-    TAutoClose<RSocketServ> ss;
-    User::LeaveIfError(ss.iObj.Connect());
-    ss.PushL();
-
-    TAutoClose<RSocket> sock;
-    User::LeaveIfError(sock.iObj.Open(ss.iObj, _L("udp")));
-    sock.PushL();
-
-    TSoInetRouteInfo routeInfo;
-    TPckg<TSoInetRouteInfo> routeInfoPkg(routeInfo);
-
-    TName destAddr;
-    TName netMask;
-    TName gateway;
-    TName ifAddr;
-
-    // Begins enumeration of routes by setting this option
-    User::LeaveIfError(sock.iObj.SetOpt(KSoInetEnumRoutes, KSolInetRtCtrl));
-
-    // The TSoInetRouteInfo contains information for a new route each time GetOpt returns KErrNone
-    for(TInt i = 0; sock.iObj.GetOpt(KSoInetNextRoute, KSolInetRtCtrl, routeInfoPkg) == KErrNone ; i++)
-    {
-      // Extract the destination and netmask
-      routeInfo.iDstAddr.Output(destAddr);
-      routeInfo.iNetMask.Output(netMask);
-      routeInfo.iGateway.Output(gateway);
-      routeInfo.iIfAddr.Output(ifAddr);
-/*
-      if(destAddr.Length() <= 2)
-          continue;
-
-      if(netMask.Find(_L("255.255.255.255")) != KErrNotFound
-              || netMask.Find(_L("0.0.0.0")) != KErrNotFound
-              || netMask.Find(_L("ffff:ffff:ffff:ffff")) != KErrNotFound)
-          continue;
-*/
-      printf("Route Info #[%i]\n", i);
-      printf("DstAddr %s\n", qt_TNameToQString(destAddr).toLatin1().data());
-      printf("NetMask %s\n", qt_TNameToQString(netMask).toLatin1().data());
-      printf("Gateway %s\n", qt_TNameToQString(gateway).toLatin1().data());
-      printf("IfAddr %s\n", qt_TNameToQString(ifAddr).toLatin1().data());
-      printf("\n");
-    }
-
-    sock.Pop();
-    ss.Pop();
-
-    return output;
-}
-
-QString qt_TDesC2QStringL(const TDesC& aDescriptor)
-{
-#ifdef QT_NO_UNICODE
-    return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
-#else
-    return QString((const QChar *)aDescriptor.Ptr(), aDescriptor.Length());
-#endif
-}
-
-static bool qt_SetDefaultIapName(const QString &iapName, int &error) {
-    struct ifreq ifReq;
-    // clear structure
-    memset(&ifReq, 0, sizeof(struct ifreq));
-    // set IAP name value
-    // make sure it is in UTF8
-    strcpy(ifReq.ifr_name, iapName.toUtf8().data());
-
-    if(setdefaultif(&ifReq) == 0) {
-        // OK
-        error = 0;
-        return true;
-    } else {
-        error = errno;
-        return false;
-    }
-
-}
-static bool qt_SetDefaultSnapId(const int snapId, int &error) {
-    struct ifreq ifReq;
-    // clear structure
-    memset(&ifReq, 0, sizeof(struct ifreq));
-    // set SNAP ID value
-    ifReq.ifr_ifru.snap_id = snapId;
-
-    if(setdefaultif(&ifReq) == 0) {
-        // OK
-        error = 0;
-        return true;
-    } else {
-        error = errno;
-        return false;
-    }
-
-}
-
-static void qt_SaveIapName(QSettings& settings, QStringList& iapNames, QString& iapNameValue) {
-    if(iapNames.contains(iapNameValue) && iapNames.first() == iapNameValue) {
-        // no need to update
-    } else {
-        if(iapNameValue != QString("Easy WLAN")) {
-            // new selection alway on top
-            iapNames.removeAll(iapNameValue);
-            iapNames.prepend(iapNameValue);
-            writeIapNamesSettings(settings, iapNames);
-        } else {
-            // Unbeliveable ... if IAP dodn't exist before
-            // no matter what you choose from IAP selection list
-            // you will get "Easy WLAN" as IAP name value
-
-            // somehow commsdb is not in sync
-        }
-    }
-}
-
-static QString qt_OfferIapDialog() {
-    TBuf8<256> iapName;
-
-    RSocketServ socketServ;
-    CleanupClosePushL(socketServ);
-
-    RConnection connection;
-    CleanupClosePushL(connection);
-
-    socketServ.Connect();
-
-    TCommDbConnPref prefs;
-    prefs.SetDialogPreference(ECommDbDialogPrefPrompt);
-
-    connection.Open(socketServ);
-    connection.Start(prefs);
-
-    connection.GetDesSetting(TPtrC(KIapNameSetting), iapName);
-    //connection.Stop();
-
-    iapName.ZeroTerminate();
-    QString strIapName((char*)iapName.Ptr());
-
-    int error = 0;
-    if(!strIapName.isEmpty()) {
-        if(!qt_SetDefaultIapName(strIapName, error)) {
-            //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error);
-            strIapName = QString("");
-        }
-    }
-
-    CleanupStack::PopAndDestroy(&connection);
-    CleanupStack::PopAndDestroy(&socketServ);
-
-    return strIapName;
-}
-
-static QString qt_CheckForActiveConnection() {
-    TUint count;
-
-    RSocketServ serv;
-    CleanupClosePushL(serv);
-
-    RConnection conn;
-    CleanupClosePushL(conn);
-
-    serv.Connect();
-    conn.Open(serv);
-
-    TConnectionInfoBuf connInfo;
-
-    TBuf8<256> iapName;
-    TBuf8<256> iapServiceType;
-
-    QString strIapName;
-
-    if (conn.EnumerateConnections(count) == KErrNone) {
-        if(count > 0) {
-            for (TUint i = 1; i <= count; i++) {
-                if (conn.GetConnectionInfo(i, connInfo) == KErrNone) {
-                    RConnection tempConn;
-                    CleanupClosePushL(tempConn);
-                    tempConn.Open(serv);
-                    if (tempConn.Attach(connInfo, RConnection::EAttachTypeNormal) == KErrNone) {
-                       tempConn.GetDesSetting(TPtrC(KIapNameSetting), iapName);
-                       tempConn.GetDesSetting(TPtrC(KIapServiceType), iapServiceType);
-                       //tempConn.Stop();
-                       iapName.ZeroTerminate();
-		               iapServiceType.ZeroTerminate();
-
-//                        if(iapServiceType.Find(_L8("LANService")) != KErrNotFound) {
-//                            activeLanConnectionFound = ETrue;
-//                            break;
-//                        }
-			            strIapName = QString((char*)iapName.Ptr());
-                        int error = 0;
-                        if(!qt_SetDefaultIapName(strIapName, error)) {
-                            //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error);
-                            strIapName = QString("");
-                        }
-
-                        CleanupStack::PopAndDestroy(&tempConn);
-                        break;
-                    }
-                }
-            }
-        }
-    }
-
-    //conn.Stop();
-
-    CleanupStack::PopAndDestroy(&conn);
-    CleanupStack::PopAndDestroy(&serv);
-
-    return strIapName;
-}
-
-static QString qt_CheckSettingsForConnection(QStringList& iapNames) {
-    QString strIapName;
-    for(int index = 0; index < iapNames.size(); ++index) {
-        strIapName = iapNames.at(index);
-        int error = 0;
-        if(!qt_SetDefaultIapName(strIapName, error)) {
-            //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error);
-            strIapName = QString("");
-        } else {
-            return strIapName;
-        }
-    }
-    return strIapName;
-}
-
-static void qt_SetDefaultIapL()
-{
-    // settings @ /c/data/.config/Trolltech.com
-    QSettings settings(QSettings::UserScope, qtOrganizationTag);
-    // populate iap name list
-    QStringList iapNames;
-    readIapNamesSettings(settings, iapNames);
-
-    QString iapNameValue;
-
-    iapNameValue = qt_CheckForActiveConnection();
-
-    if(!iapNameValue.isEmpty()) {
-        qt_SaveIapName(settings, iapNames, iapNameValue);
-        return;
-    }
-
-    iapNameValue = qt_CheckSettingsForConnection(iapNames);
-
-    if(!iapNameValue.isEmpty()) {
-        qt_SaveIapName(settings, iapNames, iapNameValue);
-        return;
-    }
-
-    /*
-     * no active LAN connections yet
-     * no IAP in settings
-     * offer IAP dialog to user
-     */
-    iapNameValue = qt_OfferIapDialog();
-    qt_SaveIapName(settings, iapNames, iapNameValue);
-    return;
-
-}
-
-static int qt_SetDefaultIap()
-{
-#ifndef __WINS__
-    TRAPD(err1, qt_SetDefaultIapL());
-//    TRAPD(err2, qt_InterfaceInfoL());
-//    TRAPD(err3, qt_RouteInfoL());
-    return err1;
-#else
-    return 0; // IAP dialog not required for emulator
-#endif
-}
-
-#endif // QSYM_IAP_UTIL_H
-- 
cgit v0.12


From 4e6b3f4c6f4bf8ea84b616031cbd54124c5b50d0 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 19 Jul 2010 10:39:18 +1000
Subject: Add a PathView example.

---
 doc/src/declarative/examples.qdoc                  |   1 +
 .../modelviews/pathview/pathview-example.qml       | 108 +++++++++++++++++++++
 .../modelviews/pathview/pathview.qmlproject        |  16 +++
 .../modelviews/pathview/pics/AddressBook_48.png    | Bin 0 -> 3350 bytes
 .../modelviews/pathview/pics/AudioPlayer_48.png    | Bin 0 -> 3806 bytes
 .../modelviews/pathview/pics/Camera_48.png         | Bin 0 -> 3540 bytes
 .../modelviews/pathview/pics/DateBook_48.png       | Bin 0 -> 2610 bytes
 .../modelviews/pathview/pics/EMail_48.png          | Bin 0 -> 3655 bytes
 .../modelviews/pathview/pics/TodoList_48.png       | Bin 0 -> 3429 bytes
 .../modelviews/pathview/pics/VideoPlayer_48.png    | Bin 0 -> 4151 bytes
 10 files changed, 125 insertions(+)
 create mode 100644 examples/declarative/modelviews/pathview/pathview-example.qml
 create mode 100644 examples/declarative/modelviews/pathview/pathview.qmlproject
 create mode 100644 examples/declarative/modelviews/pathview/pics/AddressBook_48.png
 create mode 100644 examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png
 create mode 100644 examples/declarative/modelviews/pathview/pics/Camera_48.png
 create mode 100644 examples/declarative/modelviews/pathview/pics/DateBook_48.png
 create mode 100644 examples/declarative/modelviews/pathview/pics/EMail_48.png
 create mode 100644 examples/declarative/modelviews/pathview/pics/TodoList_48.png
 create mode 100644 examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png

diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 8a24228..39da323 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -175,6 +175,7 @@ The examples can be found in Qt's \c examples/declarative directory.
 \list
 \o \l{declarative/modelviews/gridview}{GridView}
 \o \l{declarative/modelviews/listview}{ListView}
+\o \l{declarative/modelviews/pathview}{PathView}
 \o \l{declarative/modelviews/package}{Package}
 \o \l{declarative/modelviews/parallax}{Parallax}
 \o \l{declarative/modelviews/visualitemmodel}{VisualItemModel}
diff --git a/examples/declarative/modelviews/pathview/pathview-example.qml b/examples/declarative/modelviews/pathview/pathview-example.qml
new file mode 100644
index 0000000..59a0acb
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/pathview-example.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt 4.7
+
+Rectangle {
+    width: 400; height: 240
+    color: "white"
+
+    ListModel {
+        id: appModel
+        ListElement { name: "Music"; icon: "pics/AudioPlayer_48.png" }
+        ListElement { name: "Movies"; icon: "pics/VideoPlayer_48.png" }
+        ListElement { name: "Camera"; icon: "pics/Camera_48.png" }
+        ListElement { name: "Calendar"; icon: "pics/DateBook_48.png" }
+        ListElement { name: "Messaging"; icon: "pics/EMail_48.png" }
+        ListElement { name: "Todo List"; icon: "pics/TodoList_48.png" }
+        ListElement { name: "Contacts"; icon: "pics/AddressBook_48.png" }
+    }
+
+    Component {
+        id: appDelegate
+
+        Item {
+            width: 100; height: 100
+            scale: PathView.scale
+
+            Image {
+                id: myIcon
+                y: 20; anchors.horizontalCenter: parent.horizontalCenter
+                source: icon
+                smooth: true
+            }
+            Text {
+                anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
+                text: name
+                smooth: true
+            }
+
+            MouseArea {
+                anchors.fill: parent
+                onClicked: view.currentIndex = index
+            }
+        }
+    }
+
+    Component {
+        id: appHighlight
+        Rectangle { width: 80; height: 80; color: "lightsteelblue" }
+    }
+
+    PathView {
+        id: view
+        anchors.fill: parent
+        highlight: appHighlight
+        preferredHighlightBegin: 0.5
+        preferredHighlightEnd: 0.5
+        focus: true
+        model: appModel
+        delegate: appDelegate
+        path: Path {
+            startX: 10
+            startY: 50
+            PathAttribute { name: "scale"; value: 0.5 }
+            PathQuad { x: 200; y: 150; controlX: 50; controlY: 200 }
+            PathAttribute { name: "scale"; value: 1.0 }
+            PathQuad { x: 390; y: 50; controlX: 350; controlY: 200 }
+            PathAttribute { name: "scale"; value: 0.5 }
+        }
+    }
+}
diff --git a/examples/declarative/modelviews/pathview/pathview.qmlproject b/examples/declarative/modelviews/pathview/pathview.qmlproject
new file mode 100644
index 0000000..d4909f8
--- /dev/null
+++ b/examples/declarative/modelviews/pathview/pathview.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+    /* Include .qml, .js, and image files from current directory and subdirectories */
+    QmlFiles {
+        directory: "."
+    }
+    JavaScriptFiles {
+        directory: "."
+    }
+    ImageFiles {
+        directory: "."
+    }
+    /* List of plugin directories passed to QML runtime */
+    // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/modelviews/pathview/pics/AddressBook_48.png b/examples/declarative/modelviews/pathview/pics/AddressBook_48.png
new file mode 100644
index 0000000..1ab7c8e
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/AddressBook_48.png differ
diff --git a/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png b/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png
new file mode 100644
index 0000000..f4b8689
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/AudioPlayer_48.png differ
diff --git a/examples/declarative/modelviews/pathview/pics/Camera_48.png b/examples/declarative/modelviews/pathview/pics/Camera_48.png
new file mode 100644
index 0000000..c76b524
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/Camera_48.png differ
diff --git a/examples/declarative/modelviews/pathview/pics/DateBook_48.png b/examples/declarative/modelviews/pathview/pics/DateBook_48.png
new file mode 100644
index 0000000..58f5787
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/DateBook_48.png differ
diff --git a/examples/declarative/modelviews/pathview/pics/EMail_48.png b/examples/declarative/modelviews/pathview/pics/EMail_48.png
new file mode 100644
index 0000000..d6d84a6
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/EMail_48.png differ
diff --git a/examples/declarative/modelviews/pathview/pics/TodoList_48.png b/examples/declarative/modelviews/pathview/pics/TodoList_48.png
new file mode 100644
index 0000000..0988448
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/TodoList_48.png differ
diff --git a/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png b/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png
new file mode 100644
index 0000000..52638c5
Binary files /dev/null and b/examples/declarative/modelviews/pathview/pics/VideoPlayer_48.png differ
-- 
cgit v0.12


From 5572ec653fe735c4f413195c1ef34382aa8c6105 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 19 Jul 2010 11:29:35 +1000
Subject: Always place PathView delegates centered on the path The scale of the
 delegate was used to offset the item.  This was a bad way of making the item
 appear to be positioned correctly when the default transform origin was the
 top-left. Now that transform origin is center, it is obvious that it was a
 bad idea.

Task-number: QTBUG-12245
Reviewed-by: Michael Brasser
---
 tests/auto/declarative/qdeclarativepathview/data/pathview0.qml    | 2 ++
 .../declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
index 8956205..ff6f224 100644
--- a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
+++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml
@@ -6,6 +6,7 @@ Rectangle {
     property int currentB: -1
     property real delegateWidth: 60
     property real delegateHeight: 20
+    property real delegateScale: 1.0
     width: 240
     height: 320
     color: "#ffffff"
@@ -17,6 +18,7 @@ Rectangle {
                 objectName: "wrapper"
                 height: root.delegateHeight
                 width: root.delegateWidth
+                scale: root.delegateScale
                 color: PathView.isCurrentItem ? "lightsteelblue" : "white"
                 border.color: "black"
                 Text {
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index bf1e13a..fdbb16d 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -451,11 +451,19 @@ void tst_QDeclarativePathView::pathMoved()
     QCOMPARE(firstItem->pos() + offset, start);
 
     // Change delegate size
+    pathview->setOffset(0.1);
+    pathview->setOffset(0.0);
     canvas->rootObject()->setProperty("delegateWidth", 30);
     QCOMPARE(firstItem->width(), 30.0);
     offset.setX(firstItem->width()/2);
     QTRY_COMPARE(firstItem->pos() + offset, start);
 
+    // Change delegate scale
+    pathview->setOffset(0.1);
+    pathview->setOffset(0.0);
+    canvas->rootObject()->setProperty("delegateScale", 1.2);
+    QTRY_COMPARE(firstItem->pos() + offset, start);
+
     delete canvas;
 }
 
-- 
cgit v0.12


From 19473443dbeff4a57cd6ec6572ca29c2e70d672c Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 19 Jul 2010 11:47:16 +1000
Subject: Missed the actual change in 5572ec653fe735c4f413195c1ef34382aa8c6105
 Always place PathView delegates centered on the path The scale of the
 delegate was used to offset the item.  This was a bad way of making the item
 appear to be positioned correctly when the default transform origin was the
 top-left. Now that transform origin is center, it is obvious that it was a
 bad idea.

Task-number: QTBUG-12245
Reviewed-by: Michael Brasser
---
 src/declarative/graphicsitems/qdeclarativepathview.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index f4ebd13..acf9827 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -284,8 +284,8 @@ void QDeclarativePathViewPrivate::updateItem(QDeclarativeItem *item, qreal perce
             att->setValue(attr.toUtf8(), path->attributeAt(attr, percent));
     }
     QPointF pf = path->pointAt(percent);
-    item->setX(qRound(pf.x() - item->width()*item->scale()/2));
-    item->setY(qRound(pf.y() - item->height()*item->scale()/2));
+    item->setX(qRound(pf.x() - item->width()/2));
+    item->setY(qRound(pf.y() - item->height()/2));
 }
 
 void QDeclarativePathViewPrivate::regenerate()
-- 
cgit v0.12


From 9e4fb690b864f8d0c05d70687a3498b9eb9b2ed5 Mon Sep 17 00:00:00 2001
From: Alan Alpert <alan.alpert@nokia.com>
Date: Mon, 19 Jul 2010 13:07:07 +1000
Subject: Fix Samegame

Change to Behavior from Follow means that some of the previous
assumptions are now incorrect. Script logic has been fixed.

Task-number: QTBUG-12246
---
 demos/declarative/samegame/SamegameCore/samegame.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index 6e1b24d..aa1b359 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -110,7 +110,7 @@ function shuffleDown()
             }else{
                 if(fallDist > 0){
                     var obj = board[index(column,row)];
-                    obj.y += fallDist * gameCanvas.blockSize;
+                    obj.y = (row+fallDist) * gameCanvas.blockSize;
                     board[index(column,row+fallDist)] = obj;
                     board[index(column,row)] = null;
                 }
@@ -128,7 +128,7 @@ function shuffleDown()
                     obj = board[index(column,row)];
                     if(obj == null)
                         continue;
-                    obj.x -= fallDist * gameCanvas.blockSize;
+                    obj.x = (column-fallDist) * gameCanvas.blockSize;
                     board[index(column-fallDist,row)] = obj;
                     board[index(column,row)] = null;
                 }
-- 
cgit v0.12


From 931222b7d665e101ada070afb51b82f9bb85db6d Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 19 Jul 2010 13:26:10 +1000
Subject: PathView doc clarification.

---
 doc/src/examples/qml-examples.qdoc                           |  9 +++++++++
 doc/src/snippets/declarative/pathview/pathattributes.qml     | 12 ++++++------
 .../declarative/modelviews/pathview/pathview-example.qml     |  9 ++++-----
 src/declarative/graphicsitems/qdeclarativepath.cpp           |  7 +++++++
 src/declarative/util/qdeclarativetransition.cpp              |  2 +-
 5 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index ce53677..3fd4ea8 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -317,6 +317,15 @@
 */
 
 /*!
+    \title Models and Views: PathView
+    \example declarative/modelviews/pathview
+
+    This example shows how to use the PathView element.
+
+    \image qml-pathview-example.png
+*/
+
+/*!
     \title Models and Views: Object ListModel
     \example declarative/modelviews/objectlistmodel
 
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
index 8d424a8..4daee63 100644
--- a/doc/src/snippets/declarative/pathview/pathattributes.qml
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -49,8 +49,8 @@ Rectangle {
         id: delegate
         Item {
             width: 80; height: 80
-            scale: PathView.scale
-            opacity: PathView.opacity
+            scale: PathView.iconScale
+            opacity: PathView.iconOpacity
             Column {
                 Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
                 Text { text: name; font.pointSize: 16}
@@ -66,11 +66,11 @@ Rectangle {
         delegate: delegate
         path: Path {
             startX: 120; startY: 100
-            PathAttribute { name: "scale"; value: 1.0 }
-            PathAttribute { name: "opacity"; value: 1.0 }
+            PathAttribute { name: "iconScale"; value: 1.0 }
+            PathAttribute { name: "iconOpacity"; value: 1.0 }
             PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
-            PathAttribute { name: "scale"; value: 0.3 }
-            PathAttribute { name: "opacity"; value: 0.5 }
+            PathAttribute { name: "iconScale"; value: 0.3 }
+            PathAttribute { name: "iconOpacity"; value: 0.5 }
             PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
         }
     }
diff --git a/examples/declarative/modelviews/pathview/pathview-example.qml b/examples/declarative/modelviews/pathview/pathview-example.qml
index 59a0acb..0a3b34c 100644
--- a/examples/declarative/modelviews/pathview/pathview-example.qml
+++ b/examples/declarative/modelviews/pathview/pathview-example.qml
@@ -57,10 +57,9 @@ Rectangle {
 
     Component {
         id: appDelegate
-
         Item {
             width: 100; height: 100
-            scale: PathView.scale
+            scale: PathView.iconScale
 
             Image {
                 id: myIcon
@@ -98,11 +97,11 @@ Rectangle {
         path: Path {
             startX: 10
             startY: 50
-            PathAttribute { name: "scale"; value: 0.5 }
+            PathAttribute { name: "iconScale"; value: 0.5 }
             PathQuad { x: 200; y: 150; controlX: 50; controlY: 200 }
-            PathAttribute { name: "scale"; value: 1.0 }
+            PathAttribute { name: "iconScale"; value: 1.0 }
             PathQuad { x: 390; y: 50; controlX: 350; controlY: 200 }
-            PathAttribute { name: "scale"; value: 0.5 }
+            PathAttribute { name: "iconScale"; value: 0.5 }
         }
     }
 }
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index a904869..80196a1 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -533,6 +533,13 @@ void QDeclarativeCurve::setY(qreal y)
 /*!
     \qmlproperty string PathAttribute::name
     the name of the attribute to change.
+
+    This attribute will be available to the delegate as PathView.<name>
+
+    Note that using an existing Item property name such as "opacity" as an
+    attribute is allowed.  This is because path attributes add a new
+    \l{qdeclarativeintroduction.html#attached-properties} {Attached Property}
+    which in no way clashes with existing properties.
 */
 
 /*!
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 34e1e2b..6b7418e 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE
             Transition { ... }
         ]
     }
-    |endqml
+    \endqml
 
     \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative}
 */
-- 
cgit v0.12


From 70d4dc02d02ea9651df197e02e249de4a55d135c Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Mon, 19 Jul 2010 14:44:51 +1000
Subject: Remove files as instructed by Legal department.

---
 .../qimagereader/images/pngwithcompressedtext.png  | Bin 757 -> 0 bytes
 tests/auto/qimagereader/images/pngwithtext.png     | Bin 796 -> 0 bytes
 tests/auto/qimagereader/tst_qimagereader.cpp       |  50 ---------------------
 tests/auto/qimagewriter/tst_qimagewriter.cpp       |  38 ----------------
 .../qimagereader/images/pngwithcompressedtext.png  | Bin 757 -> 0 bytes
 .../gui/image/qimagereader/images/pngwithtext.png  | Bin 796 -> 0 bytes
 6 files changed, 88 deletions(-)
 delete mode 100644 tests/auto/qimagereader/images/pngwithcompressedtext.png
 delete mode 100644 tests/auto/qimagereader/images/pngwithtext.png
 delete mode 100644 tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png
 delete mode 100644 tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png

diff --git a/tests/auto/qimagereader/images/pngwithcompressedtext.png b/tests/auto/qimagereader/images/pngwithcompressedtext.png
deleted file mode 100644
index 01b2270..0000000
Binary files a/tests/auto/qimagereader/images/pngwithcompressedtext.png and /dev/null differ
diff --git a/tests/auto/qimagereader/images/pngwithtext.png b/tests/auto/qimagereader/images/pngwithtext.png
deleted file mode 100644
index 5d93799..0000000
Binary files a/tests/auto/qimagereader/images/pngwithtext.png and /dev/null differ
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index fc2582f..37e6237 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -120,9 +120,6 @@ private slots:
     void supportsAnimation_data();
     void supportsAnimation();
 
-    void description_data();
-    void description();
-
     void readFromResources_data();
     void readFromResources();
 
@@ -1110,53 +1107,6 @@ void tst_QImageReader::readFromFileAfterJunk()
     }
 }
 
-void tst_QImageReader::description_data()
-{
-    QTest::addColumn<QString>("fileName");
-    QTest::addColumn<QStringMap>("description");
-
-    QMap<QString, QString> willem;
-    willem["Title"] = "PngSuite";
-    willem["Author"] = "Willem A.J. van Schaik (gwillem@ntuvax.ntu.ac.sg)";
-    willem["Copyright"] = "Copyright Willem van Schaik, Singapore 1995";
-    willem["Description"] = "A compilation of a set of images created to test the "
-                            "various color-types of the PNG format. Included are "
-                            "black&white, color, paletted, with alpha channel, with "
-                            "transparency formats. All bit-depths allowed according "
-                            "to the spec are present.";
-    willem["Software"] = "Created on a NeXTstation color using \"pnmtopng\".";
-    willem["Disclaimer"] = "Freeware.";
-
-    QTest::newRow("PNG") << QString("pngwithtext.png") << willem;
-    QTest::newRow("PNG Compressed") << QString("pngwithcompressedtext.png") << willem;
-}
-
-void tst_QImageReader::description()
-{
-    QFETCH(QString, fileName);
-    QFETCH(QStringMap, description);
-
-    // Sanity check
-    QVERIFY(!QImage(prefix + fileName).isNull());
-
-    QImageReader reader(prefix + fileName);
-
-    foreach (QString key, description.keys())
-        QCOMPARE(reader.text(key), description.value(key));
-    QCOMPARE(reader.textKeys(), QStringList(description.keys()));
-
-    QImage image = reader.read();
-    QVERIFY(!image.isNull());
-
-    foreach (QString key, description.keys())
-        QCOMPARE(image.text(key), description.value(key));
-    QCOMPARE(image.textKeys(), QStringList(description.keys()));
-
-    foreach (QString key, description.keys())
-        QCOMPARE(reader.text(key), description.value(key));
-    QCOMPARE(reader.textKeys(), QStringList(description.keys()));
-}
-
 void tst_QImageReader::readFromResources_data()
 {
     QTest::addColumn<QString>("fileName");
diff --git a/tests/auto/qimagewriter/tst_qimagewriter.cpp b/tests/auto/qimagewriter/tst_qimagewriter.cpp
index c4860c3..c6ec715 100644
--- a/tests/auto/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/qimagewriter/tst_qimagewriter.cpp
@@ -93,9 +93,6 @@ private slots:
     void largeTiff();
 #endif
 
-    void setDescription_data();
-    void setDescription();
-
     void writeToInvalidDevice();
 
     void supportsOption_data();
@@ -420,41 +417,6 @@ void tst_QImageWriter::readWriteNonDestructive()
     QCOMPARE(image, image2);
 }
 
-void tst_QImageWriter::setDescription_data()
-{
-    QTest::addColumn<QString>("fileName");
-    QTest::addColumn<QStringMap>("description");
-
-    QMap<QString, QString> willem;
-    willem["Title"] = "PngSuite";
-    willem["Author"] = "Willem A.J. van Schaik (willem@schaik.com)";
-    willem["Copyright"] = "Copyright Willem van Schaik, Singapore 1995-96";
-    willem["Description"] = "A compilation of a set of images created to test the "
-                            "various color-types of the PNG format. Included are "
-                            "black&white, color, paletted, with alpha channel, with "
-                            "transparency formats. All bit-depths allowed according "
-                            "to the spec are present.";
-    willem["Software"] = "Created on a NeXTstation color using \"pnmtopng\".";
-    willem["Disclaimer"] = "Freeware.";
-
-    QTest::newRow("PNG") << prefix + QString("gen-pngwithtext.png") << willem;
-}
-
-void tst_QImageWriter::setDescription()
-{
-    QFETCH(QString, fileName);
-    QFETCH(QStringMap, description);
-
-    QImageWriter writer(fileName, "png");
-    foreach (QString key, description.keys())
-        writer.setText(key, description.value(key));
-    QVERIFY(writer.write(QImage(prefix + "kollada.png")));
-
-    QImageReader reader(fileName);
-    foreach (QString key, description.keys())
-        QCOMPARE(reader.text(key), description.value(key));
-}
-
 void tst_QImageWriter::writeToInvalidDevice()
 {
     QLatin1String fileName("/these/directories/do/not/exist/001.png");
diff --git a/tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png b/tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png
deleted file mode 100644
index 01b2270..0000000
Binary files a/tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png and /dev/null differ
diff --git a/tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png b/tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png
deleted file mode 100644
index 5d93799..0000000
Binary files a/tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png and /dev/null differ
-- 
cgit v0.12


From 8668f245b69da455ac7fe1d0a599226c1d6b9580 Mon Sep 17 00:00:00 2001
From: Alan Alpert <alan.alpert@nokia.com>
Date: Mon, 19 Jul 2010 15:16:40 +1000
Subject: Add label to explain how to exit QML demos

Some people didn't figure it out intuitively, so extra help is now
provided.

Task-number: QTBUG-11868
---
 demos/qtdemo/qmlShell.qml | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml
index e15d33c..e9d8d56 100644
--- a/demos/qtdemo/qmlShell.qml
+++ b/demos/qtdemo/qmlShell.qml
@@ -52,6 +52,7 @@ Item {
     //below properties are sometimes set from C++
     property url qmlFile: ''
     property bool show: false
+    /*
     Image{
         id: bg
         opacity: 0
@@ -60,6 +61,7 @@ Item {
         pixmap: bgAppPixmap
         effect: Blur { id: blurEffect; enabled: useBlur; blurRadius: 8;}
     }
+    */
 
     Item{ id:embeddedViewer
         width: parent.width
@@ -136,6 +138,32 @@ Item {
             onLinkActivated: Qt.openUrlExternally(link);
         }
     }
+    Rectangle{
+        id: helpLabel
+        property bool timedOut: false
+        z: 9
+        //Positioned in the top left corner
+        x: 8 
+        y: 8
+        color: "white"
+        border.color: "black"
+        border.width: 1
+        width: helpText.width + 16
+        height: helpText.height + 8
+        Text{
+            id: helpText
+            color: "black"
+            anchors.centerIn: parent
+            text: "Click outside the example to exit it."
+        }
+        opacity: 0
+        Behavior on opacity{ NumberAnimation{duration:500} }
+        Timer{
+            id: helpTimer
+            interval: 5000
+            onTriggered: {helpLabel.timedOut=true}
+        }
+    }
     Rectangle{ id: blackout //Maybe use a colorize effect instead?
         z: 8
         anchors.fill: parent
@@ -160,8 +188,8 @@ Item {
                 opacity: 1
             }
             PropertyChanges {
-                target: bg
-                opacity: 1
+                target: helpLabel
+                opacity: helpLabel.timedOut?0:1
             }
             PropertyChanges {
                 target: blackout
@@ -171,9 +199,9 @@ Item {
     ]
     transitions: [//Should not be too long, because the component has already started running
         Transition { from: ''; to: "show"; reversible: true
-            SequentialAnimation{
-                PropertyAction { target: bg; property: useBlur?"y":"opacity";}//fade in blurred background only if blurred
-                NumberAnimation{ properties: "opacity"; easing.type: Easing.InQuad; duration: 500}
+            ParallelAnimation{
+                ScriptAction{ script: {helpLabel.timedOut = false; helpTimer.restart();} }
+                NumberAnimation{ exclude: helpLabel; properties: "opacity"; easing.type: Easing.InQuad; duration: 500}
                 PropertyAction { target: loader; property: "focus"; value: true}//Might be needed to ensure the focus stays with us
             }
         }
-- 
cgit v0.12


From 75131b7a1bfeeb033ea5b8bf62d50cc3d82d757e Mon Sep 17 00:00:00 2001
From: Alan Alpert <alan.alpert@nokia.com>
Date: Mon, 19 Jul 2010 15:26:37 +1000
Subject: Remove the -use-blur option from qtdemo

It relied on the now missing pixmap property. Since it isn't used, it
doesn't seem worth the effort to update it to use a declarative image
provider instead.
---
 demos/qtdemo/colors.cpp      |  6 +-----
 demos/qtdemo/colors.h        |  1 -
 demos/qtdemo/mainwindow.cpp  |  8 --------
 demos/qtdemo/menumanager.cpp | 20 --------------------
 demos/qtdemo/qmlShell.qml    | 22 ----------------------
 5 files changed, 1 insertion(+), 56 deletions(-)

diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index b352e3d..802d77d 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -81,7 +81,6 @@ bool Colors::noRescale = false;
 bool Colors::noAnimations = false;
 bool Colors::noBlending = false;
 bool Colors::noScreenSync = false;
-bool Colors::noBlur = true;
 bool Colors::fullscreen = false;
 bool Colors::usePixmaps = false;
 bool Colors::useLoop = false;
@@ -233,8 +232,6 @@ void Colors::parseArgs(int argc, char *argv[])
             Colors::showFps = true;
         else if (s == "-no-blending")
             Colors::noBlending = true;
-        else if (s == "-use-blur")
-            Colors::noBlur = false;
         else if (s == "-no-sync")
             Colors::noScreenSync = true;
         else if (s.startsWith("-menu"))
@@ -270,7 +267,7 @@ void Colors::parseArgs(int argc, char *argv[])
         else if (s.startsWith("-h") || s.startsWith("-help")){
             QMessageBox::warning(0, "Arguments",
                                  QString("Usage: qtdemo [-verbose] [-no-adapt] [-opengl] [-software] [-fullscreen] [-ticker[0|1]] ")
-                                 + "[-animations[0|1]] [-no-blending] [-use-blur] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]]  "
+                                 + "[-animations[0|1]] [-no-blending] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]]  "
                                  + "[-use-window-mask] [-no-rescale] "
                                  + "[-use-pixmaps] [-show-fps] [-show-br] [-8bit[0|1]] [-menu<int>] [-use-loop] [-use-balls] "
                                  + "[-animation-speed<float>] [-fps<int>] "
@@ -298,7 +295,6 @@ void Colors::setLowSettings()
     Colors::usePixmaps = true;
     Colors::noAnimations = true;
     Colors::noBlending = true;
-    Colors::noBlur = true;
 }
 
 void Colors::detectSystemResources()
diff --git a/demos/qtdemo/colors.h b/demos/qtdemo/colors.h
index 2d58058..1e0b795 100644
--- a/demos/qtdemo/colors.h
+++ b/demos/qtdemo/colors.h
@@ -91,7 +91,6 @@ public:
     static bool noAnimations;
     static bool noBlending;
     static bool noScreenSync;
-    static bool noBlur;
     static bool useLoop;
     static bool noWindowMask;
     static bool usePixmaps;
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp
index 753014a..16c5bf3 100644
--- a/demos/qtdemo/mainwindow.cpp
+++ b/demos/qtdemo/mainwindow.cpp
@@ -310,14 +310,6 @@ void MainWindow::checkAdapt()
                qDebug() << "- benchmark adaption: removed ticker (fps < 30)";
         }
 
-        //Note: Because we don't adapt later in the program, if blur makes FPS plummet then we won't catch it
-        if (!Colors::noBlur && MenuManager::instance()->declarativeEngine && this->mainSceneRoot){
-            Colors::noBlur = true;
-            MenuManager::instance()->declarativeEngine->rootContext()->setContextProperty("useBlur", false);
-            if (Colors::verbose)
-               qDebug() << "- benchmark adaption: removed blur (fps < 30)";
-        }
-
         if (this->fpsMedian < 20){
             Colors::noAnimations = true;
             if (Colors::verbose)
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index 15561ab..7168b57 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -378,17 +378,6 @@ void MenuManager::launchQmlExample(const QString &name)
             return;
         }
     }
-    if(!Colors::noBlur){
-        QImage qmlBgImage(this->window->rect().size(), QImage::Format_ARGB32_Premultiplied);
-        QPainter painter(&qmlBgImage);
-        if(Colors::showFps)
-            this->window->fpsLabel->setOpacity(0);
-        this->window->render(&painter);
-        if(Colors::showFps)
-            this->window->fpsLabel->setOpacity(1.0);
-        Qt::ImageConversionFlags convFlags = Qt::AvoidDither | Qt::NoOpaqueDetection;
-        this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(qmlBgImage, convFlags)));
-    }
 
     qmlRoot->setProperty("qmlFile", QVariant(""));//unload component
     qmlRoot->setProperty("show", QVariant(true));
@@ -439,17 +428,8 @@ void MenuManager::init(MainWindow *window)
     }
 
     // Create QML Loader
-    qmlRegisterType<QGraphicsBlurEffect>("Effects", 1, 0, "Blur");
-    qmlRegisterType<QGraphicsDropShadowEffect>("Effects", 1, 0, "DropShadow");
     declarativeEngine = new QDeclarativeEngine(this);
 
-    // Note that we paint the background into a static image for a theorized performance improvement when blurring
-    // It has not yet been determined what, if any, speed up this gives (but is left in 'cause the QML expects it now)
-    declarativeEngine->rootContext()->setContextProperty("useBlur", !Colors::noBlur);
-    QImage qmlBgImage(this->window->rect().size(), QImage::Format_ARGB32_Premultiplied);
-    qmlBgImage.fill(0);
-    this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(qmlBgImage)));
-
     QDeclarativeComponent component(declarativeEngine, QUrl("qrc:qml/qmlShell.qml"), this);
     qmlRoot = 0;
     if(component.isReady())
diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml
index e9d8d56..b5fdf39 100644
--- a/demos/qtdemo/qmlShell.qml
+++ b/demos/qtdemo/qmlShell.qml
@@ -40,28 +40,13 @@
 ****************************************************************************/
 
 import Qt 4.7
-import Effects 1.0
 
-/* Vars exposed from C++
-   pixmap bgAppPixmap
-   bool useBlur (to turn on, pass -use-blur on the cmd line. Off by default 'cause it's too slow)
-*/
 Item {
     id: main
     //height and width set by program to fill window
     //below properties are sometimes set from C++
     property url qmlFile: ''
     property bool show: false
-    /*
-    Image{
-        id: bg
-        opacity: 0
-        anchors.fill: parent
-        z: -1
-        pixmap: bgAppPixmap
-        effect: Blur { id: blurEffect; enabled: useBlur; blurRadius: 8;}
-    }
-    */
 
     Item{ id:embeddedViewer
         width: parent.width
@@ -114,13 +99,6 @@ Item {
                 anchors.fill:parent
             }
 
-            effect: DropShadow  {
-                enabled: useBlur;
-                blurRadius: 9;
-                color: "#88000000";
-                xOffset:0
-                yOffset:0
-            }
         }
 
         Text{
-- 
cgit v0.12


From 099f684de47b936268e7c052c9ac3f97ca7ad209 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 19 Jul 2010 15:28:10 +1000
Subject: Doc error fixes.

---
 src/declarative/graphicsitems/qdeclarativeimage.cpp     | 2 +-
 src/declarative/graphicsitems/qdeclarativeitem.cpp      | 2 +-
 src/declarative/graphicsitems/qdeclarativetranslate.cpp | 2 +-
 src/declarative/util/qdeclarativexmllistmodel.cpp       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 90738c8..37736cc 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
     \endqml
     \endtable
 
-    If the \l {Image::width}{width} and \l{Image::height}{height} properties are not specified,
+    If the \l {Item::width}{width} and \l{Item::height}{height} properties are not specified,
     the Image element is automatically sized to the loaded image. Image elements can be 
     stretched and tiled using the \l fillMode property.
 
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index b9498f1..367a5d0 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -2692,7 +2692,7 @@ bool QDeclarativeItem::sceneEvent(QEvent *event)
 }
 
 /*!
-    \reimp
+    \internal
 
     Note that unlike QGraphicsItems, QDeclarativeItem::itemChange() is \e not called
     during initial widget polishing. Items wishing to optimize start-up construction
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
index 17daac7..16a1127 100644
--- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
@@ -117,7 +117,7 @@ void QDeclarativeTranslate::setY(qreal y)
 }
 
 /*!
-    \reimp
+    \internal
 */
 void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const
 {
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 9f4df22..7c1e1fd 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -567,7 +567,7 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
     \image qml-xmllistmodel-example.png
 
     The XmlListModel data is loaded asynchronously, and \l status
-    is set to \l XmlListModel::Ready when loading is complete.
+    is set to \c XmlListModel.Ready when loading is complete.
     Note this means when XmlListModel is used for a view, the view is not
     populated until the model is loaded.
 
-- 
cgit v0.12


From b6251d31652232a6ac3a5dff54ad4229542089b1 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 19 Jul 2010 15:30:06 +1000
Subject: Fix ListView sections with QList<QObject*>
 QDeclarativeVisualDataModel::stringValue() did not handle QList<QObject*>
 model types.

Task-number: QTBUG-12005
---
 src/declarative/graphicsitems/qdeclarativelistview.cpp               | 2 +-
 src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp        | 5 +++++
 .../auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml | 3 +++
 .../qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp  | 3 +++
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index fa422fd..38bc6f5 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -577,7 +577,7 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
                     listItem->attached->m_prevSection = sectionAt(modelIndex-1);
                 if (FxListItem *item = visibleItem(modelIndex+1))
                     listItem->attached->m_nextSection = item->attached->section();
-                else
+                else if (modelIndex < model->count()-1)
                     listItem->attached->m_nextSection = sectionAt(modelIndex+1);
             }
         }
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 786d6f9..cfa1c6d 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -1089,6 +1089,11 @@ QString QDeclarativeVisualDataModel::stringValue(int index, const QString &name)
     if (d->m_visualItemModel)
         return d->m_visualItemModel->stringValue(index, name);
 
+    if ((!d->m_listModelInterface || !d->m_abstractItemModel) && d->m_listAccessor) {
+        if (QObject *object = d->m_listAccessor->at(index).value<QObject*>())
+            return object->property(name.toUtf8()).toString();
+    }
+
     if ((!d->m_listModelInterface && !d->m_abstractItemModel) || !d->m_delegate)
         return QString();
 
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
index f5198c9..d030222 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
@@ -11,6 +11,9 @@ ListView {
             width: 100
             color: model.modelData.color
             Text { objectName: "name"; text: name }
+            Text { objectName: "section"; text: parent.ListView.section }
         }
     }
+    section.property: "name"
+    section.criteria: ViewSection.FullString
 }
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index 43d4d06..e0f32ea 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -179,6 +179,9 @@ void tst_qdeclarativevisualdatamodel::objectListModel()
     QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 0);
     QCOMPARE(name->text(), QString("Item 1"));
 
+    QDeclarativeText *section = findItem<QDeclarativeText>(contentItem, "section", 0);
+    QCOMPARE(section->text(), QString("Item 1"));
+
     dataList[0]->setProperty("name", QLatin1String("Changed"));
     QCOMPARE(name->text(), QString("Changed"));
 }
-- 
cgit v0.12


From 568e4ab97645692250d2aa25670aebfc0915afc0 Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Mon, 19 Jul 2010 19:28:36 +1000
Subject: Remove references to files removed by previous commit.

---
 tests/auto/qimagereader/qimagereader.qrc     | 2 --
 tests/auto/qimagereader/tst_qimagereader.cpp | 6 ------
 2 files changed, 8 deletions(-)

diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc
index bc48244..7f6d81f 100644
--- a/tests/auto/qimagereader/qimagereader.qrc
+++ b/tests/auto/qimagereader/qimagereader.qrc
@@ -38,8 +38,6 @@
         <file>images/noclearcode.bmp</file>
         <file>images/noclearcode.gif</file>
         <file>images/nontransparent.xpm</file>
-        <file>images/pngwithcompressedtext.png</file>
-        <file>images/pngwithtext.png</file>
         <file>images/runners.ppm</file>
         <file>images/teapot.ppm</file>
         <file>images/test.ppm</file>
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 37e6237..caad070 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -1198,12 +1198,6 @@ void tst_QImageReader::readFromResources_data()
     QTest::newRow("image.png") << QString("image.png")
                                       << QByteArray("png") << QSize(22, 22)
                                       << QString("");
-    QTest::newRow("pngwithcompressedtext.png") << QString("pngwithcompressedtext.png")
-                                                      << QByteArray("png") << QSize(32, 32)
-                                                      << QString("");
-    QTest::newRow("pngwithtext.png") << QString("pngwithtext.png")
-                                            << QByteArray("png") << QSize(32, 32)
-                                            << QString("");
     QTest::newRow("kollada.png") << QString("kollada.png")
                                         << QByteArray("png") << QSize(436, 160)
                                         << QString("");
-- 
cgit v0.12


From a545e26e1183133f4a66cb9a3bcd9051e2d77894 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Mon, 19 Jul 2010 12:16:43 +0200
Subject: Make configure.exe accept -no-gif again, fix comment

Reviewed-By: Jason McDonald
---
 configure                        | 2 +-
 tools/configure/configureapp.cpp | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index fb544bd..11496c4 100755
--- a/configure
+++ b/configure
@@ -3636,7 +3636,7 @@ Third Party Libraries:
 
     -no-gif ............ Do not compile GIF reading support.
  *  -qt-gif ............ Compile GIF reading support.
-                         See also src/gui/image/qgifhandler.h
+                         See also src/gui/image/qgifhandler_p.h
 
     -no-libtiff ........ Do not compile TIFF support.
     -qt-libtiff ........ Use the libtiff bundled with Qt.
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 7f2d53b..c3498e3 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -581,6 +581,8 @@ void Configure::parseCmdLine()
         // Image formats --------------------------------------------
         else if (configCmdLine.at(i) == "-no-gif")
             dictionary[ "GIF" ] = "no";
+	else if (configCmdLine.at(i) == "-qt-gif")
+            dictionary[ "GIF" ] = "yes";
 
         else if (configCmdLine.at(i) == "-no-libtiff") {
             dictionary[ "TIFF"] = "no";
@@ -1741,7 +1743,7 @@ bool Configure::displayHelp()
         desc("ZLIB", "system",  "-system-zlib",         "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n");
 
         desc("GIF", "no",       "-no-gif",              "Do not compile GIF reading support.");
-        desc("GIF", "auto",     "-qt-gif",              "Compile GIF reading support.\nSee also src/gui/image/qgifhandler.h\n");
+        desc("GIF", "auto",     "-qt-gif",              "Compile GIF reading support.\nSee also src/gui/image/qgifhandler_p.h\n");
 
         desc("LIBPNG", "no",    "-no-libpng",           "Do not compile PNG support.");
         desc("LIBPNG", "qt",    "-qt-libpng",           "Use the libpng bundled with Qt.");
-- 
cgit v0.12


From 368dd3c234b9011ab8a8506b50fce6f55694199c Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Mon, 19 Jul 2010 12:16:52 +0200
Subject: Rebuilt configure.exe

---
 configure.exe | Bin 1318400 -> 1686528 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/configure.exe b/configure.exe
index 0863ecc..104923b 100755
Binary files a/configure.exe and b/configure.exe differ
-- 
cgit v0.12


From 8acf3098bf5d88871d866aa87fa38e6feb3a32d0 Mon Sep 17 00:00:00 2001
From: Harald Fernengel <harald.fernengel@nokia.com>
Date: Mon, 19 Jul 2010 13:49:33 +0200
Subject: Do image comparison with fuzz

Looks like native png and jpeg libs on some devices have rounding
problems, so compare the color values with a fuzz of 3. This fixes
this test on Maemo 5 and 6.

Reviewed-by: Benjamin Poulain
---
 tests/auto/qimagereader/tst_qimagereader.cpp | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index fe2a719..e9ef070 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -315,7 +315,24 @@ void tst_QImageReader::jpegRgbCmyk()
     QImage image1(prefix + QLatin1String("YCbCr_cmyk.jpg"));
     QImage image2(prefix + QLatin1String("YCbCr_cmyk.png"));
 
-    QCOMPARE(image1, image2);
+    // first, do some obvious tests
+    QCOMPARE(image1.height(), image2.height());
+    QCOMPARE(image1.width(), image2.width());
+    QCOMPARE(image1.format(), image2.format());
+    QCOMPARE(image1.format(), QImage::Format_RGB32);
+
+    // compare all the pixels with a slack of 3. This ignores rounding errors in libjpeg/libpng
+    for (int h = 0; h < image1.height(); ++h) {
+        const uchar *s1 = image1.constScanLine(h);
+        const uchar *s2 = image2.constScanLine(h);
+        for (int w = 0; w < image1.width() * 4; ++w) {
+            if (*s1 != *s2) {
+                QVERIFY2(qAbs(*s1 - *s2) <= 3, qPrintable(QString("images differ in line %1, col %2 (image1: %3, image2: %4)").arg(h).arg(w).arg(*s1, 0, 16).arg(*s2, 0, 16)));
+            }
+            s1++;
+            s2++;
+        }
+    }
 }
 
 void tst_QImageReader::setScaledSize_data()
-- 
cgit v0.12


From 30341a6f9e57caac3ec19e02ffd67164d43c0453 Mon Sep 17 00:00:00 2001
From: aavit <qt-info@nokia.com>
Date: Mon, 19 Jul 2010 14:00:59 +0200
Subject: Remove some more unneeded files from libjpeg, avoiding GPL

Task-number: QT-3584
Reviewed-by: Trustme
---
 src/3rdparty/libjpeg/ansi2knr.1 |  36 --
 src/3rdparty/libjpeg/ansi2knr.c | 739 ----------------------------------------
 2 files changed, 775 deletions(-)
 delete mode 100644 src/3rdparty/libjpeg/ansi2knr.1
 delete mode 100644 src/3rdparty/libjpeg/ansi2knr.c

diff --git a/src/3rdparty/libjpeg/ansi2knr.1 b/src/3rdparty/libjpeg/ansi2knr.1
deleted file mode 100644
index f9ee5a6..0000000
--- a/src/3rdparty/libjpeg/ansi2knr.1
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH ANSI2KNR 1 "19 Jan 1996"
-.SH NAME
-ansi2knr \- convert ANSI C to Kernighan & Ritchie C
-.SH SYNOPSIS
-.I ansi2knr
-[--varargs] input_file [output_file]
-.SH DESCRIPTION
-If no output_file is supplied, output goes to stdout.
-.br
-There are no error messages.
-.sp
-.I ansi2knr
-recognizes function definitions by seeing a non-keyword identifier at the left
-margin, followed by a left parenthesis, with a right parenthesis as the last
-character on the line, and with a left brace as the first token on the
-following line (ignoring possible intervening comments).  It will recognize a
-multi-line header provided that no intervening line ends with a left or right
-brace or a semicolon.  These algorithms ignore whitespace and comments, except
-that the function name must be the first thing on the line.
-.sp
-The following constructs will confuse it:
-.br
-     - Any other construct that starts at the left margin and follows the
-above syntax (such as a macro or function call).
-.br
-     - Some macros that tinker with the syntax of the function header.
-.sp
-The --varargs switch is obsolete, and is recognized only for
-backwards compatibility.  The present version of
-.I ansi2knr
-will always attempt to convert a ... argument to va_alist and va_dcl.
-.SH AUTHOR
-L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
-continues to maintain the current version; most of the code in the current
-version is his work.  ansi2knr also includes contributions by Francois
-Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.
diff --git a/src/3rdparty/libjpeg/ansi2knr.c b/src/3rdparty/libjpeg/ansi2knr.c
deleted file mode 100644
index e84c210..0000000
--- a/src/3rdparty/libjpeg/ansi2knr.c
+++ /dev/null
@@ -1,739 +0,0 @@
-/* Copyright (C) 1989, 2000 Aladdin Enterprises.  All rights reserved. */
-
-/*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/
-/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
-
-/*
-ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY.  No author or distributor accepts responsibility to anyone for the
-consequences of using it or for whether it serves any particular purpose or
-works at all, unless he says so in writing.  Refer to the GNU General Public
-License (the "GPL") for full details.
-
-Everyone is granted permission to copy, modify and redistribute ansi2knr,
-but only under the conditions described in the GPL.  A copy of this license
-is supposed to have been given to you along with ansi2knr so you can know
-your rights and responsibilities.  It should be in a file named COPYLEFT,
-or, if there is no file named COPYLEFT, a file named COPYING.  Among other
-things, the copyright notice and this notice must be preserved on all
-copies.
-
-We explicitly state here what we believe is already implied by the GPL: if
-the ansi2knr program is distributed as a separate set of sources and a
-separate executable file which are aggregated on a storage medium together
-with another program, this in itself does not bring the other program under
-the GPL, nor does the mere fact that such a program or the procedures for
-constructing it invoke the ansi2knr executable bring any other part of the
-program under the GPL.
-*/
-
-/*
- * Usage:
-	ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
- * --filename provides the file name for the #line directive in the output,
- * overriding input_file (if present).
- * If no input_file is supplied, input is read from stdin.
- * If no output_file is supplied, output goes to stdout.
- * There are no error messages.
- *
- * ansi2knr recognizes function definitions by seeing a non-keyword
- * identifier at the left margin, followed by a left parenthesis, with a
- * right parenthesis as the last character on the line, and with a left
- * brace as the first token on the following line (ignoring possible
- * intervening comments and/or preprocessor directives), except that a line
- * consisting of only
- *	identifier1(identifier2)
- * will not be considered a function definition unless identifier2 is
- * the word "void", and a line consisting of
- *	identifier1(identifier2, <<arbitrary>>)
- * will not be considered a function definition.
- * ansi2knr will recognize a multi-line header provided that no intervening
- * line ends with a left or right brace or a semicolon.  These algorithms
- * ignore whitespace, comments, and preprocessor directives, except that
- * the function name must be the first thing on the line.  The following
- * constructs will confuse it:
- *	- Any other construct that starts at the left margin and
- *	    follows the above syntax (such as a macro or function call).
- *	- Some macros that tinker with the syntax of function headers.
- */
-
-/*
- * The original and principal author of ansi2knr is L. Peter Deutsch
- * <ghost@aladdin.com>.  Other authors are noted in the change history
- * that follows (in reverse chronological order):
-
-	lpd 2000-04-12 backs out Eggert's changes because of bugs:
-	- concatlits didn't declare the type of its bufend argument;
-	- concatlits didn't recognize when it was inside a comment;
-	- scanstring could scan backward past the beginning of the string; when
-	- the check for \ + newline in scanstring was unnecessary.
-
-	2000-03-05  Paul Eggert  <eggert@twinsun.com>
-
-	Add support for concatenated string literals.
-	* ansi2knr.c (concatlits): New decl.
-	(main): Invoke concatlits to concatenate string literals.
-	(scanstring): Handle backslash-newline correctly.  Work with
-	character constants.  Fix bug when scanning backwards through
-	backslash-quote.  Check for unterminated strings.
-	(convert1): Parse character constants, too.
-	(appendline, concatlits): New functions.
-	* ansi2knr.1: Document this.
-
-	lpd 1999-08-17 added code to allow preprocessor directives
-		wherever comments are allowed
-	lpd 1999-04-12 added minor fixes from Pavel Roskin
-		<pavel_roskin@geocities.com> for clean compilation with
-		gcc -W -Wall
-	lpd 1999-03-22 added hack to recognize lines consisting of
-		identifier1(identifier2, xxx) as *not* being procedures
-	lpd 1999-02-03 made indentation of preprocessor commands consistent
-	lpd 1999-01-28 fixed two bugs: a '/' in an argument list caused an
-		endless loop; quoted strings within an argument list
-		confused the parser
-	lpd 1999-01-24 added a check for write errors on the output,
-		suggested by Jim Meyering <meyering@ascend.com>
-	lpd 1998-11-09 added further hack to recognize identifier(void)
-		as being a procedure
-	lpd 1998-10-23 added hack to recognize lines consisting of
-		identifier1(identifier2) as *not* being procedures
-	lpd 1997-12-08 made input_file optional; only closes input and/or
-		output file if not stdin or stdout respectively; prints
-		usage message on stderr rather than stdout; adds
-		--filename switch (changes suggested by
-		<ceder@lysator.liu.se>)
-	lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with
-		compilers that don't understand void, as suggested by
-		Tom Lane
-	lpd 1996-01-15 changed to require that the first non-comment token
-		on the line following a function header be a left brace,
-		to reduce sensitivity to macros, as suggested by Tom Lane
-		<tgl@sss.pgh.pa.us>
-	lpd 1995-06-22 removed #ifndefs whose sole purpose was to define
-		undefined preprocessor symbols as 0; changed all #ifdefs
-		for configuration symbols to #ifs
-	lpd 1995-04-05 changed copyright notice to make it clear that
-		including ansi2knr in a program does not bring the entire
-		program under the GPL
-	lpd 1994-12-18 added conditionals for systems where ctype macros
-		don't handle 8-bit characters properly, suggested by
-		Francois Pinard <pinard@iro.umontreal.ca>;
-		removed --varargs switch (this is now the default)
-	lpd 1994-10-10 removed CONFIG_BROKETS conditional
-	lpd 1994-07-16 added some conditionals to help GNU `configure',
-		suggested by Francois Pinard <pinard@iro.umontreal.ca>;
-		properly erase prototype args in function parameters,
-		contributed by Jim Avera <jima@netcom.com>;
-		correct error in writeblanks (it shouldn't erase EOLs)
-	lpd 1989-xx-xx original version
- */
-
-/* Most of the conditionals here are to make ansi2knr work with */
-/* or without the GNU configure machinery. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-
-#if HAVE_CONFIG_H
-
-/*
-   For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
-   This will define HAVE_CONFIG_H and so, activate the following lines.
- */
-
-# if STDC_HEADERS || HAVE_STRING_H
-#  include <string.h>
-# else
-#  include <strings.h>
-# endif
-
-#else /* not HAVE_CONFIG_H */
-
-/* Otherwise do it the hard way */
-
-# ifdef BSD
-#  include <strings.h>
-# else
-#  ifdef VMS
-    extern int strlen(), strncmp();
-#  else
-#   include <string.h>
-#  endif
-# endif
-
-#endif /* not HAVE_CONFIG_H */
-
-#if STDC_HEADERS
-# include <stdlib.h>
-#else
-/*
-   malloc and free should be declared in stdlib.h,
-   but if you've got a K&R compiler, they probably aren't.
- */
-# ifdef MSDOS
-#  include <malloc.h>
-# else
-#  ifdef VMS
-     extern char *malloc();
-     extern void free();
-#  else
-     extern char *malloc();
-     extern int free();
-#  endif
-# endif
-
-#endif
-
-/* Define NULL (for *very* old compilers). */
-#ifndef NULL
-# define NULL (0)
-#endif
-
-/*
- * The ctype macros don't always handle 8-bit characters correctly.
- * Compensate for this here.
- */
-#ifdef isascii
-# undef HAVE_ISASCII		/* just in case */
-# define HAVE_ISASCII 1
-#else
-#endif
-#if STDC_HEADERS || !HAVE_ISASCII
-# define is_ascii(c) 1
-#else
-# define is_ascii(c) isascii(c)
-#endif
-
-#define is_space(c) (is_ascii(c) && isspace(c))
-#define is_alpha(c) (is_ascii(c) && isalpha(c))
-#define is_alnum(c) (is_ascii(c) && isalnum(c))
-
-/* Scanning macros */
-#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
-#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
-
-/* Forward references */
-char *ppdirforward();
-char *ppdirbackward();
-char *skipspace();
-char *scanstring();
-int writeblanks();
-int test1();
-int convert1();
-
-/* The main program */
-int
-main(argc, argv)
-    int argc;
-    char *argv[];
-{	FILE *in = stdin;
-	FILE *out = stdout;
-	char *filename = 0;
-	char *program_name = argv[0];
-	char *output_name = 0;
-#define bufsize 5000			/* arbitrary size */
-	char *buf;
-	char *line;
-	char *more;
-	char *usage =
-	  "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
-	/*
-	 * In previous versions, ansi2knr recognized a --varargs switch.
-	 * If this switch was supplied, ansi2knr would attempt to convert
-	 * a ... argument to va_alist and va_dcl; if this switch was not
-	 * supplied, ansi2knr would simply drop any such arguments.
-	 * Now, ansi2knr always does this conversion, and we only
-	 * check for this switch for backward compatibility.
-	 */
-	int convert_varargs = 1;
-	int output_error;
-
-	while ( argc > 1 && argv[1][0] == '-' ) {
-	  if ( !strcmp(argv[1], "--varargs") ) {
-	    convert_varargs = 1;
-	    argc--;
-	    argv++;
-	    continue;
-	  }
-	  if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
-	    filename = argv[2];
-	    argc -= 2;
-	    argv += 2;
-	    continue;
-	  }
-	  fprintf(stderr, "%s: Unrecognized switch: %s\n", program_name,
-		  argv[1]);
-	  fprintf(stderr, usage);
-	  exit(1);
-	}
-	switch ( argc )
-	   {
-	default:
-		fprintf(stderr, usage);
-		exit(0);
-	case 3:
-		output_name = argv[2];
-		out = fopen(output_name, "w");
-		if ( out == NULL ) {
-		  fprintf(stderr, "%s: Cannot open output file %s\n",
-			  program_name, output_name);
-		  exit(1);
-		}
-		/* falls through */
-	case 2:
-		in = fopen(argv[1], "r");
-		if ( in == NULL ) {
-		  fprintf(stderr, "%s: Cannot open input file %s\n",
-			  program_name, argv[1]);
-		  exit(1);
-		}
-		if ( filename == 0 )
-		  filename = argv[1];
-		/* falls through */
-	case 1:
-		break;
-	   }
-	if ( filename )
-	  fprintf(out, "#line 1 \"%s\"\n", filename);
-	buf = malloc(bufsize);
-	if ( buf == NULL )
-	   {
-		fprintf(stderr, "Unable to allocate read buffer!\n");
-		exit(1);
-	   }
-	line = buf;
-	while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
-	   {
-test:		line += strlen(line);
-		switch ( test1(buf) )
-		   {
-		case 2:			/* a function header */
-			convert1(buf, out, 1, convert_varargs);
-			break;
-		case 1:			/* a function */
-			/* Check for a { at the start of the next line. */
-			more = ++line;
-f:			if ( line >= buf + (bufsize - 1) ) /* overflow check */
-			  goto wl;
-			if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
-			  goto wl;
-			switch ( *skipspace(ppdirforward(more), 1) )
-			  {
-			  case '{':
-			    /* Definitely a function header. */
-			    convert1(buf, out, 0, convert_varargs);
-			    fputs(more, out);
-			    break;
-			  case 0:
-			    /* The next line was blank or a comment: */
-			    /* keep scanning for a non-comment. */
-			    line += strlen(line);
-			    goto f;
-			  default:
-			    /* buf isn't a function header, but */
-			    /* more might be. */
-			    fputs(buf, out);
-			    strcpy(buf, more);
-			    line = buf;
-			    goto test;
-			  }
-			break;
-		case -1:		/* maybe the start of a function */
-			if ( line != buf + (bufsize - 1) ) /* overflow check */
-			  continue;
-			/* falls through */
-		default:		/* not a function */
-wl:			fputs(buf, out);
-			break;
-		   }
-		line = buf;
-	   }
-	if ( line != buf )
-	  fputs(buf, out);
-	free(buf);
-	if ( output_name ) {
-	  output_error = ferror(out);
-	  output_error |= fclose(out);
-	} else {		/* out == stdout */
-	  fflush(out);
-	  output_error = ferror(out);
-	}
-	if ( output_error ) {
-	  fprintf(stderr, "%s: error writing to %s\n", program_name,
-		  (output_name ? output_name : "stdout"));
-	  exit(1);
-	}
-	if ( in != stdin )
-	  fclose(in);
-	return 0;
-}
-
-/*
- * Skip forward or backward over one or more preprocessor directives.
- */
-char *
-ppdirforward(p)
-    char *p;
-{
-    for (; *p == '#'; ++p) {
-	for (; *p != '\r' && *p != '\n'; ++p)
-	    if (*p == 0)
-		return p;
-	if (*p == '\r' && p[1] == '\n')
-	    ++p;
-    }
-    return p;
-}
-char *
-ppdirbackward(p, limit)
-    char *p;
-    char *limit;
-{
-    char *np = p;
-
-    for (;; p = --np) {
-	if (*np == '\n' && np[-1] == '\r')
-	    --np;
-	for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
-	    if (np[-1] == 0)
-		return np;
-	if (*np != '#')
-	    return p;
-    }
-}
-
-/*
- * Skip over whitespace, comments, and preprocessor directives,
- * in either direction.
- */
-char *
-skipspace(p, dir)
-    char *p;
-    int dir;			/* 1 for forward, -1 for backward */
-{
-    for ( ; ; ) {
-	while ( is_space(*p) )
-	    p += dir;
-	if ( !(*p == '/' && p[dir] == '*') )
-	    break;
-	p += dir;  p += dir;
-	while ( !(*p == '*' && p[dir] == '/') ) {
-	    if ( *p == 0 )
-		return p;	/* multi-line comment?? */
-	    p += dir;
-	}
-	p += dir;  p += dir;
-    }
-    return p;
-}
-
-/* Scan over a quoted string, in either direction. */
-char *
-scanstring(p, dir)
-    char *p;
-    int dir;
-{
-    for (p += dir; ; p += dir)
-	if (*p == '"' && p[-dir] != '\\')
-	    return p + dir;
-}
-
-/*
- * Write blanks over part of a string.
- * Don't overwrite end-of-line characters.
- */
-int
-writeblanks(start, end)
-    char *start;
-    char *end;
-{	char *p;
-	for ( p = start; p < end; p++ )
-	  if ( *p != '\r' && *p != '\n' )
-	    *p = ' ';
-	return 0;
-}
-
-/*
- * Test whether the string in buf is a function definition.
- * The string may contain and/or end with a newline.
- * Return as follows:
- *	0 - definitely not a function definition;
- *	1 - definitely a function definition;
- *	2 - definitely a function prototype (NOT USED);
- *	-1 - may be the beginning of a function definition,
- *		append another line and look again.
- * The reason we don't attempt to convert function prototypes is that
- * Ghostscript's declaration-generating macros look too much like
- * prototypes, and confuse the algorithms.
- */
-int
-test1(buf)
-    char *buf;
-{	char *p = buf;
-	char *bend;
-	char *endfn;
-	int contin;
-
-	if ( !isidfirstchar(*p) )
-	  return 0;		/* no name at left margin */
-	bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
-	switch ( *bend )
-	   {
-	   case ';': contin = 0 /*2*/; break;
-	   case ')': contin = 1; break;
-	   case '{': return 0;		/* not a function */
-	   case '}': return 0;		/* not a function */
-	   default: contin = -1;
-	   }
-	while ( isidchar(*p) )
-	  p++;
-	endfn = p;
-	p = skipspace(p, 1);
-	if ( *p++ != '(' )
-	  return 0;		/* not a function */
-	p = skipspace(p, 1);
-	if ( *p == ')' )
-	  return 0;		/* no parameters */
-	/* Check that the apparent function name isn't a keyword. */
-	/* We only need to check for keywords that could be followed */
-	/* by a left parenthesis (which, unfortunately, is most of them). */
-	   {	static char *words[] =
-		   {	"asm", "auto", "case", "char", "const", "double",
-			"extern", "float", "for", "if", "int", "long",
-			"register", "return", "short", "signed", "sizeof",
-			"static", "switch", "typedef", "unsigned",
-			"void", "volatile", "while", 0
-		   };
-		char **key = words;
-		char *kp;
-		unsigned len = endfn - buf;
-
-		while ( (kp = *key) != 0 )
-		   {	if ( strlen(kp) == len && !strncmp(kp, buf, len) )
-			  return 0;	/* name is a keyword */
-			key++;
-		   }
-	   }
-	   {
-	       char *id = p;
-	       int len;
-	       /*
-		* Check for identifier1(identifier2) and not
-		* identifier1(void), or identifier1(identifier2, xxxx).
-		*/
-
-	       while ( isidchar(*p) )
-		   p++;
-	       len = p - id;
-	       p = skipspace(p, 1);
-	       if (*p == ',' ||
-		   (*p == ')' && (len != 4 || strncmp(id, "void", 4)))
-		   )
-		   return 0;	/* not a function */
-	   }
-	/*
-	 * If the last significant character was a ), we need to count
-	 * parentheses, because it might be part of a formal parameter
-	 * that is a procedure.
-	 */
-	if (contin > 0) {
-	    int level = 0;
-
-	    for (p = skipspace(buf, 1); *p; p = skipspace(p + 1, 1))
-		level += (*p == '(' ? 1 : *p == ')' ? -1 : 0);
-	    if (level > 0)
-		contin = -1;
-	}
-	return contin;
-}
-
-/* Convert a recognized function definition or header to K&R syntax. */
-int
-convert1(buf, out, header, convert_varargs)
-    char *buf;
-    FILE *out;
-    int header;			/* Boolean */
-    int convert_varargs;	/* Boolean */
-{	char *endfn;
-	char *p;
-	/*
-	 * The breaks table contains pointers to the beginning and end
-	 * of each argument.
-	 */
-	char **breaks;
-	unsigned num_breaks = 2;	/* for testing */
-	char **btop;
-	char **bp;
-	char **ap;
-	char *vararg = 0;
-
-	/* Pre-ANSI implementations don't agree on whether strchr */
-	/* is called strchr or index, so we open-code it here. */
-	for ( endfn = buf; *(endfn++) != '('; )
-	  ;
-top:	p = endfn;
-	breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
-	if ( breaks == NULL )
-	   {	/* Couldn't allocate break table, give up */
-		fprintf(stderr, "Unable to allocate break table!\n");
-		fputs(buf, out);
-		return -1;
-	   }
-	btop = breaks + num_breaks * 2 - 2;
-	bp = breaks;
-	/* Parse the argument list */
-	do
-	   {	int level = 0;
-		char *lp = NULL;
-		char *rp = NULL;
-		char *end = NULL;
-
-		if ( bp >= btop )
-		   {	/* Filled up break table. */
-			/* Allocate a bigger one and start over. */
-			free((char *)breaks);
-			num_breaks <<= 1;
-			goto top;
-		   }
-		*bp++ = p;
-		/* Find the end of the argument */
-		for ( ; end == NULL; p++ )
-		   {	switch(*p)
-			   {
-			   case ',':
-				if ( !level ) end = p;
-				break;
-			   case '(':
-				if ( !level ) lp = p;
-				level++;
-				break;
-			   case ')':
-				if ( --level < 0 ) end = p;
-				else rp = p;
-				break;
-			   case '/':
-				if (p[1] == '*')
-				    p = skipspace(p, 1) - 1;
-				break;
-			   case '"':
-			       p = scanstring(p, 1) - 1;
-			       break;
-			   default:
-				;
-			   }
-		   }
-		/* Erase any embedded prototype parameters. */
-		if ( lp && rp )
-		  writeblanks(lp + 1, rp);
-		p--;			/* back up over terminator */
-		/* Find the name being declared. */
-		/* This is complicated because of procedure and */
-		/* array modifiers. */
-		for ( ; ; )
-		   {	p = skipspace(p - 1, -1);
-			switch ( *p )
-			   {
-			   case ']':	/* skip array dimension(s) */
-			   case ')':	/* skip procedure args OR name */
-			   {	int level = 1;
-				while ( level )
-				 switch ( *--p )
-				   {
-				   case ']': case ')':
-				       level++;
-				       break;
-				   case '[': case '(':
-				       level--;
-				       break;
-				   case '/':
-				       if (p > buf && p[-1] == '*')
-					   p = skipspace(p, -1) + 1;
-				       break;
-				   case '"':
-				       p = scanstring(p, -1) + 1;
-				       break;
-				   default: ;
-				   }
-			   }
-				if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
-				   {	/* We found the name being declared */
-					while ( !isidfirstchar(*p) )
-					  p = skipspace(p, 1) + 1;
-					goto found;
-				   }
-				break;
-			   default:
-				goto found;
-			   }
-		   }
-found:		if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
-		  {	if ( convert_varargs )
-			  {	*bp++ = "va_alist";
-				vararg = p-2;
-			  }
-			else
-			  {	p++;
-				if ( bp == breaks + 1 )	/* sole argument */
-				  writeblanks(breaks[0], p);
-				else
-				  writeblanks(bp[-1] - 1, p);
-				bp--;
-			  }
-		   }
-		else
-		   {	while ( isidchar(*p) ) p--;
-			*bp++ = p+1;
-		   }
-		p = end;
-	   }
-	while ( *p++ == ',' );
-	*bp = p;
-	/* Make a special check for 'void' arglist */
-	if ( bp == breaks+2 )
-	   {	p = skipspace(breaks[0], 1);
-		if ( !strncmp(p, "void", 4) )
-		   {	p = skipspace(p+4, 1);
-			if ( p == breaks[2] - 1 )
-			   {	bp = breaks;	/* yup, pretend arglist is empty */
-				writeblanks(breaks[0], p + 1);
-			   }
-		   }
-	   }
-	/* Put out the function name and left parenthesis. */
-	p = buf;
-	while ( p != endfn ) putc(*p, out), p++;
-	/* Put out the declaration. */
-	if ( header )
-	  {	fputs(");", out);
-		for ( p = breaks[0]; *p; p++ )
-		  if ( *p == '\r' || *p == '\n' )
-		    putc(*p, out);
-	  }
-	else
-	  {	for ( ap = breaks+1; ap < bp; ap += 2 )
-		  {	p = *ap;
-			while ( isidchar(*p) )
-			  putc(*p, out), p++;
-			if ( ap < bp - 1 )
-			  fputs(", ", out);
-		  }
-		fputs(")  ", out);
-		/* Put out the argument declarations */
-		for ( ap = breaks+2; ap <= bp; ap += 2 )
-		  (*ap)[-1] = ';';
-		if ( vararg != 0 )
-		  {	*vararg = 0;
-			fputs(breaks[0], out);		/* any prior args */
-			fputs("va_dcl", out);		/* the final arg */
-			fputs(bp[0], out);
-		  }
-		else
-		  fputs(breaks[0], out);
-	  }
-	free((char *)breaks);
-	return 0;
-}
-- 
cgit v0.12


From 0c57f26a32382c7431f0d536508c8e979f7e0313 Mon Sep 17 00:00:00 2001
From: ck <qt-info@nokia.com>
Date: Mon, 19 Jul 2010 15:11:48 +0200
Subject: Examples: Fix compilation with namespace.

---
 examples/tutorials/modelview/1_readonly/modelview.h      | 2 +-
 examples/tutorials/modelview/2_formatting/modelview.h    | 2 +-
 examples/tutorials/modelview/3_changingmodel/modelview.h | 2 +-
 examples/tutorials/modelview/3_changingmodel/mymodel.h   | 2 +-
 examples/tutorials/modelview/4_headers/modelview.h       | 2 +-
 examples/tutorials/modelview/5_edit/modelview.h          | 2 +-
 examples/tutorials/modelview/6_treeview/modelview.h      | 3 ++-
 examples/tutorials/modelview/7_selections/modelview.h    | 3 ++-
 8 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h
index 9307083..cc14d90 100755
--- a/examples/tutorials/modelview/1_readonly/modelview.h
+++ b/examples/tutorials/modelview/1_readonly/modelview.h
@@ -45,7 +45,7 @@
 // modelview.h
 #include <QtGui/QMainWindow>
 
-class QTableView; //forward declaration
+QT_FORWARD_DECLARE_CLASS(QTableView)
 
 class ModelView : public QMainWindow
 {
diff --git a/examples/tutorials/modelview/2_formatting/modelview.h b/examples/tutorials/modelview/2_formatting/modelview.h
index 7291487..b2943ac 100755
--- a/examples/tutorials/modelview/2_formatting/modelview.h
+++ b/examples/tutorials/modelview/2_formatting/modelview.h
@@ -43,7 +43,7 @@
 
 #include <QtGui/QMainWindow>
 
-class QTableView; //forward declaration
+QT_FORWARD_DECLARE_CLASS(QTableView)
 
 class ModelView : public QMainWindow
 {
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.h b/examples/tutorials/modelview/3_changingmodel/modelview.h
index 7291487..b2943ac 100755
--- a/examples/tutorials/modelview/3_changingmodel/modelview.h
+++ b/examples/tutorials/modelview/3_changingmodel/modelview.h
@@ -43,7 +43,7 @@
 
 #include <QtGui/QMainWindow>
 
-class QTableView; //forward declaration
+QT_FORWARD_DECLARE_CLASS(QTableView)
 
 class ModelView : public QMainWindow
 {
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.h b/examples/tutorials/modelview/3_changingmodel/mymodel.h
index 47b026e..01ad88d 100755
--- a/examples/tutorials/modelview/3_changingmodel/mymodel.h
+++ b/examples/tutorials/modelview/3_changingmodel/mymodel.h
@@ -43,7 +43,7 @@
 
 #include <QAbstractTableModel>
 
-class QTimer;  // forward declaration
+QT_FORWARD_DECLARE_CLASS(QTimer)
 
 class MyModel : public QAbstractTableModel
 {
diff --git a/examples/tutorials/modelview/4_headers/modelview.h b/examples/tutorials/modelview/4_headers/modelview.h
index 7669e35..03f99c0 100755
--- a/examples/tutorials/modelview/4_headers/modelview.h
+++ b/examples/tutorials/modelview/4_headers/modelview.h
@@ -43,7 +43,7 @@
 
 #include <QtGui/QMainWindow>
 
-class QTableView; //forward declaration
+QT_FORWARD_DECLARE_CLASS(QTableView)
 
 class ModelView : public QMainWindow
 {
diff --git a/examples/tutorials/modelview/5_edit/modelview.h b/examples/tutorials/modelview/5_edit/modelview.h
index 97c840c..069107b 100755
--- a/examples/tutorials/modelview/5_edit/modelview.h
+++ b/examples/tutorials/modelview/5_edit/modelview.h
@@ -43,7 +43,7 @@
 
 #include <QtGui/QMainWindow>
 
-class QTableView; //forward declaration
+QT_FORWARD_DECLARE_CLASS(QTableView)
 
 class ModelView : public QMainWindow
 {
diff --git a/examples/tutorials/modelview/6_treeview/modelview.h b/examples/tutorials/modelview/6_treeview/modelview.h
index a47111c..55f3470 100755
--- a/examples/tutorials/modelview/6_treeview/modelview.h
+++ b/examples/tutorials/modelview/6_treeview/modelview.h
@@ -43,10 +43,11 @@
 
 #include <QtGui/QMainWindow>
 
+QT_BEGIN_NAMESPACE
 class QTreeView; //forward declaration
 class QStandardItemModel;
 class QStandardItem;
-
+QT_END_NAMESPACE
 
 class ModelView : public QMainWindow
 {
diff --git a/examples/tutorials/modelview/7_selections/modelview.h b/examples/tutorials/modelview/7_selections/modelview.h
index 5229ac3..d20797e 100755
--- a/examples/tutorials/modelview/7_selections/modelview.h
+++ b/examples/tutorials/modelview/7_selections/modelview.h
@@ -43,10 +43,11 @@
 
 #include <QtGui/QMainWindow>
 
+QT_BEGIN_NAMESPACE
 class QTreeView; //forward declaration
 class QStandardItemModel;
 class QItemSelection;
-
+QT_END_NAMESPACE
 
 class ModelView : public QMainWindow
 {
-- 
cgit v0.12


From f19a95429a5e9b760f49152ebdf9b39474750116 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Mon, 19 Jul 2010 15:59:02 +0200
Subject: Extend the detection of CPU feature for x86

Add detection of CPU extension for SSE3, SSSE3, SSE4.1, SSE4.2 and AVX.

Reviewed-by: Andreas Kling
---
 src/corelib/tools/qsimd.cpp | 11 +++++++++++
 src/corelib/tools/qsimd_p.h |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 1ef513c..aa2ee47 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -218,6 +218,17 @@ uint qDetectCPUFeatures()
         features |= SSE;
     if (result & (1u << 26))
         features |= SSE2;
+    if (extended_result & (1u))
+        features |= SSE3;
+    if (extended_result & (1u << 9))
+        features |= SSSE3;
+    if (extended_result & (1u << 19))
+        features |= SSE4_1;
+    if (extended_result & (1u << 20))
+        features |= SSE4_2;
+    if (extended_result & (1u << 28))
+        features |= AVX;
+
 #endif // i386
 
 #if defined(QT_HAVE_MMX)
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 0ed9d5d..18394853 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -119,7 +119,12 @@ enum CPUFeatures {
     SSE2        = 0x20,
     CMOV        = 0x40,
     IWMMXT      = 0x80,
-    NEON        = 0x100
+    NEON        = 0x100,
+    SSE3        = 0x200,
+    SSSE3       = 0x400,
+    SSE4_1      = 0x800,
+    SSE4_2      = 0x1000,
+    AVX         = 0x2000
 };
 
 Q_CORE_EXPORT uint qDetectCPUFeatures();
-- 
cgit v0.12


From 4da1a3b63445c04d4ca4acae448e9b6b046938c3 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Mon, 19 Jul 2010 17:04:06 +0200
Subject: moc: Slot with complex template default value does not compile

The way we detect the end of a default argument does not take in account
template parametter.
It is unfortunatelly not trivial to do it properly without semantic information
So we will use heuristics and if the number of < matches the number of >
we consider it is a template.  Or if we have a '=' we consider it is not a
template.

Task-number: QTBUG-12260
Reviewed-by: Roberto Raggi
---
 src/tools/moc/moc.cpp      | 22 +++++++++++++++++++++-
 tests/auto/moc/tst_moc.cpp | 15 +++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 10a80f3..84d1567 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1208,6 +1208,12 @@ bool Moc::until(Token target) {
         default: break;
         }
     }
+
+    //when searching commas within the default argument, we should take care of template depth (anglecount)
+    // unfortunatelly, we do not have enough semantic information to know if '<' is the operator< or
+    // the begining of a template type. so we just use heuristics.
+    int possible = -1;
+
     while (index < symbols.size()) {
         Token t = symbols.at(index++).token;
         switch (t) {
@@ -1226,8 +1232,16 @@ bool Moc::until(Token target) {
             && braceCount <= 0
             && brackCount <= 0
             && parenCount <= 0
-            && (target != RANGLE || angleCount <= 0))
+            && (target != RANGLE || angleCount <= 0)) {
+            if (target != COMMA || angleCount <= 0)
+                return true;
+            possible = index;
+        }
+
+        if (target == COMMA && t == EQ && possible != -1) {
+            index = possible;
             return true;
+        }
 
         if (braceCount < 0 || brackCount < 0 || parenCount < 0
             || (target == RANGLE && angleCount < 0)) {
@@ -1235,6 +1249,12 @@ bool Moc::until(Token target) {
             break;
         }
     }
+
+    if(target == COMMA && angleCount != 0 && possible != -1) {
+        index = possible;
+        return true;
+    }
+
     return false;
 }
 
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index 19f3677..4fcc7bd 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -491,6 +491,7 @@ private slots:
     void typenameWithUnsigned();
     void warnOnVirtualSignal();
     void QTBUG5590_dummyProperty();
+    void QTBUG12260_defaultTemplate();
 signals:
     void sigWithUnsignedArg(unsigned foo);
     void sigWithSignedArg(signed foo);
@@ -1340,6 +1341,20 @@ signals:
     void testSignal(TestTemplate2<const int, const short*>);
 };
 
+class QTBUG12260_defaultTemplate_Object : public QObject
+{ Q_OBJECT
+public slots:
+    void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>()) { Q_UNUSED(values); }
+    void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); }
+};
+
+
+void tst_Moc::QTBUG12260_defaultTemplate()
+{
+    QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1);
+    QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1);
+}
+
 
 QTEST_APPLESS_MAIN(tst_Moc)
 #include "tst_moc.moc"
-- 
cgit v0.12


From ebf650dd893a8f6ace2252cd2a18ee895520f29d Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Mon, 19 Jul 2010 19:05:53 +0200
Subject: Check in the correct configure.exe

Reviewed-By: Alessandro Portale
---
 configure.exe | Bin 1686528 -> 1317888 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/configure.exe b/configure.exe
index 104923b..eea40f9 100755
Binary files a/configure.exe and b/configure.exe differ
-- 
cgit v0.12


From 83d799a00dd4417f6d2efb02781e332f510dab6a Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Tue, 20 Jul 2010 08:58:08 +1000
Subject: Improve QML text rendering when LCD smoothing is enabled for OS X.

Text in QML is always painted into a pixmap, and with sub-pixel
antialiasing enabled this produced incorrect results. This patch is a
temporary fix until QTBUG-12252 and/or QTBUG-7747 can be properly
addressed in a patch release. In the worst case, if using QML and
QPainters are being constructed in a non-GUI thread, this patch could
potentially turn off sub-pixel antialiasing for them.

Task-number: QTBUG-11002
Reviewed-by: Aaron Kennedy
Reviewed-by: Eskil Abrahamsen Blomfeldt
---
 .../graphicsitems/qdeclarativepainteditem.cpp            | 16 ++++++++++++++++
 src/declarative/graphicsitems/qdeclarativetext.cpp       | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
index 3b9b8df..a6db1fa 100644
--- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp
@@ -90,6 +90,8 @@ QT_BEGIN_NAMESPACE
 static int inpaint=0;
 static int inpaint_clearcache=0;
 
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
 /*!
     Marks areas of the cache that intersect with the given \a rect as dirty and
     in need of being refreshed.
@@ -287,7 +289,14 @@ void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem
             QRectF target(area.x(), area.y(), area.width(), area.height());
             if (!d->cachefrozen) {
                 if (!d->imagecache[i]->dirty.isNull() && topaint.contains(d->imagecache[i]->dirty)) {
+#ifdef Q_WS_MAC
+                    bool oldSmooth = qt_applefontsmoothing_enabled;
+                    qt_applefontsmoothing_enabled = false;
+#endif
                     QPainter qp(&d->imagecache[i]->image);
+#ifdef Q_WS_MAC
+                    qt_applefontsmoothing_enabled = oldSmooth;
+#endif
                     qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smoothCache);
                     qp.translate(-area.x(), -area.y());
                     qp.scale(d->contentsScale,d->contentsScale);
@@ -349,7 +358,14 @@ void QDeclarativePaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem
                 if (d->fillColor.isValid())
                     img.fill(d->fillColor);
                 {
+#ifdef Q_WS_MAC
+                    bool oldSmooth = qt_applefontsmoothing_enabled;
+                    qt_applefontsmoothing_enabled = false;
+#endif
                     QPainter qp(&img);
+#ifdef Q_WS_MAC
+                    qt_applefontsmoothing_enabled = oldSmooth;
+#endif
                     qp.setRenderHints(QPainter::HighQualityAntialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, d->smoothCache);
 
                     qp.translate(-r.x(),-r.y());
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index ba4fa21..d63d633 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -57,6 +57,8 @@
 
 QT_BEGIN_NAMESPACE
 
+extern Q_GUI_EXPORT bool qt_applefontsmoothing_enabled;
+
 class QTextDocumentWithImageResources : public QTextDocument {
     Q_OBJECT
 
@@ -1028,7 +1030,14 @@ QPixmap QDeclarativeTextPrivate::wrappedTextImage(bool drawStyle)
     QPixmap img(size);
     if (!size.isEmpty()) {
         img.fill(Qt::transparent);
+#ifdef Q_WS_MAC
+        bool oldSmooth = qt_applefontsmoothing_enabled;
+        qt_applefontsmoothing_enabled = false;
+#endif
         QPainter p(&img);
+#ifdef Q_WS_MAC
+        qt_applefontsmoothing_enabled = oldSmooth;
+#endif
         drawWrappedText(&p, QPointF(0,0), drawStyle);
     }
     return img;
@@ -1051,7 +1060,14 @@ QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle)
     //paint text
     QPixmap img(size);
     img.fill(Qt::transparent);
+#ifdef Q_WS_MAC
+    bool oldSmooth = qt_applefontsmoothing_enabled;
+    qt_applefontsmoothing_enabled = false;
+#endif
     QPainter p(&img);
+#ifdef Q_WS_MAC
+    qt_applefontsmoothing_enabled = oldSmooth;
+#endif
 
     QAbstractTextDocumentLayout::PaintContext context;
 
-- 
cgit v0.12


From 17cc89e918a969d85d2b46631ee8743288c7586d Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Tue, 20 Jul 2010 10:14:38 +1000
Subject: Ensure released VisualItemModel items are removed from the scene.
 Also parent them back to the VIM to ensure correct destruction.

Task-number: QTBUG-12261
---
 .../graphicsitems/qdeclarativevisualitemmodel.cpp  |  8 +++---
 .../qdeclarativerepeater/data/itemlist.qml         | 29 +++++++++++++++++++---
 .../tst_qdeclarativerepeater.cpp                   |  9 +++++++
 3 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index cfa1c6d..7952b97 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -77,7 +77,7 @@ public:
     QDeclarativeVisualItemModelPrivate() : QObjectPrivate() {}
 
     static void children_append(QDeclarativeListProperty<QDeclarativeItem> *prop, QDeclarativeItem *item) {
-        item->QObject::setParent(prop->object);
+        QDeclarative_setParent_noEvent(item, prop->object);
         static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->children.append(item);
         static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->itemAppended();
         static_cast<QDeclarativeVisualItemModelPrivate *>(prop->data)->emitChildrenChanged();
@@ -185,9 +185,11 @@ QDeclarativeItem *QDeclarativeVisualItemModel::item(int index, bool)
     return d->children.at(index);
 }
 
-QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *)
+QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDeclarativeItem *item)
 {
-    // Nothing to do
+    if (item->scene())
+        item->scene()->removeItem(item);
+    QDeclarative_setParent_noEvent(item, this);
     return 0;
 }
 
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
index e8dd8cc..4810736 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
+++ b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
@@ -4,21 +4,27 @@
 import Qt 4.7
 
 Rectangle {
+    id: root
     color: "lightgray"
     width: 240
     height: 320
+    property variant itemModel: itemModel1
 
     function checkProperties() {
         testObject.error = false;
-        if (testObject.useModel && view.model != itemModel) {
+        if (testObject.useModel && view.model != root.itemModel) {
             console.log("model property incorrect");
             testObject.error = true;
         }
     }
 
+    function switchModel() {
+        root.itemModel = itemModel2
+    }
+
     VisualItemModel {
-        id: itemModel
-        objectName: "itemModel"
+        id: itemModel1
+        objectName: "itemModel1"
         Rectangle {
             objectName: "item1"
             height: 50; width: 100; color: "#FFFEF0"
@@ -36,12 +42,27 @@ Rectangle {
         }
     }
 
+    VisualItemModel {
+        id: itemModel2
+        objectName: "itemModel2"
+        Rectangle {
+            objectName: "item4"
+            height: 50; width: 100; color: "#FFFEF0"
+            Text { objectName: "text4"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+        }
+        Rectangle {
+            objectName: "item5"
+            height: 50; width: 100; color: "#F0FFF7"
+            Text { objectName: "text5"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+        }
+    }
+
     Column {
         objectName: "container"
         Repeater {
             id: view
             objectName: "repeater"
-            model: testObject.useModel ? itemModel : 0
+            model: testObject.useModel ? root.itemModel : 0
         }
     }
 }
diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
index 7299a43..623b3d7 100644
--- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
+++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
@@ -361,6 +361,15 @@ void tst_QDeclarativeRepeater::itemModel()
     QVERIFY(qobject_cast<QObject*>(container->childItems().at(2))->objectName() == "item3");
     QVERIFY(container->childItems().at(3) == repeater);
 
+    QMetaObject::invokeMethod(canvas->rootObject(), "switchModel");
+    QCOMPARE(container->childItems().count(), 3);
+    QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item4");
+    QVERIFY(qobject_cast<QObject*>(container->childItems().at(1))->objectName() == "item5");
+    QVERIFY(container->childItems().at(2) == repeater);
+
+    testObject->setUseModel(false);
+    QCOMPARE(container->childItems().count(), 1);
+
     delete testObject;
     delete canvas;
 }
-- 
cgit v0.12


From 06ef198e0812b514c261ef8f7c82db754450f1fa Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Tue, 20 Jul 2010 11:28:36 +1000
Subject: Improve documentation on setting arbitray transform origin points
 transformOriginPoint is undocumented for a reason.  It shouldn't be used by
 Item.  Added some docs to assist find the right way, i.e. Scale and Rotation
 elements.

Task-number: QTBUG-12265
---
 src/declarative/graphicsitems/qdeclarativeitem.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 367a5d0..9d70beb 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1514,6 +1514,9 @@ QDeclarativeItem::~QDeclarativeItem()
     \endqml
 
     The default transform origin is \c Item.Center.
+
+    To set an arbitrary transform origin point use the \l Scale or \l Rotation
+    transform elements.
 */
 
 /*!
@@ -2192,6 +2195,8 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
   }
   \endqml
   \endtable
+
+  \sa transform, Rotation
 */
 
 /*!
@@ -2228,6 +2233,8 @@ void QDeclarativeItem::setBaselineOffset(qreal offset)
   }
   \endqml
   \endtable
+
+  \sa transform, Scale
 */
 
 /*!
-- 
cgit v0.12


From 8e19cbbad806b710e03ff17e80646e0274cf63cc Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Mon, 19 Jul 2010 12:20:11 +1000
Subject: Change docs to show how to define enum properties

---
 doc/src/declarative/extending-tutorial.qdoc | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc
index cc93e86..bc849b0 100644
--- a/doc/src/declarative/extending-tutorial.qdoc
+++ b/doc/src/declarative/extending-tutorial.qdoc
@@ -260,20 +260,34 @@ custom QML types may see unexpected behavior if bindings are not implemented.
 \example declarative/tutorials/extending/chapter4-customPropertyTypes
 
 The \c PieChart type currently has a string-type property and a color-type property.
-It could have many other types of properties. For example, we could add an
-integer-type property to store an identifier for each pie chart:
+It could have many other types of properties. For example, it could have an
+enum-type property to store a display mode for each chart:
 
 \code
+    // C++
     class PieChart : public QDeclarativeItem
     {
+        Q_ENUMS(DisplayMode)
+        Q_PROPERTY(DisplayMode displayMode READ displayMode WRITE setDisplayMode)
         ...
-        Q_PROPERTY(int id READ id WRITE setId)
+
     public:
-        ...
-        int id() const;
-        void setId(int id);
+        enum DisplayMode {
+            MultiLevel,
+            Exploded,
+            ThreeDimensional
+        };
+
+        void setDisplayMode(DisplayMode mode);
+        DisplayMode displayMode() const;
         ...
     };
+
+    // QML
+    PieChart {
+        ...
+        displayMode: PieChart.Exploded
+    }
 \endcode
 
 We can also use various other property types. QML has built-in support for the following
-- 
cgit v0.12


From c95889b7896dc5418841ef72326d99296943e616 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 20 Jul 2010 11:40:37 +1000
Subject: fixes for dynamic object creation docs

---
 doc/src/declarative/dynamicobjects.qdoc           | 77 ++++++++++++++---------
 doc/src/snippets/declarative/componentCreation.js | 63 ++++++++++---------
 doc/src/snippets/declarative/createComponent.qml  |  4 +-
 doc/src/snippets/declarative/createQmlObject.qml  |  3 +-
 4 files changed, 84 insertions(+), 63 deletions(-)

diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index a5e53a9..6bce4fa 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -39,31 +39,35 @@ QML also supports the dynamic creation of objects from within JavaScript
 code. This is useful if the existing QML elements do not fit the needs of your
 application, and there are no C++ components involved.
 
-See the {declarative/toys/dynamicscene}{Dynamic Scene example} for a demonstration
+See the \l {declarative/toys/dynamicscene}{Dynamic Scene example} for a demonstration
 of the concepts discussed on this page.
 
 
 \section1 Creating Objects Dynamically
 
 There are two ways to create objects dynamically from JavaScript. You can either call 
-\l {QML:Qt::createComponent()}{Qt.createComponent()} to create
-a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
+\l {QML:Qt::createComponent()}{Qt.createComponent()} to dynamically create
+a \l Component object, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
 to create an item from a string of QML.
-Creating a component is better if you have a predefined
-item, and you want to create dynamic instances of that item; creating an item from
-a string of QML is useful when the item QML itself is generated at runtime.
+Creating a component is better if you have an existing component defined in a \c .qml 
+file, and you want to dynamically create instances of that component. Otherwise,
+creating an item from a string of QML is useful when the item QML itself is generated 
+at runtime.
 
-If you have a component specified in a QML file, you can dynamically load it with
-the \l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}. 
-This function takes the URL of the QML file as its only argument and returns
-a component object which can be used to create and load that QML file.
 
-Once you have a component you can use its \l {Component::createObject()}{createObject()} method to create an instance of
+\section2 Creating a Component dynamically
+
+To dynamically load a component defined in a QML file, call the 
+\l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}. 
+This function takes the URL of the QML file as its only argument and creates
+a \l Component object from this URL.
+
+Once you have a \l Component, you can call its \l {Component::createObject()}{createObject()} method to create an instance of
 the component. This function takes exactly one argument, which is the parent for the new item. Since graphical items will
 not appear on the scene without a parent, it is recommended that you set the parent this way. However, if you wish to set
-the parent later you can safely pass null to this function.
+the parent later you can safely pass \c null to this function.
 
-Here is an example. Here is a \c Sprite.qml, which defines a simple QML component:
+Here is an example. First there is \c Sprite.qml, which defines a simple QML component:
 
 \snippet doc/src/snippets/declarative/Sprite.qml 0
 
@@ -72,35 +76,48 @@ that will create \c Sprite objects:
 
 \snippet doc/src/snippets/declarative/createComponent.qml 0
 
-Here is \c componentCreation.js. Remember that QML files that might be loaded
-over the network cannot be expected to be ready immediately:
+Here is \c componentCreation.js. Notice it checks whether the component \l{Component::status}{status} is
+\c Component.Ready before calling \l {Component::createObject()}{createObject()}
+in case the QML file is loaded over a network and thus is not ready immediately.
 
-\snippet doc/src/snippets/declarative/componentCreation.js 0
+\snippet doc/src/snippets/declarative/componentCreation.js vars
 \codeline
-\snippet doc/src/snippets/declarative/componentCreation.js 1
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js remote
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js finishCreation
 
-If you are certain the files will be local, you could simplify to:
+If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation() 
+function and call \l {Component::createObject()}{createObject()} immediately:
 
-\snippet doc/src/snippets/declarative/componentCreation.js 2
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js local
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
 
-Notice that once a \c Sprite object is created, its parent is set to \c appWindow (defined
-in \c main.qml). After creating an item, you must set its parent to an item within the scene.
-Otherwise your dynamically created item will not appear in the scene.
+Notice in both instances, \l {Component::createObject()}{createObject()} is called with 
+\c appWindow passed as an argument so that the created object will become a child of the
+\c appWindow item in \c main.qml. Otherwise, the new item will not appear in the scene.
 
 When using files with relative paths, the path should
 be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed.
 
-If the QML component does not exist until runtime, you can create a QML item from
+
+\section2 Creating an object from a string of QML
+
+If the QML is not defined until runtime, you can create a QML item from
 a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
 
 \snippet doc/src/snippets/declarative/createQmlObject.qml 0
 
 The first argument is the string of QML to create. Just like in a new file, you will need to
-import any types you wish to use. For importing files with relative paths, the path should
-be relative to the file where the item in the second argument is defined. Remember to set the parent after
-creating the item. The second argument is another item in the scene, and the new item is created
-in the same QML Context as this item. The third argument is the file path associated with this
-item, which is used for error reporting.
+import any types you wish to use. The second argument is the parent item for the new item;
+this should be an existing item in the scene. The third argument is the file path to associate
+with the new item; this is used for error reporting.
+
+If the string of QML imports files using relative paths, the path should be relative
+to the file in which the parent item (the second argument to the method) is defined.
+
 
 \section1 Maintaining Dynamically Created Objects
 
@@ -114,9 +131,9 @@ The actual creation context depends on how an item is created:
 \o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
    is the QDeclarativeContext in which this method is called
 \o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
-   if called, it is the context of the item used as the second argument to this method
+   if called, the creation context is the context of the parent item passed to this method
 \o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
-   is called on that item, it is the context in which the \c Component is defined
+   is called on that item, the creation context is the context in which the \c Component is defined
 \endlist
 
 Also, note that while dynamically created objects may be used the same as other objects, they
diff --git a/doc/src/snippets/declarative/componentCreation.js b/doc/src/snippets/declarative/componentCreation.js
index 25bc10c..c29a1f9 100644
--- a/doc/src/snippets/declarative/componentCreation.js
+++ b/doc/src/snippets/declarative/componentCreation.js
@@ -1,7 +1,39 @@
-//![0]
+//![vars]
 var component;
 var sprite;
+//![vars]
 
+//![func]
+function createSpriteObjects() {
+//![func]
+
+//![remote]
+    component = Qt.createComponent("Sprite.qml");
+    if (component.status == Component.Ready)
+        finishCreation();
+    else
+        component.statusChanged.connect(finishCreation);
+//![remote]
+
+//![local]
+    component = Qt.createComponent("Sprite.qml");
+    sprite = component.createObject(appWindow);
+
+    if (sprite == null) {
+        // Error Handling
+        console.log("Error creating object");
+    } else {
+        sprite.x = 100;
+        sprite.y = 100;
+        // ...
+    }
+//![local]
+
+//![func-end]
+}
+//![func-end]
+
+//![finishCreation]
 function finishCreation() {
     if (component.status == Component.Ready) {
         sprite = component.createObject(appWindow);
@@ -17,31 +49,4 @@ function finishCreation() {
         console.log("Error loading component:", component.errorString());
     }
 }
-//![0]
-
-function createSpriteObjects() {
-
-//![1]
-component = Qt.createComponent("Sprite.qml");
-if (component.status == Component.Ready)
-    finishCreation();
-else
-    component.statusChanged.connect(finishCreation);
-//![1]
-
-//![2]
-component = Qt.createComponent("Sprite.qml");
-sprite = component.createObject(appWindow);
-
-if (sprite == null) {
-    // Error Handling
-    console.log("Error loading component:", component.errorString());
-} else {
-    sprite.x = 100;
-    sprite.y = 100;
-    // ...
-}
-//![2]
-
-}
-
+//![finishCreation]
diff --git a/doc/src/snippets/declarative/createComponent.qml b/doc/src/snippets/declarative/createComponent.qml
index 8bfed07..0f9fad5 100644
--- a/doc/src/snippets/declarative/createComponent.qml
+++ b/doc/src/snippets/declarative/createComponent.qml
@@ -40,12 +40,12 @@
 
 //![0]
 import Qt 4.7
-import "componentCreation.js" as MyModule
+import "componentCreation.js" as MyScript
 
 Rectangle {
     id: appWindow
     width: 300; height: 300
 
-    Component.onCompleted: MyModule.createSpriteObjects();
+    Component.onCompleted: MyScript.createSpriteObjects();
 }
 //![0]
diff --git a/doc/src/snippets/declarative/createQmlObject.qml b/doc/src/snippets/declarative/createQmlObject.qml
index 380f6f1..64dd21d 100644
--- a/doc/src/snippets/declarative/createQmlObject.qml
+++ b/doc/src/snippets/declarative/createQmlObject.qml
@@ -42,14 +42,13 @@ import Qt 4.7
 
 Rectangle {
     id: parentItem
-    property QtObject newObject
 
     width: 100
     height: 100
     
     function createIt() {
 //![0]
-newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
+var newObject = Qt.createQmlObject('import Qt 4.7; Rectangle {color: "red"; width: 20; height: 20}',
     parentItem, "dynamicSnippet1");
 //![0]
     }
-- 
cgit v0.12


From 5b39b47255d04675f15b242252565ec0b7e8e78e Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 20 Jul 2010 11:44:05 +1000
Subject: various doc improvements for animation elements

---
 doc/src/snippets/declarative/behavior.qml          |  59 +++++
 doc/src/snippets/declarative/parallelanimation.qml |  57 +++++
 doc/src/snippets/declarative/parentchange.qml      |   5 +-
 doc/src/snippets/declarative/rotationanimation.qml |  66 ++++++
 .../snippets/declarative/sequentialanimation.qml   |  57 +++++
 doc/src/snippets/declarative/springanimation.qml   |   6 +-
 src/declarative/qml/qdeclarativeengine.cpp         |  15 +-
 src/declarative/util/qdeclarativeanimation.cpp     | 257 +++++++++++----------
 src/declarative/util/qdeclarativebehavior.cpp      |  39 ++--
 .../util/qdeclarativesmoothedanimation.cpp         |  31 +--
 .../util/qdeclarativespringanimation.cpp           |  39 ++--
 src/declarative/util/qdeclarativetransition.cpp    |   2 -
 12 files changed, 445 insertions(+), 188 deletions(-)
 create mode 100644 doc/src/snippets/declarative/behavior.qml
 create mode 100644 doc/src/snippets/declarative/parallelanimation.qml
 create mode 100644 doc/src/snippets/declarative/rotationanimation.qml
 create mode 100644 doc/src/snippets/declarative/sequentialanimation.qml

diff --git a/doc/src/snippets/declarative/behavior.qml b/doc/src/snippets/declarative/behavior.qml
new file mode 100644
index 0000000..420dfc4
--- /dev/null
+++ b/doc/src/snippets/declarative/behavior.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    Behavior on width {
+        NumberAnimation { duration: 1000 }
+    }
+
+    MouseArea {
+        anchors.fill: parent
+        onClicked: rect.width = 50
+    }
+}
+//![0]
diff --git a/doc/src/snippets/declarative/parallelanimation.qml b/doc/src/snippets/declarative/parallelanimation.qml
new file mode 100644
index 0000000..d823b4f
--- /dev/null
+++ b/doc/src/snippets/declarative/parallelanimation.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    ParallelAnimation {
+        running: true
+        NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
+        NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+    }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/parentchange.qml b/doc/src/snippets/declarative/parentchange.qml
index 7f5718a..ea50832 100644
--- a/doc/src/snippets/declarative/parentchange.qml
+++ b/doc/src/snippets/declarative/parentchange.qml
@@ -41,9 +41,8 @@
 //![0]
 import Qt 4.7
 
-Rectangle {
-    width: 200
-    height: 100
+Item {
+    width: 200; height: 100
 
     Rectangle { 
         id: redRect
diff --git a/doc/src/snippets/declarative/rotationanimation.qml b/doc/src/snippets/declarative/rotationanimation.qml
new file mode 100644
index 0000000..c81395a
--- /dev/null
+++ b/doc/src/snippets/declarative/rotationanimation.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Item {
+    width: 300; height: 300
+
+    Rectangle {
+        id: rect
+        width: 150; height: 100; anchors.centerIn: parent
+        color: "red"
+        smooth: true
+
+        states: State { 
+            name: "rotated"; PropertyChanges { target: rect; rotation: 180 } 
+        }
+
+        transitions: Transition {
+            RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
+        }
+    }
+
+    MouseArea { anchors.fill: parent; onClicked: rect.state = "rotated" }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/sequentialanimation.qml b/doc/src/snippets/declarative/sequentialanimation.qml
new file mode 100644
index 0000000..a15f7f3
--- /dev/null
+++ b/doc/src/snippets/declarative/sequentialanimation.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//![0]
+import Qt 4.7
+
+Rectangle {
+    id: rect
+    width: 100; height: 100
+    color: "red"
+
+    SequentialAnimation {
+        running: true
+        NumberAnimation { target: rect; property: "x"; to: 50; duration: 1000 }
+        NumberAnimation { target: rect; property: "y"; to: 50; duration: 1000 }
+    }
+}
+//![0]
+
diff --git a/doc/src/snippets/declarative/springanimation.qml b/doc/src/snippets/declarative/springanimation.qml
index b73a9d2..8e810e1 100644
--- a/doc/src/snippets/declarative/springanimation.qml
+++ b/doc/src/snippets/declarative/springanimation.qml
@@ -41,7 +41,7 @@
 //![0]
 import Qt 4.7
 
-Rectangle {
+Item {
     width: 300; height: 300
 
     Rectangle {
@@ -56,8 +56,8 @@ Rectangle {
     MouseArea {
         anchors.fill: parent
         onClicked: {
-            rect.x = mouse.x
-            rect.y = mouse.y
+            rect.x = mouse.x - rect.width/2
+            rect.y = mouse.y - rect.height/2
         }
     }
 }
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index f2eb770..d1ba6ce 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1080,13 +1080,20 @@ Here is an example. Notice it checks whether the component \l{Component::status}
 \c Component.Ready before calling \l {Component::createObject()}{createObject()}
 in case the QML file is loaded over a network and thus is not ready immediately.
 
-\snippet doc/src/snippets/declarative/componentCreation.js 0
+\snippet doc/src/snippets/declarative/componentCreation.js vars
 \codeline
-\snippet doc/src/snippets/declarative/componentCreation.js 1
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js remote
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
+\codeline
+\snippet doc/src/snippets/declarative/componentCreation.js finishCreation
 
-If you are certain the files will be local, you could simplify to:
+If you are certain the QML file to be loaded is a local file, you could omit the \c finishCreation() 
+function and call \l {Component::createObject()}{createObject()} immediately:
 
-\snippet doc/src/snippets/declarative/componentCreation.js 2
+\snippet doc/src/snippets/declarative/componentCreation.js func
+\snippet doc/src/snippets/declarative/componentCreation.js local
+\snippet doc/src/snippets/declarative/componentCreation.js func-end
 
 To create a QML object from an arbitrary string of QML (instead of a file),
 use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 88ec5ba..3617031 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -632,17 +632,18 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
     \qmlclass ColorAnimation QDeclarativeColorAnimation
     \since 4.7
     \inherits PropertyAnimation
-    \brief The ColorAnimation element allows you to animate color changes.
+    \brief The ColorAnimation element animates changes in color values.
 
-    ColorAnimation defines an animation to be applied when a color value 
-    changes.
+    ColorAnimation is a specialized PropertyAnimation that defines an 
+    animation to be applied when a color value changes.
 
     Here is a ColorAnimation applied to the \c color property of a \l Rectangle 
-    as a property value source:
+    as a property value source. It animates the \c color property's value from 
+    its current value to a value of "red", over 1000 milliseconds:
 
     \snippet doc/src/snippets/declarative/coloranimation.qml 0
 
-    Like any other animation element, a NumberAnimation can be applied in a
+    Like any other animation element, a ColorAnimation can be applied in a
     number of ways, including transitions, behaviors and property value 
     sources. The \l PropertyAnimation documentation shows a variety of methods
     for creating animations.
@@ -674,11 +675,12 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
 
 /*!
     \qmlproperty color ColorAnimation::from
-    This property holds the starting color.
+    This property holds the color value at which the animation should begin.
 
     For example, the following animation is not applied until a color value
     has reached "#c0c0c0":
 
+    \qml
     Item {
         states: [ ... ]
 
@@ -686,6 +688,11 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
             NumberAnimation { from: "#c0c0c0"; duration: 2000 }
         }
     }
+    \endqml
+
+    If this value is not set and the ColorAnimation is defined within
+    a \l Transition, it defaults to the value defined in the starting 
+    state of the \l Transition.
 */
 QColor QDeclarativeColorAnimation::from() const
 {
@@ -700,7 +707,12 @@ void QDeclarativeColorAnimation::setFrom(const QColor &f)
 
 /*!
     \qmlproperty color ColorAnimation::to
-    This property holds the ending color.
+
+    This property holds the color value at which the animation should end.
+
+    If this value is not set and the ColorAnimation is defined within
+    a \l Transition or \l Behavior, it defaults to the value defined in the end 
+    state of the \l Transition or \l Behavior.
 */
 QColor QDeclarativeColorAnimation::to() const
 {
@@ -869,18 +881,27 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
     \inherits Animation
     \brief The PropertyAction element allows immediate property changes during animation.
 
-    Explicitly set \c theimage.smooth=true during a transition:
+    PropertyAction is used to specify an immediate property change
+    during an animation. The property change is not animated.
+
+    For example, to explicitly set \c {theImage.smooth = true} during a \l Transition:
     \code
-    PropertyAction { target: theimage; property: "smooth"; value: true }
+    transitions: Transition {
+        ...
+        PropertyAction { target: theImage; property: "smooth"; value: true }
+        ...
+    }
     \endcode
 
-    Set \c thewebview.url to the value set for the destination state:
+    Or, to set \c theWebView.url to the value set for the destination state:
     \code
-    PropertyAction { target: thewebview; property: "url" }
+    transitions: Transition {
+        ...
+        PropertyAction { target: theWebView; property: "url" }
+        ...
+    }
     \endcode
 
-    The PropertyAction is immediate -
-    the target property is not animated to the selected value in any way.
 
     \sa QtDeclarative
 */
@@ -906,14 +927,6 @@ void QDeclarativePropertyActionPrivate::init()
     QDeclarative_setParent_noEvent(spa, q);
 }
 
-/*!
-    \qmlproperty Object PropertyAction::target
-    This property holds an explicit target object to animate.
-
-    The exact effect of the \c target property depends on how the animation
-    is being used.  Refer to the \l {QML Animation} documentation for details.
-*/
-
 QObject *QDeclarativePropertyAction::target() const
 {
     Q_D(const QDeclarativePropertyAction);
@@ -945,12 +958,12 @@ void QDeclarativePropertyAction::setProperty(const QString &n)
 }
 
 /*!
+    \qmlproperty Object PropertyAction::target
     \qmlproperty list<Object> PropertyAction::targets
     \qmlproperty string PropertyAction::property
     \qmlproperty string PropertyAction::properties
-    \qmlproperty Object PropertyAction::target
 
-    These properties are used as a set to determine which properties should be
+    These properties determine the items and their properties that are
     affected by this action.
 
     The details of how these properties are interpreted in different situations
@@ -982,7 +995,7 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAction::targets()
 
 /*!
     \qmlproperty list<Object> PropertyAction::exclude
-    This property holds the objects not to be affected by this animation.
+    This property holds the objects that should not be affected by this action.
 
     \sa targets
 */
@@ -1117,13 +1130,14 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
     \qmlclass NumberAnimation QDeclarativeNumberAnimation
     \since 4.7
     \inherits PropertyAnimation
-    \brief The NumberAnimation element allows you to animate changes in properties of type qreal.
+    \brief The NumberAnimation element animates changes in qreal-type values.
 
-    NumberAnimation defines an animation to be applied when a numerical value 
-    changes.
+    NumberAnimation is a specialized PropertyAnimation that defines an 
+    animation to be applied when a numerical value changes.
 
     Here is a NumberAnimation applied to the \c x property of a \l Rectangle 
-    as a property value source:
+    as a property value source. It animates the \c x value from its current 
+    value to a value of 50, over 1000 milliseconds:
 
     \snippet doc/src/snippets/declarative/numberanimation.qml 0
 
@@ -1174,6 +1188,7 @@ void QDeclarativeNumberAnimation::init()
     For example, the following animation is not applied until the \c x value
     has reached 100:
 
+    \qml
     Item {
         states: [ ... ]
 
@@ -1181,8 +1196,10 @@ void QDeclarativeNumberAnimation::init()
             NumberAnimation { properties: "x"; from: 100; duration: 200 }
         }
     }
+    \endqml
 
-    If this value is not set, it defaults to the value defined in the start 
+    If this value is not set and the NumberAnimation is defined within
+    a \l Transition, it defaults to the value defined in the start 
     state of the \l Transition.
 */
 
@@ -1201,7 +1218,8 @@ void QDeclarativeNumberAnimation::setFrom(qreal f)
     \qmlproperty real NumberAnimation::to
     This property holds the ending number value.
 
-    If this value is not set, it defaults to the value defined in the end 
+    If this value is not set and the NumberAnimation is defined within
+    a \l Transition or \l Behavior, it defaults to the value defined in the end 
     state of the \l Transition or \l Behavior.
 */
 qreal QDeclarativeNumberAnimation::to() const
@@ -1221,7 +1239,10 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
     \qmlclass Vector3dAnimation QDeclarativeVector3dAnimation
     \since 4.7
     \inherits PropertyAnimation
-    \brief The Vector3dAnimation element allows you to animate changes in properties of type QVector3d.
+    \brief The Vector3dAnimation element animates changes in QVector3d values.
+
+    Vector3dAnimation is a specialized PropertyAnimation that defines an 
+    animation to be applied when a Vector3d value changes.
 
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -1286,31 +1307,32 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
     \qmlclass RotationAnimation QDeclarativeRotationAnimation
     \since 4.7
     \inherits PropertyAnimation
-    \brief The RotationAnimation element allows you to animate rotations.
+    \brief The RotationAnimation element animates changes in rotation values.
 
     RotationAnimation is a specialized PropertyAnimation that gives control
-    over the direction of rotation. By default, it will rotate in the direction
+    over the direction of rotation during an animation. 
+
+    By default, it rotates in the direction
     of the numerical change; a rotation from 0 to 240 will rotate 220 degrees
     clockwise, while a rotation from 240 to 0 will rotate 220 degrees
-    counterclockwise.
+    counterclockwise. The \l direction property can be set to specify the
+    direction in which the rotation should occur.
+
+    In the following example we use RotationAnimation to animate the rotation
+    between states via the shortest path:
 
-    When used in a transition RotationAnimation will rotate all
+    \snippet doc/src/snippets/declarative/rotationanimation.qml 0
+    
+    Notice the RotationAnimation did not need to set a \l {RotationAnimation::}{target}
+    value. As a convenience, when used in a transition, RotationAnimation will rotate all
     properties named "rotation" or "angle". You can override this by providing
     your own properties via \l {PropertyAnimation::properties}{properties} or 
     \l {PropertyAnimation::property}{property}.
 
-    In the following example we use RotationAnimation to animate the rotation
-    between states via the shortest path.
-    \qml
-    states: {
-        State { name: "180"; PropertyChanges { target: myItem; rotation: 180 } }
-        State { name: "90"; PropertyChanges { target: myItem; rotation: 90 } }
-        State { name: "-90"; PropertyChanges { target: myItem; rotation: -90 } }
-    }
-    transition: Transition {
-        RotationAnimation { direction: RotationAnimation.Shortest }
-    }
-    \endqml
+    Like any other animation element, a RotationAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
 
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -1377,6 +1399,7 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
     For example, the following animation is not applied until the \c angle value
     has reached 100:
 
+    \qml
     Item {
         states: [ ... ]
 
@@ -1384,6 +1407,7 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
             RotationAnimation { properties: "angle"; from: 100; duration: 2000 }
         }
     }
+    \endqml
 
     If this value is not set, it defaults to the value defined in the start 
     state of the \l Transition.
@@ -1419,7 +1443,7 @@ void QDeclarativeRotationAnimation::setTo(qreal t)
 
 /*!
     \qmlproperty enumeration RotationAnimation::direction
-    The direction in which to rotate.
+    This property holds the direction of the rotation.
 
     Possible values are:
 
@@ -1512,19 +1536,26 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro
     \qmlclass SequentialAnimation QDeclarativeSequentialAnimation
     \since 4.7
     \inherits Animation
-    \brief The SequentialAnimation element allows you to run animations sequentially.
+    \brief The SequentialAnimation element allows animations to be run sequentially.
 
-    Animations controlled in SequentialAnimation will be run one after the other.
+    The SequentialAnimation and ParallelAnimation elements allow multiple
+    animations to be run together. Animations defined in a SequentialAnimation
+    are run one after the other, while animations defined in a ParallelAnimation
+    are run at the same time.
 
-    The following example chains two numeric animations together.  The \c MyItem
-    object will animate from its current x position to 100, and then back to 0.
+    The following example runs two number animations in a sequence.  The \l Rectangle
+    animates to a \c x position of 50, then to a \c y position of 50.
 
-    \code
-    SequentialAnimation {
-        NumberAnimation { target: MyItem; property: "x"; to: 100 }
-        NumberAnimation { target: MyItem; property: "x"; to: 0 }
-    }
-    \endcode
+    \snippet doc/src/snippets/declarative/sequentialanimation.qml 0
+
+    Animations defined within a \l Transition are automatically run in parallel,
+    so SequentialAnimation can be used to enclose the animations in a \l Transition
+    if this is the preferred behavior.
+
+    Like any other animation element, a SequentialAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
 
     \sa ParallelAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -1574,19 +1605,22 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
     \qmlclass ParallelAnimation QDeclarativeParallelAnimation
     \since 4.7
     \inherits Animation
-    \brief The ParallelAnimation element allows you to run animations in parallel.
+    \brief The ParallelAnimation element allows animations to be run in parallel.
 
-    Animations contained in ParallelAnimation will be run at the same time.
+    The SequentialAnimation and ParallelAnimation elements allow multiple
+    animations to be run together. Animations defined in a SequentialAnimation
+    are run one after the other, while animations defined in a ParallelAnimation
+    are run at the same time.
 
-    The following animation demonstrates animating the \c MyItem item
-    to (100,100) by animating the x and y properties in parallel.
+    The following animation runs two number animations in parallel. The \l Rectangle
+    moves to (50,50) by animating its \c x and \c y properties at the same time.
 
-    \code
-    ParallelAnimation {
-        NumberAnimation { target: MyItem; property: "x"; to: 100 }
-        NumberAnimation { target: MyItem; property: "y"; to: 100 }
-    }
-    \endcode
+    \snippet doc/src/snippets/declarative/parallelanimation.qml 0
+
+    Like any other animation element, a ParallelAnimation can be applied in a
+    number of ways, including transitions, behaviors and property value 
+    sources. The \l PropertyAnimation documentation shows a variety of methods
+    for creating animations.
 
     \sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -1685,7 +1719,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
     \qmlclass PropertyAnimation QDeclarativePropertyAnimation
     \since 4.7
     \inherits Animation
-    \brief The PropertyAnimation element allows you to animate property changes.
+    \brief The PropertyAnimation element animates changes in property values.
 
     PropertyAnimation provides a way to animate changes to a property's value. 
 
@@ -2353,43 +2387,30 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
     \qmlclass ParentAnimation QDeclarativeParentAnimation
     \since 4.7
     \inherits Animation
-    \brief The ParentAnimation element allows you to animate parent changes.
+    \brief The ParentAnimation element animates changes in parent values.
 
-    ParentAnimation is used in conjunction with NumberAnimation to smoothly
-    animate changing an item's parent. In the following example,
-    ParentAnimation wraps a NumberAnimation which animates from the
-    current position in the old parent to the new position in the new
-    parent.
+    ParentAnimation defines an animation to applied when a ParentChange
+    occurs. This allows parent changes to be smoothly animated.
 
-    \qml
-    ...
-    State {
-        //reparent myItem to newParent. myItem's final location
-        //should be 10,10 in newParent.
-        ParentChange {
-            target: myItem
-            parent: newParent
-            x: 10; y: 10
-        }
-    }
-    ...
-    Transition {
-        //smoothly reparent myItem and move into new position
-        ParentAnimation {
-            target: theItem
-            NumberAnimation { properties: "x,y" }
-        }
-    }
-    \endqml
+    For example, the following ParentChange changes \c blueRect to become
+    a child of \c redRect when it is clicked. The inclusion of the 
+    ParentAnimation, which defines a NumberAnimation to be applied during
+    the transition, ensures the item animates smoothly as it moves to
+    its new parent:
+
+    \snippet doc/src/snippets/declarative/parentanimation.qml 0
 
-    ParentAnimation can wrap any number of animations -- those animations will
-    be run in parallel (like those in a ParallelAnimation group).
+    A ParentAnimation can contain any number of animations. These animations will
+    be run in parallel; to run them sequentially, define them within a
+    SequentialAnimation.
 
-    In some cases, such as reparenting between items with clipping, it's useful
-    to animate the parent change via another item with no clipping.
+    In some cases, such as when reparenting between items with clipping enabled, it is useful
+    to animate the parent change via another item that does not have clipping
+    enabled. Such an item can be set using the \l via property.
 
-    When used in a transition, ParentAnimation will by default animate
-    all ParentChanges.
+    By default, when used in a transition, ParentAnimation animates all parent 
+    changes. This can be overriden by setting a specific target item using the
+    \l target property.
 
     \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
@@ -2426,8 +2447,8 @@ QDeclarativeParentAnimation::~QDeclarativeParentAnimation()
     \qmlproperty Item ParentAnimation::target
     The item to reparent.
 
-    When used in a transition, if no target is specified all
-    ParentChanges will be animated by the ParentAnimation.
+    When used in a transition, if no target is specified, all
+    ParentChange occurrences are animated by the ParentAnimation.
 */
 QDeclarativeItem *QDeclarativeParentAnimation::target() const
 {
@@ -2470,7 +2491,7 @@ void QDeclarativeParentAnimation::setNewParent(QDeclarativeItem *newParent)
 /*!
     \qmlproperty Item ParentAnimation::via
     The item to reparent via. This provides a way to do an unclipped animation
-    when both the old parent and new parent are clipped
+    when both the old parent and new parent are clipped.
 
     \qml
     ParentAnimation {
@@ -2720,28 +2741,14 @@ QAbstractAnimation *QDeclarativeParentAnimation::qtAnimation()
     \qmlclass AnchorAnimation QDeclarativeAnchorAnimation
     \since 4.7
     \inherits Animation
-    \brief The AnchorAnimation element allows you to animate anchor changes.
+    \brief The AnchorAnimation element animates changes in anchor values.
 
-    AnchorAnimation will animated any changes specified by a state's AnchorChanges.
-    In the following snippet we animate the addition of a right anchor to our item.
-    \qml
-    Item {
-        id: myItem
-        width: 100
-    }
-    ...
-    State {
-        AnchorChanges {
-            target: myItem
-            anchors.right: container.right
-        }
-    }
-    ...
-    Transition {
-        //smoothly reanchor myItem and move into new position
-        AnchorAnimation {}
-    }
-    \endqml
+    AnchorAnimation is used to animate an AnchorChange. It will anchor all
+    anchor changes specified in a \l State.
+
+    In the following snippet we animate the addition of a right anchor to a \l Rectangle:
+
+    \snippet doc/src/snippets/declarative/anchoranimation.qml 0
 
     \sa AnchorChanges
 */
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 2bb28c3..3719085 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -75,28 +75,21 @@ public:
     \since 4.7
     \brief The Behavior element allows you to specify a default animation for a property change.
 
-    Behaviors provide one way to specify \l{qdeclarativeanimation.html}{animations} in QML.
-
-    In the example below, the rectangle will use a bounce easing curve over 200 millisecond for any changes to its y property:
-    \code
-    Rectangle {
-        width: 20; height: 20
-        color: "#00ff00"
-        y: 200  // initial value
-        Behavior on y {
-            NumberAnimation {
-                easing.type: Easing.OutBounce
-                easing.amplitude: 100
-                duration: 200
-            }
-        }
-    }
-    \endcode
+    A Behavior defines the default animation to be applied whenever a 
+    particular property value changes.
+
+    For example, the following Behavior defines a NumberAnimation to be run
+    whenever the \l Rectangle's \c width value changes. When the MouseArea
+    is clicked, the \c width is changed, triggering the behavior's animation:
+
+    \snippet doc/src/snippets/declarative/behavior.qml 0
 
-    Currently only a single Behavior may be specified for a property;
-    this Behavior can be enabled and disabled via the \l{enabled} property.
+    To run multiple animations within a Behavior, use ParallelAnimation or
+    SequentialAnimation.
 
-    \sa {declarative/animation/behaviors}{Behavior example}, QtDeclarative
+    Note that a property cannot have more than one assigned Behavior.
+
+    \sa {Property Behaviors}, {declarative/animation/behaviors}{Behavior example}, QtDeclarative
 */
 
 
@@ -113,7 +106,7 @@ QDeclarativeBehavior::~QDeclarativeBehavior()
     \qmlproperty Animation Behavior::animation
     \default
 
-    The animation to use when the behavior is triggered.
+    This property holds the animation to run when the behavior is triggered.
 */
 
 QDeclarativeAbstractAnimation *QDeclarativeBehavior::animation()
@@ -152,7 +145,9 @@ void QDeclarativeBehavior::qtAnimationStateChanged(QAbstractAnimation::State new
 
 /*!
     \qmlproperty bool Behavior::enabled
-    Whether the Behavior will be triggered when the property it is tracking changes.
+
+    This property holds whether the behavior will be triggered when the tracked
+    property changes value.
 
     By default a Behavior is enabled.
 */
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index e0d1097..11c3d4b 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -253,15 +253,22 @@ void QSmoothedAnimation::init()
     \inherits NumberAnimation
     \brief The SmoothedAnimation element allows a property to smoothly track a value.
 
-    The SmoothedAnimation animates a property's value to a set target value
-    using an ease in/out quad easing curve.  If the animation is restarted
-    with a different target value, the easing curves used to animate to the old
-    and the new target values are smoothly spliced together to avoid any obvious
-    visual glitches by maintaining the current velocity.
-
-    The property animation is configured by setting the velocity at which the
-    animation should occur, or the duration that the animation should take.
-    If both a velocity and a duration are specified, the one that results in
+    A SmoothedAnimation animates a property's value to a set target value
+    using an ease in/out quad easing curve.  When the target value changes,
+    the easing curves used to animate between the old and new target values 
+    are smoothly spliced together to create a smooth movement to the new 
+    target value that maintains the current velocity.
+
+    The follow example shows one \l Rectangle tracking the position of another
+    using SmoothedAnimation. The green rectangle's \c x and \c y values are
+    bound to those of the red rectangle. Whenever these values change, the
+    green rectangle smoothly animates to its new position:
+
+    \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
+
+    A SmoothedAnimation can be configured by setting the \l velocity at which the
+    animation should occur, or the \l duration that the animation should take.
+    If both the \l velocity and \l duration are specified, the one that results in
     the quickest animation is chosen for each change in the target value.
 
     For example, animating from 0 to 800 will take 4 seconds if a velocity
@@ -271,10 +278,6 @@ void QSmoothedAnimation::init()
     will take 8 seconds with a duration of 8000 set, and will take 8 seconds
     with both a velocity of 200 and a duration of 8000 set.
 
-    The follow example shows one rectangle tracking the position of another.
-
-    \snippet doc/src/snippets/declarative/smoothedanimation.qml 0
-
     The default velocity of SmoothedAnimation is 200 units/second.  Note that if the range of the
     value being animated is small, then the velocity will need to be adjusted
     appropriately.  For example, the opacity of an item ranges from 0 - 1.0.
@@ -287,7 +290,7 @@ void QSmoothedAnimation::init()
     sources. The \l PropertyAnimation documentation shows a variety of methods
     for creating animations.
 
-    \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
+    \sa SpringAnimation, NumberAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
 
 QDeclarativeSmoothedAnimation::QDeclarativeSmoothedAnimation(QObject *parent)
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index be0af6d..8ce4832 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -215,7 +215,9 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
     You can also limit the maximum \l velocity of the animation.
 
     The following \l Rectangle moves to the position of the mouse using a 
-    SpringAnimation when the mouse is clicked:
+    SpringAnimation when the mouse is clicked. The use of the \l Behavior
+    on the \c x and \c y values indicates that whenever these values are 
+    changed, a SpringAnimation should be applied.
 
     \snippet doc/src/snippets/declarative/springanimation.qml 0
 
@@ -224,7 +226,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
     sources. The \l PropertyAnimation documentation shows a variety of methods
     for creating animations.
 
-    \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example}
+    \sa SmoothedAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}, {declarative/toys/clocks}{Clocks example}
 */
 
 QDeclarativeSpringAnimation::QDeclarativeSpringAnimation(QObject *parent)
@@ -284,8 +286,8 @@ qreal QDeclarativeSpringAnimation::from() const
 
     This property holds the value from which the animation will begin.
 
-    If not set, the animation will start regardless of the 
-    value being tracked.
+    If not set, the animation will start whenever the tracked value has
+    changed, regardless of its value.
 */
 
 void QDeclarativeSpringAnimation::setFrom(qreal value)
@@ -303,7 +305,10 @@ void QDeclarativeSpringAnimation::setFrom(qreal value)
 
 /*!
     \qmlproperty real SpringAnimation::velocity
+
     This property holds the maximum velocity allowed when tracking the source.
+
+    The default value is 0 (no maximum velocity).
 */
 
 qreal QDeclarativeSpringAnimation::velocity() const
@@ -322,13 +327,14 @@ void QDeclarativeSpringAnimation::setVelocity(qreal velocity)
 
 /*!
     \qmlproperty real SpringAnimation::spring
-    This property holds the spring constant
 
-    The spring constant describes how strongly the target is pulled towards the
-    source. Setting spring to 0 turns off spring tracking.  Useful values 0 - 5.0
+    This property describes how strongly the target is pulled towards the
+    source. The default value is 0 (that is, the spring-like motion is disabled).
+    
+    The useful value range is 0 - 5.0.
 
-    When a spring constant is set and the velocity property is greater than 0,
-    velocity limits the maximum speed.
+    When this property is set and the \l velocity value is greater than 0,
+    the \l velocity limits the maximum speed.
 */
 qreal QDeclarativeSpringAnimation::spring() const
 {
@@ -347,10 +353,11 @@ void QDeclarativeSpringAnimation::setSpring(qreal spring)
     \qmlproperty real SpringAnimation::damping
     This property holds the spring damping value.
 
-    This value describes how quickly a sprung follower comes to rest.
+    This value describes how quickly the spring-like motion comes to rest.
+    The default value is 0.
 
-    The useful range is 0 - 1.0. The lower the value, the faster the
-    follower comes to rest.
+    The useful value range is 0 - 1.0. The lower the value, the faster it
+    comes to rest.
 */
 qreal QDeclarativeSpringAnimation::damping() const
 {
@@ -392,7 +399,7 @@ void QDeclarativeSpringAnimation::setEpsilon(qreal epsilon)
 
 /*!
     \qmlproperty real SpringAnimation::modulus
-    This property holds the modulus value.
+    This property holds the modulus value. The default value is 0.
 
     Setting a \a modulus forces the target value to "wrap around" at the modulus.
     For example, setting the modulus to 360 will cause a value of 370 to wrap around to 10.
@@ -417,8 +424,10 @@ void QDeclarativeSpringAnimation::setModulus(qreal modulus)
     \qmlproperty real SpringAnimation::mass
     This property holds the "mass" of the property being moved.
 
-    mass is 1.0 by default.  Setting a different mass changes the dynamics of
-    a \l spring follow.
+    The value is 1.0 by default. 
+    
+    A greater mass causes slower movement and a greater spring-like 
+    motion when an item comes to rest.
 */
 qreal QDeclarativeSpringAnimation::mass() const
 {
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 6b7418e..6561b8c 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -66,8 +66,6 @@ QT_BEGIN_NAMESPACE
    
     \snippet doc/src/snippets/declarative/transition.qml 0
 
-    Items can have multiple transitions, if 
-
     To specify multiple transitions, specify \l Item::transitions as a list:
 
     \qml
-- 
cgit v0.12


From b2f90dedbeac285338af07fbffaec97ceaf0876f Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Tue, 20 Jul 2010 12:20:21 +1000
Subject: Better defaults for MouseArea's drag.

Allow essentially unbounded dragging once drag.target is set. The previous
default of contraining the dragging to 0,0 (i.e. no drag) was unintuitive
for learners. It's rare that unbounded is actually what you want, but it
makes it much easier to get started with the element.

Task-number: QTBUG-11184
Reviewed-by: Martin Jones
---
 src/declarative/graphicsitems/qdeclarativeitem.cpp      | 5 +----
 src/declarative/graphicsitems/qdeclarativemousearea.cpp | 3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 9d70beb..86ef0df 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -59,16 +59,13 @@
 #include <QEvent>
 #include <QGraphicsSceneMouseEvent>
 #include <QtCore/qnumeric.h>
+#include <QtCore/qmath.h>
 #include <QtScript/qscriptengine.h>
 #include <QtGui/qgraphicstransform.h>
 #include <qlistmodelinterface_p.h>
 
 QT_BEGIN_NAMESPACE
 
-#ifndef FLT_MAX
-#define FLT_MAX 1E+37
-#endif
-
 /*!
     \qmlclass Transform QGraphicsTransform
     \since 4.7
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index b7b0c9e..7e4a36f 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -45,12 +45,13 @@
 #include "private/qdeclarativeevents_p_p.h"
 
 #include <QGraphicsSceneMouseEvent>
+#include <QtCore/qmath.h>
 
 QT_BEGIN_NAMESPACE
 static const int PressAndHoldDelay = 800;
 
 QDeclarativeDrag::QDeclarativeDrag(QObject *parent)
-: QObject(parent), _target(0), _axis(XandYAxis), _xmin(0), _xmax(0), _ymin(0), _ymax(0),
+: QObject(parent), _target(0), _axis(XandYAxis), _xmin(-FLT_MAX), _xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX),
 _active(false)
 {
 }
-- 
cgit v0.12


From 6c3cf7e2c5868bc77ffa66059889eda3132531b3 Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Tue, 20 Jul 2010 12:26:13 +1000
Subject: Ensure the boundingRect() of Text is correctly calculated.

We need to create our cached image in boundingRect() if it doesn't
already exist, to prevents painting errors.

Reviewed-by: Warwick Allison
---
 src/declarative/graphicsitems/qdeclarativetext.cpp               | 2 ++
 tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index d63d633..ec8bfb5 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -716,6 +716,8 @@ QRectF QDeclarativeText::boundingRect() const
     // Could include font max left/right bearings to either side of rectangle.
 
     if (d->cache || d->style != Normal) {
+        QDeclarativeTextPrivate *dd = const_cast<QDeclarativeTextPrivate *>(d);
+        dd->checkImgCache();
         switch (d->hAlign) {
         case AlignLeft:
             x = 0;
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 80198eb..53862ec 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -246,6 +246,7 @@ void tst_qdeclarativetext::width()
         QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
 
         QVERIFY(textObject != 0);
+        QVERIFY(textObject->boundingRect().width() > 0);
         QCOMPARE(textObject->width(), qreal(metricWidth));
         QVERIFY(textObject->textFormat() == QDeclarativeText::AutoText); // setting text doesn't change format
     }
-- 
cgit v0.12


From 2c574ed1bf9943130fb9af5435b557a47e3c462b Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Tue, 20 Jul 2010 12:35:00 +1000
Subject: Remove some files as instructed by Legal department.

Task-number: QT-3613
---
 .../qimagereader/images/pngwithcompressedtext.png  | Bin 757 -> 0 bytes
 tests/auto/qimagereader/images/pngwithtext.png     | Bin 796 -> 0 bytes
 tests/auto/qimagereader/qimagereader.qrc           |   2 -
 tests/auto/qimagereader/tst_qimagereader.cpp       |  56 ---------------------
 tests/auto/qimagewriter/tst_qimagewriter.cpp       |  38 --------------
 .../qimagereader/images/pngwithcompressedtext.png  | Bin 757 -> 0 bytes
 .../gui/image/qimagereader/images/pngwithtext.png  | Bin 796 -> 0 bytes
 7 files changed, 96 deletions(-)
 delete mode 100644 tests/auto/qimagereader/images/pngwithcompressedtext.png
 delete mode 100644 tests/auto/qimagereader/images/pngwithtext.png
 delete mode 100644 tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png
 delete mode 100644 tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png

diff --git a/tests/auto/qimagereader/images/pngwithcompressedtext.png b/tests/auto/qimagereader/images/pngwithcompressedtext.png
deleted file mode 100644
index 01b2270..0000000
Binary files a/tests/auto/qimagereader/images/pngwithcompressedtext.png and /dev/null differ
diff --git a/tests/auto/qimagereader/images/pngwithtext.png b/tests/auto/qimagereader/images/pngwithtext.png
deleted file mode 100644
index 5d93799..0000000
Binary files a/tests/auto/qimagereader/images/pngwithtext.png and /dev/null differ
diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc
index 278427b..1acc82f 100644
--- a/tests/auto/qimagereader/qimagereader.qrc
+++ b/tests/auto/qimagereader/qimagereader.qrc
@@ -38,8 +38,6 @@
         <file>images/noclearcode.bmp</file>
         <file>images/noclearcode.gif</file>
         <file>images/nontransparent.xpm</file>
-        <file>images/pngwithcompressedtext.png</file>
-        <file>images/pngwithtext.png</file>
         <file>images/runners.ppm</file>
         <file>images/teapot.ppm</file>
         <file>images/test.ppm</file>
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index e9ef070..5b30b04 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -123,9 +123,6 @@ private slots:
     void supportsAnimation_data();
     void supportsAnimation();
 
-    void description_data();
-    void description();
-
     void readFromResources_data();
     void readFromResources();
 
@@ -1253,53 +1250,6 @@ void tst_QImageReader::devicePosition()
 }
 
 
-void tst_QImageReader::description_data()
-{
-    QTest::addColumn<QString>("fileName");
-    QTest::addColumn<QStringMap>("description");
-
-    QMap<QString, QString> willem;
-    willem["Title"] = "PngSuite";
-    willem["Author"] = "Willem A.J. van Schaik (gwillem@ntuvax.ntu.ac.sg)";
-    willem["Copyright"] = "Copyright Willem van Schaik, Singapore 1995";
-    willem["Description"] = "A compilation of a set of images created to test the "
-                            "various color-types of the PNG format. Included are "
-                            "black&white, color, paletted, with alpha channel, with "
-                            "transparency formats. All bit-depths allowed according "
-                            "to the spec are present.";
-    willem["Software"] = "Created on a NeXTstation color using \"pnmtopng\".";
-    willem["Disclaimer"] = "Freeware.";
-
-    QTest::newRow("PNG") << QString("pngwithtext.png") << willem;
-    QTest::newRow("PNG Compressed") << QString("pngwithcompressedtext.png") << willem;
-}
-
-void tst_QImageReader::description()
-{
-    QFETCH(QString, fileName);
-    QFETCH(QStringMap, description);
-
-    // Sanity check
-    QVERIFY(!QImage(prefix + fileName).isNull());
-
-    QImageReader reader(prefix + fileName);
-
-    foreach (QString key, description.keys())
-        QCOMPARE(reader.text(key), description.value(key));
-    QCOMPARE(reader.textKeys(), QStringList(description.keys()));
-
-    QImage image = reader.read();
-    QVERIFY(!image.isNull());
-
-    foreach (QString key, description.keys())
-        QCOMPARE(image.text(key), description.value(key));
-    QCOMPARE(image.textKeys(), QStringList(description.keys()));
-
-    foreach (QString key, description.keys())
-        QCOMPARE(reader.text(key), description.value(key));
-    QCOMPARE(reader.textKeys(), QStringList(description.keys()));
-}
-
 void tst_QImageReader::readFromResources_data()
 {
     QTest::addColumn<QString>("fileName");
@@ -1405,12 +1355,6 @@ void tst_QImageReader::readFromResources_data()
     QTest::newRow("image.png") << QString("image.png")
                                       << QByteArray("png") << QSize(22, 22)
                                       << QString("");
-    QTest::newRow("pngwithcompressedtext.png") << QString("pngwithcompressedtext.png")
-                                                      << QByteArray("png") << QSize(32, 32)
-                                                      << QString("");
-    QTest::newRow("pngwithtext.png") << QString("pngwithtext.png")
-                                            << QByteArray("png") << QSize(32, 32)
-                                            << QString("");
     QTest::newRow("kollada.png") << QString("kollada.png")
                                         << QByteArray("png") << QSize(436, 160)
                                         << QString("");
diff --git a/tests/auto/qimagewriter/tst_qimagewriter.cpp b/tests/auto/qimagewriter/tst_qimagewriter.cpp
index c4860c3..c6ec715 100644
--- a/tests/auto/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/qimagewriter/tst_qimagewriter.cpp
@@ -93,9 +93,6 @@ private slots:
     void largeTiff();
 #endif
 
-    void setDescription_data();
-    void setDescription();
-
     void writeToInvalidDevice();
 
     void supportsOption_data();
@@ -420,41 +417,6 @@ void tst_QImageWriter::readWriteNonDestructive()
     QCOMPARE(image, image2);
 }
 
-void tst_QImageWriter::setDescription_data()
-{
-    QTest::addColumn<QString>("fileName");
-    QTest::addColumn<QStringMap>("description");
-
-    QMap<QString, QString> willem;
-    willem["Title"] = "PngSuite";
-    willem["Author"] = "Willem A.J. van Schaik (willem@schaik.com)";
-    willem["Copyright"] = "Copyright Willem van Schaik, Singapore 1995-96";
-    willem["Description"] = "A compilation of a set of images created to test the "
-                            "various color-types of the PNG format. Included are "
-                            "black&white, color, paletted, with alpha channel, with "
-                            "transparency formats. All bit-depths allowed according "
-                            "to the spec are present.";
-    willem["Software"] = "Created on a NeXTstation color using \"pnmtopng\".";
-    willem["Disclaimer"] = "Freeware.";
-
-    QTest::newRow("PNG") << prefix + QString("gen-pngwithtext.png") << willem;
-}
-
-void tst_QImageWriter::setDescription()
-{
-    QFETCH(QString, fileName);
-    QFETCH(QStringMap, description);
-
-    QImageWriter writer(fileName, "png");
-    foreach (QString key, description.keys())
-        writer.setText(key, description.value(key));
-    QVERIFY(writer.write(QImage(prefix + "kollada.png")));
-
-    QImageReader reader(fileName);
-    foreach (QString key, description.keys())
-        QCOMPARE(reader.text(key), description.value(key));
-}
-
 void tst_QImageWriter::writeToInvalidDevice()
 {
     QLatin1String fileName("/these/directories/do/not/exist/001.png");
diff --git a/tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png b/tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png
deleted file mode 100644
index 01b2270..0000000
Binary files a/tests/benchmarks/gui/image/qimagereader/images/pngwithcompressedtext.png and /dev/null differ
diff --git a/tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png b/tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png
deleted file mode 100644
index 5d93799..0000000
Binary files a/tests/benchmarks/gui/image/qimagereader/images/pngwithtext.png and /dev/null differ
-- 
cgit v0.12


From 7fb140b63f03b96064ded4ec6f2ec7c93e87b825 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Tue, 20 Jul 2010 12:45:10 +1000
Subject: Make Item::transformOriginPoint read-only Using this property on Item
 will break transformOrigin property.  We have never documented it.  It should
 not have been used.  Now it is enforced as best we can.

Task-number: QTBUG-12265
Reviewed-by: Aaron Kennedy
---
 src/declarative/graphicsitems/qdeclarativeitem.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index 4f420f8..8878fa0 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -90,6 +90,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeItem : public QGraphicsObject, public QDe
     Q_PROPERTY(bool wantsFocus READ wantsFocus NOTIFY wantsFocusChanged)
     Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform> transform READ transform DESIGNABLE false FINAL)
     Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
+    Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // transformOriginPoint is read-only for Item
     Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
     Q_ENUMS(TransformOrigin)
     Q_CLASSINFO("DefaultProperty", "data")
-- 
cgit v0.12


From 8669542cfb31030acd9280a3d1817a0d3c1efbbc Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Tue, 20 Jul 2010 15:19:57 +1000
Subject: Revert "Add the chart utility from qtestlib-tools."

This reverts commit 453abe70fec02456aba2219025f5202060eaece1.

Task-number: QT-3583

Reviewed-by: Jason McDonald
---
 src/testlib/qtestcase.cpp                    |  30 +-
 tools/qtestlib/chart/3rdparty/excanvas.js    |  14 -
 tools/qtestlib/chart/3rdparty/flotr.js       |   2 -
 tools/qtestlib/chart/3rdparty/prototype.js   |   8 -
 tools/qtestlib/chart/benchmark_template.html | 202 ----------
 tools/qtestlib/chart/chart.pro               |  16 -
 tools/qtestlib/chart/chart.qrc               |   9 -
 tools/qtestlib/chart/chart_template.html     | 110 ------
 tools/qtestlib/chart/database.cpp            | 321 ---------------
 tools/qtestlib/chart/database.h              |  99 -----
 tools/qtestlib/chart/main.cpp                |  82 ----
 tools/qtestlib/chart/reportgenerator.cpp     | 561 ---------------------------
 tools/qtestlib/chart/reportgenerator.h       |  63 ---
 tools/qtestlib/qtestlib.pro                  |   2 +-
 14 files changed, 2 insertions(+), 1517 deletions(-)
 delete mode 100644 tools/qtestlib/chart/3rdparty/excanvas.js
 delete mode 100644 tools/qtestlib/chart/3rdparty/flotr.js
 delete mode 100644 tools/qtestlib/chart/3rdparty/prototype.js
 delete mode 100644 tools/qtestlib/chart/benchmark_template.html
 delete mode 100644 tools/qtestlib/chart/chart.pro
 delete mode 100644 tools/qtestlib/chart/chart.qrc
 delete mode 100644 tools/qtestlib/chart/chart_template.html
 delete mode 100644 tools/qtestlib/chart/database.cpp
 delete mode 100644 tools/qtestlib/chart/database.h
 delete mode 100644 tools/qtestlib/chart/main.cpp
 delete mode 100644 tools/qtestlib/chart/reportgenerator.cpp
 delete mode 100644 tools/qtestlib/chart/reportgenerator.h

diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 6591481..1aa2642 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -54,7 +54,6 @@
 #include <QtCore/qdir.h>
 #include <QtCore/qprocess.h>
 #include <QtCore/qdebug.h>
-#include <QtCore/qlibraryinfo.h>
 
 #include "QtTest/private/qtestlog_p.h"
 #include "QtTest/private/qtesttable_p.h"
@@ -989,9 +988,6 @@ static void qParseArgs(int argc, char *argv[])
         " -iterations  n  : Sets the number of accumulation iterations.\n"
         " -median  n      : Sets the number of median iterations.\n"
         " -vb             : Print out verbose benchmarking information.\n"
-#if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)
-        " -chart          : Create chart based on the benchmark result.\n"
-#endif
          "\n"
         " -help      : This help\n";
 
@@ -1105,12 +1101,8 @@ static void qParseArgs(int argc, char *argv[])
 
         } else if (strcmp(argv[i], "-vb") == 0) {
             QBenchmarkGlobalData::current->verboseOutput = true;
-#if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)
         } else if (strcmp(argv[i], "-chart") == 0) {
-            QBenchmarkGlobalData::current->createChart = true;
-            QTestLog::setLogMode(QTestLog::XML);
-            QTestLog::redirectOutput("results.xml");
-#endif
+            fprintf(stderr, "Warning: `-chart' option is not available\n");
         } else if (strcmp(argv[i], "-qws") == 0) {
             // do nothing
         } else if (strcmp(argv[i], "-graphicssystem") == 0) {
@@ -1713,26 +1705,6 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
      }
 #endif
 
-
-#if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)
-    if (QBenchmarkGlobalData::current->createChart) {
-        QString chartLocation = QLibraryInfo::location(QLibraryInfo::BinariesPath);
-#ifdef Q_OS_WIN
-        chartLocation += QLatin1String("/../tools/qtestlib/chart/release/chart.exe");
-#else
-        chartLocation += QLatin1String("/../tools/qtestlib/chart/chart");
-#endif
-        if (QFile::exists(chartLocation)) {
-            QProcess p;
-            p.setProcessChannelMode(QProcess::ForwardedChannels);
-            p.start(chartLocation, QStringList() << QLatin1String("results.xml"));
-            p.waitForFinished(-1);
-        } else {
-            qDebug() << QLatin1String("Could not find the chart tool in ") + chartLocation + QLatin1String(", please make sure it is compiled.");
-        }
-    }
-#endif
-
 #if defined(QTEST_NOEXITCODE)
     return 0;
 #else
diff --git a/tools/qtestlib/chart/3rdparty/excanvas.js b/tools/qtestlib/chart/3rdparty/excanvas.js
deleted file mode 100644
index e77763a..0000000
--- a/tools/qtestlib/chart/3rdparty/excanvas.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2006 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-if(!window.CanvasRenderingContext2D){(function(){var N=Math;var O=N.round;var L=N.sin;var U=N.cos;var A=10;var I=A/2;var G={init:function(W){var X=W||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var V=this;X.attachEvent("onreadystatechange",function(){V.init_(X)})}},init_:function(Y){if(Y.readyState=="complete"){if(!Y.namespaces.g_vml_){Y.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var X=Y.createStyleSheet();X.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";var W=Y.getElementsByTagName("canvas");for(var V=0;V<W.length;V++){if(!W[V].getContext){this.initElement(W[V])}}}},fixElement_:function(X){var Z=X.outerHTML;var Y=X.ownerDocument.createElement(Z);if(Z.slice(-2)!="/>"){var V="/"+X.tagName;var W;while((W=X.nextSibling)&&W.tagName!=V){W.removeNode()}if(W){W.removeNode()}}X.parentNode.replaceChild(Y,X);return Y},initElement:function(W){W=this.fixElement_(W);W.getContext=function(){if(this.context_){return this.context_}return this.context_=new J(this)};W.attachEvent("onpropertychange",T);W.attachEvent("onresize",B);var V=W.attributes;if(V.width&&V.width.specified){W.style.width=V.width.nodeValue+"px"}else{W.width=W.clientWidth}if(V.height&&V.height.specified){W.style.height=V.height.nodeValue+"px"}else{W.height=W.clientHeight}return W}};function T(W){var V=W.srcElement;switch(W.propertyName){case"width":V.style.width=V.attributes.width.nodeValue+"px";V.getContext().clearRect();break;case"height":V.style.height=V.attributes.height.nodeValue+"px";V.getContext().clearRect();break}}function B(W){var V=W.srcElement;if(V.firstChild){V.firstChild.style.width=V.clientWidth+"px";V.firstChild.style.height=V.clientHeight+"px"}}G.init();var D=[];for(var R=0;R<16;R++){for(var Q=0;Q<16;Q++){D[R*16+Q]=R.toString(16)+Q.toString(16)}}function K(){return[[1,0,0],[0,1,0],[0,0,1]]}function E(Y,X){var W=K();for(var V=0;V<3;V++){for(var b=0;b<3;b++){var Z=0;for(var a=0;a<3;a++){Z+=Y[V][a]*X[a][b]}W[V][b]=Z}}return W}function P(W,V){V.fillStyle=W.fillStyle;V.lineCap=W.lineCap;V.lineJoin=W.lineJoin;V.lineWidth=W.lineWidth;V.miterLimit=W.miterLimit;V.shadowBlur=W.shadowBlur;V.shadowColor=W.shadowColor;V.shadowOffsetX=W.shadowOffsetX;V.shadowOffsetY=W.shadowOffsetY;V.strokeStyle=W.strokeStyle;V.arcScaleX_=W.arcScaleX_;V.arcScaleY_=W.arcScaleY_}function C(W){var Z,Y=1;W=String(W);if(W.substring(0,3)=="rgb"){var b=W.indexOf("(",3);var V=W.indexOf(")",b+1);var a=W.substring(b+1,V).split(",");Z="#";for(var X=0;X<3;X++){Z+=D[Number(a[X])]}if((a.length==4)&&(W.substr(3,1)=="a")){Y=a[3]}}else{Z=W}return[Z,Y]}function M(V){switch(V){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function J(W){this.m_=K();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=A*1;this.globalAlpha=1;this.canvas=W;var V=W.ownerDocument.createElement("div");V.style.width=W.clientWidth+"px";V.style.height=W.clientHeight+"px";V.style.overflow="hidden";V.style.position="absolute";W.appendChild(V);this.element_=V;this.arcScaleX_=1;this.arcScaleY_=1}var H=J.prototype;H.clearRect=function(){this.element_.innerHTML="";this.currentPath_=[]};H.beginPath=function(){this.currentPath_=[]};H.moveTo=function(W,V){this.currentPath_.push({type:"moveTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.lineTo=function(W,V){this.currentPath_.push({type:"lineTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.bezierCurveTo=function(X,V,a,Z,Y,W){this.currentPath_.push({type:"bezierCurveTo",cp1x:X,cp1y:V,cp2x:a,cp2y:Z,x:Y,y:W});this.currentX_=Y;this.currentY_=W};H.quadraticCurveTo=function(c,b,a,Z){var W=this.currentX_+2/3*(c-this.currentX_);var V=this.currentY_+2/3*(b-this.currentY_);var Y=W+(a-this.currentX_)/3;var X=V+(Z-this.currentY_)/3;this.bezierCurveTo(W,V,Y,X,a,Z)};H.arc=function(b,Z,a,Y,W,X){a*=A;var f=X?"at":"wa";var c=b+(U(Y)*a)-I;var e=Z+(L(Y)*a)-I;var V=b+(U(W)*a)-I;var d=Z+(L(W)*a)-I;if(c==V&&!X){c+=0.125}this.currentPath_.push({type:f,x:b,y:Z,radius:a,xStart:c,yStart:e,xEnd:V,yEnd:d})};H.rect=function(X,W,V,Y){this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath()};H.strokeRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.stroke()};H.fillRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.fill()};H.createLinearGradient=function(W,Y,V,X){var Z=new S("gradient");return Z};H.createRadialGradient=function(Y,a,X,W,Z,V){var b=new S("gradientradial");b.radius1_=X;b.radius2_=V;b.focus_.x=Y;b.focus_.y=a;return b};H.drawImage=function(n,Y){var f,c,i,u,l,j,p,x;var g=n.runtimeStyle.width;var m=n.runtimeStyle.height;n.runtimeStyle.width="auto";n.runtimeStyle.height="auto";var e=n.width;var s=n.height;n.runtimeStyle.width=g;n.runtimeStyle.height=m;if(arguments.length==3){f=arguments[1];c=arguments[2];l=j=0;p=i=e;x=u=s}else{if(arguments.length==5){f=arguments[1];c=arguments[2];i=arguments[3];u=arguments[4];l=j=0;p=e;x=s}else{if(arguments.length==9){l=arguments[1];j=arguments[2];p=arguments[3];x=arguments[4];f=arguments[5];c=arguments[6];i=arguments[7];u=arguments[8]}else{throw"Invalid number of arguments"}}}var v=this.getCoords_(f,c);var Z=p/2;var X=x/2;var t=[];var V=10;var b=10;t.push(" <g_vml_:group",' coordsize="',A*V,",",A*b,'"',' coordorigin="0,0"',' style="width:',V,";height:",b,";position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var a=[];a.push("M11='",this.m_[0][0],"',","M12='",this.m_[1][0],"',","M21='",this.m_[0][1],"',","M22='",this.m_[1][1],"',","Dx='",O(v.x/A),"',","Dy='",O(v.y/A),"'");var r=v;var q=this.getCoords_(f+i,c);var o=this.getCoords_(f,c+u);var k=this.getCoords_(f+i,c+u);r.x=Math.max(r.x,q.x,o.x,k.x);r.y=Math.max(r.y,q.y,o.y,k.y);t.push("padding:0 ",O(r.x/A),"px ",O(r.y/A),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",a.join(""),", sizingmethod='clip');")}else{t.push("top:",O(v.y/A),"px;left:",O(v.x/A),"px;")}t.push(' ">','<g_vml_:image src="',n.src,'"',' style="width:',A*i,";"," height:",A*u,';"',' cropleft="',l/e,'"',' croptop="',j/s,'"',' cropright="',(e-l-p)/e,'"',' cropbottom="',(s-j-x)/s,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};H.stroke=function(y){var e=[];var d=false;var AB=C(y?this.fillStyle:this.strokeStyle);var u=AB[0];var Y=AB[1]*this.globalAlpha;var X=10;var j=10;e.push("<g_vml_:shape",' fillcolor="',u,'"',' filled="',Boolean(y),'"',' style="position:absolute;width:',X,";height:",j,';"',' coordorigin="0 0" coordsize="',A*X," ",A*j,'"',' stroked="',!y,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',u,'"',' path="');var h=false;var t={x:null,y:null};var v={x:null,y:null};for(var w=0;w<this.currentPath_.length;w++){var o=this.currentPath_[w];if(o.type=="moveTo"){e.push(" m ");var AA=this.getCoords_(o.x,o.y);e.push(O(AA.x),",",O(AA.y))}else{if(o.type=="lineTo"){e.push(" l ");var AA=this.getCoords_(o.x,o.y);e.push(O(AA.x),",",O(AA.y))}else{if(o.type=="close"){e.push(" x ")}else{if(o.type=="bezierCurveTo"){e.push(" c ");var AA=this.getCoords_(o.x,o.y);var s=this.getCoords_(o.cp1x,o.cp1y);var q=this.getCoords_(o.cp2x,o.cp2y);e.push(O(s.x),",",O(s.y),",",O(q.x),",",O(q.y),",",O(AA.x),",",O(AA.y))}else{if(o.type=="at"||o.type=="wa"){e.push(" ",o.type," ");var AA=this.getCoords_(o.x,o.y);var k=this.getCoords_(o.xStart,o.yStart);var b=this.getCoords_(o.xEnd,o.yEnd);e.push(O(AA.x-this.arcScaleX_*o.radius),",",O(AA.y-this.arcScaleY_*o.radius)," ",O(AA.x+this.arcScaleX_*o.radius),",",O(AA.y+this.arcScaleY_*o.radius)," ",O(k.x),",",O(k.y)," ",O(b.x),",",O(b.y))}}}}}if(AA){if(t.x==null||AA.x<t.x){t.x=AA.x}if(v.x==null||AA.x>v.x){v.x=AA.x}if(t.y==null||AA.y<t.y){t.y=AA.y}if(v.y==null||AA.y>v.y){v.y=AA.y}}}e.push(' ">');if(typeof this.fillStyle=="object"){var n={x:"50%",y:"50%"};var r=(v.x-t.x);var l=(v.y-t.y);var z=(r>l)?r:l;n.x=O((this.fillStyle.focus_.x/r)*100+50)+"%";n.y=O((this.fillStyle.focus_.y/l)*100+50)+"%";var g=[];if(this.fillStyle.type_=="gradientradial"){var x=(this.fillStyle.radius1_/z*100);var m=(this.fillStyle.radius2_/z*100)-x}else{var x=0;var m=100}var V={offset:null,color:null};var Z={offset:null,color:null};this.fillStyle.colors_.sort(function(a,W){return a.offset-W.offset});for(var w=0;w<this.fillStyle.colors_.length;w++){var f=this.fillStyle.colors_[w];g.push((f.offset*m)+x,"% ",f.color,",");if(f.offset>V.offset||V.offset==null){V.offset=f.offset;V.color=f.color}if(f.offset<Z.offset||Z.offset==null){Z.offset=f.offset;Z.color=f.color}}g.pop();e.push("<g_vml_:fill",' color="',Z.color,'"',' color2="',V.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',n.x,", ",n.y,'"',' colors="',g.join(""),'"',' opacity="',Y,'" />')}else{if(y){e.push('<g_vml_:fill color="',u,'" opacity="',Y,'" />')}else{e.push("<g_vml_:stroke",' opacity="',Y,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',M(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',u,'" />')}}e.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",e.join(""))};H.fill=function(){this.stroke(true)};H.closePath=function(){this.currentPath_.push({type:"close"})};H.getCoords_=function(W,V){return{x:A*(W*this.m_[0][0]+V*this.m_[1][0]+this.m_[2][0])-I,y:A*(W*this.m_[0][1]+V*this.m_[1][1]+this.m_[2][1])-I}};H.save=function(){var V={};P(this,V);this.aStack_.push(V);this.mStack_.push(this.m_);this.m_=E(K(),this.m_)};H.restore=function(){P(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};H.translate=function(X,W){var V=[[1,0,0],[0,1,0],[X,W,1]];this.m_=E(V,this.m_)};H.rotate=function(W){var Y=U(W);var X=L(W);var V=[[Y,X,0],[-X,Y,0],[0,0,1]];this.m_=E(V,this.m_)};H.scale=function(X,W){this.arcScaleX_*=X;this.arcScaleY_*=W;var V=[[X,0,0],[0,W,0],[0,0,1]];this.m_=E(V,this.m_)};H.clip=function(){};H.arcTo=function(){};H.createPattern=function(){return new F};function S(V){this.type_=V;this.radius1_=0;this.radius2_=0;this.colors_=[];this.focus_={x:0,y:0}}S.prototype.addColorStop=function(W,V){V=C(V);this.colors_.push({offset:1-W,color:V})};function F(){}G_vmlCanvasManager=G;CanvasRenderingContext2D=J;CanvasGradient=S;CanvasPattern=F})()};
\ No newline at end of file
diff --git a/tools/qtestlib/chart/3rdparty/flotr.js b/tools/qtestlib/chart/3rdparty/flotr.js
deleted file mode 100644
index 80bb506..0000000
--- a/tools/qtestlib/chart/3rdparty/flotr.js
+++ /dev/null
@@ -1,2 +0,0 @@
-//Flotr 0.1.0alpha Copyright (c) 2008 Bas Wenneker, <http://solutoire.com>, MIT License.
-var Flotr=(function(){var C=0;function L(M){return M.collect(function(N){return(N.data)?Object.clone(N):{data:N}})}function G(P,N){var M=N||{};for(var O in P){M[O]=(typeof (P[O])=="object"&&!(P[O].constructor==Array||P[O].constructor==RegExp))?G(P[O],N[O]):M[O]=P[O]}return M}function I(Q,P,M,N){var T=(M-P)/Q;var S=H(T);var O=T/S;var R=10;if(O<1.5){R=1}else{if(O<2.25){R=2}else{if(O<3){R=2.5}else{if(O<7.5){R=5}}}}if(R==2.5&&N==0){R=2}R*=S;return R}function E(M){return M.toString()}function F(M){return"("+M.x+", "+M.y+")"}function H(M){return Math.pow(10,Math.floor(Math.log(M)/Math.LN10))}function K(O){var M;if((M=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(O))){return new B(parseInt(M[1]),parseInt(M[2]),parseInt(M[3]))}if((M=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(O))){return new B(parseInt(M[1]),parseInt(M[2]),parseInt(M[3]),parseFloat(M[4]))}if((M=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(O))){return new B(parseFloat(M[1])*2.55,parseFloat(M[2])*2.55,parseFloat(M[3])*2.55)}if((M=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(O))){return new B(parseFloat(M[1])*2.55,parseFloat(M[2])*2.55,parseFloat(M[3])*2.55,parseFloat(M[4]))}if((M=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(O))){return new B(parseInt(M[1],16),parseInt(M[2],16),parseInt(M[3],16))}if((M=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(O))){return new B(parseInt(M[1]+M[1],16),parseInt(M[2]+M[2],16),parseInt(M[3]+M[3],16))}var N=O.strip().toLowerCase();if(N=="transparent"){return new B(255,255,255,0)}M=D[N];return new B(M[0],M[1],M[2])}function A(N){var M;do{M=N.getStyle("background-color").toLowerCase();if(M!=""&&M!="transparent"){break}N=N.up(0)}while(N.nodeName.toLowerCase()!="body");if(M=="rgba(0, 0, 0, 0)"){return"transparent"}return M}function B(S,R,N,P){var Q=["r","g","b","a"];var M=4;while(-1<--M){this[Q[M]]=arguments[M]||((M==3)?1:0)}this.toString=function(){return(this.a>=1)?"rgb("+[this.r,this.g,this.b].join(",")+")":"rgba("+[this.r,this.g,this.b,this.a].join(",")+")"};this.scale=function(V,U,W,T){M=4;while(-1<--M){if(arguments[M]!=null){this[Q[M]]*=arguments[M]}}return this.normalize()};this.adjust=function(V,U,W,T){M=4;while(-1<--M){if(arguments[M]!=null){this[Q[M]]+=arguments[M]}}return this.normalize()};this.clone=function(){return new B(this.r,this.b,this.g,this.a)};var O=function(U,T,V){return Math.max(Math.min(U,V),T)};this.normalize=function(){this.r=O(parseInt(this.r),0,255);this.g=O(parseInt(this.g),0,255);this.b=O(parseInt(this.b),0,255);this.a=O(this.a,0,1);return this};this.normalize()}var D={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};function J(y,AO,p){var o,S,AL,h,AS;var z="flotr-"+C++;var R=L(AO);var N=y;var u={},c={};var l={left:0,right:0,top:0,bottom:0};var AA=0;var d=0;var AH=0;var U=0;var P=0;var AD=0;var AC=0;var AB=0;g(p);k();AN();q();AK(u,o.xaxis);Z();AK(c,o.yaxis);m(u,o.xaxis);m(c,o.yaxis);Y();AP();AQ();this.getCanvas=function(){return S};this.getPlotOffset=function(){return l};this.clearSelection=M;this.setSelection=AF;function g(AV){o=G(AV,{colors:["#00A8F0","#C0D800","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{ticks:null,noTicks:5,tickFormatter:E,tickDecimals:null,min:null,max:null,autoscaleMargin:0},yaxis:{ticks:null,noTicks:5,tickFormatter:E,tickDecimals:null,min:null,max:null,autoscaleMargin:0},points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff"},lines:{show:false,lineWidth:2,fill:false,fillColor:null},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null},grid:{color:"#545454",backgroundColor:null,tickColor:"#dddddd",labelMargin:3},selection:{mode:null,color:"#B6D9FF",fps:10},mouse:{track:null,position:"se",trackFormatter:F,margin:3,color:"#ff3f19",trackDecimals:1,sensibility:2,radius:3},shadowSize:4});var Ah=R.length;var AT=[];var AZ=[];for(var Ac=0;Ac<R.length;++Ac){var Ag=R[Ac].color;if(Ag!=null){--Ah;if(Object.isNumber(Ag)){AZ.push(Ag)}else{AT.push(K(R[Ac].color))}}}for(var Ab=0;Ab<AZ.length;++Ab){Ah=Math.max(Ah,AZ[Ab]+1)}var AU=[];var AY=0;var Aa=0;while(AU.length<Ah){var Af=(o.colors.length==Aa)?new B(100,100,100):K(o.colors[Aa]);var AW=AY%2==1?-1:1;var Ae=1+AW*Math.ceil(AY/2)*0.2;Af.scale(Ae,Ae,Ae);AU.push(Af);if(++Aa>=o.colors.length){Aa=0;++AY}}var Ad=0;for(var AX=0,Ai;AX<R.length;++AX){Ai=R[AX];if(Ai.color==null){Ai.color=AU[Ad].toString();++Ad}else{if(Object.isNumber(Ai.color)){Ai.color=AU[Ai.color].toString()}}Ai.lines=Object.extend(Object.clone(o.lines),Ai.lines);Ai.points=Object.extend(Object.clone(o.points),Ai.points);Ai.bars=Object.extend(Object.clone(o.bars),Ai.bars);Ai.mouse=Object.extend(Object.clone(o.mouse),Ai.mouse);if(Ai.shadowSize==null){Ai.shadowSize=o.shadowSize}}}function k(){AH=N.getWidth();U=N.getHeight();N.innerHTML="";N.setStyle({position:"relative"});if(AH<=0||U<=0){throw"Invalid dimensions for plot, width = "+AH+", height = "+U}S=$(document.createElement("canvas")).writeAttribute({width:AH,height:U});N.appendChild(S);if(Prototype.Browser.IE){S=$(window.G_vmlCanvasManager.initElement(S))}h=S.getContext("2d");AL=$(document.createElement("canvas")).writeAttribute({width:AH,height:U}).setStyle({position:"absolute",left:"0px",top:"0px"});N.setStyle({cursor:"default"}).appendChild(AL);if(Prototype.Browser.IE){AL=$(window.G_vmlCanvasManager.initElement(AL))}AS=AL.getContext("2d")}function AN(){if(o.selection.mode!=null){AL.observe("mousedown",r)}AL.observe("mousemove",e);AL.observe("click",f)}function q(){c.datamin=u.datamin=0;u.datamax=c.datamax=1;if(R.length==0){return }var AY=false;for(var AV=0;AV<R.length;++AV){if(R[AV].data.length>0){u.datamin=u.datamax=R[AV].data[0][0];c.datamin=c.datamax=R[AV].data[0][1];AY=true;break}}if(!AY){return }for(var AU=0;AU<R.length;++AU){var AX=R[AU].data;for(var AW=0;AW<AX.length;++AW){var AT=AX[AW][0];var AZ=AX[AW][1];if(AT<u.datamin){u.datamin=AT}else{if(AT>u.datamax){u.datamax=AT}}if(AZ<c.datamin){c.datamin=AZ}else{if(AZ>c.datamax){c.datamax=AZ}}}}}function AK(AW,AY){var AV=AY.min!=null?AY.min:AW.datamin;var AT=AY.max!=null?AY.max:AW.datamax;if(AT-AV==0){var AU=(AT==0)?1:0.01;AV-=AU;AT+=AU}AW.tickSize=I(AY.noTicks,AV,AT,AY.tickDecimals);var AX;if(AY.min==null){AX=AY.autoscaleMargin;if(AX!=0){AV-=AW.tickSize*AX;if(AV<0&&AW.datamin>=0){AV=0}AV=AW.tickSize*Math.floor(AV/AW.tickSize)}}if(AY.max==null){AX=AY.autoscaleMargin;if(AX!=0){AT+=AW.tickSize*AX;if(AT>0&&AW.datamax<=0){AT=0}AT=AW.tickSize*Math.ceil(AT/AW.tickSize)}}AW.min=AV;AW.max=AT}function Z(){if(o.xaxis.max==null){var AU=u.max;for(var AT=0;AT<R.length;++AT){if(R[AT].bars.show&&R[AT].bars.barWidth+u.datamax>AU){AU=u.max+R[AT].bars.barWidth}}u.max=AU}}function m(AV,AW){AV.ticks=[];if(AW.ticks){var AZ=AW.ticks;if(Object.isFunction(AZ)){AZ=AZ({min:AV.min,max:AV.max})}for(var AX=0,Aa,AY;AX<AZ.length;++AX){var Ab=AZ[AX];if(typeof (Ab)=="object"){Aa=Ab[0];AY=(Ab.length>1)?Ab[1]:AW.tickFormatter(Aa)}else{Aa=Ab;AY=AW.tickFormatter(Aa)}AV.ticks[AX]={v:Aa,label:AY}}}else{var AT=AV.tickSize*Math.ceil(AV.min/AV.tickSize);for(AX=0;AT+AX*AV.tickSize<=AV.max;++AX){Aa=AT+AX*AV.tickSize;var AU=AW.tickDecimals;if(AU==null){AU=1-Math.floor(Math.log(AV.tickSize)/Math.LN10)}if(AU<0){AU=0}Aa=Aa.toFixed(AU);AV.ticks.push({v:Aa,label:AW.tickFormatter(Aa)})}}}function Y(){var AX="";for(var AW=0;AW<c.ticks.length;++AW){var AU=c.ticks[AW].label.length;if(AU>AX.length){AX=c.ticks[AW].label}}var AT=N.insert('<div style="position:absolute;top:-10000px;font-size:smaller" class="flotr-grid-label">'+AX+"</div>").down(0).next(1);AA=AT.getWidth();d=AT.getHeight();AT.remove();var AY=2;if(o.points.show){AY=Math.max(AY,o.points.radius+o.points.lineWidth/2)}for(var AV=0;AV<R.length;++AV){if(R[AV].points.show){AY=Math.max(AY,R[AV].points.radius+R[AV].points.lineWidth/2)}}l.left=l.right=l.top=l.bottom=AY;l.left+=AA+o.grid.labelMargin;l.bottom+=d+o.grid.labelMargin;P=AH-l.left-l.right;AD=U-l.bottom-l.top;AC=P/(u.max-u.min);AB=AD/(c.max-c.min)}function AP(){V();AR();for(var AT=0;AT<R.length;AT++){AI(R[AT])}}function AE(AT){return(AT-u.min)*AC}function j(AT){return AD-(AT-c.min)*AB}function V(){h.save();h.translate(l.left,l.top);if(o.grid.backgroundColor!=null){h.fillStyle=o.grid.backgroundColor;h.fillRect(0,0,P,AD)}h.lineWidth=1;h.strokeStyle=o.grid.tickColor;h.beginPath();for(var AV=0,AT=null;AV<u.ticks.length;++AV){AT=u.ticks[AV].v;if(AT==u.min||AT==u.max){continue}h.moveTo(Math.floor(AE(AT))+h.lineWidth/2,0);h.lineTo(Math.floor(AE(AT))+h.lineWidth/2,AD)}for(var AU=0,AT=null;AU<c.ticks.length;++AU){AT=c.ticks[AU].v;if(AT==c.min||AT==c.max){continue}h.moveTo(0,Math.floor(j(AT))+h.lineWidth/2);h.lineTo(P,Math.floor(j(AT))+h.lineWidth/2)}h.stroke();h.lineWidth=2;h.strokeStyle=o.grid.color;h.lineJoin="round";h.strokeRect(0,0,P,AD);h.restore()}function AR(){var AZ=0;for(var AY=0;AY<u.ticks.length;++AY){if(u.ticks[AY].label){++AZ}}var AU=P/AZ;var AX='<div style="font-size:smaller;color:'+o.grid.color+'">';for(var AV=0,AW=null;AV<u.ticks.length;++AV){AW=u.ticks[AV];if(!AW.label){continue}AX+='<div style="position:absolute;top:'+(l.top+AD+o.grid.labelMargin)+"px;left:"+(l.left+AE(AW.v)-AU/2)+"px;width:"+AU+'px;text-align:center" class="flotr-grid-label">'+AW.label+"</div>"}for(var AT=0,AW=null;AT<c.ticks.length;++AT){AW=c.ticks[AT];if(!AW.label||AW.label.length==0){continue}AX+='<div style="position:absolute;top:'+(l.top+j(AW.v)-d/2)+"px;left:0;width:"+AA+'px;text-align:right" class="flotr-grid-label">'+AW.label+"</div>"}AX+="</div>";N.insert(AX)}function AI(AT){if(AT.lines.show||(!AT.bars.show&&!AT.points.show)){i(AT)}if(AT.bars.show){v(AT)}if(AT.points.show){w(AT)}}function i(AV){function AU(Ad,Ac){if(Ad.length<2){return }var Ab=AE(Ad[0][0]),Aa=j(Ad[0][1])+Ac;h.beginPath();h.moveTo(Ab,Aa);for(var Ae=0;Ae<Ad.length-1;++Ae){var AZ=Ad[Ae][0],Ag=Ad[Ae][1],AY=Ad[Ae+1][0],Af=Ad[Ae+1][1];if(Ag<=Af&&Ag<c.min){if(Af<c.min){continue}AZ=(c.min-Ag)/(Af-Ag)*(AY-AZ)+AZ;Ag=c.min}else{if(Af<=Ag&&Af<c.min){if(Ag<c.min){continue}AY=(c.min-Ag)/(Af-Ag)*(AY-AZ)+AZ;Af=c.min}}if(Ag>=Af&&Ag>c.max){if(Af>c.max){continue}AZ=(c.max-Ag)/(Af-Ag)*(AY-AZ)+AZ;Ag=c.max}else{if(Af>=Ag&&Af>c.max){if(Ag>c.max){continue}AY=(c.max-Ag)/(Af-Ag)*(AY-AZ)+AZ;Af=c.max}}if(AZ<=AY&&AZ<u.min){if(AY<u.min){continue}Ag=(u.min-AZ)/(AY-AZ)*(Af-Ag)+Ag;AZ=u.min}else{if(AY<=AZ&&AY<u.min){if(AZ<u.min){continue}Af=(u.min-AZ)/(AY-AZ)*(Af-Ag)+Ag;AY=u.min}}if(AZ>=AY&&AZ>u.max){if(AY>u.max){continue}Ag=(u.max-AZ)/(AY-AZ)*(Af-Ag)+Ag;AZ=u.max}else{if(AY>=AZ&&AY>u.max){if(AZ>u.max){continue}Af=(u.max-AZ)/(AY-AZ)*(Af-Ag)+Ag;AY=u.max}}if(Ab!=AE(AZ)||Aa!=j(Ag)+Ac){h.moveTo(AE(AZ),j(Ag)+Ac)}Ab=AE(AY);Aa=j(Af)+Ac;h.lineTo(Ab,Aa)}h.stroke()}function AW(Ac){if(Ac.length<2){return }var AY=Math.min(Math.max(0,c.min),c.max);var Ah,Aa=0;var Ae=true;h.beginPath();for(var Ad=0;Ad<Ac.length-1;++Ad){var Ab=Ac[Ad][0],Ai=Ac[Ad][1],AZ=Ac[Ad+1][0],Ag=Ac[Ad+1][1];if(Ab<=AZ&&Ab<u.min){if(AZ<u.min){continue}Ai=(u.min-Ab)/(AZ-Ab)*(Ag-Ai)+Ai;Ab=u.min}else{if(AZ<=Ab&&AZ<u.min){if(Ab<u.min){continue}Ag=(u.min-Ab)/(AZ-Ab)*(Ag-Ai)+Ai;AZ=u.min}}if(Ab>=AZ&&Ab>u.max){if(AZ>u.max){continue}Ai=(u.max-Ab)/(AZ-Ab)*(Ag-Ai)+Ai;Ab=u.max}else{if(AZ>=Ab&&AZ>u.max){if(Ab>u.max){continue}Ag=(u.max-Ab)/(AZ-Ab)*(Ag-Ai)+Ai;AZ=u.max}}if(Ae){h.moveTo(AE(Ab),j(AY));Ae=false}if(Ai>=c.max&&Ag>=c.max){h.lineTo(AE(Ab),j(c.max));h.lineTo(AE(AZ),j(c.max));continue}else{if(Ai<=c.min&&Ag<=c.min){h.lineTo(AE(Ab),j(c.min));h.lineTo(AE(AZ),j(c.min));continue}}var Aj=Ab,Af=AZ;if(Ai<=Ag&&Ai<c.min&&Ag>=c.min){Ab=(c.min-Ai)/(Ag-Ai)*(AZ-Ab)+Ab;Ai=c.min}else{if(Ag<=Ai&&Ag<c.min&&Ai>=c.min){AZ=(c.min-Ai)/(Ag-Ai)*(AZ-Ab)+Ab;Ag=c.min}}if(Ai>=Ag&&Ai>c.max&&Ag<=c.max){Ab=(c.max-Ai)/(Ag-Ai)*(AZ-Ab)+Ab;Ai=c.max}else{if(Ag>=Ai&&Ag>c.max&&Ai<=c.max){AZ=(c.max-Ai)/(Ag-Ai)*(AZ-Ab)+Ab;Ag=c.max}}if(Ab!=Aj){Ah=(Ai<=c.min)?Ah=c.min:c.max;h.lineTo(AE(Aj),j(Ah));h.lineTo(AE(Ab),j(Ah))}h.lineTo(AE(Ab),j(Ai));h.lineTo(AE(AZ),j(Ag));if(AZ!=Af){Ah=(Ag<=c.min)?c.min:c.max;h.lineTo(AE(Af),j(Ah));h.lineTo(AE(AZ),j(Ah))}Aa=Math.max(AZ,Af)}h.lineTo(AE(Aa),j(AY));h.closePath();h.fill()}h.save();h.translate(l.left,l.top);h.lineJoin="round";var AX=AV.lines.lineWidth;var AT=AV.shadowSize;if(AT>0){h.lineWidth=AT/2;h.strokeStyle="rgba(0,0,0,0.1)";AU(AV.data,AX/2+AT/2+h.lineWidth/2);h.lineWidth=AT/2;h.strokeStyle="rgba(0,0,0,0.2)";AU(AV.data,AX/2+h.lineWidth/2)}h.lineWidth=AX;h.strokeStyle=AV.color;if(AV.lines.fill){h.fillStyle=AV.lines.fillColor!=null?AV.lines.fillColor:K(AV.color).scale(null,null,null,0.4).toString();AW(AV.data,0)}AU(AV.data,0);h.restore()}function w(AU){function AX(Ab,AZ,Ac){for(var Aa=0;Aa<Ab.length;++Aa){var AY=Ab[Aa][0],Ad=Ab[Aa][1];if(AY<u.min||AY>u.max||Ad<c.min||Ad>c.max){continue}h.beginPath();h.arc(AE(AY),j(Ad),AZ,0,2*Math.PI,true);if(Ac){h.fill()}h.stroke()}}function AW(Ab,Ac,AZ){for(var Aa=0;Aa<Ab.length;++Aa){var AY=Ab[Aa][0],Ad=Ab[Aa][1];if(AY<u.min||AY>u.max||Ad<c.min||Ad>c.max){continue}h.beginPath();h.arc(AE(AY),j(Ad)+Ac,AZ,0,Math.PI,false);h.stroke()}}h.save();h.translate(l.left,l.top);var AV=AU.lines.lineWidth;var AT=AU.shadowSize;if(AT>0){h.lineWidth=AT/2;h.strokeStyle="rgba(0,0,0,0.1)";AW(AU.data,AT/2+h.lineWidth/2,AU.points.radius);h.lineWidth=AT/2;h.strokeStyle="rgba(0,0,0,0.2)";AW(AU.data,h.lineWidth/2,AU.points.radius)}h.lineWidth=AU.points.lineWidth;h.strokeStyle=AU.color;h.fillStyle=AU.points.fillColor!=null?AU.points.fillColor:AU.color;AX(AU.data,AU.points.radius,AU.points.fill);h.restore()}function v(AU){function AT(Ab,Ak,AZ,Aj){if(Ab.length<2){return }for(var Ac=0;Ac<Ab.length;Ac++){var Ag=Ab[Ac][0],Af=Ab[Ac][1];var Ai=true,Aa=true,Ad=true;var AY=Ag,Ah=Ag+Ak,AX=0,Ae=Af;if(Ah<u.min||AY>u.max||Ae<c.min||AX>c.max){continue}if(AY<u.min){AY=u.min;Ai=false}if(Ah>u.max){Ah=u.max;Ad=false}if(AX<c.min){AX=c.min}if(Ae>c.max){Ae=c.max;Aa=false}if(Aj){h.beginPath();h.moveTo(AE(AY),j(AX)+AZ);h.lineTo(AE(AY),j(Ae)+AZ);h.lineTo(AE(Ah),j(Ae)+AZ);h.lineTo(AE(Ah),j(AX)+AZ);h.fill()}if(Ai||Ad||Aa){h.beginPath();h.moveTo(AE(AY),j(AX)+AZ);if(Ai){h.lineTo(AE(AY),j(Ae)+AZ)}else{h.moveTo(AE(AY),j(Ae)+AZ)}if(Aa){h.lineTo(AE(Ah),j(Ae)+AZ)}else{h.moveTo(AE(Ah),j(Ae)+AZ)}if(Ad){h.lineTo(AE(Ah),j(AX)+AZ)}else{h.moveTo(AE(Ah),j(AX)+AZ)}h.stroke()}}}h.save();h.translate(l.left,l.top);h.lineJoin="round";var AW=AU.bars.barWidth;var AV=Math.min(AU.bars.lineWidth,AW);h.lineWidth=AV;h.strokeStyle=AU.color;if(AU.bars.fill){h.fillStyle=AU.bars.fillColor!=null?AU.bars.fillColor:K(AU.color).scale(null,null,null,0.4).toString()}AT(AU.data,AW,0,AU.bars.fill);h.restore()}function AQ(){if(!o.legend.show){return }var Aa=[];var AY=false;for(var AX=0;AX<R.length;++AX){if(!R[AX].label){continue}if(AX%o.legend.noColumns==0){Aa.push((AY)?"</tr><tr>":"<tr>");AY=true}var Ac=R[AX].label;if(o.legend.labelFormatter!=null){Ac=o.legend.labelFormatter(Ac)}Aa.push('<td class="flotr-legend-color-box"><div style="border:1px solid '+o.legend.labelBoxBorderColor+';padding:1px"><div style="width:14px;height:10px;background-color:'+R[AX].color+'"></div></div></td><td class="flotr-legend-label">'+Ac+"</td>")}if(AY){Aa.push("</tr>")}if(Aa.length>0){var Ad='<table style="font-size:smaller;color:'+o.grid.color+'">'+Aa.join("")+"</table>";if(o.legend.container!=null){o.legend.container.append(Ad)}else{var Ab="";var AU=o.legend.position,AV=o.legend.margin;if(AU.charAt(0)=="n"){Ab+="top:"+(AV+l.top)+"px;"}else{if(AU.charAt(0)=="s"){Ab+="bottom:"+(AV+l.bottom)+"px;"}}if(AU.charAt(1)=="e"){Ab+="right:"+(AV+l.right)+"px;"}else{if(AU.charAt(1)=="w"){Ab+="left:"+(AV+l.bottom)+"px;"}}var AT=N.insert('<div class="flotr-legend" style="position:absolute;z-index:2;'+Ab+'">'+Ad+"</div>").getElementsBySelector("div.flotr-legend").first();if(o.legend.backgroundOpacity!=0){var AZ=o.legend.backgroundColor;if(AZ==null){var AW=(o.grid.backgroundColor!=null)?o.grid.backgroundColor:A(AT);AZ=K(AW).adjust(null,null,null,1).toString()}N.insert('<div class="flotr-legend-bg" style="position:absolute;width:'+AT.getWidth()+"px;height:"+AT.getHeight()+"px;"+Ab+"background-color:"+AZ+';"> </div>').select("div.flotr-legend-bg").first().setStyle({opacity:o.legend.backgroundOpacity})}}}}var AG={pageX:null,pageY:null};var b={first:{x:-1,y:-1},second:{x:-1,y:-1}};var T=null;var x=null;var t=false;var Q=null;function f(AT){if(t){t=false;return }var AU=AL.cumulativeOffset();N.fire("flotr:click",[{x:u.min+(AT.pageX-AU.left-l.left)/AC,y:c.max-(AT.pageY-AU.top-l.top)/AB}])}function e(AU){if(AU.pageX==null&&AU.clientX!=null){var AX=document.documentElement,AT=document.body;AG.pageX=AU.clientX+(AX&&AX.scrollLeft||AT.scrollLeft||0);AG.pageY=AU.clientY+(AX&&AX.scrollTop||AT.scrollTop||0)}else{AG.pageX=AU.pageX;AG.pageY=AU.pageY}var AV=AL.cumulativeOffset();var AW={x:u.min+(AU.pageX-AV.left-l.left)/AC,y:c.max-(AU.pageY-AV.top-l.top)/AB};if(o.mouse.track&&x==null){n(AW)}N.fire("flotr:mousemove",[AU,AW])}function r(AT){if(!AT.isLeftClick()){return }AM(b.first,AT);if(x!=null){clearInterval(x)}AG.pageX=null;x=setInterval(AJ,1000/o.selection.fps);$(document).observe("mouseup",O)}function a(){var AU=(b.first.x<=b.second.x)?b.first.x:b.second.x;var AT=(b.first.x<=b.second.x)?b.second.x:b.first.x;var AW=(b.first.y>=b.second.y)?b.first.y:b.second.y;var AV=(b.first.y>=b.second.y)?b.second.y:b.first.y;AU=u.min+AU/AC;AT=u.min+AT/AC;AW=c.max-AW/AB;AV=c.max-AV/AB;N.fire("flotr:select",[{x1:AU,y1:AW,x2:AT,y2:AV}])}function O(AT){$(document).stopObserving("mouseup",O);if(x!=null){clearInterval(x);x=null}AM(b.second,AT);M();if(W()||AT.isLeftClick()){X();a();t=true}Event.stop(AT)}function AM(AV,AT){var AU=$(AL).cumulativeOffset();if(o.selection.mode=="y"){AV.x=(AV==b.first)?0:P}else{AV.x=AT.pageX-AU.left-l.left;AV.x=Math.min(Math.max(0,AV.x),P)}if(o.selection.mode=="x"){AV.y=(AV==b.first)?0:AD}else{AV.y=AT.pageY-AU.top-l.top;AV.y=Math.min(Math.max(0,AV.y),AD)}}function AJ(){if(AG.pageX==null){return }AM(b.second,AG);M();if(W()){X()}}function M(){if(T==null){return }var AT=Math.min(T.first.x,T.second.x),AW=Math.min(T.first.y,T.second.y),AU=Math.abs(T.second.x-T.first.x),AV=Math.abs(T.second.y-T.first.y);AS.clearRect(AT+l.left-AS.lineWidth,AW+l.top-AS.lineWidth,AU+AS.lineWidth*2,AV+AS.lineWidth*2);T=null}function AF(AT){M();b.first.y=(o.selection.mode=="x")?0:(c.max-AT.y1)*AB;b.second.y=(o.selection.mode=="x")?AD:(c.max-AT.y2)*AB;b.first.x=(o.selection.mode=="y")?0:(AT.x1-u.min)*AC;b.second.x=(o.selection.mode=="y")?P:(AT.x2-u.min)*AC;X();a()}function X(){if(T!=null&&b.first.x==T.first.x&&b.first.y==T.first.y&&b.second.x==T.second.x&&b.second.y==T.second.y){return }AS.strokeStyle=K(o.selection.color).scale(null,null,null,0.8).toString();AS.lineWidth=1;h.lineJoin="round";AS.fillStyle=K(o.selection.color).scale(null,null,null,0.4).toString();T={first:{x:b.first.x,y:b.first.y},second:{x:b.second.x,y:b.second.y}};var AT=Math.min(b.first.x,b.second.x),AW=Math.min(b.first.y,b.second.y),AU=Math.abs(b.second.x-b.first.x),AV=Math.abs(b.second.y-b.first.y);AS.fillRect(AT+l.left,AW+l.top,AU,AV);AS.strokeRect(AT+l.left,AW+l.top,AU,AV)}function W(){var AT=5;return Math.abs(b.second.x-b.first.x)>=AT&&Math.abs(b.second.y-b.first.y)>=AT}function s(){if(Q){AS.clearRect(AE(Q.x)+l.left-o.points.radius*2,j(Q.y)+l.top-o.points.radius*2,o.points.radius*3+o.points.lineWidth*3,o.points.radius*3+o.points.lineWidth*3);Q=null}}function n(Ae){var AX={dist:Number.MAX_VALUE,x:null,y:null,mouse:null};for(var Ad=0,Ac,AZ,AV;Ad<R.length;Ad++){if(!R[Ad].mouse.track){continue}Ac=R[Ad].data;AZ=(AC*R[Ad].mouse.sensibility);AV=(AB*R[Ad].mouse.sensibility);for(var Aa=0,Af,Ab;Aa<Ac.length;Aa++){Af=AC*Math.abs(Ac[Aa][0]-Ae.x);Ab=AB*Math.abs(Ac[Aa][1]-Ae.y);if(Af<AZ&&Ab<AV&&(Af+Ab)<AX.dist){AX.dist=(Af+Ab);AX.x=Ac[Aa][0];AX.y=Ac[Aa][1];AX.mouse=R[Ad].mouse}}}if(AX.mouse&&AX.mouse.track&&!Q||(Q&&AX.x!=Q.x&&AX.y!=Q.y)){var AU=N.select(".flotr-mouse-value").first();if(!AU){var Ag="",AT=o.mouse.position,AY=o.mouse.margin;if(AT.charAt(0)=="n"){Ag+="top:"+(AY+l.top)+"px;"}else{if(AT.charAt(0)=="s"){Ag+="bottom:"+(AY+l.bottom)+"px;"}}if(AT.charAt(1)=="e"){Ag+="right:"+(AY+l.right)+"px;"}else{if(AT.charAt(1)=="w"){Ag+="left:"+(AY+l.bottom)+"px;"}}N.insert('<div class="flotr-mouse-value" style="opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;'+Ag+'"></div>');return }if(AX.x!==null&&AX.y!==null){AU.setStyle({display:"block"});s();if(AX.mouse.lineColor!=null){AS.save();AS.translate(l.left,l.top);AS.lineWidth=o.points.lineWidth;AS.strokeStyle=AX.mouse.lineColor;AS.fillStyle="#ffffff";AS.beginPath();AS.arc(AE(AX.x),j(AX.y),o.points.radius,0,2*Math.PI,true);AS.fill();AS.stroke();AS.restore()}Q=AX;var AW=AX.mouse.trackDecimals;if(AW==null||AW<0){AW=0}AU.innerHTML=AX.mouse.trackFormatter({x:AX.x.toFixed(AW),y:AX.y.toFixed(AW)});N.fire("flotr:hit",[AX])}else{if(Q){AU.setStyle({display:"none"});s()}}}}}return{clean:function(M){M.innerHTML=""},draw:function(P,N,M){var O=new J(P,N,M);return O}}})();
\ No newline at end of file
diff --git a/tools/qtestlib/chart/3rdparty/prototype.js b/tools/qtestlib/chart/3rdparty/prototype.js
deleted file mode 100644
index e580ae5..0000000
--- a/tools/qtestlib/chart/3rdparty/prototype.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*  Prototype JavaScript framework, version 1.6.0.2
- *  (c) 2005-2008 Sam Stephenson
- *
- *  Prototype is freely distributable under the terms of an MIT-style license.
- *  For details, see the Prototype web site: http://www.prototypejs.org/
- *
- *--------------------------------------------------------------------------*/
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('G 1g={9D:\'1.6.0.2\',1W:{3X:!!(1A.7b&&!1A.9e),58:!!1A.9e,4u:5e.5d.47(\'hE/\')>-1,7H:5e.5d.47(\'7H\')>-1&&5e.5d.47(\'ch\')==-1,d5:!!5e.5d.1f(/hD.*hC.*ci/)},3U:{72:!!1b.2S,6H:!!1A.6G,7x:1b.43(\'1T\').4U&&1b.43(\'1T\').4U!==1b.43(\'1x\').4U},84:\'<4S[^>]*>([\\\\S\\\\s]*?)<\\/4S>\',cM:/^\\/\\*-hB-([\\s\\S]*)\\*\\/\\s*$/,3q:q(){},K:q(x){o x}};E(1g.1W.d5)1g.3U.7x=1r;G 2b={2p:q(){G 2T=1k,3k=$A(1p);E(M.2w(3k[0]))2T=3k.5i();q 1N(){C.2I.3R(C,1p)}M.15(1N,2b.1d);1N.9Z=2T;1N.d4=[];E(2T){G a0=q(){};a0.1l=2T.1l;1N.1l=1s a0;2T.d4.1h(1N)}17(G i=0;i<3k.O;i++)1N.6a(3k[i]);E(!1N.1l.2I)1N.1l.2I=1g.3q;1N.1l.hA=1N;o 1N}};2b.1d={6a:q(22){G 3b=C.9Z&&C.9Z.1l;G 3k=M.4b(22);E(!M.4b({2H:1u}).O)3k.1h("2H","d3");17(G i=0,O=3k.O;i<O;i++){G 1y=3k[i],I=22[1y];E(3b&&M.2w(I)&&I.d1().3K()=="$4d"){G 1F=I,I=M.15((q(m){o q(){o 3b[m].3R(C,1p)}})(1y).5g(1F),{d3:q(){o 1F},2H:q(){o 1F.2H()}})}C.1l[1y]=I}o C}};G 4Y={};M.15=q(5L,22){17(G 1y 1Q 22)5L[1y]=22[1y];o 5L};M.15(M,{2C:q(Y){2s{E(M.2D(Y))o\'4z\';E(Y===1k)o\'1k\';o Y.2C?Y.2C():24(Y)}2E(e){E(e d2 hz)o\'...\';4q e}},3D:q(Y){G 1B=3Z Y;5y(1B){2r\'4z\':2r\'q\':2r\'hy\':o;2r\'hx\':o Y.2H()}E(Y===1k)o\'1k\';E(Y.3D)o Y.3D();E(M.4j(Y))o;G V=[];17(G 1y 1Q Y){G I=M.3D(Y[1y]);E(!M.2D(I))V.1h(1y.3D()+\': \'+I)}o\'{\'+V.2o(\', \')+\'}\'},4r:q(Y){o $H(Y).4r()},4i:q(Y){o Y&&Y.4i?Y.4i():24.62(Y)},4b:q(Y){G 4b=[];17(G 1y 1Q Y)4b.1h(1y);o 4b},1S:q(Y){G 1S=[];17(G 1y 1Q Y)1S.1h(Y[1y]);o 1S},2A:q(Y){o M.15({},Y)},4j:q(Y){o Y&&Y.3r==1},4x:q(Y){o Y!=1k&&3Z Y=="Y"&&\'hw\'1Q Y&&\'2o\'1Q Y},9G:q(Y){o Y d2 3V},2w:q(Y){o 3Z Y=="q"},3f:q(Y){o 3Z Y=="3h"},53:q(Y){o 3Z Y=="4M"},2D:q(Y){o 3Z Y=="4z"}});M.15(9X.1l,{d1:q(){G 3A=C.2H().1f(/^[\\s\\(]*q[^(]*\\((.*?)\\)/)[1].49(",").7k("3T");o 3A.O==1&&!3A[0]?[]:3A},1L:q(){E(1p.O<2&&M.2D(1p[0]))o C;G 3n=C,21=$A(1p),Y=21.5i();o q(){o 3n.3R(Y,21.20($A(1p)))}},hv:q(){G 3n=C,21=$A(1p),Y=21.5i();o q(1c){o 3n.3R(Y,[1c||1A.1c].20(21))}},7T:q(){E(!1p.O)o C;G 3n=C,21=$A(1p);o q(){o 3n.3R(C,21.20($A(1p)))}},9l:q(){G 3n=C,21=$A(1p),d0=21.5i()*cY;o 1A.hu(q(){o 3n.3R(3n,21)},d0)},5g:q(1K){G 3n=C;o q(){o 1K.3R(C,[3n.1L(C)].20($A(1p)))}},4v:q(){E(C.9Y)o C.9Y;G 3n=C;o C.9Y=q(){o 3n.3R(1k,[C].20($A(1p)))}}});9X.1l.4s=9X.1l.9l.7T(0.ht);hs.1l.3D=q(){o\'"\'+C.hr()+\'-\'+(C.hq()+1).4L(2)+\'-\'+C.hp().4L(2)+\'T\'+C.ho().4L(2)+\':\'+C.hn().4L(2)+\':\'+C.hm().4L(2)+\'Z"\'};G cp={co:q(){G 7d;17(G i=0,O=1p.O;i<O;i++){G cZ=1p[i];2s{7d=cZ();2d}2E(e){}}o 7d}};4k.1l.1f=4k.1l.2L;4k.c3=q(68){o 24(68).1Y(/([.*+?^=!:${}()|[\\]\\/\\\\])/g,\'\\\\$1\')};G aB=2b.2p({2I:q(2X,4c){C.2X=2X;C.4c=4c;C.85=1r;C.6s()},6s:q(){C.3W=ae(C.6N.1L(C),C.4c*cY)},8t:q(){C.2X(C)},8p:q(){E(!C.3W)o;af(C.3W);C.3W=1k},6N:q(){E(!C.85){2s{C.85=1u;C.8t()}hl{C.85=1r}}}});M.15(24,{62:q(I){o I==1k?\'\':24(I)},cQ:{\'\\b\':\'\\\\b\',\'\\t\':\'\\\\t\',\'\\n\':\'\\\\n\',\'\\f\':\'\\\\f\',\'\\r\':\'\\\\r\',\'\\\\\':\'\\\\\\\\\'}});M.15(24.1l,{3m:q(28,3F){G 1q=\'\',22=C,1f;3F=1p.5v.9S(3F);1P(22.O>0){E(1f=22.1f(28)){1q+=22.3B(0,1f.1i);1q+=24.62(3F(1f));22=22.3B(1f.1i+1f[0].O)}1m{1q+=22,22=\'\'}}o 1q},cN:q(28,3F,3x){3F=C.3m.9S(3F);3x=M.2D(3x)?1:3x;o C.3m(28,q(1f){E(--3x<0)o 1f[0];o 3F(1f)})},aN:q(28,W){C.3m(28,W);o 24(C)},hk:q(O,69){O=O||30;69=M.2D(69)?\'...\':69;o C.O>O?C.3B(0,O-69.O)+69:24(C)},3T:q(){o C.1Y(/^\\s+/,\'\').1Y(/\\s+$/,\'\')},cS:q(){o C.1Y(/<\\/?[^>]+>/gi,\'\')},4h:q(){o C.1Y(1s 4k(1g.84,\'cX\'),\'\')},cT:q(){G cW=1s 4k(1g.84,\'cX\');G cU=1s 4k(1g.84,\'hj\');o(C.1f(cW)||[]).2M(q(cV){o(cV.1f(cU)||[\'\',\'\'])[1]})},59:q(){o C.cT().2M(q(4S){o 7u(4S)})},82:q(){G 5J=1p.5v;5J.3Y.7n=C;o 5J.1T.4C},cJ:q(){G 1T=1s J(\'1T\');1T.4C=C.cS();o 1T.3g[0]?(1T.3g.O>1?$A(1T.3g).3H(\'\',q(2O,L){o 2O+L.4f}):1T.3g[0].4f):\'\'},7g:q(cR){G 1f=C.3T().1f(/([^?#]*)(#.*)?$/);E(!1f)o{};o 1f[1].49(cR||\'&\').3H({},q(3w,1H){E((1H=1H.49(\'=\'))[0]){G 1w=9p(1H.5i());G I=1H.O>1?1H.2o(\'=\'):1H[0];E(I!=4z)I=9p(I);E(1w 1Q 3w){E(!M.4x(3w[1w]))3w[1w]=[3w[1w]];3w[1w].1h(I)}1m 3w[1w]=I}o 3w})},3E:q(){o C.49(\'\')},9I:q(){o C.3B(0,C.O-1)+24.hi(C.cP(C.O-1)+1)},7E:q(3x){o 3x<1?\'\':1s 2m(3x+1).2o(C)},95:q(){G 4N=C.49(\'-\'),9W=4N.O;E(9W==1)o 4N[0];G 9V=C.83(0)==\'-\'?4N[0].83(0).2R()+4N[0].5H(1):4N[0];17(G i=1;i<9W;i++)9V+=4N[i].83(0).2R()+4N[i].5H(1);o 9V},6F:q(){o C.83(0).2R()+C.5H(1).2e()},hh:q(){o C.3m(/::/,\'/\').3m(/([A-Z]+)([A-Z][a-z])/,\'#{1}6T#{2}\').3m(/([a-z\\d])([A-Z])/,\'#{1}6T#{2}\').3m(/-/,\'6T\').2e()},hg:q(){o C.3m(/6T/,\'-\')},2C:q(cO){G 9T=C.3m(/[\\hf-\\he\\\\]/,q(1f){G 9U=24.cQ[1f[0]];o 9U?9U:\'\\\\hd\'+1f[0].cP().4L(2,16)});E(cO)o\'"\'+9T.1Y(/"/g,\'\\\\"\')+\'"\';o"\'"+9T.1Y(/\'/g,\'\\\\\\\'\')+"\'"},3D:q(){o C.2C(1u)},9w:q(2h){o C.cN(2h||1g.cM,\'#{1}\')},cK:q(){G 68=C;E(68.4O())o 1r;68=C.1Y(/\\\\./g,\'@\').1Y(/"[^"\\\\\\n\\r]*"/g,\'\');o(/^[,:{}\\[\\]0-9.\\-+hc-u \\n\\r\\t]*$/).2L(68)},60:q(cL){G 3l=C.9w();2s{E(!cL||3l.cK())o 7u(\'(\'+3l+\')\')}2E(e){}4q 1s hb(\'ha h9 c4 3h: \'+C.2C())},1J:q(28){o C.47(28)>-1},8F:q(28){o C.47(28)===0},aO:q(28){G d=C.O-28.O;o d>=0&&C.9L(28)===d},5E:q(){o C==\'\'},4O:q(){o/^\\s*$/.2L(C)},cb:q(Y,28){o 1s 32(C,28).2S(Y)}});E(1g.1W.4u||1g.1W.3X)M.15(24.1l,{82:q(){o C.1Y(/&/g,\'&cI;\').1Y(/</g,\'&cH;\').1Y(/>/g,\'&gt;\')},cJ:q(){o C.1Y(/&cI;/g,\'&\').1Y(/&cH;/g,\'<\').1Y(/&gt;/g,\'>\')}});24.1l.3m.9S=q(3F){E(M.2w(3F))o 3F;G 67=1s 32(3F);o q(1f){o 67.2S(1f)}};24.1l.h8=24.1l.7g;M.15(24.1l.82,{1T:1b.43(\'1T\'),3Y:1b.bm(\'\')});b0(24.1l.82)1T.5O(3Y);G 32=2b.2p({2I:q(67,28){C.67=67.2H();C.28=28||32.cE},2S:q(Y){E(M.2w(Y.9J))Y=Y.9J();o C.67.3m(C.28,q(1f){E(Y==1k)o\'\';G 4R=1f[1]||\'\';E(4R==\'\\\\\')o 1f[2];G 6X=Y,6Y=1f[3];G 28=/^([^.[]+|\\[((?:.*?[^\\\\])?)\\])(\\.|\\[|$)/;1f=28.cF(6Y);E(1f==1k)o 4R;1P(1f!=1k){G cG=1f[1].8F(\'[\')?1f[2].3m(\'\\\\\\\\]\',\']\'):1f[1];6X=6X[cG];E(1k==6X||\'\'==1f[3])2d;6Y=6Y.5H(\'[\'==1f[3]?1f[1].O:1f[0].O);1f=28.cF(6Y)}o 4R+24.62(6X)})}});32.cE=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;G $2d={};G 2G={1E:q(W,1M){G 1i=0;W=W.1L(1M);2s{C.48(q(I){W(I,1i++)})}2E(e){E(e!=$2d)4q e}o C},cD:q(4M,W,1M){W=W?W.1L(1M):1g.K;G 1i=-4M,9R=[],2F=C.3E();1P((1i+=4M)<2F.O)9R.1h(2F.3B(1i,1i+4M));o 9R.9N(W,1M)},88:q(W,1M){W=W?W.1L(1M):1g.K;G 1q=1u;C.1E(q(I,1i){1q=1q&&!!W(I,1i);E(!1q)4q $2d});o 1q},cB:q(W,1M){W=W?W.1L(1M):1g.K;G 1q=1r;C.1E(q(I,1i){E(1q=!!W(I,1i))4q $2d});o 1q},9N:q(W,1M){W=W?W.1L(1M):1g.K;G V=[];C.1E(q(I,1i){V.1h(W(I,1i))});o V},81:q(W,1M){W=W.1L(1M);G 1q;C.1E(q(I,1i){E(W(I,1i)){1q=I;4q $2d}});o 1q},5C:q(W,1M){W=W.1L(1M);G V=[];C.1E(q(I,1i){E(W(I,1i))V.1h(I)});o V},h7:q(2h,W,1M){W=W?W.1L(1M):1g.K;G V=[];E(M.3f(2h))2h=1s 4k(2h);C.1E(q(I,1i){E(2h.1f(I))V.1h(W(I,1i))});o V},1J:q(Y){E(M.2w(C.47))E(C.47(Y)!=-1)o 1u;G 9Q=1r;C.1E(q(I){E(I==Y){9Q=1u;4q $2d}});o 9Q},h6:q(4M,6W){6W=M.2D(6W)?1k:6W;o C.cD(4M,q(3B){1P(3B.O<4M)3B.1h(6W);o 3B})},3H:q(2O,W,1M){W=W.1L(1M);C.1E(q(I,1i){2O=W(2O,I,1i)});o 2O},7k:q(1F){G 21=$A(1p).3B(1);o C.2M(q(I){o I[1F].3R(I,21)})},h5:q(W,1M){W=W?W.1L(1M):1g.K;G 1q;C.1E(q(I,1i){I=W(I,1i);E(1q==1k||I>=1q)1q=I});o 1q},h4:q(W,1M){W=W?W.1L(1M):1g.K;G 1q;C.1E(q(I,1i){I=W(I,1i);E(1q==1k||I<1q)1q=I});o 1q},h3:q(W,1M){W=W?W.1L(1M):1g.K;G 9P=[],9O=[];C.1E(q(I,1i){(W(I,1i)?9P:9O).1h(I)});o[9P,9O]},5u:q(1y){G V=[];C.1E(q(I){V.1h(I[1y])});o V},h2:q(W,1M){W=W.1L(1M);G V=[];C.1E(q(I,1i){E(!W(I,1i))V.1h(I)});o V},aK:q(W,1M){W=W.1L(1M);o C.2M(q(I,1i){o{I:I,6D:W(I,1i)}}).h1(q(2x,5U){G a=2x.6D,b=5U.6D;o a<b?-1:a>b?1:0}).5u(\'I\')},3E:q(){o C.2M()},h0:q(){G W=1g.K,21=$A(1p);E(M.2w(21.2u()))W=21.gZ();G cC=[C].20(21).2M($A);o C.2M(q(I,1i){o W(cC.5u(1i))})},cw:q(){o C.3E().O},2C:q(){o\'#<2G:\'+C.3E().2C()+\'>\'}};M.15(2G,{2M:2G.9N,8l:2G.81,2z:2G.5C,2h:2G.5C,gY:2G.1J,gX:2G.3E,gW:2G.88,gV:2G.cB});q $A(3d){E(!3d)o[];E(3d.3E)o 3d.3E();G O=3d.O||0,V=1s 2m(O);1P(O--)V[O]=3d[O];o V}E(1g.1W.4u){$A=q(3d){E(!3d)o[];E(!(M.2w(3d)&&3d==\'[Y gU]\')&&3d.3E)o 3d.3E();G O=3d.O||0,V=1s 2m(O);1P(O--)V[O]=3d[O];o V}}2m.cr=$A;M.15(2m.1l,2G);E(!2m.1l.9M)2m.1l.9M=2m.1l.4e;M.15(2m.1l,{48:q(W){17(G i=0,O=C.O;i<O;i++)W(C[i])},aH:q(){C.O=0;o C},3K:q(){o C[0]},2u:q(){o C[C.O-1]},gT:q(){o C.2z(q(I){o I!=1k})},cA:q(){o C.3H([],q(2F,I){o 2F.20(M.4x(I)?I.cA():[I])})},6b:q(){G 1S=$A(1p);o C.2z(q(I){o!1S.1J(I)})},4e:q(cz){o(cz!==1r?C:C.3E()).9M()},gS:q(){o C.O>1?C:C[0]},cx:q(cy){o C.3H([],q(2F,I,1i){E(0==1i||(cy?2F.2u()!=I:!2F.1J(I)))2F.1h(I);o 2F})},gR:q(2F){o C.cx().5C(q(66){o 2F.81(q(I){o 66===I})})},2A:q(){o[].20(C)},cw:q(){o C.O},2C:q(){o\'[\'+C.2M(M.2C).2o(\', \')+\']\'},3D:q(){G V=[];C.1E(q(Y){G I=M.3D(Y);E(!M.2D(I))V.1h(I)});o\'[\'+V.2o(\', \')+\']\'}});E(M.2w(2m.1l.cv))2m.1l.48=2m.1l.cv;E(!2m.1l.47)2m.1l.47=q(66,i){i||(i=0);G O=C.O;E(i<0)i=O+i;17(;i<O;i++)E(C[i]===66)o i;o-1};E(!2m.1l.9L)2m.1l.9L=q(66,i){i=gQ(i)?C.O:(i<0?C.O+i:i)+1;G n=C.3B(0,i).4e().47(66);o(n<0)?n:i-n-1};2m.1l.3E=2m.1l.2A;q $w(3h){E(!M.3f(3h))o[];3h=3h.3T();o 3h?3h.49(/\\s+/):[]}E(1g.1W.58){2m.1l.20=q(){G 2F=[];17(G i=0,O=C.O;i<O;i++)2F.1h(C[i]);17(G i=0,O=1p.O;i<O;i++){E(M.4x(1p[i])){17(G j=0,cu=1p[i].O;j<cu;j++)2F.1h(1p[i][j])}1m{2F.1h(1p[i])}}o 2F}}M.15(54.1l,{gP:q(){o C.4L(2,16)},9I:q(){o C+1},7E:q(W){$R(0,C,1u).1E(W);o C},4L:q(O,ct){G 3h=C.2H(ct||10);o\'0\'.7E(O-3h.O)+3h},3D:q(){o gO(C)?C.2H():\'1k\'}});$w(\'gN gM gL gK\').1E(q(1F){54.1l[1F]=gJ[1F].4v()});q $H(Y){o 1s 3V(Y)};G 3V=2b.2p(2G,(q(){q 9K(1w,I){E(M.2D(I))o 1w;o 1w+\'=\'+cs(24.62(I))}o{2I:q(Y){C.4K=M.9G(Y)?Y.6U():M.2A(Y)},48:q(W){17(G 1w 1Q C.4K){G I=C.4K[1w],1H=[1w,I];1H.1w=1w;1H.I=I;W(1H)}},6c:q(1w,I){o C.4K[1w]=I},9F:q(1w){o C.4K[1w]},gI:q(1w){G I=C.4K[1w];8R C.4K[1w];o I},6U:q(){o M.2A(C.4K)},4b:q(){o C.5u(\'1w\')},1S:q(){o C.5u(\'I\')},1i:q(I){G 1f=C.81(q(1H){o 1H.I===I});o 1f&&1f.1w},gH:q(Y){o C.2A().5a(Y)},5a:q(Y){o 1s 3V(Y).3H(C,q(1q,1H){1q.6c(1H.1w,1H.I);o 1q})},4r:q(){o C.2M(q(1H){G 1w=cs(1H.1w),1S=1H.I;E(1S&&3Z 1S==\'Y\'){E(M.4x(1S))o 1S.2M(9K.7T(1w)).2o(\'&\')}o 9K(1w,1S)}).2o(\'&\')},2C:q(){o\'#<3V:{\'+C.2M(q(1H){o 1H.2M(M.2C).2o(\': \')}).2o(\', \')+\'}>\'},3D:q(){o M.3D(C.6U())},2A:q(){o 1s 3V(C)}}})());3V.1l.9J=3V.1l.6U;3V.cr=$H;G cq=2b.2p(2G,{2I:q(4l,5o,65){C.4l=4l;C.5o=5o;C.65=65},48:q(W){G I=C.4l;1P(C.1J(I)){W(I);I=I.9I()}},1J:q(I){E(I<C.4l)o 1r;E(C.65)o I<C.5o;o I<=C.5o}});G $R=q(4l,5o,65){o 1s cq(4l,5o,65)};G 1R={cj:q(){o cp.co(q(){o 1s cf()},q(){o 1s cm(\'gG.cl\')},q(){o 1s cm(\'gF.cl\')})||1r},9H:0};1R.63={6V:[],48:q(W){C.6V.48(W)},ck:q(4m){E(!C.1J(4m))C.6V.1h(4m)},gE:q(4m){C.6V=C.6V.6b(4m)},7X:q(2X,2Q,1Z,3l){C.1E(q(4m){E(M.2w(4m[2X])){2s{4m[2X].3R(4m,[2Q,1Z,3l])}2E(e){}}})}};M.15(1R.63,2G);1R.63.ck({80:q(){1R.9H++},3S:q(){1R.9H--}});1R.9m=2b.2p({2I:q(U){C.U={1F:\'6S\',7Z:1u,6R:\'7V/x-gD-1x-gC\',9C:\'gB-8\',3v:\'\',60:1u,9z:1u};M.15(C.U,U||{});C.U.1F=C.U.1F.2e();E(M.3f(C.U.3v))C.U.3v=C.U.3v.7g();1m E(M.9G(C.U.3v))C.U.3v=C.U.3v.6U()}});1R.50=2b.2p(1R.9m,{9A:1r,2I:q($4d,2U,U){$4d(U);C.1Z=1R.cj();C.2Q(2U)},2Q:q(2U){C.2U=2U;C.1F=C.U.1F;G 2Y=M.2A(C.U.3v);E(![\'9F\',\'6S\'].1J(C.1F)){2Y[\'gA\']=C.1F;C.1F=\'6S\'}C.3v=2Y;E(2Y=M.4r(2Y)){E(C.1F==\'9F\')C.2U+=(C.2U.1J(\'?\')?\'&\':\'?\')+2Y;1m E(/gz|ci|ch/.2L(5e.5d))2Y+=\'&6T=\'}2s{G 2y=1s 1R.9t(C);E(C.U.80)C.U.80(2y);1R.63.7X(\'80\',C,2y);C.1Z.gy(C.1F.2R(),C.2U,C.U.7Z);E(C.U.7Z)C.9B.1L(C).4s(1);C.1Z.77=C.9E.1L(C);C.cg();C.2q=C.1F==\'6S\'?(C.U.gx||2Y):1k;C.1Z.gw(C.2q);E(!C.U.7Z&&C.1Z.ce)C.9E()}2E(e){C.5m(e)}},9E:q(){G 2N=C.1Z.2N;E(2N>1&&!((2N==4)&&C.9A))C.9B(C.1Z.2N)},cg:q(){G 5n={\'X-gv-gu\':\'cf\',\'X-1g-9D\':1g.9D,\'gs\':\'3Y/gr, 3Y/7D, 7V/6P, 3Y/6P, */*\'};E(C.1F==\'6S\'){5n[\'9o-1B\']=C.U.6R+(C.U.9C?\'; gq=\'+C.U.9C:\'\');E(C.1Z.ce&&(5e.5d.1f(/7H\\/(\\d{4})/)||[0,cd])[1]<cd)5n[\'gp\']=\'go\'}E(3Z C.U.cc==\'Y\'){G 64=C.U.cc;E(M.2w(64.1h))17(G i=0,O=64.O;i<O;i+=2)5n[64[i]]=64[i+1];1m $H(64).1E(q(1H){5n[1H.1w]=1H.I})}17(G 1e 1Q 5n)C.1Z.gn(1e,5n[1e])},5l:q(){G 4J=C.6O();o!4J||(4J>=gm&&4J<gl)},6O:q(){2s{o C.1Z.4J||0}2E(e){o 0}},9B:q(2N){G 6Q=1R.50.c8[2N],2y=1s 1R.9t(C);E(6Q==\'9u\'){2s{C.9A=1u;(C.U[\'5t\'+2y.4J]||C.U[\'5t\'+(C.5l()?\'gk\':\'gj\')]||1g.3q)(2y,2y.7W)}2E(e){C.5m(e)}G 6R=2y.61(\'9o-1B\');E(C.U.9z==\'c1\'||(C.U.9z&&C.7U()&&6R&&6R.1f(/^\\s*(3Y|7V)\\/(x-)?(gh|gg)4S(;.*)?\\s*$/i)))C.ca()}2s{(C.U[\'5t\'+6Q]||1g.3q)(2y,2y.7W);1R.63.7X(\'5t\'+6Q,C,2y,2y.7W)}2E(e){C.5m(e)}E(6Q==\'9u\'){C.1Z.77=1g.3q}},7U:q(){G m=C.2U.1f(/^\\s*gf?:\\/\\/[^\\/]*/);o!m||(m[0]==\'#{9y}//#{9x}#{7Y}\'.cb({9y:7h.9y,9x:1b.9x,7Y:7h.7Y?\':\'+7h.7Y:\'\'}))},61:q(1e){2s{o C.1Z.9r(1e)||1k}2E(e){o 1k}},ca:q(){2s{o 7u((C.1Z.3c||\'\').9w())}2E(e){C.5m(e)}},5m:q(9v){(C.U.c9||1g.3q)(C,9v);1R.63.7X(\'c9\',C,9v)}});1R.50.c8=[\'ge\',\'gd\',\'gc\',\'gb\',\'9u\'];1R.9t=2b.2p({2I:q(2Q){C.2Q=2Q;G 1Z=C.1Z=2Q.1Z,2N=C.2N=1Z.2N;E((2N>2&&!1g.1W.3X)||2N==4){C.4J=C.6O();C.9s=C.c6();C.3c=24.62(1Z.3c);C.7W=C.c5()}E(2N==4){G 6P=1Z.c7;C.c7=M.2D(6P)?1k:6P;C.ga=C.c2()}},4J:0,9s:\'\',6O:1R.50.1l.6O,c6:q(){2s{o C.1Z.9s||\'\'}2E(e){o\'\'}},61:1R.50.1l.61,g9:q(){2s{o C.9q()}2E(e){o 1k}},9r:q(1e){o C.1Z.9r(1e)},9q:q(){o C.1Z.9q()},c5:q(){G 3l=C.61(\'X-c4\');E(!3l)o 1k;3l=9p(c3(3l));2s{o 3l.60(C.2Q.U.c0||!C.2Q.7U())}2E(e){C.2Q.5m(e)}},c2:q(){G U=C.2Q.U;E(!U.60||(U.60!=\'c1\'&&!(C.61(\'9o-1B\')||\'\').1J(\'7V/3l\'))||C.3c.4O())o 1k;2s{o C.3c.60(U.c0||!C.2Q.7U())}2E(e){C.2Q.5m(e)}}});1R.bW=2b.2p(1R.50,{2I:q($4d,3C,2U,U){C.3C={5l:(3C.5l||3C),9n:(3C.9n||(3C.5l?1k:3C))};U=M.2A(U);G 3S=U.3S;U.3S=(q(2y,3l){C.bZ(2y.3c);E(M.2w(3S))3S(2y,3l)}).1L(C);$4d(2U,U)},bZ:q(3c){G 5Z=C.3C[C.5l()?\'5l\':\'9n\'],U=C.U;E(!U.59)3c=3c.4h();E(5Z=$(5Z)){E(U.5k){E(M.3f(U.5k)){G 5k={};5k[U.5k]=3c;5Z.3o(5k)}1m U.5k(5Z,3c)}1m 5Z.5a(3c)}}});1R.g8=2b.2p(1R.9m,{2I:q($4d,3C,2U,U){$4d(U);C.3S=C.U.3S;C.4c=(C.U.4c||2);C.5j=(C.U.5j||1);C.9k={};C.3C=3C;C.2U=2U;C.4l()},4l:q(){C.U.3S=C.bY.1L(C);C.6N()},8p:q(){C.9k.U.3S=4z;g7(C.3W);(C.3S||1g.3q).3R(C,1p)},bY:q(2y){E(C.U.5j){C.5j=(2y.3c==C.bX?C.5j*C.U.5j:1);C.bX=2y.3c}C.3W=C.6N.1L(C).9l(C.5j*C.4c)},6N:q(){C.9k=1s 1R.bW(C.3C,C.2U,C.U)}});q $(k){E(1p.O>1){17(G i=0,1V=[],O=1p.O;i<O;i++)1V.1h($(1p[i]));o 1V}E(M.3f(k))k=1b.g6(k);o J.15(k)}E(1g.3U.72){1b.8a=q(1t,71){G V=[];G 9j=1b.2S(1t,$(71)||1b,1k,g5.g4,1k);17(G i=0,O=9j.g3;i<O;i++)V.1h(J.15(9j.g2(i)));o V}}E(!1A.6o)G 6o={};E(!6o.bV){M.15(6o,{bV:1,g1:2,au:3,g0:4,fZ:5,fY:6,fX:7,fW:8,fV:9,fU:10,fT:11,fS:12})}(q(){G k=C.J;C.J=q(1a,2l){2l=2l||{};1a=1a.2e();G 2P=J.2P;E(1g.1W.3X&&2l.1e){1a=\'<\'+1a+\' 1e="\'+2l.1e+\'">\';8R 2l.1e;o J.6M(1b.43(1a),2l)}E(!2P[1a])2P[1a]=J.15(1b.43(1a));o J.6M(2P[1a].fR(1r),2l)};M.15(C.J,k||{})}).8m(1A);J.2P={};J.1d={99:q(k){o $(k).14.3p!=\'7L\'},aa:q(k){k=$(k);J[J.99(k)?\'bU\':\'bT\'](k);o k},bU:q(k){$(k).14.3p=\'7L\';o k},bT:q(k){$(k).14.3p=\'\';o k},a1:q(k){k=$(k);k.1O.6I(k);o k},5a:q(k,18){k=$(k);E(18&&18.3s)18=18.3s();E(M.4j(18))o k.5a().3o(18);18=M.4i(18);k.4C=18.4h();18.59.1L(18).4s();o k},1Y:q(k,18){k=$(k);E(18&&18.3s)18=18.3s();1m E(!M.4j(18)){18=M.4i(18);G 9i=k.fQ.fP();9i.fO(k);18.59.1L(18).4s();18=9i.fN(18.4h())}k.1O.8Z(18,k);o k},3o:q(k,3Q){k=$(k);E(M.3f(3Q)||M.53(3Q)||M.4j(3Q)||(3Q&&(3Q.3s||3Q.4i)))3Q={4Q:3Q};G 18,3o,1a,3g;17(G 1v 1Q 3Q){18=3Q[1v];1v=1v.2e();3o=J.5M[1v];E(18&&18.3s)18=18.3s();E(M.4j(18)){3o(k,18);3G}18=M.4i(18);1a=((1v==\'4R\'||1v==\'75\')?k.1O:k).1a.2R();3g=J.7F(1a,18.4h());E(1v==\'2i\'||1v==\'75\')3g.4e();3g.1E(3o.7T(k));18.59.1L(18).4s()}o k},5g:q(k,1K,2l){k=$(k);E(M.4j(1K))$(1K).6M(2l||{});1m E(M.3f(1K))1K=1s J(1K,2l);1m 1K=1s J(\'1T\',1K);E(k.1O)k.1O.8Z(1K,k);1K.5O(k);o 1K},2C:q(k){k=$(k);G 1q=\'<\'+k.1a.2e();$H({\'1o\':\'1o\',\'1j\':\'6e\'}).1E(q(1H){G 1y=1H.3K(),1U=1H.2u();G I=(k[1y]||\'\').2H();E(I)1q+=\' \'+1U+\'=\'+I.2C(1u)});o 1q+\'>\'},7S:q(k,1y){k=$(k);G 1V=[];1P(k=k[1y])E(k.3r==1)1V.1h(J.15(k));o 1V},5x:q(k){o $(k).7S(\'1O\')},bR:q(k){o $(k).2z("*")},bS:q(k){k=$(k).5D;1P(k&&k.3r!=1)k=k.3M;o $(k)},br:q(k){E(!(k=$(k).5D))o[];1P(k&&k.3r!=1)k=k.3M;E(k)o[k].20($(k).4E());o[]},5Y:q(k){o $(k).7S(\'aY\')},4E:q(k){o $(k).7S(\'3M\')},fM:q(k){k=$(k);o k.5Y().4e().20(k.4E())},1f:q(k,41){E(M.3f(41))41=1s 19(41);o 41.1f($(k))},fL:q(k,1t,1i){k=$(k);E(1p.O==1)o $(k.1O);G 5x=k.5x();o M.53(1t)?5x[1t]:19.5w(5x,1t,1i)},fK:q(k,1t,1i){k=$(k);E(1p.O==1)o k.bS();o M.53(1t)?k.bR()[1t]:k.2z(1t)[1i||0]},fJ:q(k,1t,1i){k=$(k);E(1p.O==1)o $(19.25.6x(k));G 5Y=k.5Y();o M.53(1t)?5Y[1t]:19.5w(5Y,1t,1i)},6B:q(k,1t,1i){k=$(k);E(1p.O==1)o $(19.25.6w(k));G 4E=k.4E();o M.53(1t)?4E[1t]:19.5w(4E,1t,1i)},2z:q(){G 21=$A(1p),k=$(21.5i());o 19.7o(k,21)},55:q(){G 21=$A(1p),k=$(21.5i());o 19.7o(k.1O,21).6b(k)},bt:q(k){k=$(k);G 1o=k.51(\'1o\'),5J=1p.5v;E(1o)o 1o;do{1o=\'fI\'+5J.bs++}1P($(1o));k.6M(\'1o\',1o);o 1o},51:q(k,1e){k=$(k);E(1g.1W.3X){G t=J.3O.7I;E(t.1S[1e])o t.1S[1e](k,1e);E(t.3A[1e])1e=t.3A[1e];E(1e.1J(\':\')){o(!k.2l||!k.2l[1e])?1k:k.2l[1e].I}}o k.91(1e)},6M:q(k,1e,I){k=$(k);G 2l={},t=J.3O.6l;E(3Z 1e==\'Y\')2l=1e;1m 2l[1e]=M.2D(I)?1u:I;17(G 29 1Q 2l){1e=t.3A[29]||29;I=2l[29];E(t.1S[29])1e=t.1S[29](k,I);E(I===1r||I===1k)k.8D(1e);1m E(I===1u)k.bQ(1e,1e);1m k.bQ(1e,I)}o k},b5:q(k){o $(k).5I().3a},b6:q(k){o $(k).5I().2g},6d:q(k){o 1s J.6Z(k)},7s:q(k,1j){E(!(k=$(k)))o;G 7R=k.1j;o(7R.O>0&&(7R==1j||1s 4k("(^|\\\\s)"+1j+"(\\\\s|$)").2L(7R)))},bO:q(k,1j){E(!(k=$(k)))o;E(!k.7s(1j))k.1j+=(k.1j?\' \':\'\')+1j;o k},bP:q(k,1j){E(!(k=$(k)))o;k.1j=k.1j.1Y(1s 4k("(^|\\\\s+)"+1j+"(\\\\s+|$)"),\' \').3T();o k},fH:q(k,1j){E(!(k=$(k)))o;o k[k.7s(1j)?\'bP\':\'bO\'](1j)},fG:q(k){k=$(k);G L=k.5D;1P(L){G bN=L.3M;E(L.3r==3&&!/\\S/.2L(L.4f))k.6I(L);L=bN}o k},5E:q(k){o $(k).4C.4O()},76:q(k,3b){k=$(k),3b=$(3b);G bL=3b;E(k.bM)o(k.bM(3b)&8)===8;E(k.6L&&!1g.1W.58){G e=k.6L,a=3b.6L,5X=3b.3M;E(!5X){do{3b=3b.1O}1P(!(5X=3b.3M)&&3b.1O)}E(5X&&5X.6L)o(e>a&&e<5X.6L)}1P(k=k.1O)E(k==bL)o 1u;o 1r},bK:q(k){k=$(k);G 5W=k.4P();1A.bK(5W[0],5W[1]);o k},2a:q(k,14){k=$(k);14=14==\'97\'?\'7N\':14.95();G I=k.14[14];E(!I){G 9h=1b.fF.fE(k,1k);I=9h?9h[14]:1k}E(14==\'3P\')o I?5R(I):1.0;o I==\'7M\'?1k:I},fD:q(k){o $(k).2a(\'3P\')},5S:q(k,4I){k=$(k);G 9g=k.14,1f;E(M.3f(4I)){k.14.90+=\';\'+4I;o 4I.1J(\'3P\')?k.5Q(4I.1f(/3P:\\s*(\\d?\\.?\\d*)/)[1]):k}17(G 1y 1Q 4I)E(1y==\'3P\')k.5Q(4I[1y]);1m 9g[(1y==\'97\'||1y==\'7N\')?(M.2D(9g.96)?\'7N\':\'96\'):1y]=4I[1y];o k},5Q:q(k,I){k=$(k);k.14.3P=(I==1||I===\'\')?\'\':(I<0.7G)?0:I;o k},5I:q(k){k=$(k);G 3p=$(k).2a(\'3p\');E(3p!=\'7L\'&&3p!=1k)o{2g:k.5q,3a:k.5r};G 44=k.14;G bH=44.9f;G bI=44.1v;G bJ=44.3p;44.9f=\'7j\';44.1v=\'5P\';44.3p=\'fC\';G bG=k.bE;G bF=k.bD;44.3p=bJ;44.1v=bI;44.9f=bH;o{2g:bG,3a:bF}},fB:q(k){k=$(k);G 5W=J.2a(k,\'1v\');E(5W==\'5T\'||!5W){k.9d=1u;k.14.1v=\'6K\';E(1A.9e){k.14.2i=0;k.14.2x=0}}o k},fA:q(k){k=$(k);E(k.9d){k.9d=4z;k.14.1v=k.14.2i=k.14.2x=k.14.4Q=k.14.5U=\'\'}o k},fz:q(k){k=$(k);E(k.5h)o k;k.5h=J.2a(k,\'9c\')||\'7M\';E(k.5h!==\'7j\')k.14.9c=\'7j\';o k},fy:q(k){k=$(k);E(!k.5h)o k;k.14.9c=k.5h==\'7M\'?\'\':k.5h;k.5h=1k;o k},4P:q(k){G 2J=0,2K=0;do{2J+=k.5c||0;2K+=k.5b||0;k=k.3e}1P(k);o J.57(2K,2J)},6h:q(k){G 2J=0,2K=0;do{2J+=k.5c||0;2K+=k.5b||0;k=k.3e;E(k){E(k.1a==\'by\')2d;G p=J.2a(k,\'1v\');E(p!==\'5T\')2d}}1P(k);o J.57(2K,2J)},8g:q(k){k=$(k);E(k.2a(\'1v\')==\'5P\')o;G 9b=k.6h();G 2i=9b[1];G 2x=9b[0];G 2g=k.bE;G 3a=k.bD;k.bB=2x-5R(k.14.2x||0);k.bC=2i-5R(k.14.2i||0);k.bz=k.14.2g;k.bA=k.14.3a;k.14.1v=\'5P\';k.14.2i=2i+\'3i\';k.14.2x=2x+\'3i\';k.14.2g=2g+\'3i\';k.14.3a=3a+\'3i\';o k},8d:q(k){k=$(k);E(k.2a(\'1v\')==\'6K\')o;k.14.1v=\'6K\';G 2i=5R(k.14.2i||0)-(k.bC||0);G 2x=5R(k.14.2x||0)-(k.bB||0);k.14.2i=2i+\'3i\';k.14.2x=2x+\'3i\';k.14.3a=k.bA;k.14.2g=k.bz;o k},8c:q(k){G 2J=0,2K=0;do{2J+=k.4n||0;2K+=k.4p||0;k=k.1O}1P(k);o J.57(2K,2J)},5p:q(k){E(k.3e)o $(k.3e);E(k==1b.2q)o $(k);1P((k=k.1O)&&k!=1b.2q)E(J.2a(k,\'1v\')!=\'5T\')o $(k);o $(1b.2q)},6g:q(9a){G 2J=0,2K=0;G k=9a;do{2J+=k.5c||0;2K+=k.5b||0;E(k.3e==1b.2q&&J.2a(k,\'1v\')==\'5P\')2d}1P(k=k.3e);k=9a;do{E(!1g.1W.58||k.1a==\'by\'){2J-=k.4n||0;2K-=k.4p||0}}1P(k=k.1O);o J.57(2K,2J)},a3:q(k,22){G U=M.15({bx:1u,bw:1u,bv:1u,bu:1u,5c:0,5b:0},1p[2]||{});22=$(22);G p=22.6g();k=$(k);G 5V=[0,0];G 2T=1k;E(J.2a(k,\'1v\')==\'5P\'){2T=k.5p();5V=2T.6g()}E(2T==1b.2q){5V[0]-=1b.2q.5b;5V[1]-=1b.2q.5c}E(U.bx)k.14.2x=(p[0]-5V[0]+U.5b)+\'3i\';E(U.bw)k.14.2i=(p[1]-5V[1]+U.5c)+\'3i\';E(U.bv)k.14.2g=22.5q+\'3i\';E(U.bu)k.14.3a=22.5r+\'3i\';o k}};J.1d.bt.bs=1;M.15(J.1d,{fx:J.1d.2z,fw:J.1d.br});J.3O={6l:{3A:{1j:\'6e\',bo:\'17\'},1S:{}}};E(1g.1W.58){J.1d.2a=J.1d.2a.5g(q(3j,k,14){5y(14){2r\'2x\':2r\'2i\':2r\'5U\':2r\'4Q\':E(3j(k,\'1v\')===\'5T\')o 1k;2r\'3a\':2r\'2g\':E(!J.99(k))o 1k;G 7O=bq(3j(k,14),10);E(7O!==k[\'2V\'+14.6F()])o 7O+\'3i\';G 3k;E(14===\'3a\'){3k=[\'7P-2i-2g\',\'7Q-2i\',\'7Q-4Q\',\'7P-4Q-2g\']}1m{3k=[\'7P-2x-2g\',\'7Q-2x\',\'7Q-5U\',\'7P-5U-2g\']}o 3k.3H(7O,q(2O,1y){G 98=3j(k,1y);o 98===1k?2O:2O-bq(98,10)})+\'3i\';6p:o 3j(k,14)}});J.1d.51=J.1d.51.5g(q(3j,k,1U){E(1U===\'7K\')o k.7K;o 3j(k,1U)})}1m E(1g.1W.3X){J.1d.5p=J.1d.5p.5g(q(3j,k){k=$(k);G 1v=k.2a(\'1v\');E(1v!==\'5T\')o 3j(k);k.5S({1v:\'6K\'});G I=3j(k);k.5S({1v:1v});o I});$w(\'6h 6g\').1E(q(1F){J.1d[1F]=J.1d[1F].5g(q(3j,k){k=$(k);G 1v=k.2a(\'1v\');E(1v!==\'5T\')o 3j(k);G 3e=k.5p();E(3e&&3e.2a(\'1v\')===\'fv\')3e.5S({94:1});k.5S({1v:\'6K\'});G I=3j(k);k.5S({1v:1v});o I})});J.1d.2a=q(k,14){k=$(k);14=(14==\'97\'||14==\'7N\')?\'96\':14.95();G I=k.14[14];E(!I&&k.5f)I=k.5f[14];E(14==\'3P\'){E(I=(k.2a(\'2h\')||\'\').1f(/92\\(3P=(.*)\\)/))E(I[1])o 5R(I[1])/bp;o 1.0}E(I==\'7M\'){E((14==\'2g\'||14==\'3a\')&&(k.2a(\'3p\')!=\'7L\'))o k[\'2V\'+14.6F()]+\'3i\';o 1k}o I};J.1d.5Q=q(k,I){q 93(2h){o 2h.1Y(/92\\([^\\)]*\\)/gi,\'\')}k=$(k);G 5f=k.5f;E((5f&&!5f.fu)||(!5f&&k.14.94==\'ft\'))k.14.94=1;G 2h=k.2a(\'2h\'),14=k.14;E(I==1||I===\'\'){(2h=93(2h))?14.2h=2h:14.8D(\'2h\');o k}1m E(I<0.7G)I=0;14.2h=93(2h)+\'92(3P=\'+(I*bp)+\')\';o k};J.3O={7I:{3A:{\'6e\':\'1j\',\'17\':\'bo\'},1S:{7J:q(k,1U){o k.91(1U,2)},bn:q(k,1U){G L=k.bj(1U);o L?L.I:""},2k:q(k,1U){1U=k.91(1U);o 1U?1U.2H().3B(23,-2):1k},6J:q(k,1U){o $(k).3I(1U)?1U:1k},14:q(k){o k.14.90.2e()},7K:q(k){o k.7K}}}};J.3O.6l={3A:M.15({fs:\'fr\',fq:\'fp\'},J.3O.7I.3A),1S:{3J:q(k,I){k.3J=!!I},14:q(k,I){k.14.90=I?I:\'\'}}};J.3O.8X={};$w(\'fo fn fm fl fk 7i \'+\'fj fi fh fg\').1E(q(29){J.3O.6l.3A[29.2e()]=29;J.3O.8X[29.2e()]=29});(q(v){M.15(v,{aI:v.7J,ad:v.7J,1B:v.7J,5B:v.bn,3u:v.6J,3J:v.6J,ff:v.6J,fe:v.6J,fd:v.2k,ao:v.2k,fc:v.2k,fb:v.2k,fa:v.2k,f9:v.2k,f8:v.2k,f7:v.2k,f6:v.2k,f5:v.2k,f4:v.2k,f3:v.2k,f2:v.2k,f1:v.2k,f0:v.2k,eZ:v.2k,eY:v.2k,eX:v.2k})})(J.3O.7I.1S)}1m E(1g.1W.7H&&/eW:1\\.8\\.0/.2L(5e.5d)){J.1d.5Q=q(k,I){k=$(k);k.14.3P=(I==1)?0.eV:(I===\'\')?\'\':(I<0.7G)?0:I;o k}}1m E(1g.1W.4u){J.1d.5Q=q(k,I){k=$(k);k.14.3P=(I==1||I===\'\')?\'\':(I<0.7G)?0:I;E(I==1)E(k.1a==\'bf\'&&k.2g){k.2g++;k.2g--}1m 2s{G n=1b.bm(\' \');k.5O(n);k.6I(n)}2E(e){}o k};J.1d.4P=q(k){G 2J=0,2K=0;do{2J+=k.5c||0;2K+=k.5b||0;E(k.3e==1b.2q)E(J.2a(k,\'1v\')==\'5P\')2d;k=k.3e}1P(k);o J.57(2K,2J)}}E(1g.1W.3X||1g.1W.58){J.1d.5a=q(k,18){k=$(k);E(18&&18.3s)18=18.3s();E(M.4j(18))o k.5a().3o(18);18=M.4i(18);G 1a=k.1a.2R();E(1a 1Q J.5M.4G){$A(k.3g).1E(q(L){k.6I(L)});J.7F(1a,18.4h()).1E(q(L){k.5O(L)})}1m k.4C=18.4h();18.59.1L(18).4s();o k}}E(\'bl\'1Q 1b.43(\'1T\')){J.1d.1Y=q(k,18){k=$(k);E(18&&18.3s)18=18.3s();E(M.4j(18)){k.1O.8Z(18,k);o k}18=M.4i(18);G 2T=k.1O,1a=2T.1a.2R();E(J.5M.4G[1a]){G 3M=k.6B();G 8Y=J.7F(1a,18.4h());2T.6I(k);E(3M)8Y.1E(q(L){2T.7C(L,3M)});1m 8Y.1E(q(L){2T.5O(L)})}1m k.bl=18.4h();18.59.1L(18).4s();o k}}J.57=q(l,t){G 1q=[l,t];1q.2x=l;1q.2i=t;o 1q};J.7F=q(1a,7D){G 1T=1s J(\'1T\'),t=J.5M.4G[1a];E(t){1T.4C=t[0]+7D+t[1];t[2].7E(q(){1T=1T.5D})}1m 1T.4C=7D;o $A(1T.3g)};J.5M={4R:q(k,L){k.1O.7C(L,k)},2i:q(k,L){k.7C(L,k.5D)},4Q:q(k,L){k.5O(L)},75:q(k,L){k.1O.7C(L,k.3M)},4G:{eU:[\'<4H>\',\'</4H>\',1],7z:[\'<4H><5N>\',\'</5N></4H>\',2],bb:[\'<4H><5N><7B>\',\'</7B></5N></4H>\',3],8V:[\'<4H><5N><7B><bk>\',\'</bk></7B></5N></4H>\',4],bi:[\'<2z>\',\'</2z>\',1]}};(q(){M.15(C.4G,{bd:C.4G.7z,bc:C.4G.7z,ba:C.4G.8V})}).8m(J.5M);J.1d.7y={3I:q(k,1U){1U=J.3O.8X[1U]||1U;G L=$(k).bj(1U);o L&&L.eT}};J.1d.3z={};M.15(J,J.1d);E(!1g.3U.6H&&1b.43(\'1T\').4U){1A.6G={};1A.6G.1l=1b.43(\'1T\').4U;1g.3U.6H=1u}J.15=(q(){E(1g.3U.7x)o 1g.K;G 1d={},3z=J.1d.3z;G 15=M.15(q(k){E(!k||k.7c||k.3r!=1||k==1A)o k;G 2B=M.2A(1d),1a=k.1a,1y,I;E(3z[1a])M.15(2B,3z[1a]);17(1y 1Q 2B){I=2B[1y];E(M.2w(I)&&!(1y 1Q k))k[1y]=I.4v()}k.7c=1g.3q;o k},{7v:q(){E(!1g.3U.6H){M.15(1d,J.1d);M.15(1d,J.1d.7y)}}});15.7v();o 15})();J.3I=q(k,1U){E(k.3I)o k.3I(1U);o J.1d.7y.3I(k,1U)};J.6a=q(2B){G F=1g.3U,T=J.1d.3z;E(!2B){M.15(1C,1C.1d);M.15(1C.J,1C.J.1d);M.15(J.1d.3z,{"eS":M.2A(1C.1d),"eR":M.2A(1C.J.1d),"bi":M.2A(1C.J.1d),"bh":M.2A(1C.J.1d)})}E(1p.O==2){G 1a=2B;2B=1p[1]}E(!1a)M.15(J.1d,2B||{});1m{E(M.4x(1a))1a.1E(15);1m 15(1a)}q 15(1a){1a=1a.2R();E(!J.1d.3z[1a])J.1d.3z[1a]={};M.15(J.1d.3z[1a],2B)}q 7w(2B,5L,7A){7A=7A||1r;17(G 1y 1Q 2B){G I=2B[1y];E(!M.2w(I))3G;E(!7A||!(1y 1Q 5L))5L[1y]=I.4v()}}q b8(1a){G 1N;G 8U={"eQ":"eP","bh":"eO","P":"eN","eM":"eL","eK":"eJ","eI":"eH","eG":"eF","eE":"eD","eC":"5K","eB":"5K","eA":"5K","ez":"5K","ey":"5K","ex":"5K","Q":"ew","ev":"bg","eu":"bg","A":"et","bf":"es","er":"eq","ep":"be","eo":"be","bd":"8W","bc":"8W","7z":"8W","bb":"em","ba":"b9","8V":"b9","el":"ek","ej":"ei"};E(8U[1a])1N=\'8T\'+8U[1a]+\'J\';E(1A[1N])o 1A[1N];1N=\'8T\'+1a+\'J\';E(1A[1N])o 1A[1N];1N=\'8T\'+1a.6F()+\'J\';E(1A[1N])o 1A[1N];1A[1N]={};1A[1N].1l=1b.43(1a).4U;o 1A[1N]}E(F.6H){7w(J.1d,6G.1l);7w(J.1d.7y,6G.1l,1u)}E(F.7x){17(G 8S 1Q J.1d.3z){G 1N=b8(8S);E(M.2D(1N))3G;7w(T[8S],1N.1l)}}M.15(J,J.1d);8R J.3z;E(J.15.7v)J.15.7v();J.2P={}};1b.eh={5I:q(){G 8Q={};G B=1g.1W;$w(\'2g 3a\').1E(q(d){G D=d.6F();8Q[d]=(B.4u&&!1b.2S)?5J[\'eg\'+D]:(B.58)?1b.2q[\'b7\'+D]:1b.4o[\'b7\'+D]});o 8Q},b6:q(){o C.5I().2g},b5:q(){o C.5I().3a},ef:q(){o J.57(1A.a9||1b.4o.4p||1b.2q.4p,1A.a8||1b.4o.4n||1b.2q.4n)}};G 19=2b.2p({2I:q(1t){C.1t=1t.3T();C.b4()},b3:q(){E(!1g.3U.72)o 1r;G e=C.1t;E(1g.1W.4u&&(e.1J("-2t-1B")||e.1J(":5E")))o 1r;E((/(\\[[\\w-]*?:|:3J)/).2L(C.1t))o 1r;o 1u},b4:q(){E(C.b3())o C.b2();G e=C.1t,4g=19.6C,h=19.25,c=19.6D,3y,p,m;E(19.56[e]){C.3N=19.56[e];o}C.3N=["C.3N = q(1n) {","G r = 1n, h = 19.25, c = 1r, n;"];1P(e&&3y!=e&&(/\\S/).2L(e)){3y=e;17(G i 1Q 4g){p=4g[i];E(m=e.1f(p)){C.3N.1h(M.2w(c[i])?c[i](m):1s 32(c[i]).2S(m));e=e.1Y(m[0],\'\');2d}}}C.3N.1h("o h.8E(n);\\n}");7u(C.3N.2o(\'\\n\'));19.56[C.1t]=C.3N},b2:q(){G e=C.1t,4g=19.6C,x=19.2v,3y,m;E(19.56[e]){C.2v=19.56[e];o}C.3N=[\'.//*\'];1P(e&&3y!=e&&(/\\S/).2L(e)){3y=e;17(G i 1Q 4g){E(m=e.1f(4g[i])){C.3N.1h(M.2w(x[i])?x[i](m):1s 32(x[i]).2S(m));e=e.1Y(m[0],\'\');2d}}}C.2v=C.3N.2o(\'\');19.56[C.1t]=C.2v},7p:q(1n){1n=1n||1b;E(C.2v)o 1b.8a(C.2v,1n);o C.3N(1n)},1f:q(k){C.8P=[];G e=C.1t,4g=19.6C,as=19.8J;G 3y,p,m;1P(e&&3y!==e&&(/\\S/).2L(e)){3y=e;17(G i 1Q 4g){p=4g[i];E(m=e.1f(p)){E(as[i]){C.8P.1h([i,M.2A(m)]);e=e.1Y(m[0],\'\')}1m{o C.7p(1b).1J(k)}}}}G 1f=1u,1e,2j;17(G i=0,7t;7t=C.8P[i];i++){1e=7t[0],2j=7t[1];E(!19.8J[1e](k,2j)){1f=1r;2d}}o 1f},2H:q(){o C.1t},2C:q(){o"#<19:"+C.1t.2C()+">"}});M.15(19,{56:{},2v:{4D:"//*",1G:"/*",55:"/6E-4F::*[1]",6A:\'/6E-4F::*\',1a:q(m){E(m[1]==\'*\')o\'\';o"[b1-1e()=\'"+m[1].2e()+"\' 8O b1-1e()=\'"+m[1].2R()+"\']"},1j:"[6f(20(\' \', @6e, \' \'), \' #{1} \')]",1o:"[@1o=\'#{1}\']",5F:q(m){m[1]=m[1].2e();o 1s 32("[@#{1}]").2S(m)},29:q(m){m[1]=m[1].2e();m[3]=m[5]||m[6];o 1s 32(19.2v.6t[m[2]]).2S(m)},6y:q(m){G h=19.2v.2f[m[1]];E(!h)o\'\';E(M.2w(h))o h(m);o 1s 32(19.2v.2f[m[1]]).2S(m)},6t:{\'=\':"[@#{1}=\'#{3}\']",\'!=\':"[@#{1}!=\'#{3}\']",\'^=\':"[ee-b0(@#{1}, \'#{3}\')]",\'$=\':"[5H(@#{1}, (3h-O(@#{1}) - 3h-O(\'#{3}\') + 1))=\'#{3}\']",\'*=\':"[6f(@#{1}, \'#{3}\')]",\'~=\':"[6f(20(\' \', @#{1}, \' \'), \' #{3} \')]",\'|=\':"[6f(20(\'-\', @#{1}, \'-\'), \'-#{3}-\')]"},2f:{\'3K-1G\':\'[4B(8M-4F::*)]\',\'2u-1G\':\'[4B(6E-4F::*)]\',\'6v-1G\':\'[4B(8M-4F::* 8O 6E-4F::*)]\',\'5E\':"[3x(*) = 0 8L (3x(3Y()) = 0 8O ed(3Y(), \' \\t\\r\\n\', \'\') = \'\')]",\'3J\':"[@3J]",\'3u\':"[@3u]",\'aP\':"[4B(@3u)]",\'4B\':q(m){G e=m[6],p=19.6C,x=19.2v,3y,v;G 8N=[];1P(e&&3y!=e&&(/\\S/).2L(e)){3y=e;17(G i 1Q p){E(m=e.1f(p[i])){v=M.2w(x[i])?x[i](m):1s 32(x[i]).2S(m);8N.1h("("+v.5H(1,v.O-1)+")");e=e.1Y(m[0],\'\');2d}}}o"[4B("+8N.2o(" 8L ")+")]"},\'1X-1G\':q(m){o 19.2v.2f.1X("(3x(./8M-4F::*) + 1) ",m)},\'1X-2u-1G\':q(m){o 19.2v.2f.1X("(3x(./6E-4F::*) + 1) ",m)},\'1X-2t-1B\':q(m){o 19.2v.2f.1X("1v() ",m)},\'1X-2u-2t-1B\':q(m){o 19.2v.2f.1X("(2u() + 1 - 1v()) ",m)},\'3K-2t-1B\':q(m){m[6]="1";o 19.2v.2f[\'1X-2t-1B\'](m)},\'2u-2t-1B\':q(m){m[6]="1";o 19.2v.2f[\'1X-2u-2t-1B\'](m)},\'6v-2t-1B\':q(m){G p=19.2v.2f;o p[\'3K-2t-1B\'](m)+p[\'2u-2t-1B\'](m)},1X:q(5G,m){G 42,1I=m[6],8K;E(1I==\'aS\')1I=\'2n+0\';E(1I==\'aR\')1I=\'2n+1\';E(42=1I.1f(/^(\\d+)$/))o\'[\'+5G+"= "+42[1]+\']\';E(42=1I.1f(/^(-?\\d*)?n(([+-])(\\d+))?/)){E(42[1]=="-")42[1]=-1;G a=42[1]?54(42[1]):1;G b=42[2]?54(42[2]):0;8K="[((#{5G} - #{b}) ec #{a} = 0) 8L "+"((#{5G} - #{b}) 1T #{a} >= 0)]";o 1s 32(8K).2S({5G:5G,a:a,b:b})}}}},6D:{1a:\'n = h.1a(n, r, "#{1}", c);      c = 1r;\',1j:\'n = h.1j(n, r, "#{1}", c);    c = 1r;\',1o:\'n = h.1o(n, r, "#{1}", c);           c = 1r;\',5F:\'n = h.5F(n, r, "#{1}", c); c = 1r;\',29:q(m){m[3]=(m[5]||m[6]);o 1s 32(\'n = h.29(n, r, "#{1}", "#{3}", "#{2}", c); c = 1r;\').2S(m)},6y:q(m){E(m[6])m[6]=m[6].1Y(/"/g,\'\\\\"\');o 1s 32(\'n = h.6y(n, "#{1}", "#{6}", r, c); c = 1r;\').2S(m)},4D:\'c = "4D";\',1G:\'c = "1G";\',55:\'c = "55";\',6A:\'c = "6A";\'},6C:{6A:/^\\s*~\\s*/,1G:/^\\s*>\\s*/,55:/^\\s*\\+\\s*/,4D:/^\\s/,1a:/^\\s*(\\*|[\\w\\-]+)(\\b|$)?/,1o:/^#([\\w\\-\\*]+)(\\b|$)/,1j:/^\\.([\\w\\-\\*]+)(\\b|$)/,6y:/^:((3K|2u|1X|1X-2u|6v)(-1G|-2t-1B)|5E|3J|(en|eb)ea|4B)(\\((.*?)\\))?(\\b|$|(?=\\s|[:+~>]))/,5F:/^\\[([\\w]+)\\]/,29:/\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*(([\'"])([^\\4]*?)\\4|([^\'"][^\\]]*?)))?\\]/},8J:{1a:q(k,2j){o 2j[1].2R()==k.1a.2R()},1j:q(k,2j){o J.7s(k,2j[1])},1o:q(k,2j){o k.1o===2j[1]},5F:q(k,2j){o J.3I(k,2j[1])},29:q(k,2j){G 4f=J.51(k,2j[1]);o 4f&&19.6t[2j[2]](4f,2j[5]||2j[6])}},25:{20:q(a,b){17(G i=0,L;L=b[i];i++)a.1h(L);o a},7q:q(N){G aZ=1g.3q;17(G i=0,L;L=N[i];i++)L.3L=aZ;o N},52:q(N){17(G i=0,L;L=N[i];i++)L.3L=4z;o N},1i:q(1O,4e,6u){1O.3L=1g.3q;E(4e){17(G N=1O.3g,i=N.O-1,j=1;i>=0;i--){G L=N[i];E(L.3r==1&&(!6u||L.3L))L.7r=j++}}1m{17(G i=0,j=1,N=1O.3g;L=N[i];i++)E(L.3r==1&&(!6u||L.3L))L.7r=j++}},8E:q(N){E(N.O==0)o N;G V=[],n;17(G i=0,l=N.O;i<l;i++)E(!(n=N[i]).3L){n.3L=1g.3q;V.1h(J.15(n))}o 19.25.52(V)},4D:q(N){G h=19.25;17(G i=0,V=[],L;L=N[i];i++)h.20(V,L.4a(\'*\'));o V},1G:q(N){G h=19.25;17(G i=0,V=[],L;L=N[i];i++){17(G j=0,1G;1G=L.3g[j];j++)E(1G.3r==1&&1G.1a!=\'!\')V.1h(1G)}o V},55:q(N){17(G i=0,V=[],L;L=N[i];i++){G 6B=C.6w(L);E(6B)V.1h(6B)}o V},6A:q(N){G h=19.25;17(G i=0,V=[],L;L=N[i];i++)h.20(V,J.4E(L));o V},6w:q(L){1P(L=L.3M)E(L.3r==1)o L;o 1k},6x:q(L){1P(L=L.aY)E(L.3r==1)o L;o 1k},1a:q(N,1n,1a,26){G aX=1a.2R();G V=[],h=19.25;E(N){E(26){E(26=="4D"){17(G i=0,L;L=N[i];i++)h.20(V,L.4a(1a));o V}1m N=C[26](N);E(1a=="*")o N}17(G i=0,L;L=N[i];i++)E(L.1a.2R()===aX)V.1h(L);o V}1m o 1n.4a(1a)},1o:q(N,1n,1o,26){G 31=$(1o),h=19.25;E(!31)o[];E(!N&&1n==1b)o[31];E(N){E(26){E(26==\'1G\'){17(G i=0,L;L=N[i];i++)E(31.1O==L)o[31]}1m E(26==\'4D\'){17(G i=0,L;L=N[i];i++)E(J.76(31,L))o[31]}1m E(26==\'55\'){17(G i=0,L;L=N[i];i++)E(19.25.6x(31)==L)o[31]}1m N=h[26](N)}17(G i=0,L;L=N[i];i++)E(L==31)o[31];o[]}o(31&&J.76(31,1n))?[31]:[]},1j:q(N,1n,1j,26){E(N&&26)N=C[26](N);o 19.25.aW(N,1n,1j)},aW:q(N,1n,1j){E(!N)N=19.25.4D([1n]);G aV=\' \'+1j+\' \';17(G i=0,V=[],L,6z;L=N[i];i++){6z=L.1j;E(6z.O==0)3G;E(6z==1j||(\' \'+6z+\' \').1J(aV))V.1h(L)}o V},5F:q(N,1n,29,26){E(!N)N=1n.4a("*");E(N&&26)N=C[26](N);G V=[];17(G i=0,L;L=N[i];i++)E(J.3I(L,29))V.1h(L);o V},29:q(N,1n,29,I,aU,26){E(!N)N=1n.4a("*");E(N&&26)N=C[26](N);G 2c=19.6t[aU],V=[];17(G i=0,L;L=N[i];i++){G 4f=J.51(L,29);E(4f===1k)3G;E(2c(4f,I))V.1h(L)}o V},6y:q(N,1e,I,1n,26){E(N&&26)N=C[26](N);E(!N)N=1n.4a("*");o 19.2f[1e](N,I,1n)}},2f:{\'3K-1G\':q(N,I,1n){17(G i=0,V=[],L;L=N[i];i++){E(19.25.6x(L))3G;V.1h(L)}o V},\'2u-1G\':q(N,I,1n){17(G i=0,V=[],L;L=N[i];i++){E(19.25.6w(L))3G;V.1h(L)}o V},\'6v-1G\':q(N,I,1n){G h=19.25;17(G i=0,V=[],L;L=N[i];i++)E(!h.6x(L)&&!h.6w(L))V.1h(L);o V},\'1X-1G\':q(N,1I,1n){o 19.2f.1X(N,1I,1n)},\'1X-2u-1G\':q(N,1I,1n){o 19.2f.1X(N,1I,1n,1u)},\'1X-2t-1B\':q(N,1I,1n){o 19.2f.1X(N,1I,1n,1r,1u)},\'1X-2u-2t-1B\':q(N,1I,1n){o 19.2f.1X(N,1I,1n,1u,1u)},\'3K-2t-1B\':q(N,1I,1n){o 19.2f.1X(N,"1",1n,1r,1u)},\'2u-2t-1B\':q(N,1I,1n){o 19.2f.1X(N,"1",1n,1u,1u)},\'6v-2t-1B\':q(N,1I,1n){G p=19.2f;o p[\'2u-2t-1B\'](p[\'3K-2t-1B\'](N,1I,1n),1I,1n)},aQ:q(a,b,aT){E(a==0)o b>0?[b]:[];o $R(1,aT).3H([],q(2O,i){E(0==(i-b)%a&&(i-b)/a>=0)2O.1h(i);o 2O})},1X:q(N,1I,1n,4e,6u){E(N.O==0)o[];E(1I==\'aS\')1I=\'2n+0\';E(1I==\'aR\')1I=\'2n+1\';G h=19.25,V=[],8H=[],m;h.7q(N);17(G i=0,L;L=N[i];i++){E(!L.1O.3L){h.1i(L.1O,4e,6u);8H.1h(L.1O)}}E(1I.1f(/^\\d+$/)){1I=54(1I);17(G i=0,L;L=N[i];i++)E(L.7r==1I)V.1h(L)}1m E(m=1I.1f(/^(-?\\d*)?n(([+-])(\\d+))?/)){E(m[1]=="-")m[1]=-1;G a=m[1]?54(m[1]):1;G b=m[2]?54(m[2]):0;G 8I=19.2f.aQ(a,b,N.O);17(G i=0,L,l=8I.O;L=N[i];i++){17(G j=0;j<l;j++)E(L.7r==8I[j])V.1h(L)}}h.52(N);h.52(8H);o V},\'5E\':q(N,I,1n){17(G i=0,V=[],L;L=N[i];i++){E(L.1a==\'!\'||(L.5D&&!L.4C.1f(/^\\s*$/)))3G;V.1h(L)}o V},\'4B\':q(N,41,1n){G h=19.25,e9,m;G 8G=1s 19(41).7p(1n);h.7q(8G);17(G i=0,V=[],L;L=N[i];i++)E(!L.3L)V.1h(L);h.52(8G);o V},\'aP\':q(N,I,1n){17(G i=0,V=[],L;L=N[i];i++)E(!L.3u)V.1h(L);o V},\'3u\':q(N,I,1n){17(G i=0,V=[],L;L=N[i];i++)E(L.3u)V.1h(L);o V},\'3J\':q(N,I,1n){17(G i=0,V=[],L;L=N[i];i++)E(L.3J)V.1h(L);o V}},6t:{\'=\':q(2Z,v){o 2Z==v},\'!=\':q(2Z,v){o 2Z!=v},\'^=\':q(2Z,v){o 2Z.8F(v)},\'$=\':q(2Z,v){o 2Z.aO(v)},\'*=\':q(2Z,v){o 2Z.1J(v)},\'~=\':q(2Z,v){o(\' \'+2Z+\' \').1J(\' \'+v+\' \')},\'|=\':q(2Z,v){o(\'-\'+2Z.2R()+\'-\').1J(\'-\'+v.2R()+\'-\')}},49:q(1t){G 4A=[];1t.aN(/(([\\w#:.~>+()\\s-]+|\\*|\\[.*?\\])+)\\s*(,|$)/,q(m){4A.1h(m[1].3T())});o 4A},aM:q(1V,1t){G 2j=$$(1t),h=19.25;h.7q(2j);17(G i=0,V=[],k;k=1V[i];i++)E(k.3L)V.1h(k);h.52(2j);o V},5w:q(1V,1t,1i){E(M.53(1t)){1i=1t;1t=1r}o 19.aM(1V,1t||\'*\')[1i||0]},7o:q(k,4A){4A=19.49(4A.2o(\',\'));G V=[],h=19.25;17(G i=0,l=4A.O,41;i<l;i++){41=1s 19(4A[i].3T());h.20(V,41.7p(k))}o(l>1)?h.8E(V):V}});E(1g.1W.3X){M.15(19.25,{20:q(a,b){17(G i=0,L;L=b[i];i++)E(L.1a!=="!")a.1h(L);o a},52:q(N){17(G i=0,L;L=N[i];i++)L.8D(\'3L\');o N}})}q $$(){o 19.7o(1b,$A(1p))}G 1C={8y:q(1x){$(1x).8y();o 1x},aL:q(1V,U){E(3Z U!=\'Y\')U={3w:!!U};1m E(M.2D(U.3w))U.3w=1u;G 1w,I,8C=1r,4Z=U.4Z;G 7n=1V.3H({},q(1q,k){E(!k.3u&&k.1e){1w=k.1e;I=$(k).2W();E(I!=1k&&(k.1B!=\'4Z\'||(!8C&&4Z!==1r&&(!4Z||1w==4Z)&&(8C=1u)))){E(1w 1Q 1q){E(!M.4x(1q[1w]))1q[1w]=[1q[1w]];1q[1w].1h(I)}1m 1q[1w]=I}}o 1q});o U.3w?7n:M.4r(7n)}};1C.1d={6q:q(1x,U){o 1C.aL(1C.5z(1x),U)},5z:q(1x){o $A($(1x).4a(\'*\')).3H([],q(1V,1G){E(1C.J.5A[1G.1a.2e()])1V.1h(J.15(1G));o 1V})},e8:q(1x,7l,1e){1x=$(1x);G 7m=1x.4a(\'4y\');E(!7l&&!1e)o $A(7m).2M(J.15);17(G i=0,8B=[],O=7m.O;i<O;i++){G 4y=7m[i];E((7l&&4y.1B!=7l)||(1e&&4y.1e!=1e))3G;8B.1h(J.15(4y))}o 8B},8x:q(1x){1x=$(1x);1C.5z(1x).7k(\'8x\');o 1x},8w:q(1x){1x=$(1x);1C.5z(1x).7k(\'8w\');o 1x},aJ:q(1x){G 1V=$(1x).5z().5C(q(k){o\'7j\'!=k.1B&&!k.3u});G 8A=1V.5C(q(k){o k.3I(\'7i\')&&k.7i>=0}).aK(q(k){o k.7i}).3K();o 8A?8A:1V.8l(q(k){o[\'4y\',\'2z\',\'8v\'].1J(k.1a.2e())})},e7:q(1x){1x=$(1x);1x.aJ().aG();o 1x},2Q:q(1x,U){1x=$(1x),U=M.2A(U||{});G 2Y=U.3v,5B=1x.51(\'5B\')||\'\';E(5B.4O())5B=1A.7h.aI;U.3v=1x.6q(1u);E(2Y){E(M.3f(2Y))2Y=2Y.7g();M.15(U.3v,2Y)}E(1x.3I(\'1F\')&&!U.1F)U.1F=1x.1F;o 1s 1R.50(5B,U)}};1C.J={8z:q(k){$(k).8z();o k},2z:q(k){$(k).2z();o k}};1C.J.1d={6q:q(k){k=$(k);E(!k.3u&&k.1e){G I=k.2W();E(I!=4z){G 1H={};1H[k.1e]=I;o M.4r(1H)}}o\'\'},2W:q(k){k=$(k);G 1F=k.1a.2e();o 1C.J.5A[1F](k)},e6:q(k,I){k=$(k);G 1F=k.1a.2e();1C.J.5A[1F](k,I);o k},aH:q(k){$(k).I=\'\';o k},e5:q(k){o $(k).I!=\'\'},aG:q(k){k=$(k);2s{k.8z();E(k.2z&&(k.1a.2e()!=\'4y\'||![\'8q\',\'8y\',\'4Z\'].1J(k.1B)))k.2z()}2E(e){}o k},8x:q(k){k=$(k);k.e4();k.3u=1u;o k},8w:q(k){k=$(k);k.3u=1r;o k}};G e3=1C.J;G $F=1C.J.1d.2W;1C.J.5A={4y:q(k,I){5y(k.1B.2e()){2r\'ay\':2r\'ax\':o 1C.J.5A.aF(k,I);6p:o 1C.J.5A.8v(k,I)}},aF:q(k,I){E(M.2D(I))o k.3J?k.I:1k;1m k.3J=!!I},8v:q(k,I){E(M.2D(I))o k.I;1m k.I=I},2z:q(k,1i){E(M.2D(1i))o C[k.1B==\'2z-e2\'?\'aD\':\'aC\'](k);1m{G 3t,I,aE=!M.4x(1i);17(G i=0,O=k.O;i<O;i++){3t=k.U[i];I=C.7f(3t);E(aE){E(I==1i){3t.8u=1u;o}}1m 3t.8u=1i.1J(I)}}},aD:q(k){G 1i=k.e1;o 1i>=0?C.7f(k.U[1i]):1k},aC:q(k){G 1S,O=k.O;E(!O)o 1k;17(G i=0,1S=[];i<O;i++){G 3t=k.U[i];E(3t.8u)1S.1h(C.7f(3t))}o 1S},7f:q(3t){o J.15(3t).3I(\'I\')?3t.I:3t.3Y}};4Y.8s=2b.2p(aB,{2I:q($4d,k,4c,2X){$4d(2X,4c);C.k=$(k);C.4w=C.2W()},8t:q(){G I=C.2W();E(M.3f(C.4w)&&M.3f(I)?C.4w!=I:24(C.4w)!=24(I)){C.2X(C.k,I);C.4w=I}}});1C.J.aA=2b.2p(4Y.8s,{2W:q(){o 1C.J.2W(C.k)}});1C.aA=2b.2p(4Y.8s,{2W:q(){o 1C.6q(C.k)}});4Y.6r=2b.2p({2I:q(k,2X){C.k=$(k);C.2X=2X;C.4w=C.2W();E(C.k.1a.2e()==\'1x\')C.az();1m C.6s(C.k)},8r:q(){G I=C.2W();E(C.4w!=I){C.2X(C.k,I);C.4w=I}},az:q(){1C.5z(C.k).1E(C.6s,C)},6s:q(k){E(k.1B){5y(k.1B.2e()){2r\'ay\':2r\'ax\':1D.4t(k,\'e0\',C.8r.1L(C));2d;6p:1D.4t(k,\'dZ\',C.8r.1L(C));2d}}}});1C.J.6r=2b.2p(4Y.6r,{2W:q(){o 1C.J.2W(C.k)}});1C.6r=2b.2p(4Y.6r,{2W:q(){o 1C.6q(C.k)}});E(!1A.1D)G 1D={};M.15(1D,{dY:8,dX:9,dW:13,dV:27,dU:37,dT:38,dS:39,dR:40,dQ:46,dP:36,dO:35,dN:33,dM:34,dL:45,2P:{},8o:q(1c){G k;5y(1c.1B){2r\'dK\':k=1c.dJ;2d;2r\'dI\':k=1c.3s;2d;6p:o 1k}o J.15(k)}});1D.1d=(q(){G 4W;E(1g.1W.3X){G aw={0:1,1:4,2:2};4W=q(1c,4X){o 1c.8q==aw[4X]}}1m E(1g.1W.4u){4W=q(1c,4X){5y(4X){2r 0:o 1c.7e==1&&!1c.av;2r 1:o 1c.7e==1&&1c.av;6p:o 1r}}}1m{4W=q(1c,4X){o 1c.7e?(1c.7e===4X+1):(1c.8q===4X)}}o{dH:q(1c){o 4W(1c,0)},dG:q(1c){o 4W(1c,1)},dF:q(1c){o 4W(1c,2)},k:q(1c){G L=1D.15(1c).73;o J.15(L.3r==6o.au?L.1O:L)},5w:q(1c,1t){G k=1D.k(1c);E(!1t)o k;G 1V=[k].20(k.5x());o 19.5w(1V,1t,0)},4V:q(1c){o{x:1c.aq||(1c.dE+(1b.4o.4p||1b.2q.4p)),y:1c.ap||(1c.dD+(1b.4o.4n||1b.2q.4n))}},dC:q(1c){o 1D.4V(1c).x},dB:q(1c){o 1D.4V(1c).y},8p:q(1c){1D.15(1c);1c.ar();1c.at();1c.dA=1u}}})();1D.15=(q(){G 2B=M.4b(1D.1d).3H({},q(m,1e){m[1e]=1D.1d[1e].4v();o m});E(1g.1W.3X){M.15(2B,{at:q(){C.dz=1u},ar:q(){C.7d=1r},2C:q(){o"[Y 1D]"}});o q(1c){E(!1c)o 1r;E(1c.7c)o 1c;1c.7c=1g.3q;G 4V=1D.4V(1c);M.15(1c,{73:1c.dy,8o:1D.8o(1c),aq:4V.x,ap:4V.y});o M.15(1c,2B)}}1m{1D.1l=1D.1l||1b.6n("aj").4U;M.15(1D.1l,2B);o 1g.K}})();M.15(1D,(q(){G 2P=1D.2P;q 8k(k){E(k.8n)o k.8n[0];1p.5v.1o=1p.5v.1o||1;o k.8n=[++1p.5v.1o]}q 8j(1z){E(1z&&1z.1J(\':\'))o"ai";o 1z}q 79(1o){o 2P[1o]=2P[1o]||{}}q 7a(1o,1z){G c=79(1o);o c[1z]=c[1z]||[]}q am(k,1z,2c){G 1o=8k(k);G c=7a(1o,1z);E(c.5u("2c").1J(2c))o 1r;G 1K=q(1c){E(!1D||!1D.15||(1c.1z&&1c.1z!=1z))o 1r;1D.15(1c);2c.8m(k,1c)};1K.2c=2c;c.1h(1K);o 1K}q 8i(1o,1z,2c){G c=7a(1o,1z);o c.8l(q(1K){o 1K.2c==2c})}q ak(1o,1z,2c){G c=79(1o);E(!c[1z])o 1r;c[1z]=c[1z].6b(8i(1o,1z,2c))}q an(){17(G 1o 1Q 2P)17(G 1z 1Q 2P[1o])2P[1o][1z]=1k}E(1A.7b){1A.7b("ao",an)}o{4t:q(k,1z,2c){k=$(k);G 1e=8j(1z);G 1K=am(k,1z,2c);E(!1K)o k;E(k.78){k.78(1e,1K,1r)}1m{k.7b("5t"+1e,1K)}o k},4T:q(k,1z,2c){k=$(k);G 1o=8k(k),1e=8j(1z);E(!2c&&1z){7a(1o,1z).1E(q(1K){k.4T(1z,1K.2c)});o k}1m E(!1z){M.4b(79(1o)).1E(q(1z){k.4T(1z)});o k}G 1K=8i(1o,1z,2c);E(!1K)o k;E(k.al){k.al(1e,1K,1r)}1m{k.dx("5t"+1e,1K)}ak(1o,1z,2c);o k},5s:q(k,1z,2O){k=$(k);E(k==1b&&1b.6n&&!k.ah)k=1b.4o;G 1c;E(1b.6n){1c=1b.6n("aj");1c.dw("ai",1u,1u)}1m{1c=1b.dv();1c.ag="du"}1c.1z=1z;1c.2O=2O||{};E(1b.6n){k.ah(1c)}1m{k.dt(1c.ag,1c)}o 1D.15(1c)}}})());M.15(1D,1D.1d);J.6a({5s:1D.5s,4t:1D.4t,4T:1D.4T});M.15(1b,{5s:J.1d.5s.4v(),4t:J.1d.4t.4v(),4T:J.1d.4T.4v(),6m:1r});(q(){G 3W;q 6k(){E(1b.6m)o;E(3W)1A.af(3W);1b.5s("ds:6m");1b.6m=1u}E(1b.78){E(1g.1W.4u){3W=1A.ae(q(){E(/6m|ab/.2L(1b.2N))6k()},0);1D.4t(1A,"dr",6k)}1m{1b.78("dq",6k,1r)}}1m{1b.6l("<4S 1o=ac 4s ad=//:><\\/4S>");$("ac").77=q(){E(C.2N=="ab"){C.77=1k;6k()}}}})();3V.4r=M.4r;G dp={3p:J.aa};J.1d.dn=J.1d.76;G dm={dl:q(k,18){o J.3o(k,{4R:18})},dk:q(k,18){o J.3o(k,{2i:18})},dj:q(k,18){o J.3o(k,{4Q:18})},di:q(k,18){o J.3o(k,{75:18})}};G $3G=1s dh(\'"4q $3G" dg df, de "o" dd\');G 8f={a7:1r,8e:q(){C.a5=1A.a9||1b.4o.4p||1b.2q.4p||0;C.a4=1A.a8||1b.4o.4n||1b.2q.4n||0},dc:q(k,x,y){E(C.a7)o C.a6(k,x,y);C.6i=x;C.6j=y;C.2V=J.4P(k);o(y>=C.2V[1]&&y<C.2V[1]+k.5r&&x>=C.2V[0]&&x<C.2V[0]+k.5q)},a6:q(k,x,y){G 8h=J.8c(k);C.6i=x+8h[0]-C.a5;C.6j=y+8h[1]-C.a4;C.2V=J.4P(k);o(C.6j>=C.2V[1]&&C.6j<C.2V[1]+k.5r&&C.6i>=C.2V[0]&&C.6i<C.2V[0]+k.5q)},db:q(74,k){E(!74)o 0;E(74==\'da\')o((C.2V[1]+k.5r)-C.6j)/k.5r;E(74==\'d9\')o((C.2V[0]+k.5q)-C.6i)/k.5q},4P:J.1d.4P,6h:J.1d.6h,8g:q(k){8f.8e();o J.8g(k)},8d:q(k){8f.8e();o J.8d(k)},d8:J.1d.8c,3e:J.1d.5p,d7:J.1d.6g,2A:q(22,73,U){U=U||{};o J.a3(73,22,U)}};E(!1b.70)1b.70=q(a2){q 8b(1e){o 1e.4O()?1k:"[6f(20(\' \', @6e, \' \'), \' "+1e+" \')]"}a2.70=1g.3U.72?q(k,1j){1j=1j.2H().3T();G 89=/\\s/.2L(1j)?$w(1j).2M(8b).2o(\'\'):8b(1j);o 89?1b.8a(\'.//*\'+89,k):[]}:q(k,1j){1j=1j.2H().3T();G 1V=[],6d=(/\\s/.2L(1j)?$w(1j):1k);E(!6d&&!1j)o 1V;G N=$(k).4a(\'*\');1j=\' \'+1j+\' \';17(G i=0,1G,cn;1G=N[i];i++){E(1G.1j&&(cn=\' \'+1G.1j+\' \')&&(cn.1J(1j)||(6d&&6d.88(q(1e){o!1e.2H().4O()&&cn.1J(\' \'+1e+\' \')}))))1V.1h(J.15(1G))}o 1V};o q(1j,71){o $(71||1b.2q).70(1j)}}(J.1d);J.6Z=2b.2p();J.6Z.1l={2I:q(k){C.k=$(k)},48:q(W){C.k.1j.49(/\\s+/).2z(q(1e){o 1e.O>0}).48(W)},6c:q(1j){C.k.1j=1j},d6:q(87){E(C.1J(87))o;C.6c($A(C).20(87).2o(\' \'))},a1:q(86){E(!C.1J(86))o;C.6c($A(C).6b(86).2o(\' \'))},2H:q(){o $A(C).2o(\' \')}};M.15(J.6Z.1l,2G);J.6a();',62,1095,'||||||||||||||||||||element||||return||function||||||||||||this||if||var||value|Element||node|Object|nodes|length||||||options|results|iterator||object||||||style|extend||for|content|Selector|tagName|document|event|Methods|name|match|Prototype|push|index|className|null|prototype|else|root|id|arguments|result|false|new|expression|true|position|key|form|property|eventName|window|type|Form|Event|each|method|child|pair|formula|include|wrapper|bind|context|klass|parentNode|while|in|Ajax|values|div|attribute|elements|Browser|nth|replace|transport|concat|args|source||String|handlers|combinator||pattern|attr|getStyle|Class|handler|break|toLowerCase|pseudos|width|filter|top|matches|_getEv|attributes|Array||join|create|body|case|try|of|last|xpath|isFunction|left|response|select|clone|methods|inspect|isUndefined|catch|array|Enumerable|toString|initialize|valueT|valueL|test|map|readyState|memo|cache|request|toUpperCase|evaluate|parent|url|offset|getValue|callback|params|nv||targetNode|Template||||||||height|ancestor|responseText|iterable|offsetParent|isString|childNodes|string|px|proceed|properties|json|gsub|__method|insert|display|emptyFunction|nodeType|toElement|opt|disabled|parameters|hash|count|le|ByTag|names|slice|container|toJSON|toArray|replacement|continue|inject|hasAttribute|checked|first|_countedByPrototype|nextSibling|matcher|_attributeTranslations|opacity|insertions|apply|onComplete|strip|BrowserFeatures|Hash|timer|IE|text|typeof||selector|mm|createElement|els|||indexOf|_each|split|getElementsByTagName|keys|frequency|super|reverse|nodeValue|ps|stripScripts|toHTML|isElement|RegExp|start|responder|scrollTop|documentElement|scrollLeft|throw|toQueryString|defer|observe|WebKit|methodize|lastValue|isArray|input|undefined|expressions|not|innerHTML|descendant|nextSiblings|sibling|tags|table|styles|status|_object|toPaddedString|number|parts|blank|cumulativeOffset|bottom|before|script|stopObserving|__proto__|pointer|isButton|code|Abstract|submit|Request|readAttribute|unmark|isNumber|Number|adjacent|_cache|_returnOffset|Opera|evalScripts|update|offsetLeft|offsetTop|userAgent|navigator|currentStyle|wrap|_overflow|shift|decay|insertion|success|dispatchException|headers|end|getOffsetParent|offsetWidth|offsetHeight|fire|on|pluck|callee|findElement|ancestors|switch|getElements|Serializers|action|findAll|firstChild|empty|attrPresence|fragment|substring|getDimensions|self|Heading|destination|_insertionTranslations|tbody|appendChild|absolute|setOpacity|parseFloat|setStyle|static|right|delta|pos|nextAncestor|previousSiblings|receiver|evalJSON|getHeader|interpret|Responders|extras|exclusive|item|template|str|truncation|addMethods|without|set|classNames|class|contains|viewportOffset|positionedOffset|xcomp|ycomp|fireContentLoadedEvent|write|loaded|createEvent|Node|default|serialize|EventObserver|registerCallback|operators|ofType|only|nextElementSibling|previousElementSibling|pseudo|nodeClassName|laterSibling|next|patterns|criteria|following|capitalize|HTMLElement|ElementExtensions|removeChild|_flag|relative|sourceIndex|writeAttribute|onTimerEvent|getStatus|xml|state|contentType|post|_|toObject|responders|fillWith|ctx|expr|ClassNames|getElementsByClassName|parentElement|XPath|target|mode|after|descendantOf|onreadystatechange|addEventListener|getCacheForID|getWrappersForEventName|attachEvent|_extendedByPrototype|returnValue|which|optionValue|toQueryParams|location|tabIndex|hidden|invoke|typeName|inputs|data|findChildElements|findElements|mark|nodeIndex|hasClassName|token|eval|refresh|copy|SpecificElementExtensions|Simulated|TBODY|onlyIfAbsent|tr|insertBefore|html|times|_getContentFromAnonymousElement|00001|Gecko|read|_getAttr|title|none|auto|cssFloat|dim|border|padding|elementClassName|recursivelyCollect|curry|isSameOrigin|application|headerJSON|dispatch|port|asynchronous|onCreate|detect|escapeHTML|charAt|ScriptFragment|currentlyExecuting|classNameToRemove|classNameToAdd|all|cond|_getElementsByXPath|iter|cumulativeScrollOffset|relativize|prepare|Position|absolutize|offsetcache|findWrapper|getDOMEventName|getEventID|find|call|_prototypeEventID|relatedTarget|stop|button|onElementEvent|TimedObserver|execute|selected|textarea|enable|disable|reset|focus|firstByIndex|matchingInputs|submitted|removeAttribute|unique|startsWith|exclusions|indexed|indices|assertions|predicate|and|preceding|exclusion|or|tokens|dimensions|delete|tag|HTML|trans|TD|TableSection|has|fragments|replaceChild|cssText|getAttribute|alpha|stripAlpha|zoom|camelize|styleFloat|float|val|visible|forElement|offsets|overflow|_madePositioned|opera|visibility|elementStyle|css|range|query|updater|delay|Base|failure|Content|decodeURIComponent|getAllResponseHeaders|getResponseHeader|statusText|Response|Complete|exception|unfilterJSON|domain|protocol|evalJS|_complete|respondToReadyState|encoding|Version|onStateChange|get|isHash|activeRequestCount|succ|toTemplateReplacements|toQueryPair|lastIndexOf|_reverse|collect|falses|trues|found|slices|prepareReplacement|escapedString|character|camelized|len|Function|_methodized|superclass|subclass|remove|instanceMethods|clonePosition|deltaY|deltaX|withinIncludingScrolloffsets|includeScrollOffsets|pageYOffset|pageXOffset|toggle|complete|__onDOMContentLoaded|src|setInterval|clearInterval|eventType|dispatchEvent|dataavailable|HTMLEvents|destroyWrapper|removeEventListener|createWrapper|destroyCache|onunload|pageY|pageX|preventDefault||stopPropagation|TEXT_NODE|metaKey|buttonMap|radio|checkbox|registerFormCallbacks|Observer|PeriodicalExecuter|selectMany|selectOne|single|inputSelector|activate|clear|href|findFirstElement|sortBy|serializeElements|matchElements|scan|endsWith|enabled|getIndices|odd|even|total|operator|needle|byClassName|uTagName|previousSibling|_true|with|local|compileXPathMatcher|shouldUseXPath|compileMatcher|getHeight|getWidth|client|findDOMClass|TableCell|TH|TR|TFOOT|THEAD|TableCol|IMG|Mod|TEXTAREA|SELECT|getAttributeNode|td|outerHTML|createTextNode|_getAttrNode|htmlFor|100|parseInt|immediateDescendants|counter|identify|setHeight|setWidth|setTop|setLeft|BODY|_originalWidth|_originalHeight|_originalLeft|_originalTop|clientHeight|clientWidth|originalHeight|originalWidth|originalVisibility|originalPosition|originalDisplay|scrollTo|originalAncestor|compareDocumentPosition|nextNode|addClassName|removeClassName|setAttribute|descendants|firstDescendant|show|hide|ELEMENT_NODE|Updater|lastText|updateComplete|updateContent|sanitizeJSON|force|_getResponseJSON|escape|JSON|_getHeaderJSON|getStatusText|responseXML|Events|onException|evalResponse|interpolate|requestHeaders|2005|overrideMimeType|XMLHttpRequest|setRequestHeaders|KHTML|Safari|getTransport|register|XMLHTTP|ActiveXObject||these|Try|ObjectRange|from|encodeURIComponent|radix|arrayLength|forEach|size|uniq|sorted|inline|flatten|any|collections|eachSlice|Pattern|exec|comp|lt|amp|unescapeHTML|isJSON|sanitize|JSONFilter|sub|useDoubleQuotes|charCodeAt|specialChar|separator|stripTags|extractScripts|matchOne|scriptTag|matchAll|img|1000|lambda|timeout|argumentNames|instanceof|valueOf|subclasses|MobileSafari|add|page|realOffset|horizontal|vertical|overlap|within|instead|use|deprecated|is|Error|After|Bottom|Top|Before|Insertion|childOf||Toggle|DOMContentLoaded|load|dom|fireEvent|ondataavailable|createEventObject|initEvent|detachEvent|srcElement|cancelBubble|stopped|pointerY|pointerX|clientY|clientX|isRightClick|isMiddleClick|isLeftClick|mouseout|fromElement|mouseover|KEY_INSERT|KEY_PAGEDOWN|KEY_PAGEUP|KEY_END|KEY_HOME|KEY_DELETE|KEY_DOWN|KEY_RIGHT|KEY_UP|KEY_LEFT|KEY_ESC|KEY_RETURN|KEY_TAB|KEY_BACKSPACE|change|click|selectedIndex|one|Field|blur|present|setValue|focusFirstElement|getInputs|selectorType|abled|dis|mod|translate|starts|getScrollOffsets|inner|viewport|IFrame|IFRAME|FrameSet|FRAMESET|TableRow||COLGROUP|COL|TableCaption|CAPTION|Image|Anchor|DEL|INS|Quote|H6|H5|H4|H3|H2|H1|Directory|DIR|DList|DL|OList|OL|UList|UL|FieldSet|FIELDSET|Paragraph|TextArea|OptGroup|OPTGROUP|INPUT|FORM|specified|TABLE|999999|rv|onchange|onselect|onreset|onsubmit|onkeyup|onkeydown|onkeypress|onblur|onfocus|onmouseout|onmousemove|onmouseover|onmouseup|onmousedown|ondblclick|onclick|onload|multiple|readonly|longDesc|readOnly|maxLength|encType|accessKey|dateTime|vAlign|rowSpan|colSpan|cellSpacing|cellspacing|cellPadding|cellpadding|normal|hasLayout|fixed|childElements|getElementsBySelector|undoClipping|makeClipping|undoPositioned|makePositioned|block|getOpacity|getComputedStyle|defaultView|cleanWhitespace|toggleClassName|anonymous_element_|previous|down|up|siblings|createContextualFragment|selectNode|createRange|ownerDocument|cloneNode|NOTATION_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_NODE|COMMENT_NODE|PROCESSING_INSTRUCTION_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|CDATA_SECTION_NODE|ATTRIBUTE_NODE|snapshotItem|snapshotLength|ORDERED_NODE_SNAPSHOT_TYPE|XPathResult|getElementById|clearTimeout|PeriodicalUpdater|getAllHeaders|responseJSON|Interactive|Loaded|Loading|Uninitialized|https|ecma|java||Failure|Success|300|200|setRequestHeader|close|Connection|charset|javascript|Accept||With|Requested|send|postBody|open|Konqueror|_method|UTF|urlencoded|www|unregister|Microsoft|Msxml2|merge|unset|Math|floor|ceil|round|abs|isFinite|toColorPart|isNaN|intersect|reduce|compact|NodeList|some|every|entries|member|pop|zip|sort|reject|partition|min|max|inGroupsOf|grep|parseQuery|formed|Badly|SyntaxError|Eaeflnr|u00|x1f|x00|dasherize|underscore|fromCharCode|im|truncate|finally|getUTCSeconds|getUTCMinutes|getUTCHours|getUTCDate|getUTCMonth|getUTCFullYear|Date|01|setTimeout|bindAsEventListener|splice|boolean|unknown|RangeError|constructor|secure|Mobile|Apple|AppleWebKit'.split('|'),0,{}))
\ No newline at end of file
diff --git a/tools/qtestlib/chart/benchmark_template.html b/tools/qtestlib/chart/benchmark_template.html
deleted file mode 100644
index a7e48be..0000000
--- a/tools/qtestlib/chart/benchmark_template.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-	<head>
-		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-		<title>Title</title>
-        <! Javascript Here>
-	
-        	<script type="text/javascript">
-
-function offsetLabels(labels, offset)
-{
-    var copy = new Array();
-    for (key in labels) {
-        copy[key] = new Array(labels[key][0] + 0.25, labels[key][1]);
-    }
-    return copy;
-}
-
-function createLogDataSet(inDataSet)
-{
-    var logDataSet  = {};
-    logDataSet.label = inDataSet.label;
-    logDataSet.data = [];
-
-    if (!inDataSet.data)
-        return logDataSet;
-
-    var length = inDataSet.data.length;
-    
-    for (var i = 0; i < length; i++) {
-        logDataSet.data[i] = [];
-        logDataSet.data[i][0] = inDataSet.data[i][0];
-        logDataSet.data[i][1] = Math.log(inDataSet.data[i][1]);
-    }
-    return logDataSet;
-}
-
-
-function createLogData(inData)
-{
-    var logData  = [];
-
-    // foreach data set;
-    var length = inData.length;
-    for (var i = 0; i < length; ++i) {
-        logData[i] = createLogDataSet(inData[i]);
-    }
-    return logData;
-}
-
-function createChart() {
-//    alert("create chart" + this.chartId)
-
-    var dataSet;
-
-    if (this.useLinearScale)
-        dataSet = this.selectedDataset;
-    else 
-        dataSet = createLogData(this.selectedDataset);
-
-    if (this.useLineChart) {
-        var f = Flotr.draw($(this.chartId), 
-            dataSet,
-            { legend:{ backgroundColor: '#D2E8FF' } 
-            , xaxis: { ticks: this.labels, noTicks : 10 }
-             , mouse: { 
-                 track: true,
-                 lineColor: 'purple',
-                 sensibility: 1, 
-                 trackDecimals: 2,
-                 trackFormatter: function(obj){ return 'x = ' + obj.x +', y = ' + obj.y; }
-	         }
-            });
-        
-    } else {
-        var f = Flotr.draw($(this.chartId), 
-            dataSet,
-            { legend:{ backgroundColor: '#D2E8FF'}
-            ,  bars: { show: true, lineWidth: 1, barWidth: this.barWidth } 
-            , xaxis: { ticks: offsetLabels(this.labels, chartOptions.tickOffset), noTicks : 10 }
-            });
-    }
-}
-
-function checkform()
-{
-//    alert("check form " + this.form.id + " " + this.chartId);    
-    var field = this.form.list
-
-    // Apparently list of lenght one is not a list...
-    // Display the entire chart if there is only one data series.
-    if (!field.length) {
-        this.createChart();    
-        return;
-    }
-
-    this.selectedDataset = [];
-    var data = [];
-    var index = 0;
-
-    for (i = 0; i < field.length; i++) {
-        if (field[i].checked == true) {
-            this.selectedDataset[index++] = this.dataset[i];
-        } else {
-            this.selectedDataset[index++] = [];
-        }
-    }
-    this.createChart();
-}
-
-function createElement(nodeName, name) {
-  var node;
-  try {
-    node = document.createElement("<"+nodeName+" name="+name+">");
-  } catch (e) {
-    node = document.createElement(nodeName);
-    node.name = name;
-  }
-  return node;
-}
-
-function createFormSelector(form, value, text, type)
-{
-  var selector = createElement('input', 'list');
-  selector.type = type;
-  selector.defaultChecked = true;
-  selector.value = value;
-
-  form.appendChild(selector);
-  form.appendChild(document.createTextNode(text));
-  form.appendChild(document.createElement("BR"));
-}
-
-function createCheckBox(form, value, text)
-{
-    createFormSelector(form, value, text, "checkbox");
-}
-
-function createRadioButton(form, value, text)
-{
-    createFormSelector(form, value, text, "radio");
-}
-
-function buildSeriesSelector(form, chartOptions)
-{
-//    alert("form" + form.id + " " + chartOptions.chartId);
-    var series = chartOptions.seriesLabels;
-    form.onclick = function() { /*alert("fn " + chartOptions.chartId);*/ chartOptions.checkform() };
-    for (s = 0; s < series.length; ++s) {
-        createCheckBox(form, s, series[s]);
-    }
-}
-
-function buildChartTypeSelector()
-{
-    createRadioButton(this.chartTypeForm, 0, "Bar Chart");
-    createRadioButton(this.chartTypeForm, 1, "Line Chart");
-    
-    var field = this.chartTypeForm.list;
-    if (this.useLineChart)
-        field[1].checked = true;
-    else
-        field[0].checked = true;
-
-    var chartOptions = this;
-    this.chartTypeForm.onclick = function() { 
-        var field = chartOptions.chartTypeForm.list;
-
-        chartOptions.useLineChart = (field[1].checked == true);
-        chartOptions.checkform();
-    };
-}
-
-function buildScaleSelector()
-{
-    createRadioButton(this.scaleForm, 0, "Linear Scale");
-    createRadioButton(this.scaleForm, 1, "Logarithmic  Scale");
-    
-    var field = this.scaleForm.list;
-    field[0].checked = true;
-    field[1].checked = false;
-
-    var chartOptions = this;
-    this.scaleForm.onclick = function() { 
-        var field = chartOptions.scaleForm.list;
-
-        chartOptions.useLinearScale = (field[0].checked == true);
-        chartOptions.checkform();
-    };
-}
-
-
-		</script>
-	</head>
-	<body>
-        <h2>
-        <! Title Here>
-        </h2>
-        <! Description Here>
-        <! Chart Here>
-	</body>
-</html>
diff --git a/tools/qtestlib/chart/chart.pro b/tools/qtestlib/chart/chart.pro
deleted file mode 100644
index 7328e5d..0000000
--- a/tools/qtestlib/chart/chart.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-HEADERS += $$PWD/database.h  $$PWD/reportgenerator.h 
-SOURCES += $$PWD/database.cpp  $$PWD/reportgenerator.cpp 
-SOURCES += main.cpp
-RESOURCES = $$PWD/chart.qrc
-
-QT += sql xml
-CONFIG += console
-CONFIG -= app_bundle
-
-
-TEMPLATE = app
-DEPENDPATH += .
-INCLUDEPATH += .
-TARGET = chart
-
-
diff --git a/tools/qtestlib/chart/chart.qrc b/tools/qtestlib/chart/chart.qrc
deleted file mode 100644
index 90f782e..0000000
--- a/tools/qtestlib/chart/chart.qrc
+++ /dev/null
@@ -1,9 +0,0 @@
- <!DOCTYPE RCC><RCC version="1.0">
- <qresource>
-     <file>chart_template.html</file>
-     <file>benchmark_template.html</file>
-     <file>3rdparty/excanvas.js</file>
-     <file>3rdparty/flotr.js</file>
-     <file>3rdparty/prototype.js</file>
- </qresource>
- </RCC> 
\ No newline at end of file
diff --git a/tools/qtestlib/chart/chart_template.html b/tools/qtestlib/chart/chart_template.html
deleted file mode 100644
index 0a4b81a..0000000
--- a/tools/qtestlib/chart/chart_template.html
+++ /dev/null
@@ -1,110 +0,0 @@
-		<div>
-			<h3>
-			<! Test Name Here>
-			</h3>
-			<div id=
-                <! Chart ID Here>
-             style="width:900px;height:350px;"></div>
-
-            <table cellspacing = "10"><tr>
-            
-            <td valign = "top">
-            <form id=
-                <! Form ID Here>
-            <b> Data series </b><br>
-            </form>
-            </td>
-
-            <td valign = "top">
-            <form id=
-                <! ChartTypeForm ID Here>
-            <b> Chart Type </b><br>
-            </form>
-            </td>
-
-            <td valign = "top">
-            <form id=
-                <! ScaleForm ID Here>
-            <b> Scale </b><br>
-            </form>
-            </td>
-
-            </tr></table>
-
-     	</div>
-		<script type="text/javascript">
-            var chartId = 
-            <! Chart ID Here>
-            ;
-
-            var chartType = 
-            <! Chart Type Here>
-            ;
-
-           var seriesLabels = 
-           <! Series Labels Here>
-
-			var dataset = [];
-			<! Data Goes Here>
-
-            var labels = [
-                <! Labels Go Here>
-            ];
-            
-            var colors = new Hash({
-                <! ColorScheme Here>
-            });
-
-            var shouldFill = 
-           <! Fill Setting Here>
-           ;
-
-           var form = document.getElementById(
-           <! Form ID Here>
-           );
-
-           var chartTypeForm = document.getElementById(
-           <! ChartTypeForm ID Here>
-           );
-
-           var scaleForm = document.getElementById(
-           <! ScaleForm ID Here>
-           );
-
-
-
-           var chartOptions = new Object();
-           chartOptions.chartId = chartId;
-           chartOptions.chartType = chartType;
-           chartOptions.dataset = dataset;
-           chartOptions.colors = colors;
-           chartOptions.shouldFill = shouldFill;
-           chartOptions.labels = labels;
-           chartOptions.seriesLabels = seriesLabels;
-           chartOptions.useLineChart = true;
-           chartOptions.useLinearScale = true;
-           chartOptions.createChart = createChart;
-
-           chartOptions.ticks = labels;
-           chartOptions.barWidth = 0.5;
-           chartOptions.tickOffset = 0.25;
-
-           chartOptions.useLineChart = 
-                <! Use Line Chart Here>
-
-           chartOptions.chartTypeForm = chartTypeForm;
-           chartOptions.buildChartTypeSelector = buildChartTypeSelector;
-           chartOptions.buildChartTypeSelector();
-
-           chartOptions.scaleForm = scaleForm;
-           chartOptions.buildScaleSelector = buildScaleSelector;
-           chartOptions.buildScaleSelector();
-
-           chartOptions.selectedDataset = dataset;
-           chartOptions.checkform = checkform;
-           chartOptions.form = form;
-           chartOptions.buildSeriesSelector = buildSeriesSelector;
-           chartOptions.buildSeriesSelector(form, chartOptions);
-           chartOptions.checkform();
-		</script>
-
diff --git a/tools/qtestlib/chart/database.cpp b/tools/qtestlib/chart/database.cpp
deleted file mode 100644
index dfc0fc5..0000000
--- a/tools/qtestlib/chart/database.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights.  These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "database.h"
-#include <QtGui>
-#include <QtXml>
-
-// Database schema definition and open/create functions
-
-QString resultsTable = QString("(TestName varchar, TestCaseName varchar, Series varchar, Idx varchar, ") + 
-                       QString("Result varchar, ChartType varchar, Title varchar, ChartWidth varchar, ") + 
-                       QString("ChartHeight varchar, TestTitle varchar, QtVersion varchar, Iterations varchar") +
-                       QString(")");
-
-void execQuery(QSqlQuery query, bool warnOnFail)
-{
-    bool ok = query.exec();
-    if (!ok && warnOnFail) {
-        qDebug() << "FAIL:" << query.lastQuery() << query.lastError().text();
-    }
-}
-
-void execQuery(const QString &spec, bool warnOnFail)
-{
-    QSqlQuery query;
-    query.prepare(spec);
-    execQuery(query, warnOnFail);
-}
-
-QSqlDatabase openDataBase(const QString &databaseFile)
-{
-//    qDebug() << "open data base";
-    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
-    db.setDatabaseName(databaseFile);
-    bool ok = db.open(); 
-    if (!ok)
-        qDebug() << "FAIL: could not open database";
-    return db;
-}
-
-QSqlDatabase createDataBase(const QString &databaseFile)
-{
-//    qDebug() << "create data base";
-    QSqlDatabase db = openDataBase(databaseFile);
-
-    execQuery("DROP TABLE Results", false);
-    execQuery("CREATE TABLE Results " + resultsTable);
-
-    return db;
-}
-
-struct Tag
-{
-    Tag(QString key, QString value)
-    : key(key.trimmed()), value(value.trimmed())
-    {
-    
-    }
-
-    QString key;
-    QString value;
-};
-
-QList<Tag> parseTag(const QString &tag)
-{
-    // Format: key1=value ; key2=value
-    //         key1=value key2=value
-    //         value--value
-    
-    QList<Tag> keyValues;
-
-    QString keyValuePairSeparator("");
-    if (tag.contains(";"))
-        keyValuePairSeparator = ';';
-    if (tag.contains("--"))
-        keyValuePairSeparator = "--";
-
-    foreach (QString keyValue, tag.split(keyValuePairSeparator)) {
-        if (keyValue.contains("=")) {
-            QStringList parts = keyValue.split("=");
-            keyValues.append(Tag(parts.at(0), parts.at(1)));
-        } else {
-            keyValues.append(Tag(QString(), keyValue)); // no key, just a value.
-        }
-    }
-
-    return keyValues;
-}
-
-void loadXml(const QStringList &fileNames)
-{
-    foreach(const QString &fileName, fileNames) {
-        QFileInfo fi( fileName );
-        loadXml(fileName, fi.fileName());
-    }
-}
-
-void loadXml(const QString &fileName, const QString &context)
-{
-    QFile f(fileName);
-    f.open(QIODevice::ReadOnly);
-    loadXml(f.readAll(), context);
-}
-
-void loadXml(const QByteArray &xml, const QString& context)
-{
-    QDomDocument doc;
-
-    int line;
-    int col;
-    QString errorMsg;
-    if (doc.setContent(xml, &errorMsg, &line, &col) == false) {
-        qDebug() << "dom setContent failed" << line << col << errorMsg;
-    }
-    
-    // Grab "Value" from <Environment><QtVersion>Value</QtVersion></Environment>
-    QString qtVersion = doc.elementsByTagName("Environment").at(0).toElement().elementsByTagName("QtVersion")
-                        .at(0).toElement().childNodes().at(0).nodeValue();
-    QString testCase = doc.elementsByTagName("TestCase").at(0).toElement().attributeNode("name").value();
-        
-//    qDebug() << "qt version" << qtVersion;
-//    qDebug() << "test case" << testCase;
-
-    DataBaseWriter writer;
-    writer.testName = testCase; // testCaseName and testName is mixed up in the database writer class
-    writer.qtVersion = qtVersion;
-    
-    QDomNodeList testFunctions = doc.elementsByTagName("TestFunction");
-    for (int i = 0; i < testFunctions.count(); ++i) {
-        QDomElement function = testFunctions.at(i).toElement();
-        QString functionName = function.attributeNode("name").value();
-        writer.testCaseName = functionName; // testCaseName and testName is mixed up in the database writer class
-        
-//        qDebug() << "fn" << functionName;
-
-        QDomNodeList results = function.elementsByTagName("BenchmarkResult");
-        for (int j = 0; j < results.count(); ++j) {    
-            QDomElement result = results.at(j).toElement();
-            QString tag = result.attributeNode("tag").value();
-
-                Q_UNUSED(context);
-//            if (!context.isEmpty())
-//                tag += QString(" (%1)").arg(context);
-
-            QString series;
-            QString index;
-
-            // By convention, "--" separates series and indexes in tags.
-            if (tag.contains("--")) {
-                QStringList parts = tag.split("--");
-                series = parts.at(0);
-                index = parts.at(1);
-            } else {
-                series = tag;
-            }
-
-            QString resultString = result.attributeNode("value").value();
-            QString iterationCount = result.attributeNode("iterations").value();
-            double resultNumber = resultString.toDouble() / iterationCount.toDouble();
-            writer.addResult(series, index, QString::number(resultNumber), iterationCount);
-//            qDebug() << "result" << series  << index << tag << resultString << iterationCount;
-        }
-    }
-}
-
-void displayTable(const QString &table)
-{
-    QSqlTableModel *model = new QSqlTableModel();
-    model->setTable(table);
-    model->select();
-    QTableView *view = new QTableView();
-    view->setModel(model);
-    view->show();
-}
-
-void printDataBase()
-{
-   QSqlQuery query;
-   query.prepare("SELECT TestName, TestCaseName, Result FROM Results;");
-   bool ok  = query.exec(); 
-   qDebug() <<  "printDataBase ok?" <<  ok;
-
-   query.next();
-   qDebug() << "";
-   qDebug() << "Benchmark" << query.value(0).toString();
-   query.previous();
-
-   while (query.next()) {
-       //  QString country = query.value(fieldNo).toString();
-       //  doSomething(country);
-       qDebug() << "result for" << query.value(1).toString() << query.value(2).toString();
-   } 
-}
-
-// TempTable implementation
-
-static int tempTableIdentifier = 0;
-TempTable::TempTable(const QString &spec)
-{
-    m_name = "TempTable" + QString::number(tempTableIdentifier++);
-    execQuery("CREATE TEMP TABLE " + m_name + " " + spec);
-}
-
-TempTable::~TempTable()
-{
-    // ref count and drop it?
-}
-
-QString TempTable::name()
-{
-    return m_name;
-}
-
-// DataBaseWriter implementation
-
-DataBaseWriter::DataBaseWriter()
-{
-    disable = false;
-    chartSize = QSize(800, 400);
-    databaseFileName = ":memory:";
-    qtVersion = QT_VERSION_STR;
-}
-
-void DataBaseWriter::openDatabase()
-{
-    db = openDataBase(databaseFileName);
-}
-
-void DataBaseWriter::createDatabase()
-{
-    db = createDataBase(databaseFileName);
-}
-
-void DataBaseWriter::beginTransaction()
-{
-    if (db.transaction() == false) {
-        qDebug() << db.lastError();
-        qFatal("no transaction support");
-    }
-}
-
-void DataBaseWriter::commitTransaction()
-{
-    db.commit();
-}
-
-void DataBaseWriter::rollbackTransaction()
-{
-    db.rollback();
-}
-
-void DataBaseWriter::addResult(const QString &result)
-{
-	return addResult(QString(), QString(), result);
-}
-
-void DataBaseWriter::addResult(const QString &series, const QString &index, const QString &result, const QString &iterations)
-{
-    if (disable)
-        return;
-
-     QSqlQuery query;
-
-     query.prepare("INSERT INTO Results (TestName, TestCaseName, Series, Idx, Result, ChartWidth, ChartHeight, Title, TestTitle, ChartType, QtVersion, Iterations) "
-                    "VALUES (:TestName, :TestCaseName, :Series, :Idx, :Result, :ChartWidth, :ChartHeight, :Title, :TestTitle, :ChartType, :QtVersion, :Iterations)");
-     query.bindValue(":TestName", testName);
-     query.bindValue(":TestCaseName", testCaseName);
-     query.bindValue(":Series", series);
-     query.bindValue(":Idx", index);
-     query.bindValue(":Result", result);
-     query.bindValue(":ChartWidth", chartSize.width());
-     query.bindValue(":ChartHeight", chartSize.height());
-     query.bindValue(":Title", chartTitle);
-     query.bindValue(":TestTitle", testTitle);
-     query.bindValue(":QtVersion", qtVersion);
-     query.bindValue(":Iterations", iterations);
-
-
-    if (chartType == LineChart)
-        query.bindValue(":ChartType", "LineChart");
-    else
-        query.bindValue(":ChartType", "BarChart");
-    execQuery(query);
-}
diff --git a/tools/qtestlib/chart/database.h b/tools/qtestlib/chart/database.h
deleted file mode 100644
index d9861ad..0000000
--- a/tools/qtestlib/chart/database.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights.  These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef DATABASE_H
-#define DATABASE_H
-
-#include <QtCore>
-#include <QtSql>
-
-extern QString resultsTable;
-QSqlDatabase openDataBase(const QString &databaseFile = "database");
-QSqlDatabase createDataBase(const QString &databaseFile = "database");
-
-void loadXml(const QStringList &fileNames);
-void loadXml(const QString &fileName, const QString &context=QString::null);
-void loadXml(const QByteArray &xml, const QString &context=QString::null);
-
-void execQuery(QSqlQuery query, bool warnOnFail = true);
-void execQuery(const QString &spec, bool warnOnFail = true);
-void printDataBase();
-void displayTable(const QString &table);
-
-class TempTable
-{
-public:
-    TempTable(const QString &spec);
-    ~TempTable();
-    QString name();
-private:
-    QString m_name;
-};
-
-enum ChartType { BarChart, LineChart };
-class DataBaseWriter
-{
-public:
-    DataBaseWriter();
-    QString databaseFileName;
-    QString testTitle;
-    QString testName;
-    QString testCaseName;
-    ChartType chartType;
-    QSize chartSize;
-    QString chartTitle;
-    QString qtVersion;
-    bool disable;
-    
-    void openDatabase();
-    void createDatabase();
-
-    void beginTransaction();
-    void commitTransaction();
-    void rollbackTransaction();
-
-    void addResult(const QString &result);
-    void addResult(const QString &series , const QString &index, const QString &result, const QString &iterations = QLatin1String("1"));
-
-    QSqlDatabase db;
-};
-
-
-#endif
diff --git a/tools/qtestlib/chart/main.cpp b/tools/qtestlib/chart/main.cpp
deleted file mode 100644
index 14734d9..0000000
--- a/tools/qtestlib/chart/main.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights.  These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QtCore>
-#include <QtSql>
-#include <database.h>
-#include <reportgenerator.h>
- 
-int main(int argc, char **argv)
-{
-    QCoreApplication app(argc, argv);
-
-    QSqlDatabase db = createDataBase(":memory:");
-
-    if (argc < 2) {
-
-        // Try stdin
-        QFile in;
-        in.open(stdin, QIODevice::ReadOnly);
-        QByteArray xml = in.readAll();
-
-        if (xml.isEmpty()) {
-            qDebug() << "Usage: chart xml-file [xml-file2 xml-file3 ...]";
-            qDebug() << "See also QTestLib's \"-chart\" option";
-            return 0;
-        } else {
-            loadXml(xml, QString());
-        }
-    }
-
-    QStringList files;
-    for (int i = 1; i < argc; i++) {
-        QString file = QString::fromLocal8Bit(argv[i]);
-        files += file;
-    }
-
-    if (files.isEmpty() == false)
-        loadXml(files);
-
-    ReportGenerator reportGenerator;
-    reportGenerator.writeReports();
-
-    db.close();
-}
-
diff --git a/tools/qtestlib/chart/reportgenerator.cpp b/tools/qtestlib/chart/reportgenerator.cpp
deleted file mode 100644
index 1ce362c..0000000
--- a/tools/qtestlib/chart/reportgenerator.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights.  These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "reportgenerator.h"
-
-// Report generator file utility functions
-
-QList<QByteArray> readLines(const QString &fileName)
-{
-    QList<QByteArray> lines;
-    QFile f(fileName);
-    f.open(QIODevice::ReadOnly | QIODevice::Text);
-    while(!f.atEnd())
-       lines.append(f.readLine());
-    return lines;
-}
-
-void writeLines(const QString &fileName, const QList<QByteArray> &lines)
-{
-    QFile f(fileName);
-    f.open(QIODevice::WriteOnly | QIODevice::Text);
-    foreach(const QByteArray line, lines)
-       f.write(line);
-}
-
-void writeFile(const QString &fileName, const QByteArray &contents)
-{
-    QFile f(fileName);
-    f.open(QIODevice::WriteOnly | QIODevice::Append);
-    f.write(contents);
-}
-
-// Report generator database utility functions
-
-QStringList select(const QString &field, const QString &tableName)
-{
-    QSqlQuery query;
-    query.prepare("SELECT DISTINCT " + field +" FROM " + tableName);
-    bool ok  = query.exec(); 
-    Q_UNUSED(ok);
-//    if (!ok)
-//        qDebug() << "select unique ok" << ok;
-
-    QStringList values;
-    while (query.next()) {
-        values += query.value(0).toString();
-    }
-    return values;
-}
-
-QStringList selectUnique(const QString &field, const QString &tableName)
-{
-    QSqlQuery query;
-    query.prepare("SELECT DISTINCT " + field +" FROM " + tableName);
-    bool ok  = query.exec(); 
-    Q_UNUSED(ok);
-//    if (!ok)
-//        qDebug() << "select unique ok" << ok;
-
-    QStringList values;
-    while (query.next()) {
-        values += query.value(0).toString();
-    }
-    return values;
-}
-
-QSqlQuery selectFromSeries(const QString &serie, const QString &column, const QString &tableName, const QString &seriesName)
-{
-    QSqlQuery query;
-    if (serie == QString())
-        query.prepare("SELECT " + column + " FROM " + tableName);
-    else
-        query.prepare("SELECT " + column + " FROM " + tableName + " WHERE " + seriesName + "='" + serie + "'");
-    /*bool ok  =*/ query.exec(); 
-    
-
-//    qDebug() <<  "selectDataFromSeries ok?" <<  ok << query.size();
-    return query;
-}
-
-int countDataFromSeries(const QString &serie, const QString &tableName, const QString &seriesName)
-{
-//    qDebug() << "count" << serie << "in" << tableName;
-    QSqlQuery query;
-    query.prepare("SELECT COUNT(Result) FROM " + tableName + " WHERE" + seriesName + "='" + serie + "'");
-    bool ok  = query.exec(); 
-    if (!ok) {
-        qDebug() << "query fail" << query.lastError();
-    }
-    
-    qDebug() <<  "countDataFromSeries ok?" <<  ok << query.size();
-    query.next();
-    return query.value(0).toInt();
-}
-
-// Report generator output utility functions
-
-QList<QByteArray> printData(const QString &tableName, const QString &seriesName, const QString &indexName)
-{
-    QList<QByteArray> output;
-    QStringList series = selectUnique(seriesName, tableName); 
-//    qDebug() << "series" << series;
-    if (series.isEmpty())
-        series+=QString();
-    
-    foreach (QString serie, series) {
-        QSqlQuery data = selectFromSeries(serie, "Result", tableName, seriesName);
-        QSqlQuery labels = selectFromSeries(serie, indexName, tableName, seriesName);
-
-        QByteArray dataLine = "dataset.push({ data: [";
-        int i = 0;
-        while (data.next() && labels.next()) {
-            QString label = labels.value(0).toString();
-
-            QString labelString;
-            bool ok;
-            label.toInt(&ok);
-            if (ok)
-                labelString = label;
-        //    else
-                labelString = QString::number(i);
-
-            dataLine += ("[" + labelString + ", " + data.value(0).toString() + "]");
-            
-            ++i;
-            if (data.next()) {
-                dataLine += ", ";
-                data.previous();
-            }
-        }
-        dataLine += "], label : \"" + serie + "\" });\n";
-        output.append(dataLine);
-    }
-    return output;
-}
-
-// Determines if a line chart should be used. Returns true if the first label is numerical.
-bool useLineChart(const QString &tableName, const QString &seriesName, const QString &indexName)
-{
-    QList<QByteArray> output;
-    QStringList series = selectUnique(seriesName, tableName);
-	if (series.isEmpty())
-		return false;
-
-    QSqlQuery data = selectFromSeries(series[0], indexName, tableName, seriesName);
-
-    if (data.next()) {
-        QString label = data.value(0).toString();
-        bool ok;
-        label.toDouble(&ok);
-        return ok;
-    }
-
-    return false;
-}
-
-int countLabels(const QString &tableName, const QString &seriesName, const QString &indexName)
-{
-    QStringList series = selectUnique(seriesName, tableName);
-        if (series.isEmpty())
-            return 0;
-    QSqlQuery data = selectFromSeries(series[0], indexName, tableName, seriesName);
-    int count = 0;
-    while (data.next())
-        count++;
-
-    return count;
-}
-
-
-QList<QByteArray> printLabels(const QString &tableName, const QString &seriesName, const QString &indexName)
-{
-    QList<QByteArray> output;
-    QStringList series = selectUnique(seriesName, tableName);
-	if (series.isEmpty())
-		return QList<QByteArray>();
-
-        QSqlQuery data = selectFromSeries(series[0], indexName, tableName, seriesName);
-
-        int count = 0;
-        while (data.next())
-            count++;
-
-        data.first(); data.previous();
-
-        const int labelCount = 10;
-        int skip = count / labelCount;
-       
-        QByteArray dataLine;
-        int i = 0;
-        while (data.next()) {
-            dataLine += ("[" + QByteArray::number(i) + ",\"" + data.value(0).toString() + "\"]");
-            ++i;
-            if (data.next()) {
-                dataLine += ", ";
-                data.previous();
-            }
-
-            // skip labels.
-            i += skip;
-            for (int j = 0; j < skip; ++j)
-                data.next();
-        }
-        dataLine += "\n";
-        output.append(dataLine);
-    return output;
-}
-
-QByteArray printSeriesLabels(const QString &tableName, const QString &seriesColumnName)
-{
-    QByteArray output;
-    QStringList series = selectUnique(seriesColumnName, tableName);
- 	if (series.isEmpty())
-        return "[];\n";
-
-    output += "[";
-    
-    foreach(const QString &serie, series) {
-        output += "\"" + serie.toLocal8Bit() + "\",";
-    }
-    output.chop(1); //remove last comma
-    output += "]\n";
-    return output;
-}
-
-void addJavascript(QList<QByteArray> *output, const QString &fileName)
-{
-    output->append("<script type=\"text/javascript\">\n");
-    (*output) += readLines(fileName);
-    output->append("</script>\n");
-}
-
-void addJavascript(QList<QByteArray> *output)
-{
-    addJavascript(output, ":3rdparty/prototype.js");
-    addJavascript(output, ":3rdparty/excanvas.js");
-    addJavascript(output, ":3rdparty/flotr.js");
-}
-
-TempTable selectRows(const QString &sourceTable, const QString &column, const QString &value)
-{
-    TempTable tempTable(resultsTable);
-    
-    QSqlQuery query;
-    query.prepare("INSERT INTO " + tempTable.name() + " SELECT * FROM " + sourceTable +
-                  " WHERE " + column + "='" + value + "'");
-    execQuery(query);
-    
-//    displayTable(tempTable.name());
-    
-    return tempTable;
-}
-
-TempTable mergeVersions(const QString &)
-{
-
-//  QtVersion - As series
-//  Result - (free)
-//  Idx - match
-//  TestName - match
-//  CaseName - match
-
-//  (Series - average)
-/*
-    TempTable tempTable(resultsTable);
-    QStringlist versions = selectUnique("QtVersions", sourceTable);
-
-    QSqlQuery oneVersion = select(WHERE QtVersions = versions.at(0))
-    while (oneVersion.next) {
-        QSqlQuery otherversions = selectMatches(QStringList() << "TestName" << "TestCaseName" << "Idx")
-        while (otherversions.next) {
-            insert(temptable
-        }
-    }
-*/
-    return TempTable("");
-}
-
-QStringList fieldPriorityList = QStringList() << "Idx" << "Series" << "QtVersion";
-
-struct IndexSeriesFields
-{
-    QString index;
-    QString series;
-};
-
-IndexSeriesFields selectFields(const QString &table)
-{
-    IndexSeriesFields fields;
-    foreach (QString field, fieldPriorityList) {
-//        qDebug() << "unique" << field << selectUnique(field, table).count();
-        QStringList rows = selectUnique(field, table);
-
-        if (rows.count() <= 1 && rows.join("") == QString(""))
-            continue;
-
-        if (fields.index.isEmpty()) {
-            fields.index = field;
-            continue;
-        }
-
-        if (fields.series.isEmpty()) {
-            fields.series = field;
-            break;
-        }
-    }
-    return fields;
-}
-
-TempTable selectTestCase(const QString &testCase, const QString &sourceTable)
-{
-    return selectRows(sourceTable, QLatin1String("TestCaseName"), testCase);
-}
-
-QString field(const QSqlQuery &query, const QString &name)
-{
-    return query.value(query.record().indexOf(name)).toString();
-}
-
-QSqlQuery selectAllResults(const QString &tableName)
-{
-    QSqlQuery query;
-    query.prepare("SELECT * FROM " + tableName);
-    execQuery(query);
-    return query;
-}
-
-void printTestCaseResults(const QString &testCaseName)
-{
-//    QStringList testCases = selectUnique("TestCaseName", "Results");
-    qDebug() << "";
-    qDebug() << "Results for benchmark" << testCaseName;
-    TempTable temptable = selectTestCase(testCaseName, "Results");
-    QSqlQuery query = selectAllResults(temptable.name());
-    if (query.isActive() == false) {
-        qDebug() << "No results";
-        return;
-    }
-    
-    query.next();
-
-    if (field(query, "Idx") == QString()) {
-        do {
-            qDebug() << "Result:" << field(query, "result");
-        } while (query.next());
-    } else if (field(query, "Series") == QString()) {
-        do {
-            qDebug() << field(query, "Idx") << " : " << field(query, "result");
-        } while (query.next());
-    } else {
-        do {
-            qDebug() << field(query, "Series") << " - " <<  field(query, "Idx") << " : " << field(query, "result");
-        } while (query.next());
-    }
-
-    qDebug() << "";
-}
-
-
-// ReportGenerator implementation
-
-ReportGenerator::ReportGenerator()
-{
-	m_colorScheme = QList<QByteArray>() << "#a03b3c" << "#3ba03a" << "#3a3ba0" << "#3aa09f" << "#39a06b" << "#a09f39";
-}
-
-
-void ReportGenerator::writeReport(const QString &tableName, const QString &fileName, bool combineQtVersions)
-{
-    QStringList testCases = selectUnique("TestCaseName", tableName);
-    QList<QByteArray> lines = readLines(":benchmark_template.html");
-    QList<QByteArray> output;
-
-    foreach(QByteArray line, lines) {
-        if (line.contains("<! Chart Here>")) {
-            foreach (const QString testCase, testCases) {
-                TempTable testCaseTable = selectTestCase(testCase, tableName);
-                output += writeChart(testCaseTable.name(), combineQtVersions);
-            }
-         } else if (line.contains("<! Title Here>")) {
-            QStringList name = selectUnique("TestName", tableName);
-            output += "Test: " + name.join("").toLocal8Bit();
-         } else if (line.contains("<! Description Here>")) {
-            output += selectUnique("TestTitle", tableName).join("").toLocal8Bit();
-        } else if (line.contains("<! Javascript Here>")){
-            addJavascript(&output);
-         } else {
-            output.append(line);
-        }
-    }
-
-    m_fileName = fileName;
-
-    writeLines(m_fileName, output);
-    qDebug() << "Wrote report to" << m_fileName;
-}
-
-void ReportGenerator::writeReports()
-{
-/*
-    QStringList versions = selectUnique("QtVersion", "Results");
-
- //   qDebug() << "versions" << versions;
-
-    foreach (QString version, versions) {
-        QString fileName = "results-"  + version  + ".html";
-        TempTable versionTable = selectRows("Results", "QtVersion", version);
-        writeReport(versionTable.name(), fileName, false);
-    }
-*/
-    writeReport("Results", "results.html", false);
-}
-
-QString ReportGenerator::fileName()
-{
-    return m_fileName;
-}
-
-QList<QByteArray> ReportGenerator::writeChart(const QString &tableName, bool combineQtVersions)
-{
-    QSqlQuery query;
-    query.prepare("SELECT TestName, Series, Idx, Result, ChartWidth, ChartHeight, Title, TestCaseName, ChartType, QtVersion FROM " + tableName);
-    execQuery(query);
-       
-    QString seriesName;
-    QString indexName;
-    
-    if (combineQtVersions) {
-        IndexSeriesFields fields = selectFields(tableName);
-        seriesName = fields.series;
-        indexName = fields.index;
-    } else {
-        seriesName = "Series";
-        indexName = "Idx";
-    }
-
-    QList<QByteArray> data = printData(tableName, seriesName, indexName);
-    QList<QByteArray> labels = printLabels(tableName, seriesName, indexName);
-    QByteArray seriesLabels = printSeriesLabels(tableName, seriesName);
-    QByteArray useLineChartString = useLineChart(tableName, seriesName, indexName) ? "true" : "false" ;
-
-    query.next();
-    QString testName = query.value(0).toString();
-    QSize size(query.value(4).toInt(), query.value(5).toInt());
-//    QString title = "Test Function: " + query.value(7).toString() + " - " +  query.value(6).toString();
-    QString title = "Test Function: " + query.value(7).toString();
-    QString chartId = "\"" + query.value(7).toString() + "\"";
-    QString formId = "\"" + query.value(7).toString() + "form\"";
-    QString chartTypeFormId = "\"" + query.value(7).toString() + "chartTypeform\"";
-    QString scaleFormId = "\"" + query.value(7).toString() + "scaleform\"";
-    QString type = query.value(8).toString();
-
-    // Skip chart generation if there isn't enough data.
-    if (countLabels(tableName, seriesName, indexName) < 2) {
-        qDebug() << title.toAscii() << "No chartable data. (See the \"series\" test function"
-                                    << "in examples/qtestlib/tutorial5 for an example.) ";
-        return QList<QByteArray>() << title.toAscii() << " (no chartable data)"; // TODO: genrate text table here.
-    }
-
-//    QString qtVersion = query.value(9).toString();
-    query.previous();
-
-    QString sizeString = "height=\"" + QString::number(size.height()) + "\" width=\"" + QString::number(size.width()) + "\"";
-
-    QString fillString;
-    if (type == "LineChart")
-        fillString = "false";
-    else
-        fillString = "true";
-
-    QByteArray colors = printColors(tableName, seriesName);
-
-    QList<QByteArray> lines = readLines(":chart_template.html");
-    QList<QByteArray> output;
-
-    foreach(QByteArray line, lines) {
-        if (line.contains("<! Test Name Here>")) {
-            output.append(title.toLocal8Bit());
-        } else if (line.contains("<! Chart ID Here>")) {
-            output += chartId.toLocal8Bit();
-        } else if (line.contains("<! Form ID Here>")) {
-            output += formId.toLocal8Bit();
-        } else if (line.contains("<! ChartTypeForm ID Here>")) {
-            output += chartTypeFormId.toLocal8Bit();    
-        } else if (line.contains("<! ScaleForm ID Here>")) {
-            output += scaleFormId.toLocal8Bit();    
-        } else if (line.contains("<! Size>")) {
-            output += sizeString.toLocal8Bit();
-        } else if (line.contains("<! ColorScheme Here>")) {
-            output += colors;
-        } else if (line.contains("<! Data Goes Here>")) {
-            output += data;
-        } else if (line.contains("<! Labels Go Here>")) {
-            output += labels;
-        } else if (line.contains("<! Use Line Chart Here>")) {
-            output += useLineChartString + ";";
-        } else if (line.contains("<! Chart Type Here>")) {
-            output += "\"" + type.toLocal8Bit() + "\"";
-        } else if (line.contains("<! Fill Setting Here>")) {
-            output += fillString.toLocal8Bit();            
-        } else if (line.contains("<! Series Labels Here>")) {
-            output += seriesLabels;
-        } else {
-            output.append(line);
-        }
-    }
-
-    return output;
-}
-
-QByteArray ReportGenerator::printColors(const QString &tableName, const QString &seriesName)
-{
-    QByteArray colors;
-    int i = 0;
-    QStringList series = selectUnique(seriesName, tableName);
-    foreach (const QString &serie, series) {
-        colors.append("'" + serie.toLocal8Bit() + "': '" + m_colorScheme.at(i % m_colorScheme.count()) + "',\n");
-        ++ i;
-    }
-    colors.chop(2); // remove last comma
-    colors.append("\n");
-    return colors;
-}
-
diff --git a/tools/qtestlib/chart/reportgenerator.h b/tools/qtestlib/chart/reportgenerator.h
deleted file mode 100644
index d44aea9..0000000
--- a/tools/qtestlib/chart/reportgenerator.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights.  These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef REPORTGENERATOR_H
-#define REPORTGENERATOR_H
-
-#include "database.h"
-
-class ReportGenerator
-{
-public:	
-	ReportGenerator();
-	QByteArray printColors(const QString &tableName, const QString &seriesName);
-	QList<QByteArray> writeChart(const QString &tableName, bool combineVersions);
-    void writeReport(const QString &tableName, const QString &filename, bool combineVersions = false);
-	void writeReports();
-    QString fileName();
-private:
-	QList<QByteArray> m_colorScheme;
-    QString m_fileName;
-};
-
-void printTestCaseResults(const QString &testCaseName);
-
-#endif
-
diff --git a/tools/qtestlib/qtestlib.pro b/tools/qtestlib/qtestlib.pro
index 9ff7360..da94e81 100644
--- a/tools/qtestlib/qtestlib.pro
+++ b/tools/qtestlib/qtestlib.pro
@@ -1,4 +1,4 @@
 TEMPLATE = subdirs
-!wince*: SUBDIRS += updater chart
+!wince*: SUBDIRS += updater
 wince*: contains(QT_CONFIG, cetest): SUBDIRS += wince
 CONFIG += ordered
-- 
cgit v0.12


From 39721ae5cce44c3ea77d96a47d60aff54a91ad5c Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@nokia.com>
Date: Tue, 20 Jul 2010 08:54:36 +0200
Subject: Add a testcase for when peeking and then reading from a QIODevice

This case was broken and then fixed again recently, this testcase should
ensure that it does not break again in the future.

Reviewed-by: Andreas Kling
---
 tests/auto/qiodevice/tst_qiodevice.cpp | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp
index 356e2f8..7048754 100644
--- a/tests/auto/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/qiodevice/tst_qiodevice.cpp
@@ -72,6 +72,7 @@ private slots:
     void read_QByteArray();
     void unget();
     void peek();
+    void peekAndRead();
     void getch();
     void putch();
 
@@ -354,6 +355,31 @@ void tst_QIODevice::peek()
     QFile::remove("peektestfile");
 }
 
+void tst_QIODevice::peekAndRead()
+{
+    QByteArray originalData;
+    for (int i=0;i<1000;i++)
+        originalData += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    QBuffer buffer;
+    QFile::remove("peektestfile");
+    QFile file("peektestfile");
+
+    for (int i = 0; i < 2; ++i) {
+        QByteArray readData;
+        QIODevice *device = i ? (QIODevice *)&file : (QIODevice *)&buffer;
+        device->open(QBuffer::ReadWrite);
+        device->write(originalData);
+        device->seek(0);
+        while (!device->atEnd()) {
+            char peekIn[26];
+            device->peek(peekIn, 26);
+            readData += device->read(26);
+        }
+        QCOMPARE(readData, originalData);
+    }
+    QFile::remove("peektestfile");
+}
+
 void tst_QIODevice::getch()
 {
 #ifdef QT3_SUPPORT
-- 
cgit v0.12


From b0998a44a5dc384a6cf65c1d5910cb3dd40620cf Mon Sep 17 00:00:00 2001
From: Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com>
Date: Tue, 20 Jul 2010 10:33:36 +0200
Subject: Qt does not build with qt_namespace on macos

The problem was that the QT_BEGIN_NAMESPACE was in the wrong place.
I moved it 10 lines before and the problem is gone.

Task-number: QTBUG-12262
Reviewed-by: Prasanth
---
 src/network/ssl/qsslsocket_openssl.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index c297eea..b4d030c 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -59,6 +59,8 @@
 #include <QtCore/qvarlengtharray.h>
 #include <QLibrary> // for loading the security lib for the CA store
 
+QT_BEGIN_NAMESPACE
+
 #if defined(Q_OS_MAC)
 #define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file
     PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0;
@@ -72,8 +74,6 @@
 #include <QtCore/private/qcore_symbian_p.h>
 #endif
 
-QT_BEGIN_NAMESPACE
-
 bool QSslSocketPrivate::s_libraryLoaded = false;
 bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
 
-- 
cgit v0.12


From 8517f787b798d9e300438404aab359de2acc0978 Mon Sep 17 00:00:00 2001
From: Pierre Rossi <pierre.rossi@nokia.com>
Date: Tue, 20 Jul 2010 11:23:25 +0200
Subject: Fix a Headerview layout bug

When the sections were moved calling logicalIndex on what was already
a logical index messed up the hidden sections.

Task-number: QTBUG-12268
Reviewed-by: Gabriel
---
 src/gui/itemviews/qheaderview.cpp          |  2 +-
 tests/auto/qheaderview/tst_qheaderview.cpp | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index cd9ee15..67854a3 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -1871,7 +1871,7 @@ void QHeaderViewPrivate::_q_layoutChanged()
 
     for (int i = 0; i < oldSectionHidden.count(); ++i) {
         if (oldSectionHidden.testBit(i))
-            q->setSectionHidden(logicalIndex(i), false);
+            q->setSectionHidden(i, false);
     }
 
     // the number of sections changed; we need to reread the state of the model
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index f6cd4e3..da0a0bb 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -193,6 +193,7 @@ private slots:
     void QTBUG6058_reset();
     void QTBUG7833_sectionClicked();
     void QTBUG8650_crashOnInsertSections();
+    void QTBUG12268_hiddenMovedSectionSorting();
 
 protected:
     QHeaderView *view;
@@ -2071,5 +2072,25 @@ void tst_QHeaderView::QTBUG8650_crashOnInsertSections()
     model.insertColumn(0, items);
 }
 
+void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting()
+{
+    QTableView view;
+    QStandardItemModel *model = new QStandardItemModel(4,3, &view);
+    for (int i = 0; i< model->rowCount(); ++i)
+        for (int j = 0; j< model->columnCount(); ++j)
+            model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j));
+    view.setModel(model);
+    view.horizontalHeader()->setMovable(true);
+    view.setSortingEnabled(true);
+    view.sortByColumn(1, Qt::AscendingOrder);
+    view.horizontalHeader()->moveSection(0,2);
+    view.setColumnHidden(1, true);
+    view.show();
+    QTest::qWaitForWindowShown(&view);
+    QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
+    QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton);
+    QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
+}
+
 QTEST_MAIN(tst_QHeaderView)
 #include "tst_qheaderview.moc"
-- 
cgit v0.12


From 4df9c96e2c213c39924e22e02621b0c61e83f8fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= <bjorn.nilsen@nokia.com>
Date: Tue, 20 Jul 2010 10:32:59 +0200
Subject: QGraphicsItem: Animation leaves drawing artifacts when clipping is
 used.

This only happens when the ItemHasNoContents and ItemClipsChildrenToShape
flags are set. Problem is that items with no content are threated as 'dummy'
items, which means they are never drawn or 'processed' otherwise, so the
cached bounding rect is not reliable/usable. This means that in case of
changing the geometry of such items, its children always have to take
care of invalidating the occupied areas and the update can not be
clipped to the item's bounding rect.

Regression after commit: c1c7dbf2

Auto test included.

Task-number: QTBUG-11504
Reviewed-by: yoann
---
 src/gui/graphicsview/qgraphicsscene.cpp        |  7 ++-
 tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 73 ++++++++++++++++++++++++++
 2 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 4bc7f4c..48a0093 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5178,7 +5178,12 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
     // Process children.
     if (itemHasChildren && item->d_ptr->dirtyChildren) {
         const bool itemClipsChildrenToShape = item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape;
-        if (itemClipsChildrenToShape) {
+        // Items with no content are threated as 'dummy' items which means they are never drawn and
+        // 'processed', so the painted view bounding rect is never up-to-date. This means that whenever
+        // such an item changes geometry, its children have to take care of the update regardless
+        // of whether the item clips children to shape or not.
+        const bool bypassUpdateClip = !itemHasContents && wasDirtyParentViewBoundingRects;
+        if (itemClipsChildrenToShape && !bypassUpdateClip) {
             // Make sure child updates are clipped to the item's bounding rect.
             for (int i = 0; i < views.size(); ++i)
                 views.at(i)->d_func()->setUpdateClip(item);
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index b8df7f6..1cce687 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -219,6 +219,7 @@ private slots:
     void update2_data();
     void update2();
     void update_ancestorClipsChildrenToShape();
+    void update_ancestorClipsChildrenToShape2();
     void inputMethodSensitivity();
     void inputContextReset();
     void indirectPainting();
@@ -3815,6 +3816,78 @@ void tst_QGraphicsView::update_ancestorClipsChildrenToShape()
 #endif
 }
 
+void tst_QGraphicsView::update_ancestorClipsChildrenToShape2()
+{
+    QGraphicsScene scene(-150, -150, 300, 300);
+
+    /*
+    Add two rects:
+
+    +------------------+
+    | child            |
+    | +--------------+ |
+    | | parent       | |
+    | |              | |
+    | |              | |
+    | |              | |
+    | +--------------+ |
+    +------------------+
+
+    ... where the parent has no contents and clips the child to shape.
+    */
+    QApplication::processEvents(); // Get rid of pending update.
+
+    QGraphicsRectItem *parent = static_cast<QGraphicsRectItem *>(scene.addRect(-50, -50, 100, 100));
+    parent->setBrush(QColor(0, 0, 255, 125));
+    parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+    parent->setFlag(QGraphicsItem::ItemHasNoContents);
+
+    QGraphicsRectItem *child = static_cast<QGraphicsRectItem *>(scene.addRect(-100, -100, 200, 200));
+    child->setBrush(QColor(255, 0, 0, 125));
+    child->setParentItem(parent);
+
+    CustomView view(&scene);
+    view.show();
+    QTest::qWaitForWindowShown(&view);
+    QTRY_VERIFY(view.painted);
+
+    view.lastUpdateRegions.clear();
+    view.painted = false;
+
+    // Call child->update() and make sure the updated area is within its parent's clip.
+    QRectF expected = child->deviceTransform(view.viewportTransform()).mapRect(child->boundingRect());
+    expected &= parent->deviceTransform(view.viewportTransform()).mapRect(parent->boundingRect());
+
+    child->update();
+    QTRY_VERIFY(view.painted);
+
+#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions
+    QTRY_VERIFY(view.painted);
+    QCOMPARE(view.lastUpdateRegions.size(), 1);
+    QCOMPARE(view.lastUpdateRegions.at(0), QRegion(expected.toAlignedRect()));
+#endif
+
+    QTest::qWait(50);
+
+    view.lastUpdateRegions.clear();
+    view.painted = false;
+
+    // Invalidate the parent's geometry and trigger an update.
+    // The update area should be clipped to the parent's bounding rect for 'normal' items,
+    // but in this case the item has no contents (ItemHasNoContents) and its geometry
+    // is invalidated, which means we cannot clip the child update. So, the expected
+    // area is exactly the same as the child's bounding rect (adjusted for antialiasing).
+    parent->setRect(parent->rect().adjusted(-10, -10, -10, -10));
+    expected = child->deviceTransform(view.viewportTransform()).mapRect(child->boundingRect());
+    expected.adjust(-2, -2, 2, 2); // Antialiasing
+
+#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions
+    QTRY_VERIFY(view.painted);
+    QCOMPARE(view.lastUpdateRegions.size(), 1);
+    QCOMPARE(view.lastUpdateRegions.at(0), QRegion(expected.toAlignedRect()));
+#endif
+}
+
 class FocusItem : public QGraphicsRectItem
 {
 public:
-- 
cgit v0.12


From 04bc2b1f37750a2afbb88521001758249a8df383 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Date: Tue, 20 Jul 2010 12:29:19 +0200
Subject: doc: Fix qdoc errors for text related files

QTextBlock::layoutDirection() doesn't exist, and the QStaticText
constructor no longer takes a size argument.

Task-number: QTBUG-12072
Reviewed-by: Fabien Freling
---
 src/gui/text/qstatictext.cpp | 4 +---
 src/gui/text/qtextobject.cpp | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index ab518d0..f6daed8 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -148,9 +148,7 @@ QStaticText::QStaticText()
 }
 
 /*!
-    Constructs a QStaticText object with the given \a text and bounded by the given \a size.
-
-    If an invalid size is passed for \a size the text will be unbounded.
+    Constructs a QStaticText object with the given \a text.
 */
 QStaticText::QStaticText(const QString &text)
     : data(new QStaticTextPrivate)
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index f386871..5fb3384 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1148,7 +1148,7 @@ int QTextBlock::charFormatIndex() const
   direction from the blocks content. Returns either Qt::LeftToRight
   or Qt::RightToLeft.
 
-  \sa QTextBlock::layoutDirection(), QString::isRightToLeft(), Qt::LayoutDirection
+  \sa QTextFormat::layoutDirection(), QString::isRightToLeft(), Qt::LayoutDirection
 */
 Qt::LayoutDirection QTextBlock::textDirection() const
 {
-- 
cgit v0.12


From 64b9e63f4f9162c1af299b1355e84b0e616ad768 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= <jan-arve.saether@nokia.com>
Date: Tue, 20 Jul 2010 11:40:48 +0200
Subject: Do not crash due to a infinite recursion when using voiceover on
 MacOS

The reason for the infinite recursion was that
QAccessibleTitleBar::object() returned the titlebar's dockwidget.
This could lead to a problem when the AT client tried to
traverse the accessibility hierarchy:
As a response to QAXChildrenAttribute (retrieve children) on a dock
widget node, it would register it's children in the
hierarchy manager. In this case, the object registered for the titlebar
interface was the QDockWidget.
In order to do further traversal, the bridge could call
queryAccessibleInterface on the list of retrieved children to get the
QAccessibleInterface for those objects, however, that would return the
QAccessibleDockWidget interface that we just had traversed,....

Task-number: QTBUG-6843
Reviewed-by:  Carlos Manuel Duclos Vergara
---
 src/plugins/accessible/widgets/qaccessiblewidgets.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 499eb1d..662663d 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -984,7 +984,7 @@ int QAccessibleDockWidget::childCount() const
 int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const
 {
     if (child) {
-        if (qobject_cast<QDockWidget *>(child->object()) == dockWidget() && child->role(0) == TitleBar) {
+        if (child->role(0) == TitleBar) {
             return 1;
         } else {
             return 2;   //###
@@ -1214,7 +1214,7 @@ int QAccessibleTitleBar::childAt(int x, int y) const
 
 QObject *QAccessibleTitleBar::object() const
 {
-    return m_dockWidget;
+    return 0;
 }
 
 QDockWidgetLayout *QAccessibleTitleBar::dockWidgetLayout() const
-- 
cgit v0.12


From d4cc1dcea5b4116767cfee0ec45bfba72dc011ff Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Mon, 19 Jul 2010 16:44:26 +0200
Subject: Fixed a QSplashScreen hanging bug in S60 3.1 devices.

QSymbianBitmapDataAccess is used to provide access to the bitmap heap
in a manner that locks correctly on all platform versions. The
heapWasLocked variable was meant to protect against the case where
the heap is locked recursively. However, it failed to take into
account the case where the same QSymbianBitmapDataAccess object was
used to lock recursively. In this case the variable would be changed
to true on the second lock, which means that the lock would never be
released again.

This was fixed by making the access reference counted instead. Since
the bitmap heap lock is global, the refcount was made global as well.

Task:     QTBUG-11129
RevBy:    Jason Barron
AutoTest: Works again. It was hanging before this fix.
---
 src/gui/image/qpixmap_s60.cpp | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index a13c8c8..9d571b5 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -157,10 +157,10 @@ class QSymbianBitmapDataAccess
 {
 public:
 
-    bool heapWasLocked;
+    static int heapRefCount;
     QSysInfo::SymbianVersion symbianVersion;
 
-    explicit QSymbianBitmapDataAccess() : heapWasLocked(false)
+    explicit QSymbianBitmapDataAccess()
     {
         symbianVersion = QSysInfo::symbianVersion();
     };
@@ -169,16 +169,22 @@ public:
 
     inline void beginDataAccess(CFbsBitmap *bitmap)
     {
-        if (symbianVersion == QSysInfo::SV_9_2)
-            heapWasLocked = qt_symbianFbsClient()->lockHeap();
-        else
+        if (symbianVersion == QSysInfo::SV_9_2) {
+            if (heapRefCount == 0)
+                qt_symbianFbsClient()->lockHeap();
+        } else {
             bitmap->LockHeap(ETrue);
+        }
+
+        heapRefCount++;
     }
 
     inline void endDataAccess(CFbsBitmap *bitmap)
     {
+        heapRefCount--;
+
         if (symbianVersion == QSysInfo::SV_9_2) {
-            if (!heapWasLocked)
+            if (heapRefCount == 0)
                 qt_symbianFbsClient()->unlockHeap();
         } else {
             bitmap->UnlockHeap(ETrue);
@@ -186,6 +192,8 @@ public:
     }
 };
 
+int QSymbianBitmapDataAccess::heapRefCount = 0;
+
 
 #define UPDATE_BUFFER()     \
     {                       \
-- 
cgit v0.12


From a87ce3dd0d134b353ae76b031c1d1696ab7e522c Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Mon, 19 Jul 2010 17:00:26 +0200
Subject: Fixed some deployment issues on Symbian.

Both plugins should be part of the main package now.

RevBy:    Trust me
---
 tests/auto/qpixmap/qpixmap.pro | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index c3ee192..082747b 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -13,13 +13,12 @@ wince*|symbian: {
    icons.path = convertFromToHICON
    
    DEPLOYMENT += task31722_0 task31722_1 icons
-   DEPLOYMENT_PLUGIN += qico
 }
 
 wince*: {
    DEFINES += SRCDIR=\\\".\\\"
+   DEPLOYMENT_PLUGIN += qico
 } else:symbian {
-   DEPLOYMENT_PLUGIN += qmng
    LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
    contains(QT_CONFIG, openvg) {
        LIBS += $$QMAKE_LIBS_OPENVG
-- 
cgit v0.12


From 2feb893547a19534613c434fccbb0cdc8eba6cdb Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 20 Jul 2010 13:24:07 +0200
Subject: Added missing deployment to autotest.

RevBy:    Trust me
---
 tests/auto/qpixmap/qpixmap.pro | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index 082747b..ff8258f 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -12,7 +12,10 @@ wince*|symbian: {
    icons.sources = convertFromToHICON/*       
    icons.path = convertFromToHICON
    
-   DEPLOYMENT += task31722_0 task31722_1 icons
+   loadFromData.sources = loadFromData/*
+   loadFromData.path = loadFromData
+
+   DEPLOYMENT += task31722_0 task31722_1 icons loadFromData
 }
 
 wince*: {
-- 
cgit v0.12


From ebcb490b3e179157a886474c86597984b346abe3 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Date: Tue, 20 Jul 2010 13:32:40 +0200
Subject: My 4.7.0 changes

My 4.7.0 changes
---
 dist/changes-4.7.0 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 52 insertions(+), 5 deletions(-)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index c19bf15..5f585c1 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -32,7 +32,10 @@ New features
 
  - QNetworkSession, QNetworkConfiguration, QNetworkConfigurationManager
     * New bearer management classes added.
-
+	
+ - QStaticText class was added to support high-performance output of 
+   seldomly altered text. 
+	
 Third party components
 ----------------------
 
@@ -74,14 +77,14 @@ QtCore
 
 QtGui
 -----
-
+ 
  - QAbstractItemView
     * Fixed a bug that would cause keyboard searches not to behave
       properly when used within 400 milliseconds of midnight.
 
  - QComboBox
     * [QTBUG-8796] Made ForegroundRole work for all styles.
-
+				
  - QPrinter
     * Obsoleted the slightly confusing setNumCopies() and numCopies()
       functions, and replaced them with setCopyCount(), copyCount() and
@@ -156,10 +159,28 @@ QtGui
  - QSplitter
     * [QTBUG-9335] Improve support for 1-pixel splitters by using a 
       larger drag area.
-
+	  	  
+ - QTextDocumentWriter
+    * Fixed tab-stops and table padding in ODF export.
+
+ - QTextLayout
+    * [QTBUG-11427] Fix possible crash in QTextLayout for glyphless 
+      items.
+    * [QTBUG-8864] Fix regression in right alignment of text with 
+      negative right bearing.
+	  
  - QTransform
     * [QTBUG-8557] Fixed bug in QTransform::type() potentially occuring
       after using operator/ or operator* or their overloads.
+	  
+QtOpenGL
+--------
+ - Improve performance of text by adding special cased fragment shader.
+ 
+ - Made width and height of glyph cache power-of-two for performance 
+   improvements on some hardware.
+   
+ - [QTBUG-9706] Improved appearance of text antialiasing.
 
 QtNetwork
 ---------
@@ -234,7 +255,19 @@ Qt for Linux/X11
  - QGtkStyle
     * Fixed rtl issues with sliders (QTBUG-8986)
     * Fixed missing pressed appearance on scroll bar handles. (QTBUG-10396)  
-
+ 
+ - QFontDatabase
+    * [QTBUG-4428] Fixed regression when using bitmap fonts on some 
+      Linux systems.
+ 
+ - QFontEngine
+     * [QTBUG-9442] Avoid possible square root of negative number in 
+      FreeType font engine.
+	  
+ - QFontMetrics
+    * [QTBUG-10448] Fix crash when using fonts in non-gui QApplication.
+	  
+ 	
 Qt for Windows
 --------------
  - Popup windows now implicitly activate when shown. (QTBUG-7386)
@@ -252,6 +285,20 @@ Qt for Mac OS X
     * Removed frame around statusbar items. (QTBUG-3574)
     * More native appearance of item view headers and frames. (QTBUG-10047)    
 
+ - QFontEngine	
+    * Enable fractional metrics for the font engine on Mac in all 
+      stages of text layout.
+    * [QTBUG-5529] Enable design metrics for correct character spacing 
+      in ATSUI font engine. (Mac/Carbon)
+
+- QTextDocument
+    * [QTBUG-8791] Fix misalignment of fixed width fonts between 
+      format changes on Cocoa.
+	  
+ - QTextLayout
+    * [QTBUG-9879] Fix off-by-one in vertical position for elided and 
+	  non-elided text.
+ 
 Qt for Embedded Linux
 ---------------------
 
-- 
cgit v0.12


From 5cfad3a7b24abbde6c01bba0fbf8446b3a5137f7 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Tue, 20 Jul 2010 14:37:35 +0200
Subject: Workaround gcc bug, disable test with old version of gcc

---
 tests/auto/moc/tst_moc.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index 4fcc7bd..d871540 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1344,14 +1344,18 @@ signals:
 class QTBUG12260_defaultTemplate_Object : public QObject
 { Q_OBJECT
 public slots:
+#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) //gcc bug, this does not compile
     void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>()) { Q_UNUSED(values); }
+#endif
     void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); }
 };
 
 
 void tst_Moc::QTBUG12260_defaultTemplate()
 {
+#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3)
     QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1);
+#endif
     QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1);
 }
 
-- 
cgit v0.12


From bf7ffca088904c6872715a588a9c4e3dd0904fc8 Mon Sep 17 00:00:00 2001
From: Yoann Lopes <yoann.lopes@nokia.com>
Date: Tue, 20 Jul 2010 15:50:24 +0200
Subject: Updated changelog for 4.7.

---
 dist/changes-4.7.0 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index 5f585c1..49c17ee 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -107,6 +107,7 @@ QtGui
     * [QTBUG-9024] Improved performance when calling update() on items that
       are clipped by an ancestor (QGraphicsItem::ItemClipsChildrenToShape).
     * [QTBUG-7703], [QTBUG-8378] Fixed scrolling issues
+    * [QTBUG-12112] Fixed focusItem() returning incorrect value.
 
  - QGraphicsTextItem
     * [QTBUG-7333] Fixed keyboard shortcuts not being triggered when the
@@ -119,6 +120,10 @@ QtGui
       the mouse.
     * [QTBUG-10338] Fixed drawing artifacts due to rounding errors.
 
+ - QGraphicsWidget
+    * [QTBUG-12056] Fixed a crash occuring when adding a QGraphicsWidget
+      to a scene after removing and deleting another QGraphicsWidget.
+
  - QImage
     * [QTBUG-9640] Prevented unneccessary copy in QImage::setAlphaChannel().
     * [QTBUG-7982] Added QImage::bitPlaneCount().
-- 
cgit v0.12


From 9d95c2f032df55c2a1865f049dd8dc76ea924c83 Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@nokia.com>
Date: Tue, 20 Jul 2010 16:19:52 +0200
Subject: doc: Fixed typos in QAbstractFileEngineIterator

Reviewed-by: Alessandro Portale
---
 src/corelib/io/qabstractfileengine.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index e239ee9..d6b6f11 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -818,7 +818,7 @@ bool QAbstractFileEngine::unmap(uchar *address)
     You can call dirName() to get the directory name, nameFilters() to get a
     stringlist of name filters, and filters() to get the entry filters.
 
-    The pure virual function hasNext() returns true if the current directory
+    The pure virtual function hasNext() returns true if the current directory
     has at least one more entry (i.e., the directory name is valid and
     accessible, and we have not reached the end of the entry list), and false
     otherwise. Reimplement next() to seek to the next entry.
@@ -828,7 +828,7 @@ bool QAbstractFileEngine::unmap(uchar *address)
     function is provided for convenience; it returns the full path of the
     current entry.
 
-    Here is an example of how to implement an interator that returns each of
+    Here is an example of how to implement an iterator that returns each of
     three fixed entries in sequence.
 
     \snippet doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp 3
@@ -959,7 +959,7 @@ QString QAbstractFileEngineIterator::currentFilePath() const
 /*!
     The virtual function returns a QFileInfo for the current directory
     entry. This function is provided for convenience. It can also be slightly
-    faster that creating a QFileInfo object yourself, as the object returned
+    faster than creating a QFileInfo object yourself, as the object returned
     by this function might contain cached information that QFileInfo otherwise
     would have to access through the file engine.
 
-- 
cgit v0.12


From 2fd446db8842e78af22d63acbb03a96ca242bb35 Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@nokia.com>
Date: Tue, 20 Jul 2010 17:52:18 +0200
Subject: Removed some translations

Reviewed-by: Daniel Molkentin
---
 translations/qt_hu.ts | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/translations/qt_hu.ts b/translations/qt_hu.ts
index 9ee3b32..d9b05d1 100644
--- a/translations/qt_hu.ts
+++ b/translations/qt_hu.ts
@@ -4970,30 +4970,6 @@ Biztosan törölni akarja?</translation>
         <translation>&lt;h3&gt;Qt névjegye&lt;/h3&gt;&lt;p&gt;Ez a program a Qt %1 verzióját használja.&lt;/p&gt;</translation>
     </message>
     <message>
-        <location line="+5"/>
-        <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; for more information.&lt;/p&gt;</source>
-        <translation>&lt;p&gt;A Qt egy C++ eszközkészlet keresztplatformos alkalmazások fejlesztéséhez, mely egyetlen, MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, és minden főbb kereskedelmi Unix változat között hordozható forrást ad; valamint elérhető még beágyazott eszközökhöz is, mint Qt beágyazott Linuxhoz és Qt Windows CE-hez.&lt;/p&gt;
-&lt;p&gt;A Qt három különböző licensz alatt érhető el, hogy illeszkedjen a különbőző felhasználói igényekhez:
-&lt;p&gt;A kereskedelmi licenszünk alkalmas saját/kereskedelmi szoftver fejlesztéséhez, ha nem akarja megosztani a forráskódot harmadik partnerrel vagy nem kívánja teljesíteni GNU LGPL v2.1 vagy GNU GPL v3.0 feltételeit.&lt;/p&gt;
-&lt;p&gt;A GNU LGPL v2.1 alá tartozó Qt licensz alkalmas Qt-n alapuló programok fejlesztéséhez (zárt vagy nyílt forrású), amennyiben betartja a GNU LGPL v2.1 kikötéseit és feltételeit.&lt;/p&gt;
-&lt;p&gt;A GNU General Public License v3.0 alá tartozó Qt licensz pedig alkalmas Qt-n alapuló programok fejlesztésére, ahol olyan programok kombinációját kívánja használni, melyek megfelelnek a GNU GPL version 3.0 feltételeinek vagy ahol hajlandó teljesíteni a GNU GPL v3.0 feltételeit.&lt;/p&gt;
-&lt;p&gt;Tekintse át a &lt;a href=&quot;http://qt.nokia.com/products/licensing&quot;&gt;qt.nokia.com/products/licensing&lt;/a&gt; oldalon a Qt licenszeit.&lt;/p&gt;
-&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;
-&lt;p&gt;A Qt a Nokia terméke. További információért látogassa meg a &lt;a href=&quot;http://qt.nokia.com/&quot;&gt;qt.nokia.com&lt;/a&gt; honlapot.&lt;/p&gt;</translation>
-    </message>
-    <message>
-        <source>&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;&lt;p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; for more information.&lt;/p&gt;</source>
-        <translatorcomment>Needing review, but basically accepted string.</translatorcomment>
-        <translation type="obsolete">&lt;p&gt;A Qt egy C++ eszközkészlet keresztplatformos alkalmazások fejlesztéséhez, mely egyetlen, MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, és minden főbb kereskedelmi Unix változat között hordozható forrást ad; valamint elérhető még beágyazott eszközökhöz is, mint Qt beágyazott Linuxhoz és Qt Windows CE-hez.&lt;/p&gt;
-&lt;p&gt;A Qt három különböző licensz alatt érhető el, hogy illeszkedjen a különbőző felhasználói igényekhez:
-&lt;p&gt;A kereskedelmi licenszünk alkalmas saját/kereskedelmi szoftver fejlesztéséhez, ha nem akarja megosztani a forráskódot harmadik partnerrel vagy nem kívánja teljesíteni GNU LGPL v2.1 vagy GNU GPL v3.0 feltételeit.&lt;/p&gt;
-&lt;p&gt;A GNU LGPL v2.1 alá tartozó Qt licensz alkalmas Qt-n alapuló programok fejlesztéséhez (zárt vagy nyílt forrású), amennyiben betartja a GNU LGPL v2.1 kikötéseit és feltételeit.&lt;/p&gt;
-&lt;p&gt;A GNU General Public License v3.0 alá tartozó Qt licensz pedig alkalmas Qt-n alapuló programok fejlesztésére, ahol olyan programok kombinációját kívánja használni, melyek megfelelnek a GNU GPL version 3.0 feltételeinek vagy ahol hajlandó teljesíteni a GNU GPL v3.0 feltételeit.&lt;/p&gt;
-&lt;p&gt;Tekintse át a &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; oldalon a Qt licenszeit.&lt;/p&gt;
-&lt;p&gt;Copyright (C) 2009 Nokia Corporation és/vagy annak leányvállalat(-ai).&lt;/p&gt;
-&lt;p&gt;A Qt a Nokia terméke. További információért látogassa meg a &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; honlapot.&lt;/p&gt;</translation>
-    </message>
-    <message>
         <source>&lt;p&gt;This program uses Qt Open Source Edition version %1.&lt;/p&gt;&lt;p&gt;Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://www.trolltech.com/company/model/&quot;&gt;www.trolltech.com/company/model/&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;</source>
         <translation type="obsolete">&lt;p&gt;A programa Qt Open Source Edition %1 verziót használja.&lt;/p&gt;&lt;p&gt;A Qt Open Source Edition az Open Source (nyílt forrású) alkalmazások fejlesztéséhez készült. Zárt forrású alkalmazások fejlesztéséhez a kereskedelmi Qt licenszre van szükség.&lt;/p&gt;&lt;p&gt;A Qt licenszeléséről további információ a &lt;a href=&quot;http://www.trolltech.com/company/model/&quot;&gt;www.trolltech.com/company/model/&lt;/a&gt; oldalon található.&lt;/p&gt;</translation>
     </message>
-- 
cgit v0.12


From 42267701edd266463c90cec82d45022446a2606a Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Tue, 20 Jul 2010 13:28:55 +0200
Subject: Add support for more vector instructions on x86

Add the configuration, autodetection, and the #define for vector
instructions on x86. The configuration has been extended with SSE3,
SSSE3, SSE4.1, SSE4.2 and AVX.

Reviewed-by: Andreas Kling
---
 config.tests/unix/avx/avx.cpp       |  51 ++++++++++++++++++
 config.tests/unix/avx/avx.pro       |   3 ++
 config.tests/unix/sse3/sse3.cpp     |  51 ++++++++++++++++++
 config.tests/unix/sse3/sse3.pro     |   3 ++
 config.tests/unix/sse4_1/sse4_1.cpp |  51 ++++++++++++++++++
 config.tests/unix/sse4_1/sse4_1.pro |   3 ++
 config.tests/unix/sse4_2/sse4_2.cpp |  51 ++++++++++++++++++
 config.tests/unix/ssse3/ssse3.cpp   |  51 ++++++++++++++++++
 config.tests/unix/ssse3/ssse3.pro   |   3 ++
 configure                           | 100 +++++++++++++++++++++++++++++++++++-
 src/corelib/corelib.pro             |  15 ++++++
 src/gui/gui.pro                     |   5 ++
 12 files changed, 386 insertions(+), 1 deletion(-)
 create mode 100644 config.tests/unix/avx/avx.cpp
 create mode 100644 config.tests/unix/avx/avx.pro
 create mode 100644 config.tests/unix/sse3/sse3.cpp
 create mode 100644 config.tests/unix/sse3/sse3.pro
 create mode 100644 config.tests/unix/sse4_1/sse4_1.cpp
 create mode 100644 config.tests/unix/sse4_1/sse4_1.pro
 create mode 100644 config.tests/unix/sse4_2/sse4_2.cpp
 create mode 100644 config.tests/unix/ssse3/ssse3.cpp
 create mode 100644 config.tests/unix/ssse3/ssse3.pro

diff --git a/config.tests/unix/avx/avx.cpp b/config.tests/unix/avx/avx.cpp
new file mode 100644
index 0000000..65a0eb8
--- /dev/null
+++ b/config.tests/unix/avx/avx.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <immintrin.h>
+
+int main(int, char**)
+{
+    volatile __m256d a = _mm256_setzero_pd();
+    volatile __m256d b = _mm256_set1_pd(42.42);
+    volatile __m256d result = _mm256_add_pd(a, b);
+    (void)result;
+    return 0;
+}
diff --git a/config.tests/unix/avx/avx.pro b/config.tests/unix/avx/avx.pro
new file mode 100644
index 0000000..00a0550
--- /dev/null
+++ b/config.tests/unix/avx/avx.pro
@@ -0,0 +1,3 @@
+SOURCES = avx.cpp
+CONFIG -= x11 qt
+mac:CONFIG -= app_bundle
diff --git a/config.tests/unix/sse3/sse3.cpp b/config.tests/unix/sse3/sse3.cpp
new file mode 100644
index 0000000..b159acf
--- /dev/null
+++ b/config.tests/unix/sse3/sse3.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <pmmintrin.h>
+
+int main(int, char**)
+{
+    volatile __m128d a = _mm_set1_pd(6.28);
+    volatile __m128d b = _mm_set1_pd(3.14);
+    volatile __m128d result = _mm_addsub_pd(a, b);
+    result = _mm_movedup_pd(result);
+    return 0;
+}
diff --git a/config.tests/unix/sse3/sse3.pro b/config.tests/unix/sse3/sse3.pro
new file mode 100644
index 0000000..009fea2
--- /dev/null
+++ b/config.tests/unix/sse3/sse3.pro
@@ -0,0 +1,3 @@
+SOURCES = sse3.cpp
+CONFIG -= x11 qt
+mac:CONFIG -= app_bundle
diff --git a/config.tests/unix/sse4_1/sse4_1.cpp b/config.tests/unix/sse4_1/sse4_1.cpp
new file mode 100644
index 0000000..e9bec9e
--- /dev/null
+++ b/config.tests/unix/sse4_1/sse4_1.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <smmintrin.h>
+
+int main(int, char**)
+{
+    volatile __m128 a = _mm_setzero_ps();
+    _mm_ceil_ps(a);
+    volatile __m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64));
+    (void)result;
+    return 0;
+}
diff --git a/config.tests/unix/sse4_1/sse4_1.pro b/config.tests/unix/sse4_1/sse4_1.pro
new file mode 100644
index 0000000..c6c4746
--- /dev/null
+++ b/config.tests/unix/sse4_1/sse4_1.pro
@@ -0,0 +1,3 @@
+SOURCES = sse4_1.cpp
+CONFIG -= x11 qt
+mac:CONFIG -= app_bundle
diff --git a/config.tests/unix/sse4_2/sse4_2.cpp b/config.tests/unix/sse4_2/sse4_2.cpp
new file mode 100644
index 0000000..005b2c5
--- /dev/null
+++ b/config.tests/unix/sse4_2/sse4_2.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <smmintrin.h>
+
+int main(int, char**)
+{
+    volatile __m128i a = _mm_setzero_si128();
+    volatile __m128i b = _mm_set1_epi32(42);
+    volatile __m128i result = _mm_cmpestrm(a, 16, b, 16, 0);
+    (void)result;
+    return 0;
+}
diff --git a/config.tests/unix/ssse3/ssse3.cpp b/config.tests/unix/ssse3/ssse3.cpp
new file mode 100644
index 0000000..37fd479
--- /dev/null
+++ b/config.tests/unix/ssse3/ssse3.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <tmmintrin.h>
+
+int main(int, char**)
+{
+    volatile __m128i a = _mm_set1_epi32(42);
+    _mm_abs_epi8(a);
+    volatile __m128i result = _mm_sign_epi16(a, _mm_set1_epi32(64));
+    (void)result;
+    return 0;
+}
diff --git a/config.tests/unix/ssse3/ssse3.pro b/config.tests/unix/ssse3/ssse3.pro
new file mode 100644
index 0000000..4864267
--- /dev/null
+++ b/config.tests/unix/ssse3/ssse3.pro
@@ -0,0 +1,3 @@
+SOURCES = ssse3.cpp
+CONFIG -= x11 qt
+mac:CONFIG -= app_bundle
diff --git a/configure b/configure
index 11496c4..1122c7e 100755
--- a/configure
+++ b/configure
@@ -740,6 +740,11 @@ CFG_MMX=auto
 CFG_3DNOW=auto
 CFG_SSE=auto
 CFG_SSE2=auto
+CFG_SSE3=auto
+CFG_SSSE3=auto
+CFG_SSE4_1=auto
+CFG_SSE4_2=auto
+CFG_AVX=auto
 CFG_REDUCE_RELOCATIONS=no
 CFG_IPV6=auto
 CFG_NAS=no
@@ -1642,6 +1647,41 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
+    sse3)
+        if [ "$VAL" = "no" ]; then
+            CFG_SSE3="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
+    ssse3)
+        if [ "$VAL" = "no" ]; then
+            CFG_SSSE3="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
+    sse4.1)
+        if [ "$VAL" = "no" ]; then
+            CFG_SSE4_1="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
+    sse4.2)
+        if [ "$VAL" = "no" ]; then
+            CFG_SSE4_2="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
+    avx)
+        if [ "$VAL" = "no" ]; then
+            CFG_AVX="$VAL"
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
     iwmmxt)
 	CFG_IWMMXT="yes"
 	;;
@@ -3427,6 +3467,7 @@ Usage:  $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir
         [-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
         [-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
         [-no-separate-debug-info] [-no-mmx] [-no-3dnow] [-no-sse] [-no-sse2]
+        [-no-sse3] [-no-ssse3] [-no-sse4.1] [-no-sse4.2] [-no-avx]
         [-qtnamespace <namespace>] [-qtlibinfix <infix>] [-separate-debug-info] [-armfpa]
         [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns]
         [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend]
@@ -3618,6 +3659,11 @@ cat << EOF
     -no-3dnow .......... Do not compile with use of 3DNOW instructions.
     -no-sse ............ Do not compile with use of SSE instructions.
     -no-sse2 ........... Do not compile with use of SSE2 instructions.
+    -no-sse3 ........... Do not compile with use of SSE3 instructions.
+    -no-ssse3 .......... Do not compile with use of SSSE3 instructions.
+    -no-sse4.1.......... Do not compile with use of SSE4.1 instructions.
+    -no-sse4.2.......... Do not compile with use of SSE4.2 instructions.
+    -no-avx ............ Do not compile with use of AVX instructions.
 
     -qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'.
     -qtlibinfix <infix>  Renames all libQt*.so to libQt*<infix>.so.
@@ -4667,6 +4713,51 @@ if [ "${CFG_SSE2}" = "auto" ]; then
     fi
 fi
 
+# detect sse3 support
+if [ "${CFG_SSE3}" = "auto" ]; then
+    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse3 "sse3" $L_FLAGS $I_FLAGS $l_FLAGS "-msse3"; then
+       CFG_SSE3=yes
+    else
+       CFG_SSE3=no
+    fi
+fi
+
+# detect ssse3 support
+if [ "${CFG_SSSE3}" = "auto" ]; then
+    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ssse3 "ssse3" $L_FLAGS $I_FLAGS $l_FLAGS "-mssse3"; then
+       CFG_SSSE3=yes
+    else
+       CFG_SSSE3=no
+    fi
+fi
+
+# detect sse4.1 support
+if [ "${CFG_SSE4_1}" = "auto" ]; then
+    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse4_1 "sse4_1" $L_FLAGS $I_FLAGS $l_FLAGS "-msse4.1"; then
+       CFG_SSE4_1=yes
+    else
+       CFG_SSE4_1=no
+    fi
+fi
+
+# detect sse4.2 support
+if [ "${CFG_SSE4_2}" = "auto" ]; then
+    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/sse4_2 "sse4_2" $L_FLAGS $I_FLAGS $l_FLAGS "-msse4.2"; then
+       CFG_SSE4_2=yes
+    else
+       CFG_SSE4_2=no
+    fi
+fi
+
+# detect avx support
+if [ "${CFG_AVX}" = "auto" ]; then
+    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/avx "avx" $L_FLAGS $I_FLAGS $l_FLAGS "-mavx"; then
+       CFG_AVX=yes
+    else
+       CFG_AVX=no
+    fi
+fi
+
 # check iWMMXt support
 if [ "$CFG_IWMMXT" = "yes" ]; then
     "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/iwmmxt "iwmmxt" $L_FLAGS $I_FLAGS $l_FLAGS "-mcpu=iwmmxt"
@@ -6558,6 +6649,11 @@ fi
 [ "$CFG_3DNOW" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG 3dnow"
 [ "$CFG_SSE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse"
 [ "$CFG_SSE2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse2"
+[ "$CFG_SSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse3"
+[ "$CFG_SSSE3" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG ssse3"
+[ "$CFG_SSE4_1" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_1"
+[ "$CFG_SSE4_2" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG sse4_2"
+[ "$CFG_AVX" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG avx"
 [ "$CFG_IWMMXT" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG iwmmxt"
 [ "$CFG_NEON" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG neon"
 [ "$PLATFORM_MAC" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG $CFG_MAC_ARCHS"
@@ -7959,7 +8055,9 @@ echo "Support for S60 ........ $CFG_S60"
 echo "Symbian DEF files ...... $CFG_SYMBIAN_DEFFILES"
 echo "STL support ............ $CFG_STL"
 echo "PCH support ............ $CFG_PRECOMPILE"
-echo "MMX/3DNOW/SSE/SSE2...... ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}"
+echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}"
+echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
+echo "AVX..................... ${CFG_AVX}"
 if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then
     echo "iWMMXt support ......... ${CFG_IWMMXT}"
     echo "NEON support ........... ${CFG_NEON}"
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index dba2a42..bbf445f 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -66,6 +66,21 @@ sse {
 sse2 {
     DEFINES += QT_HAVE_SSE2
 }
+sse3 {
+    DEFINES += QT_HAVE_SSE3
+}
+ssse3 {
+    DEFINES += QT_HAVE_SSSE3
+}
+sse4_1 {
+    DEFINES += QT_HAVE_SSE4_1
+}
+sse4_2 {
+    DEFINES += QT_HAVE_SSE4_2
+}
+avx {
+    DEFINES += QT_HAVE_AVX
+}
 iwmmxt {
     DEFINES += QT_HAVE_IWMMXT
 }
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 41f1904..3aee078 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -84,6 +84,11 @@ contains(QMAKE_MAC_XARCH, no) {
     3dnow:DEFINES += QT_HAVE_3DNOW
     sse:DEFINES += QT_HAVE_SSE QT_HAVE_MMXEXT
     sse2:DEFINES += QT_HAVE_SSE2
+    sse3:DEFINES += QT_HAVE_SSE3
+    ssse3:DEFINES += QT_HAVE_SSSE3
+    sse4_1:DEFINES += QT_HAVE_SSE4_1
+    sse4_2:DEFINES += QT_HAVE_SSE4_2
+    avx:DEFINES += QT_HAVE_AVX
     iwmmxt:DEFINES += QT_HAVE_IWMMXT
 
     win32-g++*|!win32:!*-icc* {
-- 
cgit v0.12


From 5a8a64821da7dae1ff5351b898899a5974c6d569 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Tue, 20 Jul 2010 14:48:38 +0200
Subject: Remove the masking when computing qAlpha()

After a bit shift of 24, only the alpha value should remain, so it is
not necessary to mask the result.
The documentation state QRgb works on a ARGB quadruplet, so the upper
bits can be assumed to be zero in the cases when QRgb is 64 bits.

This saves some time because qAlpha() is used for each pixel in the
generic blend functions.

Reviewed-by: Andreas Kling
Reviewed-by: Kim
---
 src/gui/painting/qrgb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/painting/qrgb.h b/src/gui/painting/qrgb.h
index 8e635a8..ea5f353 100644
--- a/src/gui/painting/qrgb.h
+++ b/src/gui/painting/qrgb.h
@@ -64,7 +64,7 @@ Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)                // get blue part of RGB
 { return (rgb & 0xff); }
 
 Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)                // get alpha part of RGBA
-{ return ((rgb >> 24) & 0xff); }
+{ return rgb >> 24; }
 
 Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)// set RGB value
 { return (0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
-- 
cgit v0.12


From ca7b451c42fc7bc9957dc1fe48f5aaf2fd937eaa Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Tue, 20 Jul 2010 19:41:33 +0200
Subject: Add a missing file in the config.test for SSE 4.2

The pro file was accidently missing of
42267701edd266463c90cec82d45022446a2606a
---
 config.tests/unix/sse4_2/sse4_2.pro | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 config.tests/unix/sse4_2/sse4_2.pro

diff --git a/config.tests/unix/sse4_2/sse4_2.pro b/config.tests/unix/sse4_2/sse4_2.pro
new file mode 100644
index 0000000..cab1711
--- /dev/null
+++ b/config.tests/unix/sse4_2/sse4_2.pro
@@ -0,0 +1,3 @@
+SOURCES = sse4_2.cpp
+CONFIG -= x11 qt
+mac:CONFIG -= app_bundle
-- 
cgit v0.12


From 7725da34a828df00feb289515c11fa8aea1a55d8 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Wed, 21 Jul 2010 08:46:43 +1000
Subject: Restore the FLT_MAX define. Seems some platforms don't have it.

---
 src/declarative/graphicsitems/qdeclarativeitem.cpp      | 4 ++++
 src/declarative/graphicsitems/qdeclarativemousearea.cpp | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 86ef0df..54aa3a9 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -64,6 +64,10 @@
 #include <QtGui/qgraphicstransform.h>
 #include <qlistmodelinterface_p.h>
 
+#ifndef FLT_MAX
+#define FLT_MAX 1E+37
+#endif
+
 QT_BEGIN_NAMESPACE
 
 /*!
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 7e4a36f..67de288 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -47,6 +47,10 @@
 #include <QGraphicsSceneMouseEvent>
 #include <QtCore/qmath.h>
 
+#ifndef FLT_MAX
+#define FLT_MAX 1E+37
+#endif
+
 QT_BEGIN_NAMESPACE
 static const int PressAndHoldDelay = 800;
 
-- 
cgit v0.12


From b325c90e5a0e5088aa8723d943f4c38b14048bd7 Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Wed, 21 Jul 2010 09:18:21 +1000
Subject: Compile: include <float.h> for usage of FLT_MAX.

---
 src/declarative/graphicsitems/qdeclarativeitem.cpp      | 5 +----
 src/declarative/graphicsitems/qdeclarativemousearea.cpp | 5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 54aa3a9..1b0d7ef 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -59,14 +59,11 @@
 #include <QEvent>
 #include <QGraphicsSceneMouseEvent>
 #include <QtCore/qnumeric.h>
-#include <QtCore/qmath.h>
 #include <QtScript/qscriptengine.h>
 #include <QtGui/qgraphicstransform.h>
 #include <qlistmodelinterface_p.h>
 
-#ifndef FLT_MAX
-#define FLT_MAX 1E+37
-#endif
+#include <float.h>
 
 QT_BEGIN_NAMESPACE
 
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 67de288..8ee6093 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -45,11 +45,8 @@
 #include "private/qdeclarativeevents_p_p.h"
 
 #include <QGraphicsSceneMouseEvent>
-#include <QtCore/qmath.h>
 
-#ifndef FLT_MAX
-#define FLT_MAX 1E+37
-#endif
+#include <float.h>
 
 QT_BEGIN_NAMESPACE
 static const int PressAndHoldDelay = 800;
-- 
cgit v0.12


From 164b2b54922d87a44a60efe6dbbe2fa3b7716820 Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Tue, 20 Jul 2010 15:14:11 +1000
Subject: Rewinding AnchorChanges should not make target item's implicit width
 and height explicit

Task-number: QTBUG-12273
Reviewed-by: Michael Brasser
---
 .../util/qdeclarativestateoperations.cpp           |  8 +++--
 .../qdeclarativestates/data/anchorRewindBug.qml    | 37 ++++++++++++++++++++++
 .../qdeclarativestates/tst_qdeclarativestates.cpp  | 35 ++++++++++++++++++++
 3 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml

diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 5590449..2291c16 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -1501,8 +1501,12 @@ void QDeclarativeAnchorChanges::rewind()
 
     d->target->setX(d->rewindX);
     d->target->setY(d->rewindY);
-    d->target->setWidth(d->rewindWidth);
-    d->target->setHeight(d->rewindHeight);
+    if (targetPrivate->widthValid) {
+        d->target->setWidth(d->rewindWidth);
+    }
+    if (targetPrivate->heightValid) {
+        d->target->setHeight(d->rewindHeight);
+    }
 }
 
 void QDeclarativeAnchorChanges::saveCurrentValues()
diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
new file mode 100644
index 0000000..e6b6020
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/anchorRewindBug.qml
@@ -0,0 +1,37 @@
+import Qt 4.7
+Rectangle {
+    id: container
+    color: "red"
+    height: 200
+    width: 200
+    Column {
+        id: column
+        objectName: "column"
+        anchors.left: container.right
+        anchors.bottom: container.bottom
+
+        Rectangle {
+            id: rectangle
+            color: "blue"
+            height: 100
+            width: 200
+        }
+        Rectangle {
+            color: "blue"
+            height: 100
+            width: 200
+        }
+    }
+    states: State {
+        name: "reanchored"
+        AnchorChanges {
+            target: column
+            anchors.left: undefined
+            anchors.right: container.right
+        }
+        PropertyChanges {
+            target: rectangle
+            opacity: 0
+        }
+    }
+}
\ No newline at end of file
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 639b2f3..7bc4fd4 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -121,6 +121,7 @@ private slots:
     void anchorChanges4();
     void anchorChanges5();
     void anchorChangesCrash();
+    void anchorRewindBug();
     void script();
     void restoreEntryValues();
     void explicitChanges();
@@ -807,6 +808,40 @@ void tst_qdeclarativestates::anchorChangesCrash()
     delete rect;
 }
 
+// QTBUG-12273
+void tst_qdeclarativestates::anchorRewindBug()
+{
+    QDeclarativeEngine engine;
+
+    QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorRewindBug.qml");
+    QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+    QVERIFY(rect != 0);
+
+    QDeclarativeItem * column = rect->findChild<QDeclarativeItem*>("column");
+
+    QVERIFY(column != 0);
+    QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+    QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+    QCOMPARE(column->height(), 200.0);
+    QDeclarativeItemPrivate::get(rect)->setState("reanchored");
+
+    // column height and width should stay implicit
+    // and column's implicit resizing should still work
+    QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+    QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+    QCOMPARE(column->height(), 100.0);
+
+    QDeclarativeItemPrivate::get(rect)->setState("");
+
+    // column height and width should stay implicit
+    // and column's implicit resizing should still work
+    QVERIFY(!QDeclarativeItemPrivate::get(column)->heightValid);
+    QVERIFY(!QDeclarativeItemPrivate::get(column)->widthValid);
+    QCOMPARE(column->height(), 200.0);
+
+    delete rect;
+}
+
 void tst_qdeclarativestates::script()
 {
     QDeclarativeEngine engine;
-- 
cgit v0.12


From 78a01438e5a37fd1778924f73ca8bfa55960b0d0 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Wed, 21 Jul 2010 10:36:17 +1000
Subject: font.letterSpacing used percentage rather than absolute values. ...
 and percentage is useless.

Task-number: QTBUG-12282
Reviewed-by: Warwick Allison
---
 src/declarative/QmlChanges.txt                                    | 5 ++++-
 src/declarative/graphicsitems/qdeclarativetext.cpp                | 3 +--
 src/declarative/graphicsitems/qdeclarativetextedit.cpp            | 3 +--
 src/declarative/graphicsitems/qdeclarativetextinput.cpp           | 3 +--
 src/declarative/qml/qdeclarativevaluetype.cpp                     | 2 +-
 tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp  | 8 ++++----
 .../declarative/qmlvisual/qdeclarativetext/font/plaintext.qml     | 4 ++--
 .../auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml | 4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 872f6cb..6a2537b 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,9 +1,12 @@
 =============================================================================
-The changes below are pre Qt 4.7.0 tech preview
+The changes below are pre Qt 4.7.0 RC1
 
 TextInput
    - copy(), cut() and paste() functions added
+Font.letterSpacing
+   - was percentage based.  Now specified in pixels.
 
+=============================================================================
 The changes below are pre Qt 4.7.0 beta 2
 
 QDeclarativeView
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index ec8bfb5..a1703c1 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -303,8 +303,7 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate()
     Sets the letter spacing for the font.
 
     Letter spacing changes the default spacing between individual letters in the font.
-    A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by
-    the width of the character itself.
+    A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
 */
 
 /*!
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index d13e139..0cbada4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -213,8 +213,7 @@ QString QDeclarativeTextEdit::text() const
     Sets the letter spacing for the font.
 
     Letter spacing changes the default spacing between individual letters in the font.
-    A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by
-    the width of the character itself.
+    A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
 */
 
 /*!
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 2a5d73d..321b121 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -176,8 +176,7 @@ void QDeclarativeTextInput::setText(const QString &s)
     Sets the letter spacing for the font.
 
     Letter spacing changes the default spacing between individual letters in the font.
-    A value of 100 will keep the spacing unchanged; a value of 200 will enlarge the spacing after a character by
-    the width of the character itself.
+    A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
 */
 
 /*!
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index c17ec95..61e550a 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -973,7 +973,7 @@ qreal QDeclarativeFontValueType::letterSpacing() const
 
 void QDeclarativeFontValueType::setLetterSpacing(qreal size)
 {
-    font.setLetterSpacing(QFont::PercentageSpacing, size);
+    font.setLetterSpacing(QFont::AbsoluteSpacing, size);
 }
 
 qreal QDeclarativeFontValueType::wordSpacing() const
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 53862ec..821394d 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -848,22 +848,22 @@ void tst_qdeclarativetext::letterSpacing()
         QCOMPARE(textObject->font().letterSpacing(), 0.0);
     }
     {
-        QString componentStr = "import Qt 4.7\nText { text: \"Hello world!\"; font.letterSpacing: -50 }";
+        QString componentStr = "import Qt 4.7\nText { text: \"Hello world!\"; font.letterSpacing: -2 }";
         QDeclarativeComponent textComponent(&engine);
         textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
         QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
 
         QVERIFY(textObject != 0);
-        QCOMPARE(textObject->font().letterSpacing(), -50.);
+        QCOMPARE(textObject->font().letterSpacing(), -2.);
     }
     {
-        QString componentStr = "import Qt 4.7\nText { text: \"Hello world!\"; font.letterSpacing: 200 }";
+        QString componentStr = "import Qt 4.7\nText { text: \"Hello world!\"; font.letterSpacing: 3 }";
         QDeclarativeComponent textComponent(&engine);
         textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
         QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
 
         QVERIFY(textObject != 0);
-        QCOMPARE(textObject->font().letterSpacing(), 200.);
+        QCOMPARE(textObject->font().letterSpacing(), 3.);
     }
 }
 
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml
index 73dd4d7..e268a60 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/plaintext.qml
@@ -34,10 +34,10 @@ Rectangle {
             text: s.text; font.underline: true; font.overline: true; font.strikeout: true
         }
         Text {
-            text: s.text; font.letterSpacing: 200
+            text: s.text; font.letterSpacing: 2
         }
         Text {
-            text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue"
+            text: s.text; font.underline: true; font.letterSpacing: 2; font.capitalization: "AllUppercase"; color: "blue"
         }
         Text {
             text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green"
diff --git a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml
index b41b93a..a883b9c 100644
--- a/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml
+++ b/tests/auto/declarative/qmlvisual/qdeclarativetext/font/richtext.qml
@@ -34,10 +34,10 @@ Rectangle {
             text: s.text; font.underline: true; font.overline: true; font.strikeout: true
         }
         Text {
-            text: s.text; font.letterSpacing: 200
+            text: s.text; font.letterSpacing: 2
         }
         Text {
-            text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue"
+            text: s.text; font.underline: true; font.letterSpacing: 2; font.capitalization: "AllUppercase"; color: "blue"
         }
         Text {
             text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green"
-- 
cgit v0.12


From f8f255553f3640355d3e196e100778256741701c Mon Sep 17 00:00:00 2001
From: Charles Yin <charles.yin@nokia.com>
Date: Fri, 16 Jul 2010 11:15:06 +1000
Subject: Fixes the Oracle nchar bug when NLS_CHARSET is different with
 NLS_NCHAR_CHARSET.

If Oracle national char types use different charset(NLS_NCHAR_CHARSET) with
the database charset (NLS_CHARSET), the oci client need to set OCI_ATTR_CHARSET_FORM
to SQLCS_NCHAR instead of SQLCS_IMPLICIT.

Task-number: QTBUG-10919
Reviewed-by: Michael Goddard
---
 src/sql/drivers/oci/qsql_oci.cpp | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index c56b995..e11cf75 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -93,8 +93,17 @@ enum { QOCIEncoding = 2002 }; // AL16UTF16LE
 enum { QOCIEncoding = 2000 }; // AL16UTF16
 #endif
 
-static const ub1 CSID_NCHAR = SQLCS_NCHAR;
+// Always set the OCI_ATTR_CHARSET_FORM to SQLCS_NCHAR is safe
+// because Oracle server will deal with the implicit Conversion
+// Between CHAR and NCHAR.
+// see: http://download.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a89857/oci05bnd.htm#422705 
+static const ub1 qOraCharsetForm = SQLCS_NCHAR;
+
+#if defined (OCI_UTF16ID)
+static const ub2 qOraCharset = OCI_UTF16ID;
+#else
 static const ub2 qOraCharset = OCI_UCS2ID;
+#endif
 
 typedef QVarLengthArray<sb2, 32> IndicatorArray;
 typedef QVarLengthArray<ub2, 32> SizeArray;
@@ -209,12 +218,24 @@ void QOCIResultPrivate::setCharset(OCIBind* hbnd)
                    OCI_HTYPE_BIND,
                    // this const cast is safe since OCI doesn't touch
                    // the charset.
+                   const_cast<void *>(static_cast<const void *>(&qOraCharsetForm)),
+                   0,
+                   OCI_ATTR_CHARSET_FORM,
+                   err);
+    if (r != 0)
+        qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_FORM: ", err);
+
+    r = OCIAttrSet(hbnd,
+                   OCI_HTYPE_BIND,
+                   // this const cast is safe since OCI doesn't touch
+                   // the charset.
                    const_cast<void *>(static_cast<const void *>(&qOraCharset)),
                    0,
                    OCI_ATTR_CHARSET_ID,
                    err);
     if (r != 0)
         qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_ID: ", err);
+
 }
 
 int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, int pos,
@@ -939,6 +960,17 @@ void QOCICols::setCharset(OCIDefine* dfn)
                    OCI_HTYPE_DEFINE,
                    // this const cast is safe since OCI doesn't touch
                    // the charset.
+                   const_cast<void *>(static_cast<const void *>(&qOraCharsetForm)),
+                   0,
+                   OCI_ATTR_CHARSET_FORM,
+                   d->err);
+    if (r != 0)
+        qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_FORM: ", d->err);
+
+    r = OCIAttrSet(dfn,
+                   OCI_HTYPE_DEFINE,
+                   // this const cast is safe since OCI doesn't touch
+                   // the charset.
                    const_cast<void *>(static_cast<const void *>(&qOraCharset)),
                    0,
                    OCI_ATTR_CHARSET_ID,
-- 
cgit v0.12


From 947b30973c53c3dc336aafc5352c13a2a660e32e Mon Sep 17 00:00:00 2001
From: Charles Yin <charles.yin@nokia.com>
Date: Wed, 21 Jul 2010 10:54:22 +1000
Subject: Updates changes-4.7.0

---
 dist/changes-4.7.0 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index 49c17ee..e195488 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -249,7 +249,13 @@ Qt Plugins
 ****************************************************************************
 *                          Database Drivers                                *
 ****************************************************************************
-
+ - Sqlite
+   * [QTBUG-11904] Pointer aliasing problem in sqlite
+ - OCI
+   * [QTBUG-10919] Unable to insert unicode chars with codepoint > 255 
+     in nvarchar2 column on oracle
+   * [QTBUG-8210] Oracle - DATE in db with a year greater or equal to 2800 
+     returns an invalid date
 
 ****************************************************************************
 *                      Platform Specific Changes                           *
-- 
cgit v0.12


From 6d8b3453b6b4b151c777ad541ab25ca6bacc7381 Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Wed, 21 Jul 2010 10:04:11 +1000
Subject: Fix clock example: make sure hands always moves forward.

Task-number: QTBUG-12292
---
 examples/declarative/toys/clocks/content/Clock.qml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/declarative/toys/clocks/content/Clock.qml b/examples/declarative/toys/clocks/content/Clock.qml
index 24a07ec..eaa14c6 100644
--- a/examples/declarative/toys/clocks/content/Clock.qml
+++ b/examples/declarative/toys/clocks/content/Clock.qml
@@ -77,7 +77,7 @@ Item {
             origin.x: 7.5; origin.y: 73;
             angle: (clock.hours * 30) + (clock.minutes * 0.5)
             Behavior on angle {
-                NumberAnimation{}
+                RotationAnimation{ direction: RotationAnimation.Clockwise }
             }
         }
     }
@@ -91,7 +91,7 @@ Item {
             origin.x: 6.5; origin.y: 83;
             angle: clock.minutes * 6
             Behavior on angle {
-                NumberAnimation{}
+                RotationAnimation{ direction: RotationAnimation.Clockwise }
             }
         }
     }
@@ -105,7 +105,7 @@ Item {
             origin.x: 2.5; origin.y: 80;
             angle: clock.seconds * 6
             Behavior on angle {
-                NumberAnimation{}
+                RotationAnimation{ direction: RotationAnimation.Clockwise }
             }
         }
     }
-- 
cgit v0.12


From 64833c0a648211f3fe7547436f022edc0ceb51ac Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Wed, 21 Jul 2010 10:52:08 +1000
Subject: Only ignore the same target value for a Behavior when it is running.

Otherwise a Behavior may mistakenly not be triggered. This situation
can arise when the property in question has been manipulated via the
property system, followed by a direct function call (which correctly
bypasses the Behavior), followed by a another change via the property
system.

Task-number: QTBUG-12295
---
 src/declarative/util/qdeclarativebehavior.cpp      |  2 +-
 .../qdeclarativebehaviors/data/qtbug12295.qml      | 17 ++++++++++++++
 .../tst_qdeclarativebehaviors.cpp                  | 27 ++++++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml

diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 3719085..fadb2ae 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -177,7 +177,7 @@ void QDeclarativeBehavior::write(const QVariant &value)
         return;
     }
 
-    if (value == d->targetValue)
+    if (d->animation->isRunning() && value == d->targetValue)
         return;
 
     d->currentValue = d->property.read();
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml b/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
new file mode 100644
index 0000000..804559c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/qtbug12295.qml
@@ -0,0 +1,17 @@
+import Qt 4.7
+
+Rectangle {
+    width: 200
+    height: 200
+    color: "blue"
+
+    Rectangle {
+        id: myRect
+        objectName: "myRect"
+        width: 100
+        height: 100
+        Behavior on x {
+            NumberAnimation {}
+        }
+    }
+}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index 5c2c145..bb7fc7b 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -80,6 +80,7 @@ private slots:
     void startup();
     void groupedPropertyCrash();
     void runningTrue();
+    void sameValue();
 };
 
 void tst_qdeclarativebehaviors::simpleBehavior()
@@ -384,6 +385,32 @@ void tst_qdeclarativebehaviors::runningTrue()
     QTRY_VERIFY(runningSpy.count() > 0);
 }
 
+//QTBUG-12295
+void tst_qdeclarativebehaviors::sameValue()
+{
+    QDeclarativeEngine engine;
+    QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/qtbug12295.qml"));
+    QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
+    QVERIFY(rect);
+
+    QDeclarativeRectangle *target = rect->findChild<QDeclarativeRectangle*>("myRect");
+    QVERIFY(target);
+
+    target->setX(100);
+    QCOMPARE(target->x(), qreal(100));
+
+    target->setProperty("x", 0);
+    QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+
+    target->setX(100);
+    QCOMPARE(target->x(), qreal(100));
+
+    //this is the main point of the test -- the behavior needs to be triggered again
+    //even though we set 0 twice in a row.
+    target->setProperty("x", 0);
+    QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+}
+
 QTEST_MAIN(tst_qdeclarativebehaviors)
 
 #include "tst_qdeclarativebehaviors.moc"
-- 
cgit v0.12


From c2c28428123cfd3a3994117bfea88a0ae68f6884 Mon Sep 17 00:00:00 2001
From: Warwick Allison <warwick.allison@nokia.com>
Date: Wed, 21 Jul 2010 11:30:20 +1000
Subject: Ensure redirects (and indeed all reply process) is done in the right
 thread. i.e. the thread with the QNAM the original reply was created in.

Task-number: QTBUG-12302
Reviewed-by: Aaron Kennedy
---
 src/declarative/util/qdeclarativepixmapcache.cpp   | 55 +++++++++++++---------
 .../qdeclarativeimage/tst_qdeclarativeimage.cpp    |  2 +
 2 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 00dd922..31813a6 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -114,6 +114,18 @@ public:
     static int downloadProgressIndex;
 };
 
+class QDeclarativePixmapReaderThreadObject : public QObject {
+    Q_OBJECT
+public:
+    QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *);
+    void processJobs();
+    virtual bool event(QEvent *e);
+private slots:
+    void networkRequestDone();
+private:
+    QDeclarativePixmapReader *reader;
+};
+
 class QDeclarativePixmapData;
 class QDeclarativePixmapReader : public QThread
 {
@@ -130,12 +142,11 @@ public:
 protected:
     void run();
 
-private slots:
-    void networkRequestDone();
-
 private:
+    friend class QDeclarativePixmapReaderThreadObject;
     void processJobs();
     void processJob(QDeclarativePixmapReply *);
+    void networkRequestDone(QNetworkReply *);
 
     QList<QDeclarativePixmapReply*> jobs;
     QList<QDeclarativePixmapReply*> cancelled;
@@ -143,14 +154,7 @@ private:
     QObject *eventLoopQuitHack;
 
     QMutex mutex;
-    class ThreadObject : public QObject {
-    public:
-        ThreadObject(QDeclarativePixmapReader *);
-        void processJobs();
-        virtual bool event(QEvent *e);
-    private:
-        QDeclarativePixmapReader *reader;
-    } *threadObject;
+    QDeclarativePixmapReaderThreadObject *threadObject;
     QWaitCondition waitCondition;
 
     QNetworkAccessManager *networkAccessManager();
@@ -161,7 +165,7 @@ private:
     static int replyDownloadProgress;
     static int replyFinished;
     static int downloadProgress;
-    static int thisNetworkRequestDone;
+    static int threadNetworkRequestDone;
     static QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> readers;
     static QMutex readerMutex;
 };
@@ -232,7 +236,7 @@ QMutex QDeclarativePixmapReader::readerMutex;
 int QDeclarativePixmapReader::replyDownloadProgress = -1;
 int QDeclarativePixmapReader::replyFinished = -1;
 int QDeclarativePixmapReader::downloadProgress = -1;
-int QDeclarativePixmapReader::thisNetworkRequestDone = -1;
+int QDeclarativePixmapReader::threadNetworkRequestDone = -1;
 
 
 void QDeclarativePixmapReply::postReply(ReadError error, const QString &errorString, 
@@ -317,9 +321,8 @@ QDeclarativePixmapReader::~QDeclarativePixmapReader()
     wait();
 }
 
-void QDeclarativePixmapReader::networkRequestDone()
+void QDeclarativePixmapReader::networkRequestDone(QNetworkReply *reply)
 {
-    QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
     QDeclarativePixmapReply *job = replies.take(reply);
 
     if (job) {
@@ -335,7 +338,7 @@ void QDeclarativePixmapReader::networkRequestDone()
                 reply = networkAccessManager()->get(req);
 
                 QMetaObject::connect(reply, replyDownloadProgress, job, downloadProgress);
-                QMetaObject::connect(reply, replyFinished, this, thisNetworkRequestDone);
+                QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
 
                 replies.insert(reply, job);
                 return;
@@ -368,17 +371,17 @@ void QDeclarativePixmapReader::networkRequestDone()
     threadObject->processJobs();
 }
 
-QDeclarativePixmapReader::ThreadObject::ThreadObject(QDeclarativePixmapReader *i)
+QDeclarativePixmapReaderThreadObject::QDeclarativePixmapReaderThreadObject(QDeclarativePixmapReader *i)
 : reader(i)
 {
 }
 
-void QDeclarativePixmapReader::ThreadObject::processJobs() 
+void QDeclarativePixmapReaderThreadObject::processJobs() 
 { 
     QCoreApplication::postEvent(this, new QEvent(QEvent::User)); 
 }
 
-bool QDeclarativePixmapReader::ThreadObject::event(QEvent *e) 
+bool QDeclarativePixmapReaderThreadObject::event(QEvent *e) 
 {
     if (e->type() == QEvent::User) { 
         reader->processJobs(); 
@@ -388,6 +391,12 @@ bool QDeclarativePixmapReader::ThreadObject::event(QEvent *e)
     }
 }
 
+void QDeclarativePixmapReaderThreadObject::networkRequestDone()
+{
+    QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
+    reader->networkRequestDone(reply);
+}
+
 void QDeclarativePixmapReader::processJobs()
 {
     QMutexLocker locker(&mutex);
@@ -469,7 +478,7 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob)
             QNetworkReply *reply = networkAccessManager()->get(req);
 
             QMetaObject::connect(reply, replyDownloadProgress, runningJob, downloadProgress);
-            QMetaObject::connect(reply, replyFinished, this, thisNetworkRequestDone);
+            QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
 
             replies.insert(reply, runningJob);
         }
@@ -520,15 +529,15 @@ void QDeclarativePixmapReader::run()
     if (replyDownloadProgress == -1) {
         const QMetaObject *nr = &QNetworkReply::staticMetaObject;
         const QMetaObject *pr = &QDeclarativePixmapReply::staticMetaObject;
-        const QMetaObject *ir = &QDeclarativePixmapReader::staticMetaObject;
+        const QMetaObject *ir = &QDeclarativePixmapReaderThreadObject::staticMetaObject;
         replyDownloadProgress = nr->indexOfSignal("downloadProgress(qint64,qint64)");
         replyFinished = nr->indexOfSignal("finished()");
         downloadProgress = pr->indexOfSignal("downloadProgress(qint64,qint64)");
-        thisNetworkRequestDone = ir->indexOfSlot("networkRequestDone()");
+        threadNetworkRequestDone = ir->indexOfSlot("networkRequestDone()");
     }
 
     mutex.lock();
-    threadObject = new ThreadObject(this);
+    threadObject = new QDeclarativePixmapReaderThreadObject(this);
     mutex.unlock();
 
     processJobs();
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index 38fd458..b8d2828 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -136,6 +136,7 @@ void tst_qdeclarativeimage::imageSource_data()
     QTest::newRow("local async not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() << 0.0 << 0.0 << false
         << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString();
     QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << "";
+    QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << "";
     QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << "";
     QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true
         << false << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found";
@@ -155,6 +156,7 @@ void tst_qdeclarativeimage::imageSource()
     if (remote) {
         QVERIFY(server.isValid());
         server.serveDirectory(SRCDIR "/data");
+        server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
     }
 
     if (!error.isEmpty())
-- 
cgit v0.12


From 4f6e480acce94d8ae920c3eda4879fc4f9cb2598 Mon Sep 17 00:00:00 2001
From: Yann Bodson <yann.bodson@nokia.com>
Date: Wed, 21 Jul 2010 11:36:03 +1000
Subject: Do not show copyright header in documentation.

---
 doc/src/declarative/qdeclarativeintro.qdoc | 2 +-
 doc/src/snippets/declarative/comments.qml  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 3f1b184..75055d8 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -129,7 +129,7 @@ Commenting in QML is similar to JavaScript.
 \o Multiline comments start with /* and finish with *\/
 \endlist
 
-\quotefile doc/src/snippets/declarative/comments.qml
+\snippet doc/src/snippets/declarative/comments.qml 0
 
 Comments are ignored by the engine. They are useful for explaining what you
 are doing; for referring back to at a later date, or for others reading
diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml
index f4bedb8..bafa26d 100644
--- a/doc/src/snippets/declarative/comments.qml
+++ b/doc/src/snippets/declarative/comments.qml
@@ -40,6 +40,7 @@
 
 import Qt 4.7
 
+//![0]
 Text {
     text: "Hello world!"    //a basic greeting
     /*
@@ -49,3 +50,4 @@ Text {
     font.family: "Helvetica"
     font.pointSize: 24
 }
+//![0]
-- 
cgit v0.12


From 21806ff0921641b4e4d9d39721ab4ebeae74dddc Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Wed, 21 Jul 2010 12:23:15 +1000
Subject: QML focus API updates.

The wantsFocus property has been renamed to activeFocus, to better
reflect its value. Reading and writing the focus property is also now
consistent -- this property represents focus within a scope. Other small
changes were made to keep things consistent with the new naming.

Reviewed-by: Aaron Kennedy
---
 .../photoviewer/PhotoViewerCore/EditableButton.qml |   2 +-
 demos/declarative/twitter/TwitterCore/Button.qml   |   2 +-
 demos/declarative/webbrowser/content/UrlInput.qml  |   2 +-
 doc/src/declarative/focus.qdoc                     |   8 +-
 .../keyinteraction/focus/Core/GridMenu.qml         |   6 +-
 .../keyinteraction/focus/Core/ListViewDelegate.qml |   4 +-
 .../keyinteraction/focus/Core/ListViews.qml        |   8 +-
 .../declarative/keyinteraction/focus/focus.qml     |   4 +-
 .../declarative/toys/dynamicscene/dynamicscene.qml |   1 -
 src/declarative/QmlChanges.txt                     |   7 ++
 src/declarative/graphicsitems/qdeclarativeitem.cpp |  95 ++++++++++++---
 src/declarative/graphicsitems/qdeclarativeitem.h   |   8 +-
 src/declarative/graphicsitems/qdeclarativeitem_p.h |   9 +-
 .../graphicsitems/qdeclarativetextedit.cpp         |  42 +++----
 .../graphicsitems/qdeclarativetextedit_p.h         |   4 +-
 .../graphicsitems/qdeclarativetextinput.cpp        |  44 +++----
 .../graphicsitems/qdeclarativetextinput_p.h        |   4 +-
 src/gui/graphicsview/qgraphicsitem.cpp             |  12 ++
 src/gui/graphicsview/qgraphicsitem_p.h             |   1 +
 .../qdeclarativefocusscope/data/chain.qml          |  10 +-
 .../qdeclarativefocusscope/data/forcefocus.qml     |  22 ++--
 .../qdeclarativefocusscope/data/test.qml           |  14 +--
 .../qdeclarativefocusscope/data/test2.qml          |  10 +-
 .../qdeclarativefocusscope/data/test3.qml          |   2 +-
 .../qdeclarativefocusscope/data/test4.qml          |  14 +--
 .../qdeclarativefocusscope/data/test5.qml          |  10 +-
 .../tst_qdeclarativefocusscope.cpp                 | 131 ++++++++++-----------
 .../qdeclarativeitem/tst_qdeclarativeitem.cpp      |  28 ++---
 .../qdeclarativestates/data/propertyErrors.qml     |   2 +-
 .../qdeclarativestates/tst_qdeclarativestates.cpp  |   2 +-
 .../tst_qdeclarativetextedit.cpp                   |  28 ++---
 .../tst_qdeclarativetextinput.cpp                  |  40 +++----
 32 files changed, 330 insertions(+), 246 deletions(-)

diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
index be7dfa4..decc0fe 100644
--- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
+++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -81,6 +81,6 @@ Item {
 
     MouseArea {
         anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
-        onClicked: { textInput.forceFocus(); textInput.openSoftwareInputPanel(); }
+        onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); }
     }
 }
diff --git a/demos/declarative/twitter/TwitterCore/Button.qml b/demos/declarative/twitter/TwitterCore/Button.qml
index 9c90c2c..d326c64 100644
--- a/demos/declarative/twitter/TwitterCore/Button.qml
+++ b/demos/declarative/twitter/TwitterCore/Button.qml
@@ -80,7 +80,7 @@ Item {
         },
         State {
             name: "Focused"
-            when: container.focus == true
+            when: container.activeFocus == true
             PropertyChanges { target: btnText; color: "#FFFFFF" }
         }
     ]
diff --git a/demos/declarative/webbrowser/content/UrlInput.qml b/demos/declarative/webbrowser/content/UrlInput.qml
index 9992456..4f49821 100644
--- a/demos/declarative/webbrowser/content/UrlInput.qml
+++ b/demos/declarative/webbrowser/content/UrlInput.qml
@@ -69,7 +69,7 @@ Item {
     TextInput {
         id: urlText
         horizontalAlignment: TextEdit.AlignLeft
-        font.pixelSize: 14; focusOnPress: true
+        font.pixelSize: 14;
 
         onTextChanged: container.urlChanged()
 
diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc
index 0dd5eb3..e3ca963 100644
--- a/doc/src/declarative/focus.qdoc
+++ b/doc/src/declarative/focus.qdoc
@@ -73,12 +73,12 @@ See also the \l {Keys}{Keys attached property} and \l {KeyNavigation}{KeyNavigat
 \section1 Querying the Active Focus Item
 
 Whether or not an \l Item has \e {active focus} can be queried through the
-property \c {Item::focus}.  For example, here we have a \l Text
+property \c {Item::activeFocus}.  For example, here we have a \l Text
 element whose text is determined by whether or not it has \e {active focus}.
 
 \code
 Text {
-    text: focus ? "I have active focus!" : "I do not have active focus"
+    text: activeFocus ? "I have active focus!" : "I do not have active focus"
 }
 \endcode
 
@@ -174,7 +174,7 @@ Rectangle {
 The right hand side of the example shows the expanded code - the equivalent QML
 without the use of the component \c {MyWidget}.  From this, the problem is
 evident - there are no less than three elements that have the \c {Item::focus}
-property set to true.  Ultimately only one element can have focus, and the
+property set to true.  Ultimately only one element can have keyboard focus, and the
 system has to decide which on.  In this case the first appearance of the
 \c {Item::focus} property being set to true on line 4 is selected, and the value
 of \c {Item::focus} in the other two instances is reverted back to false.  This
@@ -233,7 +233,7 @@ and the others are unset, just like when there are no \e {focus scopes}.
 \o When a \e {focus scope} receives \e {active focus}, the contained element with
 \c {Item::focus} set (if any) also gets \e {active focus}.  If this element is
 also a \l FocusScope, the proxying behaviour continues.  Both the
-\e {focus scope} and the sub-focused item will have \c {Item::focus} set.
+\e {focus scope} and the sub-focused item will have \c {Item::activeFocus} set.
 \endlist
 
 So far the example has the second component statically selected.  It is trivial
diff --git a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
index 9a8d3f3..19f7235 100644
--- a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
+++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
@@ -43,7 +43,7 @@ import Qt 4.7
 FocusScope {
     property alias interactive: gridView.interactive
 
-    onWantsFocusChanged: if (wantsFocus) mainView.state = ""
+    onActiveFocusChanged: if (activeFocus) mainView.state = ""
 
     Rectangle {
         anchors.fill: parent
@@ -84,12 +84,12 @@ FocusScope {
 
                     onClicked: {
                         GridView.view.currentIndex = index
-                        container.forceFocus()
+                        container.forceActiveFocus()
                     }
                 }
 
                 states: State {
-                    name: "active"; when: container.focus == true
+                    name: "active"; when: container.activeFocus
                     PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
                 }
 
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
index cc13637..602b52b 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
@@ -69,12 +69,12 @@ Item {
 
         onClicked: {
             ListView.view.currentIndex = index
-            container.forceFocus()
+            container.forceActiveFocus()
         }
     }
 
     states: State {
-        name: "active"; when: container.focus == true
+        name: "active"; when: container.activeFocus
         PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
         PropertyChanges { target: label; font.pixelSize: 16 }
     }
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
index 6f9ceb4..3d6ceab 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViews.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
@@ -43,11 +43,11 @@ import Qt 4.7
 FocusScope {
     clip: true
 
-    onWantsFocusChanged: if (wantsFocus) mainView.state = "showListViews"
+    onActiveFocusChanged: if (activeFocus) mainView.state = "showListViews"
 
     ListView {
         id: list1
-        y: wantsFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
+        y: activeFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
         focus: true
         KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2
         model: 10; cacheBuffer: 200
@@ -60,7 +60,7 @@ FocusScope {
 
     ListView {
         id: list2
-        y: wantsFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
+        y: activeFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
         KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
         model: 10; cacheBuffer: 200
         delegate: ListViewDelegate {}
@@ -72,7 +72,7 @@ FocusScope {
 
     ListView {
         id: list3
-        y: wantsFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
+        y: activeFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
         KeyNavigation.up: gridMenu; KeyNavigation.left: list2
         model: 10; cacheBuffer: 200
         delegate: ListViewDelegate {}
diff --git a/examples/declarative/keyinteraction/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml
index 8b2af70..56fdffc 100644
--- a/examples/declarative/keyinteraction/focus/focus.qml
+++ b/examples/declarative/keyinteraction/focus/focus.qml
@@ -58,7 +58,7 @@ Rectangle {
 
             width: parent.width; height: 320
             focus: true
-            interactive: parent.wantsFocus
+            interactive: parent.activeFocus
         }
 
         ListViews {
@@ -98,7 +98,7 @@ Rectangle {
 
     states: State {
         name: "contextMenuOpen"
-        when: !mainView.wantsFocus
+        when: !mainView.activeFocus
         PropertyChanges { target: contextMenu; x: 0; open: true }
         PropertyChanges { target: mainView; x: 130 }
         PropertyChanges { target: shade; opacity: 0.25 }
diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qml b/examples/declarative/toys/dynamicscene/dynamicscene.qml
index 1edb841..2a22a5f 100644
--- a/examples/declarative/toys/dynamicscene/dynamicscene.qml
+++ b/examples/declarative/toys/dynamicscene/dynamicscene.qml
@@ -184,7 +184,6 @@ Item {
                     id: qmlText
                     anchors.fill: parent; anchors.margins: 5
                     readOnly: false
-                    focusOnPress: true
                     font.pixelSize: 14
                     wrapMode: TextEdit.WordWrap
 
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 6a2537b..6e07330 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -5,6 +5,13 @@ TextInput
    - copy(), cut() and paste() functions added
 Font.letterSpacing
    - was percentage based.  Now specified in pixels.
+Item
+   - wantsFocus renamed to activeFocus
+   - forceFocus() renamed to forceActiveFocus()
+   - focus now returns the scoped focus (i.e. focus read/write now manipulate
+     the same value)
+TextInput and TextEdit:
+   - focusOnPress renamed to activeFocusOnPress
 
 =============================================================================
 The changes below are pre Qt 4.7.0 beta 2
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 1b0d7ef..301779a 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1430,7 +1430,7 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
 */
 
 /*!
-    \fn void QDeclarativeItem::wantsFocusChanged(bool)
+    \fn void QDeclarativeItem::activeFocusChanged(bool)
     \internal
 */
 
@@ -2370,12 +2370,12 @@ QScriptValue QDeclarativeItem::mapToItem(const QScriptValue &item, qreal x, qrea
 }
 
 /*!
-    \qmlmethod Item::forceFocus()
+    \qmlmethod Item::forceActiveFocus()
 
-    Force the focus on the item.
-    This method sets the focus on the item and makes sure that all the focus scopes higher in the object hierarchy are given focus.
+    Force active focus on the item.
+    This method sets focus on the item and makes sure that all the focus scopes higher in the object hierarchy are also given focus.
 */
-void QDeclarativeItem::forceFocus()
+void QDeclarativeItem::forceActiveFocus()
 {
     setFocus(true);
     QGraphicsItem *parent = parentItem();
@@ -2412,8 +2412,19 @@ void QDeclarativeItemPrivate::focusChanged(bool flag)
 {
     Q_Q(QDeclarativeItem);
     if (!(flags & QGraphicsItem::ItemIsFocusScope) && parent)
-        emit q->wantsFocusChanged(flag);   //see also QDeclarativeItemPrivate::subFocusItemChange()
-    emit q->focusChanged(flag);
+        emit q->activeFocusChanged(flag);   //see also QDeclarativeItemPrivate::subFocusItemChange()
+
+    bool inScope = false;
+    QGraphicsItem *p = parent;
+    while (p) {
+        if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+            inScope = true;
+            break;
+        }
+        p = p->parentItem();
+    }
+    if (!inScope)
+        emit q->focusChanged(flag);
 }
 
 /*! \internal */
@@ -2690,7 +2701,7 @@ bool QDeclarativeItem::sceneEvent(QEvent *event)
 
         if (event->type() == QEvent::FocusIn ||
             event->type() == QEvent::FocusOut) {
-            d->focusChanged(hasFocus());
+            d->focusChanged(hasActiveFocus());
         }
         return rv;
     }
@@ -3104,15 +3115,32 @@ void QDeclarativeItem::setSize(const QSizeF &size)
 }
 
 /*!
-  \qmlproperty bool Item::wantsFocus
+  \qmlproperty bool Item::activeFocus
+
+  This property indicates whether the item has active focus.
+
+  An item with active focus will receive keyboard input,
+  or is a FocusScope ancestor of the item that will receive keyboard input.
 
-  This property indicates whether the item has has an active focus request.
+  Usually, activeFocus is gained by setting focus on an item and its enclosing
+  FocusScopes. In the following example \c input will have activeFocus.
+  \qml
+  Rectangle {
+      FocusScope {
+          focus: true
+          TextInput {
+              id: input
+              focus: true
+          }
+      }
+  }
+  \endqml
 
-  \sa {qmlfocus}{Keyboard Focus}
+  \sa focus, {qmlfocus}{Keyboard Focus}
 */
 
 /*! \internal */
-bool QDeclarativeItem::wantsFocus() const
+bool QDeclarativeItem::hasActiveFocus() const
 {
     Q_D(const QDeclarativeItem);
     return focusItem() == this ||
@@ -3122,16 +3150,51 @@ bool QDeclarativeItem::wantsFocus() const
 
 /*!
   \qmlproperty bool Item::focus
-  This property indicates whether the item has keyboard input focus. Set this
-  property to true to request focus.
+  This property indicates whether the item has focus within the enclosing focus scope. If true, this item
+  will gain active focus when the enclosing focus scope gains active focus.
+  In the following example, \c input will be given active focus when \c scope gains active focus.
+  \qml
+  Rectangle {
+      FocusScope {
+          id: scope
+          TextInput {
+              id: input
+              focus: true
+          }
+      }
+  }
+  \endqml
 
-  \sa {qmlfocus}{Keyboard Focus}
+  For the purposes of this property, the top level item in the scene
+  is assumed to act like a focus scope, and to always have active focus
+  when the scene has focus. On a practical level, that means the following
+  QML will give active focus to \c input on startup.
+
+  \qml
+  Rectangle {
+      TextInput {
+          id: input
+          focus: true
+      }
+  }
+  \endqml
+
+  \sa activeFocus, {qmlfocus}{Keyboard Focus}
 */
 
 /*! \internal */
 bool QDeclarativeItem::hasFocus() const
 {
-    return QGraphicsItem::hasFocus();
+    Q_D(const QDeclarativeItem);
+    QGraphicsItem *p = d->parent;
+    while (p) {
+        if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+            return p->focusScopeItem() == this;
+        }
+        p = p->parentItem();
+    }
+
+    return hasActiveFocus() ? true : (!QGraphicsItem::parentItem() ? true : false);
 }
 
 /*! \internal */
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index 8878fa0..cd9b910 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -87,7 +87,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeItem : public QGraphicsObject, public QDe
     Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
     Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged) // ### move to QGI/QGO, NOTIFY
     Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
-    Q_PROPERTY(bool wantsFocus READ wantsFocus NOTIFY wantsFocusChanged)
+    Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged)
     Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform> transform READ transform DESIGNABLE false FINAL)
     Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
     Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // transformOriginPoint is read-only for Item
@@ -139,7 +139,7 @@ public:
     QRectF boundingRect() const;
     virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
 
-    bool wantsFocus() const;
+    bool hasActiveFocus() const;
     bool hasFocus() const;
     void setFocus(bool);
 
@@ -148,7 +148,7 @@ public:
 
     Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const;
     Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const;
-    Q_INVOKABLE void forceFocus();
+    Q_INVOKABLE void forceActiveFocus();
     Q_INVOKABLE QDeclarativeItem *childAt(qreal x, qreal y) const;
 
 Q_SIGNALS:
@@ -157,7 +157,7 @@ Q_SIGNALS:
     void baselineOffsetChanged(qreal);
     void stateChanged(const QString &);
     void focusChanged(bool);
-    void wantsFocusChanged(bool);
+    void activeFocusChanged(bool);
     void parentChanged(QDeclarativeItem *);
     void transformOriginChanged(TransformOrigin);
     void smoothChanged(bool);
diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h
index bc5d809..8c3e084 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h
@@ -285,11 +285,18 @@ public:
     virtual void subFocusItemChange()
     {
         if (flags & QGraphicsItem::ItemIsFocusScope || !parent)
-            emit q_func()->wantsFocusChanged(subFocusItem != 0);
+            emit q_func()->activeFocusChanged(subFocusItem != 0);
         //see also QDeclarativeItemPrivate::focusChanged
     }
 
     // Reimplemented from QGraphicsItemPrivate
+    virtual void focusScopeItemChange(bool isSubFocusItem)
+    {
+        emit q_func()->focusChanged(isSubFocusItem);
+    }
+
+
+    // Reimplemented from QGraphicsItemPrivate
     virtual void siblingOrderChange()
     {
         Q_Q(QDeclarativeItem);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 0cbada4..f7b2ebf 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -624,7 +624,7 @@ void QDeclarativeTextEdit::moveCursorSelection(int pos)
     \qmlproperty bool TextEdit::cursorVisible
     If true the text edit shows a cursor.
 
-    This property is set and unset when the text edit gets focus, but it can also
+    This property is set and unset when the text edit gets active focus, but it can also
     be set directly (useful, for example, if a KeyProxy might forward keys to it).
 */
 bool QDeclarativeTextEdit::isCursorVisible() const
@@ -783,9 +783,9 @@ QString QDeclarativeTextEdit::selectedText() const
 }
 
 /*!
-    \qmlproperty bool TextEdit::focusOnPress
+    \qmlproperty bool TextEdit::activeFocusOnPress
 
-    Whether the TextEdit should gain focus on a mouse press. By default this is
+    Whether the TextEdit should gain active focus on a mouse press. By default this is
     set to true.
 */
 bool QDeclarativeTextEdit::focusOnPress() const
@@ -800,13 +800,13 @@ void QDeclarativeTextEdit::setFocusOnPress(bool on)
     if (d->focusOnPress == on)
         return;
     d->focusOnPress = on;
-    emit focusOnPressChanged(d->focusOnPress);
+    emit activeFocusOnPressChanged(d->focusOnPress);
 }
 
 /*!
     \qmlproperty bool TextEdit::persistentSelection
 
-    Whether the TextEdit should keep the selection visible when it loses focus to another
+    Whether the TextEdit should keep the selection visible when it loses active focus to another
     item in the scene. By default this is set to true;
 */
 bool QDeclarativeTextEdit::persistentSelection() const
@@ -1106,15 +1106,15 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
     Q_D(QDeclarativeTextEdit);
     if (d->focusOnPress){
-        bool hadFocus = hasFocus();
-        forceFocus();
+        bool hadActiveFocus = hasActiveFocus();
+        forceActiveFocus();
         if (d->showInputPanelOnFocus) {
-            if (hasFocus() && hadFocus && !isReadOnly()) {
+            if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
                 // re-open input panel on press if already focused
                 openSoftwareInputPanel();
             }
         } else { // show input panel on click
-            if (hasFocus() && !hadFocus) {
+            if (hasActiveFocus() && !hadActiveFocus) {
                 d->clickCausedFocus = true;
             }
         }
@@ -1427,10 +1427,10 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
 
     By default the opening of input panels follows the platform style. On Symbian^1 and
     Symbian^3 -based devices the panels are opened by clicking TextEdit. On other platforms
-    the panels are automatically opened when TextEdit element gains focus. Input panels are
-    always closed if no editor owns focus.
+    the panels are automatically opened when TextEdit element gains active focus. Input panels are
+    always closed if no editor has active focus.
 
-    You can disable the automatic behavior by setting the property \c focusOnPress to false
+    You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
     and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
     the behavior you want.
 
@@ -1441,12 +1441,12 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
         TextEdit {
             id: textEdit
             text: "Hello world!"
-            focusOnPress: false
+            activeFocusOnPress: false
             MouseArea {
                 anchors.fill: parent
                 onClicked: {
-                    if (!textEdit.focus) {
-                        textEdit.focus = true;
+                    if (!textEdit.activeFocus) {
+                        textEdit.forceActiveFocus();
                         textEdit.openSoftwareInputPanel();
                     } else {
                         textEdit.focus = false;
@@ -1478,10 +1478,10 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
 
     By default the opening of input panels follows the platform style. On Symbian^1 and
     Symbian^3 -based devices the panels are opened by clicking TextEdit. On other platforms
-    the panels are automatically opened when TextEdit element gains focus. Input panels are
-    always closed if no editor owns focus.
+    the panels are automatically opened when TextEdit element gains active focus. Input panels are
+    always closed if no editor has active focus.
 
-    You can disable the automatic behavior by setting the property \c focusOnPress to false
+    You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
     and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
     the behavior you want.
 
@@ -1492,12 +1492,12 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
         TextEdit {
             id: textEdit
             text: "Hello world!"
-            focusOnPress: false
+            activeFocusOnPress: false
             MouseArea {
                 anchors.fill: parent
                 onClicked: {
-                    if (!textEdit.focus) {
-                        textEdit.focus = true;
+                    if (!textEdit.activeFocus) {
+                        textEdit.forceActiveFocus();
                         textEdit.openSoftwareInputPanel();
                     } else {
                         textEdit.focus = false;
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 279af78..68fde3d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -85,7 +85,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
     Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
     Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
     Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged)
-    Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
+    Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
     Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
     Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin NOTIFY textMarginChanged)
     Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
@@ -216,7 +216,7 @@ Q_SIGNALS:
     void readOnlyChanged(bool isReadOnly);
     void cursorVisibleChanged(bool isCursorVisible);
     void cursorDelegateChanged();
-    void focusOnPressChanged(bool focusIsPressed);
+    void activeFocusOnPressChanged(bool activeFocusOnPressed);
     void persistentSelectionChanged(bool isPersistentSelection);
     void textMarginChanged(qreal textMargin);
     void selectByMouseChanged(bool selectByMouse);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 321b121..34f5897 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -375,14 +375,14 @@ void QDeclarativeTextInput::setMaxLength(int ml)
     \qmlproperty bool TextInput::cursorVisible
     Set to true when the TextInput shows a cursor.
 
-    This property is set and unset when the TextInput gets focus, so that other
+    This property is set and unset when the TextInput gets active focus, so that other
     properties can be bound to whether the cursor is currently showing. As it
     gets set and unset automatically, when you set the value yourself you must
     keep in mind that your value may be overwritten.
 
     It can be set directly in script, for example if a KeyProxy might
     forward keys to it and you desire it to look active when this happens
-    (but without actually giving it the focus).
+    (but without actually giving it active focus).
 
     It should not be set directly on the element, like in the below QML,
     as the specified value will be overridden an lost on focus changes.
@@ -395,7 +395,7 @@ void QDeclarativeTextInput::setMaxLength(int ml)
     \endcode
 
     In the above snippet the cursor will still become visible when the
-    TextInput gains focus.
+    TextInput gains active focus.
 */
 bool QDeclarativeTextInput::isCursorVisible() const
 {
@@ -510,9 +510,9 @@ QString QDeclarativeTextInput::selectedText() const
 }
 
 /*!
-    \qmlproperty bool TextInput::focusOnPress
+    \qmlproperty bool TextInput::activeFocusOnPress
 
-    Whether the TextInput should gain focus on a mouse press. By default this is
+    Whether the TextInput should gain active focus on a mouse press. By default this is
     set to true.
 */
 bool QDeclarativeTextInput::focusOnPress() const
@@ -529,7 +529,7 @@ void QDeclarativeTextInput::setFocusOnPress(bool b)
 
     d->focusOnPress = b;
 
-    emit focusOnPressChanged(d->focusOnPress);
+    emit activeFocusOnPressChanged(d->focusOnPress);
 }
 
 /*!
@@ -945,15 +945,15 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
     Q_D(QDeclarativeTextInput);
     if(d->focusOnPress){
-        bool hadFocus = hasFocus();
-        forceFocus();
+        bool hadActiveFocus = hasActiveFocus();
+        forceActiveFocus();
         if (d->showInputPanelOnFocus) {
-            if (hasFocus() && hadFocus && !isReadOnly()) {
+            if (hasActiveFocus() && hadActiveFocus && !isReadOnly()) {
                 // re-open input panel on press if already focused
                 openSoftwareInputPanel();
             }
         } else { // show input panel on click
-            if (hasFocus() && !hadFocus) {
+            if (hasActiveFocus() && !hadActiveFocus) {
                 d->clickCausedFocus = true;
             }
         }
@@ -1312,10 +1312,10 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
 
     By default the opening of input panels follows the platform style. On Symbian^1 and
     Symbian^3 -based devices the panels are opened by clicking TextInput. On other platforms
-    the panels are automatically opened when TextInput element gains focus. Input panels are
-    always closed if no editor owns focus.
+    the panels are automatically opened when TextInput element gains active focus. Input panels are
+    always closed if no editor has active focus.
 
-  . You can disable the automatic behavior by setting the property \c focusOnPress to false
+  . You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
     and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
     the behavior you want.
 
@@ -1326,12 +1326,12 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
         TextInput {
             id: textInput
             text: "Hello world!"
-            focusOnPress: false
+            activeFocusOnPress: false
             MouseArea {
                 anchors.fill: parent
                 onClicked: {
-                    if (!textInput.focus) {
-                        textInput.focus = true;
+                    if (!textInput.activeFocus) {
+                        textInput.forceActiveFocus()
                         textInput.openSoftwareInputPanel();
                     } else {
                         textInput.focus = false;
@@ -1363,10 +1363,10 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
 
     By default the opening of input panels follows the platform style. On Symbian^1 and
     Symbian^3 -based devices the panels are opened by clicking TextInput. On other platforms
-    the panels are automatically opened when TextInput element gains focus. Input panels are
-    always closed if no editor owns focus.
+    the panels are automatically opened when TextInput element gains active focus. Input panels are
+    always closed if no editor has active focus.
 
-  . You can disable the automatic behavior by setting the property \c focusOnPress to false
+  . You can disable the automatic behavior by setting the property \c activeFocusOnPress to false
     and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
     the behavior you want.
 
@@ -1377,12 +1377,12 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
         TextInput {
             id: textInput
             text: "Hello world!"
-            focusOnPress: false
+            activeFocusOnPress: false
             MouseArea {
                 anchors.fill: parent
                 onClicked: {
-                    if (!textInput.focus) {
-                        textInput.focus = true;
+                    if (!textInput.activeFocus) {
+                        textInput.forceActiveFocus();
                         textInput.openSoftwareInputPanel();
                     } else {
                         textInput.focus = false;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index b1862c6..ba3f5b1 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -87,7 +87,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativePaintedItem
 
     Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
     Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
-    Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
+    Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
     Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
     Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
     Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
@@ -211,7 +211,7 @@ Q_SIGNALS:
     void echoModeChanged(EchoMode echoMode);
     void passwordCharacterChanged();
     void displayTextChanged();
-    void focusOnPressChanged(bool focusOnPress);
+    void activeFocusOnPressChanged(bool activeFocusOnPress);
     void autoScrollChanged(bool autoScroll);
     void selectByMouseChanged(bool selectByMouse);
 
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6249822..56182d1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1150,6 +1150,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
             if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) {
                 parentFocusScopeItem = fsi;
                 p->d_ptr->focusScopeItem = 0;
+                fsi->d_ptr->focusScopeItemChange(false);
             }
             break;
         }
@@ -1182,6 +1183,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
         while (p) {
             if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
                 p->d_ptr->focusScopeItem = newFocusScopeItem;
+                newFocusScopeItem->d_ptr->focusScopeItemChange(true);
                 // Ensure the new item is no longer the subFocusItem. The
                 // only way to set focus on a child of a focus scope is
                 // by setting focus on the scope itself.
@@ -5587,6 +5589,16 @@ void QGraphicsItemPrivate::subFocusItemChange()
 /*!
     \internal
 
+    Subclasses can reimplement this function to be notified when an item
+    becomes a focusScopeItem (or is no longer a focusScopeItem).
+*/
+void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)
+{
+}
+
+/*!
+    \internal
+
     Subclasses can reimplement this function to be notified when its
     siblingIndex order is changed.
 */
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 5b9a710..d60dffb 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -482,6 +482,7 @@ public:
     void clearSubFocus(QGraphicsItem *rootItem = 0);
     void resetFocusProxy();
     virtual void subFocusItemChange();
+    virtual void focusScopeItemChange(bool isSubFocusItem);
 
     static void children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item);
     static int children_count(QDeclarativeListProperty<QGraphicsObject> *list);
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml b/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
index 6c39f20..42b50cf 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/chain.qml
@@ -4,11 +4,11 @@ Rectangle {
     id: root
     width:300; height:400
 
-    property bool focus1: root.wantsFocus
-    property bool focus2: item1.wantsFocus
-    property bool focus3: fs1.wantsFocus
-    property bool focus4: fs2.wantsFocus
-    property bool focus5: theItem.wantsFocus
+    property bool focus1: root.activeFocus
+    property bool focus2: item1.activeFocus
+    property bool focus3: fs1.activeFocus
+    property bool focus4: fs2.activeFocus
+    property bool focus5: theItem.activeFocus
 
     Item {
         id: item1
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
index af9c420..9144854 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/forcefocus.qml
@@ -15,28 +15,28 @@ Rectangle {
                 height: 120; width: 420
 
                 color: "transparent"
-                border.width: 5; border.color: firstScope.wantsFocus?"blue":"black"
+                border.width: 5; border.color: firstScope.activeFocus?"blue":"black"
 
                 Rectangle {
                     id: item1; objectName: "item1"
                     x: 10; y: 10; width: 100; height: 100; color: "green"
-                    border.width: 5; border.color: wantsFocus?"blue":"black"
+                    border.width: 5; border.color: activeFocus?"blue":"black"
                     focus: true
 
                     Rectangle {
                         width: 50; height: 50; anchors.centerIn: parent
-                        color: parent.focus?"red":"transparent"
+                        color: parent.activeFocus?"red":"transparent"
                     }
                 }
 
                 Rectangle {
                     id: item2; objectName: "item2"
                     x: 310; y: 10; width: 100; height: 100; color: "green"
-                    border.width: 5; border.color: wantsFocus?"blue":"black"
+                    border.width: 5; border.color: activeFocus?"blue":"black"
 
                     Rectangle {
                         width: 50; height: 50; anchors.centerIn: parent
-                        color: parent.focus?"red":"transparent"
+                        color: parent.activeFocus?"red":"transparent"
                     }
                 }
             }
@@ -50,32 +50,32 @@ Rectangle {
                 y: 160; height: 120; width: 420
 
                 color: "transparent"
-                border.width: 5; border.color: secondScope.wantsFocus?"blue":"black"
+                border.width: 5; border.color: secondScope.activeFocus?"blue":"black"
 
                 Rectangle {
                     id: item4; objectName: "item4"
                     x: 10; y: 10; width: 100; height: 100; color: "green"
-                    border.width: 5; border.color: wantsFocus?"blue":"black"
+                    border.width: 5; border.color: activeFocus?"blue":"black"
 
                     Rectangle {
                         width: 50; height: 50; anchors.centerIn: parent
-                        color: parent.focus?"red":"transparent"
+                        color: parent.activeFocus?"red":"transparent"
                     }
                 }
 
                 Rectangle {
                     id: item5; objectName: "item5"
                     x: 310; y: 10; width: 100; height: 100; color: "green"
-                    border.width: 5; border.color: wantsFocus?"blue":"black"
+                    border.width: 5; border.color: activeFocus?"blue":"black"
 
                     Rectangle {
                         width: 50; height: 50; anchors.centerIn: parent
-                        color: parent.focus?"red":"transparent"
+                        color: parent.activeFocus?"red":"transparent"
                     }
                 }
             }
         }
     }
     Keys.onDigit4Pressed: item4.focus = true
-    Keys.onDigit5Pressed: item5.forceFocus()
+    Keys.onDigit5Pressed: item5.forceActiveFocus()
 }
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
index aa43ba8..55be103 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test.qml
@@ -20,21 +20,21 @@ Rectangle {
 
             color: "transparent"
             border.width: 5
-            border.color: myScope.wantsFocus?"blue":"black"
+            border.color: myScope.activeFocus?"blue":"black"
 
             Rectangle {
                 id: item1; objectName: "item1"
                 x: 10; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 Keys.onDigit9Pressed: console.debug("Top Left");
                 KeyNavigation.right: item2
                 focus: true
 
                 Rectangle {
                     width: 50; height: 50; anchors.centerIn: parent
-                    color: parent.focus?"red":"transparent"
+                    color: parent.activeFocus?"red":"transparent"
                 }
             }
 
@@ -43,13 +43,13 @@ Rectangle {
                 x: 310; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 KeyNavigation.left: item1
                 Keys.onDigit9Pressed: console.log("Top Right");
 
                 Rectangle {
                     width: 50; height: 50; anchors.centerIn: parent
-                    color: parent.focus?"red":"transparent"
+                    color: parent.activeFocus?"red":"transparent"
                 }
             }
         }
@@ -63,14 +63,14 @@ Rectangle {
         x: 10; y: 300
         width: 100; height: 100; color: "green"
         border.width: 5
-        border.color: wantsFocus?"blue":"black"
+        border.color: activeFocus?"blue":"black"
 
         Keys.onDigit9Pressed: console.log("Bottom Left");
         KeyNavigation.up: myScope
 
         Rectangle {
             width: 50; height: 50; anchors.centerIn: parent
-            color: parent.focus?"red":"transparent"
+            color: parent.activeFocus?"red":"transparent"
         }
     }
 
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml
index 216277e..5ed701d 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test2.qml
@@ -10,27 +10,27 @@ Rectangle {
     FocusScope {
         y: 100
         focus: true; objectName: "item1"
-        Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+        Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
         FocusScope {
             y: 100
             focus: true; objectName: "item2"
-            Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+            Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
             FocusScope {
                 y: 100
                 focus: true; objectName: "item3"
-                Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+                Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
                 FocusScope {
                     y: 100
                     focus: true; objectName: "item4"
-                    Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+                    Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
                     FocusScope {
                         y: 100
                         focus: true; objectName: "item5"
-                        Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+                        Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
                     }
                 }
             }
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml
index 2ac0d18..c6d112f 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test3.qml
@@ -13,7 +13,7 @@ Rectangle {
         ListElement { name: "4" }
         ListElement { name: "5" }
         ListElement { name: "6" }
-        ListElement { name: "6" }
+        ListElement { name: "7" }
         ListElement { name: "8" }
         ListElement { name: "9" }
     }
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml
index 8862b39..3c6d3bd 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test4.qml
@@ -19,21 +19,21 @@ Rectangle {
 
             color: "transparent"
             border.width: 5
-            border.color: myScope.wantsFocus?"blue":"black"
+            border.color: myScope.activeFocus?"blue":"black"
 
             Rectangle {
                 id: item1; objectName: "item1"
                 x: 10; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 Keys.onDigit9Pressed: console.log("Error - Top Left");
                 KeyNavigation.right: item2
                 focus: true
 
                 Rectangle {
                     width: 50; height: 50; anchors.centerIn: parent
-                    color: parent.focus?"red":"transparent"
+                    color: parent.activeFocus?"red":"transparent"
                 }
             }
 
@@ -42,13 +42,13 @@ Rectangle {
                 x: 310; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 KeyNavigation.left: item1
                 Keys.onDigit9Pressed: console.log("Error - Top Right");
 
                 Rectangle {
                     width: 50; height: 50; anchors.centerIn: parent
-                    color: parent.focus?"red":"transparent"
+                    color: parent.activeFocus?"red":"transparent"
                 }
             }
         }
@@ -62,14 +62,14 @@ Rectangle {
         x: 10; y: 300
         width: 100; height: 100; color: "green"
         border.width: 5
-        border.color: wantsFocus?"blue":"black"
+        border.color: activeFocus?"blue":"black"
 
         Keys.onDigit9Pressed: console.log("Error - Bottom Left");
         KeyNavigation.up: myScope
 
         Rectangle {
             width: 50; height: 50; anchors.centerIn: parent
-            color: parent.focus?"red":"transparent"
+            color: parent.activeFocus?"red":"transparent"
         }
     }
 
diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
index cdb5164..4417d5f 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
+++ b/tests/auto/declarative/qdeclarativefocusscope/data/test5.qml
@@ -20,13 +20,13 @@ Rectangle {
 
             color: "transparent"
             border.width: 5
-            border.color: myScope.wantsFocus?"blue":"black"
+            border.color: myScope.activeFocus?"blue":"black"
 
             Rectangle {
                 x: 10; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: item1.wantsFocus?"blue":"black"
+                border.color: item1.activeFocus?"blue":"black"
             }
 
             TextEdit {
@@ -47,13 +47,13 @@ Rectangle {
                 x: 310; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 KeyNavigation.left: item1
                 Keys.onReturnPressed: console.log("Top Right");
 
                 Rectangle {
                     width: 50; height: 50; anchors.centerIn: parent
-                    color: parent.focus?"red":"transparent"
+                    color: parent.activeFocus?"red":"transparent"
                 }
             }
         }
@@ -66,7 +66,7 @@ Rectangle {
         x: 10; y: 300
         width: 100; height: 100; color: "green"
         border.width: 5
-        border.color: item3.wantsFocus?"blue":"black"
+        border.color: item3.activeFocus?"blue":"black"
     }
 
     TextEdit {
diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
index 2559087..b0c9c03 100644
--- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
+++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp
@@ -118,22 +118,22 @@ void tst_qdeclarativefocusscope::basic()
 
     QVERIFY(view->hasFocus());
     QVERIFY(view->scene()->hasFocus());
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == true);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == true);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Right);
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == true);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == true);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Down);
-    QVERIFY(item0->wantsFocus() == false);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == true);
+    QVERIFY(item0->hasActiveFocus() == false);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == true);
 
     delete view;
 }
@@ -166,16 +166,11 @@ void tst_qdeclarativefocusscope::nested()
     QVERIFY(view->hasFocus());
     QVERIFY(view->scene()->hasFocus());
 
-    QVERIFY(item1->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->wantsFocus() == true);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->wantsFocus() == true);
-    QVERIFY(item3->hasFocus() == false);
-    QVERIFY(item4->wantsFocus() == true);
-    QVERIFY(item4->hasFocus() == false);
-    QVERIFY(item5->wantsFocus() == true);
-    QVERIFY(item5->hasFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == true);
+    QVERIFY(item2->hasActiveFocus() == true);
+    QVERIFY(item3->hasActiveFocus() == true);
+    QVERIFY(item4->hasActiveFocus() == true);
+    QVERIFY(item5->hasActiveFocus() == true);
     delete view;
 }
 
@@ -204,22 +199,22 @@ void tst_qdeclarativefocusscope::noFocus()
 
     QVERIFY(view->hasFocus());
     QVERIFY(view->scene()->hasFocus());
-    QVERIFY(item0->wantsFocus() == false);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == false);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Right);
-    QVERIFY(item0->wantsFocus() == false);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == false);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Down);
-    QVERIFY(item0->wantsFocus() == false);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == false);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     delete view;
 }
@@ -249,32 +244,32 @@ void tst_qdeclarativefocusscope::textEdit()
 
     QVERIFY(view->hasFocus());
     QVERIFY(view->scene()->hasFocus());
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == true);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == true);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Right);
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == true);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == true);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Right);
     QTest::keyClick(view, Qt::Key_Right);
     QTest::keyClick(view, Qt::Key_Right);
     QTest::keyClick(view, Qt::Key_Right);
     QTest::keyClick(view, Qt::Key_Right);
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == true);
-    QVERIFY(item3->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == true);
+    QVERIFY(item3->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_Down);
-    QVERIFY(item0->wantsFocus() == false);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->hasFocus() == true);
+    QVERIFY(item0->hasActiveFocus() == false);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == true);
 
     delete view;
 }
@@ -308,28 +303,28 @@ void tst_qdeclarativefocusscope::forceFocus()
 
     QVERIFY(view->hasFocus());
     QVERIFY(view->scene()->hasFocus());
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == true);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->wantsFocus() == false);
-    QVERIFY(item4->hasFocus() == false);
-    QVERIFY(item5->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == true);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
+    QVERIFY(item4->hasActiveFocus() == false);
+    QVERIFY(item5->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_4);
-    QVERIFY(item0->wantsFocus() == true);
-    QVERIFY(item1->hasFocus() == true);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->wantsFocus() == false);
-    QVERIFY(item4->hasFocus() == false);
-    QVERIFY(item5->hasFocus() == false);
+    QVERIFY(item0->hasActiveFocus() == true);
+    QVERIFY(item1->hasActiveFocus() == true);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == false);
+    QVERIFY(item4->hasActiveFocus() == false);
+    QVERIFY(item5->hasActiveFocus() == false);
 
     QTest::keyClick(view, Qt::Key_5);
-    QVERIFY(item0->wantsFocus() == false);
-    QVERIFY(item1->hasFocus() == false);
-    QVERIFY(item2->hasFocus() == false);
-    QVERIFY(item3->wantsFocus() == true);
-    QVERIFY(item4->hasFocus() == false);
-    QVERIFY(item5->hasFocus() == true);
+    QVERIFY(item0->hasActiveFocus() == false);
+    QVERIFY(item1->hasActiveFocus() == false);
+    QVERIFY(item2->hasActiveFocus() == false);
+    QVERIFY(item3->hasActiveFocus() == true);
+    QVERIFY(item4->hasActiveFocus() == false);
+    QVERIFY(item5->hasActiveFocus() == true);
 
     delete view;
 }
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index ffb2105..345ce38 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -371,7 +371,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // right
     QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
@@ -380,7 +380,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // down
     key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1);
@@ -389,7 +389,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     item = findItem<QDeclarativeItem>(canvas->rootObject(), "item4");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // left
     key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1);
@@ -398,7 +398,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     item = findItem<QDeclarativeItem>(canvas->rootObject(), "item3");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // up
     key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1);
@@ -407,7 +407,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // tab
     key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
@@ -416,7 +416,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     item = findItem<QDeclarativeItem>(canvas->rootObject(), "item2");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // backtab
     key = QKeyEvent(QEvent::KeyPress, Qt::Key_Backtab, Qt::NoModifier, "", false, 1);
@@ -425,7 +425,7 @@ void tst_QDeclarativeItem::keyNavigation()
 
     item = findItem<QDeclarativeItem>(canvas->rootObject(), "item1");
     QVERIFY(item);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     delete canvas;
 }
@@ -618,21 +618,21 @@ void tst_QDeclarativeItem::mouseFocus()
 
     QDeclarativeItem *item = findItem<QDeclarativeItem>(canvas->rootObject(), "declarativeItem");
     QVERIFY(item);
-    QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
+    QSignalSpy focusSpy(item, SIGNAL(activeFocusChanged(bool)));
 
     QTest::mouseClick(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(item->scenePos()));
     QApplication::processEvents();
     QCOMPARE(focusSpy.count(), 1);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     // make sure focusable graphics widget underneath does not steal focus
     QTest::mouseClick(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(item->scenePos()));
     QApplication::processEvents();
     QCOMPARE(focusSpy.count(), 1);
-    QVERIFY(item->hasFocus());
+    QVERIFY(item->hasActiveFocus());
 
     item->setFocus(false);
-    QVERIFY(!item->hasFocus());
+    QVERIFY(!item->hasActiveFocus());
     QCOMPARE(focusSpy.count(), 2);
     item->setFocus(true);
     QCOMPARE(focusSpy.count(), 3);
@@ -664,7 +664,7 @@ void tst_QDeclarativeItem::propertyChanges()
     QSignalSpy baselineOffsetSpy(item, SIGNAL(baselineOffsetChanged(qreal)));
     QSignalSpy childrenRectSpy(parentItem, SIGNAL(childrenRectChanged(QRectF)));
     QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
-    QSignalSpy wantsFocusSpy(parentItem, SIGNAL(wantsFocusChanged(bool)));
+    QSignalSpy wantsFocusSpy(parentItem, SIGNAL(activeFocusChanged(bool)));
 
     item->setParentItem(parentItem);
     item->setWidth(100.0);
@@ -696,14 +696,14 @@ void tst_QDeclarativeItem::propertyChanges()
     QVERIFY(childrenRectArguments.count() == 1);
     QCOMPARE(parentItem->childrenRect(), childrenRectArguments.at(0).toRectF());
 
-    QCOMPARE(item->hasFocus(), true);
+    QCOMPARE(item->hasActiveFocus(), true);
     QCOMPARE(focusSpy.count(),1);
     QList<QVariant> focusArguments = focusSpy.first();
     QVERIFY(focusArguments.count() == 1);
     QCOMPARE(focusArguments.at(0).toBool(), true);
 
+    QCOMPARE(parentItem->hasActiveFocus(), false);
     QCOMPARE(parentItem->hasFocus(), false);
-    QCOMPARE(parentItem->wantsFocus(), false);
     QCOMPARE(wantsFocusSpy.count(),0);
 
     delete canvas;
diff --git a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
index 807eec9..8f9a7f2 100644
--- a/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
+++ b/tests/auto/declarative/qdeclarativestates/data/propertyErrors.qml
@@ -5,6 +5,6 @@ Rectangle {
     color: "red"
     states: State {
         name: "blue"
-        PropertyChanges { target: myRectangle; colr: "blue"; wantsFocus: true }
+        PropertyChanges { target: myRectangle; colr: "blue"; activeFocus: true }
     }
 }
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 7bc4fd4..3b6a420 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -922,7 +922,7 @@ void tst_qdeclarativestates::propertyErrors()
     QCOMPARE(rect->color(),QColor("red"));
 
     QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\"");
-    QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"wantsFocus\"");
+    QTest::ignoreMessage(QtWarningMsg, fullDataPath("/data/propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"activeFocus\"");
     QDeclarativeItemPrivate::get(rect)->setState("blue");
 }
 
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 4783bc7..93351a8 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -604,7 +604,7 @@ void tst_qdeclarativetextedit::persistentSelection()
 void tst_qdeclarativetextedit::focusOnPress()
 {
     {
-        QString componentStr = "import Qt 4.7\nTextEdit {  focusOnPress: true; text: \"Hello World\" }";
+        QString componentStr = "import Qt 4.7\nTextEdit {  activeFocusOnPress: true; text: \"Hello World\" }";
         QDeclarativeComponent texteditComponent(&engine);
         texteditComponent.setData(componentStr.toLatin1(), QUrl());
         QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
@@ -613,7 +613,7 @@ void tst_qdeclarativetextedit::focusOnPress()
     }
 
     {
-        QString componentStr = "import Qt 4.7\nTextEdit {  focusOnPress: false; text: \"Hello World\" }";
+        QString componentStr = "import Qt 4.7\nTextEdit {  activeFocusOnPress: false; text: \"Hello World\" }";
         QDeclarativeComponent texteditComponent(&engine);
         texteditComponent.setData(componentStr.toLatin1(), QUrl());
         QDeclarativeTextEdit *textEditObject = qobject_cast<QDeclarativeTextEdit*>(texteditComponent.create());
@@ -840,15 +840,15 @@ void tst_qdeclarativetextedit::navigation()
     QDeclarativeItem *input = qobject_cast<QDeclarativeItem *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
 
     QVERIFY(input != 0);
-    QTRY_VERIFY(input->hasFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus() == true);
     simulateKey(canvas, Qt::Key_Left);
-    QVERIFY(input->hasFocus() == false);
+    QVERIFY(input->hasActiveFocus() == false);
     simulateKey(canvas, Qt::Key_Right);
-    QVERIFY(input->hasFocus() == true);
+    QVERIFY(input->hasActiveFocus() == true);
     simulateKey(canvas, Qt::Key_Right);
-    QVERIFY(input->hasFocus() == false);
+    QVERIFY(input->hasActiveFocus() == false);
     simulateKey(canvas, Qt::Key_Left);
-    QVERIFY(input->hasFocus() == true);
+    QVERIFY(input->hasActiveFocus() == true);
 }
 
 void tst_qdeclarativetextedit::copyAndPaste() {
@@ -908,7 +908,7 @@ void tst_qdeclarativetextedit::readOnly()
     QDeclarativeTextEdit *edit = qobject_cast<QDeclarativeTextEdit *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
 
     QVERIFY(edit != 0);
-    QTRY_VERIFY(edit->hasFocus() == true);
+    QTRY_VERIFY(edit->hasActiveFocus() == true);
     QVERIFY(edit->isReadOnly() == true);
     QString initial = edit->text();
     for(int k=Qt::Key_0; k<=Qt::Key_Z; k++)
@@ -968,7 +968,7 @@ void tst_qdeclarativetextedit::openInputPanelOnClick()
     MyInputContext ic;
     view.setInputContext(&ic);
     QDeclarativeTextEdit edit;
-    QSignalSpy focusOnPressSpy(&edit, SIGNAL(focusOnPressChanged(bool)));
+    QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool)));
     edit.setText("Hello world");
     edit.setPos(0, 0);
     scene.addItem(&edit);
@@ -1016,7 +1016,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
     MyInputContext ic;
     view.setInputContext(&ic);
     QDeclarativeTextEdit edit;
-    QSignalSpy focusOnPressSpy(&edit, SIGNAL(focusOnPressChanged(bool)));
+    QSignalSpy focusOnPressSpy(&edit, SIGNAL(activeFocusOnPressChanged(bool)));
     edit.setText("Hello world");
     edit.setPos(0, 0);
     scene.addItem(&edit);
@@ -1038,7 +1038,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
     // focus on press, input panel on focus
     QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
     QApplication::processEvents();
-    QVERIFY(edit.hasFocus());
+    QVERIFY(edit.hasActiveFocus());
     QCOMPARE(ic.openInputPanelReceived, true);
     ic.openInputPanelReceived = false;
 
@@ -1048,7 +1048,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
     ic.openInputPanelReceived = false;
 
     // if already focused, input panel can be opened on press
-    QVERIFY(edit.hasFocus());
+    QVERIFY(edit.hasActiveFocus());
     QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(edit.scenePos()));
     QApplication::processEvents();
     QCOMPARE(ic.openInputPanelReceived, true);
@@ -1076,7 +1076,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
     QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
 
     // no automatic input panel events should
-    // be sent if focusOnPress is false
+    // be sent if activeFocusOnPress is false
     edit.setFocusOnPress(false);
     QCOMPARE(focusOnPressSpy.count(),1);
     edit.setFocusOnPress(false);
@@ -1103,7 +1103,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus()
     QCOMPARE(ic.closeInputPanelReceived, true);
     ic.closeInputPanelReceived = false;
 
-    // set focusOnPress back to true
+    // set activeFocusOnPress back to true
     edit.setFocusOnPress(true);
     QCOMPARE(focusOnPressSpy.count(),2);
     edit.setFocusOnPress(true);
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index a48bc39..e5e495e 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -494,7 +494,7 @@ void tst_qdeclarativetextinput::maxLength()
     }
 
     textinputObject->setText("");
-    QTRY_VERIFY(textinputObject->hasFocus() == true);
+    QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
     for(int i=0; i<20; i++){
         QCOMPARE(textinputObject->text().length(), qMin(i,10));
         //simulateKey(canvas, Qt::Key_A);
@@ -515,7 +515,7 @@ void tst_qdeclarativetextinput::masks()
     QVERIFY(canvas->rootObject() != 0);
     QDeclarativeTextInput *textinputObject = qobject_cast<QDeclarativeTextInput *>(canvas->rootObject());
     QVERIFY(textinputObject != 0);
-    QTRY_VERIFY(textinputObject->hasFocus() == true);
+    QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
     QVERIFY(textinputObject->text().length() == 0);
     QCOMPARE(textinputObject->inputMask(), QString("HHHHhhhh; "));
     for(int i=0; i<10; i++){
@@ -544,7 +544,7 @@ void tst_qdeclarativetextinput::validators()
     QDeclarativeTextInput *intInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("intInput")));
     QVERIFY(intInput);
     intInput->setFocus(true);
-    QTRY_VERIFY(intInput->hasFocus());
+    QTRY_VERIFY(intInput->hasActiveFocus());
     QTest::keyPress(canvas, Qt::Key_1);
     QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
     QCOMPARE(intInput->text(), QLatin1String("1"));
@@ -565,7 +565,7 @@ void tst_qdeclarativetextinput::validators()
     QDeclarativeTextInput *dblInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("dblInput")));
     QTRY_VERIFY(dblInput);
     dblInput->setFocus(true);
-    QVERIFY(dblInput->hasFocus() == true);
+    QVERIFY(dblInput->hasActiveFocus() == true);
     QTest::keyPress(canvas, Qt::Key_1);
     QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
     QCOMPARE(dblInput->text(), QLatin1String("1"));
@@ -594,7 +594,7 @@ void tst_qdeclarativetextinput::validators()
     QDeclarativeTextInput *strInput = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("strInput")));
     QTRY_VERIFY(strInput);
     strInput->setFocus(true);
-    QVERIFY(strInput->hasFocus() == true);
+    QVERIFY(strInput->hasActiveFocus() == true);
     QTest::keyPress(canvas, Qt::Key_1);
     QTest::keyRelease(canvas, Qt::Key_1, Qt::NoModifier ,10);
     QCOMPARE(strInput->text(), QLatin1String(""));
@@ -642,7 +642,7 @@ void tst_qdeclarativetextinput::inputMethods()
     QVERIFY(canvas->rootObject() != 0);
 
     input->setFocus(true);
-    QVERIFY(input->hasFocus() == true);
+    QVERIFY(input->hasActiveFocus() == true);
     // test that input method event is committed
     QInputMethodEvent event;
     event.setCommitString( "My ", -12, 0);
@@ -669,11 +669,11 @@ void tst_qdeclarativetextinput::navigation()
 
     QVERIFY(input != 0);
     input->setCursorPosition(0);
-    QTRY_VERIFY(input->hasFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus() == true);
     simulateKey(canvas, Qt::Key_Left);
-    QVERIFY(input->hasFocus() == false);
+    QVERIFY(input->hasActiveFocus() == false);
     simulateKey(canvas, Qt::Key_Right);
-    QVERIFY(input->hasFocus() == true);
+    QVERIFY(input->hasActiveFocus() == true);
     //QT-2944: If text is selected, ensure we deselect upon cursor motion
     input->setCursorPosition(input->text().length());
     input->select(0,input->text().length());
@@ -681,11 +681,11 @@ void tst_qdeclarativetextinput::navigation()
     simulateKey(canvas, Qt::Key_Right);
     QVERIFY(input->selectionStart() == input->selectionEnd());
     QVERIFY(input->selectionStart() == input->text().length());
-    QVERIFY(input->hasFocus() == true);
+    QVERIFY(input->hasActiveFocus() == true);
     simulateKey(canvas, Qt::Key_Right);
-    QVERIFY(input->hasFocus() == false);
+    QVERIFY(input->hasActiveFocus() == false);
     simulateKey(canvas, Qt::Key_Left);
-    QVERIFY(input->hasFocus() == true);
+    QVERIFY(input->hasActiveFocus() == true);
 
     // Up and Down should NOT do Home/End, even on Mac OS X (QTBUG-10438).
     input->setCursorPosition(2);
@@ -784,7 +784,7 @@ void tst_qdeclarativetextinput::readOnly()
     QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
 
     QVERIFY(input != 0);
-    QTRY_VERIFY(input->hasFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus() == true);
     QVERIFY(input->isReadOnly() == true);
     QString initial = input->text();
     for(int k=Qt::Key_0; k<=Qt::Key_Z; k++)
@@ -808,7 +808,7 @@ void tst_qdeclarativetextinput::echoMode()
     QDeclarativeTextInput *input = qobject_cast<QDeclarativeTextInput *>(qvariant_cast<QObject *>(canvas->rootObject()->property("myInput")));
 
     QVERIFY(input != 0);
-    QTRY_VERIFY(input->hasFocus() == true);
+    QTRY_VERIFY(input->hasActiveFocus() == true);
     QString initial = input->text();
     Qt::InputMethodHints ref;
     QCOMPARE(initial, QLatin1String("ABCDefgh"));
@@ -901,7 +901,7 @@ void tst_qdeclarativetextinput::openInputPanelOnClick()
     MyInputContext ic;
     view.setInputContext(&ic);
     QDeclarativeTextInput input;
-    QSignalSpy focusOnPressSpy(&input, SIGNAL(focusOnPressChanged(bool)));
+    QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool)));
     input.setText("Hello world");
     input.setPos(0, 0);
     scene.addItem(&input);
@@ -948,7 +948,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
     MyInputContext ic;
     view.setInputContext(&ic);
     QDeclarativeTextInput input;
-    QSignalSpy focusOnPressSpy(&input, SIGNAL(focusOnPressChanged(bool)));
+    QSignalSpy focusOnPressSpy(&input, SIGNAL(activeFocusOnPressChanged(bool)));
     input.setText("Hello world");
     input.setPos(0, 0);
     scene.addItem(&input);
@@ -970,7 +970,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
     // focus on press, input panel on focus
     QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
     QApplication::processEvents();
-    QVERIFY(input.hasFocus());
+    QVERIFY(input.hasActiveFocus());
     QCOMPARE(ic.openInputPanelReceived, true);
     ic.openInputPanelReceived = false;
 
@@ -980,7 +980,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
     ic.openInputPanelReceived = false;
 
     // if already focused, input panel can be opened on press
-    QVERIFY(input.hasFocus());
+    QVERIFY(input.hasActiveFocus());
     QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(input.scenePos()));
     QApplication::processEvents();
     QCOMPARE(ic.openInputPanelReceived, true);
@@ -1008,7 +1008,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
     QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled));
 
     // no automatic input panel events should
-    // be sent if focusOnPress is false
+    // be sent if activeFocusOnPress is false
     input.setFocusOnPress(false);
     QCOMPARE(focusOnPressSpy.count(),1);
     input.setFocusOnPress(false);
@@ -1035,7 +1035,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus()
     QCOMPARE(ic.closeInputPanelReceived, true);
     ic.closeInputPanelReceived = false;
 
-    // set focusOnPress back to true
+    // set activeFocusOnPress back to true
     input.setFocusOnPress(true);
     QCOMPARE(focusOnPressSpy.count(),2);
     input.setFocusOnPress(true);
-- 
cgit v0.12


From ed89fd5ff5aab99ee0fd47f7fdcb4824f1c92102 Mon Sep 17 00:00:00 2001
From: Alan Alpert <alan.alpert@nokia.com>
Date: Wed, 21 Jul 2010 12:51:55 +1000
Subject: Add QML tutorials to the tutorials page

---
 doc/src/getting-started/tutorials.qdoc | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/doc/src/getting-started/tutorials.qdoc b/doc/src/getting-started/tutorials.qdoc
index 0a83170..46a5808 100644
--- a/doc/src/getting-started/tutorials.qdoc
+++ b/doc/src/getting-started/tutorials.qdoc
@@ -84,6 +84,18 @@
     \o
     
     \row
+    \o{2,1} \l{QML Tutorial}{\bold QML Tutorial}
+    \o{2,1} \l{QML Advanced Tutorial}{\bold SameGame}
+    \row
+    \o{2,1}
+    This tutorial provides a very basic introduction to QML.
+    \o \image qml-samegame-demo-small.png Samegame
+    \o
+    This tutorial walks through creating a complete application with QML,
+    in this case a simple game. It is recommended that you complete the basic QML
+    tutorial first.
+
+    \row
     \o{2,1} \l{QTestLib Tutorial}{\bold QTestLib}
     \o{2,1} \l{qmake Tutorial}{\bold qmake}
     \row
-- 
cgit v0.12


From 3aeafb4839f49f524f10eae65be27fd189d37060 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Wed, 21 Jul 2010 14:16:34 +1000
Subject: Bounding rect of text was not always calculated correctly. The
 boundingRect depended upon the image cache which may not become valid until
 after boundingRect is called.

Task-number: QTBUG-12291
Reviewed-by: Michael Brasser
---
 src/declarative/graphicsitems/qdeclarativetext.cpp | 80 ++++++++--------------
 .../declarative/qdeclarativetext/data/rotated.qml  | 18 +++++
 .../qdeclarativetext/tst_qdeclarativetext.cpp      | 19 +++++
 3 files changed, 64 insertions(+), 53 deletions(-)
 create mode 100644 tests/auto/declarative/qdeclarativetext/data/rotated.qml

diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index a1703c1..ab2be9c 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -712,63 +712,37 @@ QRectF QDeclarativeText::boundingRect() const
     int x = 0;
     int y = 0;
 
-    // Could include font max left/right bearings to either side of rectangle.
-
-    if (d->cache || d->style != Normal) {
-        QDeclarativeTextPrivate *dd = const_cast<QDeclarativeTextPrivate *>(d);
-        dd->checkImgCache();
-        switch (d->hAlign) {
-        case AlignLeft:
-            x = 0;
-            break;
-        case AlignRight:
-            x = w - d->imgCache.width();
-            break;
-        case AlignHCenter:
-            x = (w - d->imgCache.width()) / 2;
-            break;
-        }
-
-        switch (d->vAlign) {
-        case AlignTop:
-            y = 0;
-            break;
-        case AlignBottom:
-            y = h - d->imgCache.height();
-            break;
-        case AlignVCenter:
-            y = (h - d->imgCache.height()) / 2;
-            break;
-        }
+    QSize size = d->cachedLayoutSize;
+    if (d->style != Normal)
+        size += QSize(2,2);
 
-        return QRectF(x,y,d->imgCache.width(),d->imgCache.height());
-    } else {
-        switch (d->hAlign) {
-        case AlignLeft:
-            x = 0;
-            break;
-        case AlignRight:
-            x = w - d->cachedLayoutSize.width();
-            break;
-        case AlignHCenter:
-            x = (w - d->cachedLayoutSize.width()) / 2;
-            break;
-        }
+    // Could include font max left/right bearings to either side of rectangle.
 
-        switch (d->vAlign) {
-        case AlignTop:
-            y = 0;
-            break;
-        case AlignBottom:
-            y = h - d->cachedLayoutSize.height();
-            break;
-        case AlignVCenter:
-            y = (h - d->cachedLayoutSize.height()) / 2;
-            break;
-        }
+    switch (d->hAlign) {
+    case AlignLeft:
+        x = 0;
+        break;
+    case AlignRight:
+        x = w - size.width();
+        break;
+    case AlignHCenter:
+        x = (w - size.width()) / 2;
+        break;
+    }
 
-        return QRectF(x,y,d->cachedLayoutSize.width(),d->cachedLayoutSize.height());
+    switch (d->vAlign) {
+    case AlignTop:
+        y = 0;
+        break;
+    case AlignBottom:
+        y = h - size.height();
+        break;
+    case AlignVCenter:
+        y = (h - size.height()) / 2;
+        break;
     }
+
+    return QRectF(x,y,size.width(),size.height());
 }
 
 void QDeclarativeText::geometryChanged(const QRectF &newGeometry,
diff --git a/tests/auto/declarative/qdeclarativetext/data/rotated.qml b/tests/auto/declarative/qdeclarativetext/data/rotated.qml
new file mode 100644
index 0000000..01eec44
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativetext/data/rotated.qml
@@ -0,0 +1,18 @@
+import Qt 4.7
+
+Rectangle {
+    width : 200
+    height : 100
+
+    Text {
+        objectName: "text"
+        x: 20
+        y: 20
+        height : 20
+        width : 80
+        text : "Something"
+        rotation : 30
+        transformOrigin : Item.TopLeft
+    }
+}
+
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 821394d..658f381 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -97,6 +97,8 @@ private slots:
 
     void clickLink();
 
+    void QTBUG_12291();
+
 private:
     QStringList standard;
     QStringList richText;
@@ -898,6 +900,23 @@ void tst_qdeclarativetext::wordSpacing()
     }
 }
 
+void tst_qdeclarativetext::QTBUG_12291()
+{
+    QDeclarativeView *canvas = createView(SRCDIR "/data/rotated.qml");
+
+    canvas->show();
+    QApplication::setActiveWindow(canvas);
+    QTest::qWaitForWindowShown(canvas);
+    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+    QObject *ob = canvas->rootObject();
+    QVERIFY(ob != 0);
+
+    QDeclarativeText *text = ob->findChild<QDeclarativeText*>("text");
+    QVERIFY(text);
+    QVERIFY(text->boundingRect().isValid());
+}
+
 class EventSender : public QGraphicsItem
 {
 public:
-- 
cgit v0.12


From bd7d4947940593e7f56eccfae57db90d3b4acc4d Mon Sep 17 00:00:00 2001
From: Yann Bodson <yann.bodson@nokia.com>
Date: Wed, 21 Jul 2010 14:36:51 +1000
Subject: Rename remaining 'wantsFocus'.

---
 src/declarative/graphicsitems/qdeclarativeitem.cpp    |  2 +-
 tests/auto/declarative/qmlvisual/focusscope/test.qml  |  8 ++++----
 tests/auto/declarative/qmlvisual/focusscope/test2.qml | 10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 301779a..c5c1a47 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -2872,7 +2872,7 @@ void QDeclarativeItem::setSmooth(bool smooth)
 */
 
 /*!
-  \property QDeclarativeItem::wantsFocus
+  \property QDeclarativeItem::activeFocus
   \internal
 */
 
diff --git a/tests/auto/declarative/qmlvisual/focusscope/test.qml b/tests/auto/declarative/qmlvisual/focusscope/test.qml
index d83bad4..24b4b99 100644
--- a/tests/auto/declarative/qmlvisual/focusscope/test.qml
+++ b/tests/auto/declarative/qmlvisual/focusscope/test.qml
@@ -19,14 +19,14 @@ Rectangle {
 
             color: "transparent"
             border.width: 5
-            border.color: myScope.wantsFocus?"blue":"black"
+            border.color: myScope.activeFocus?"blue":"black"
 
             Rectangle {
                 id: item1
                 x: 10; y: 10 
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 Keys.onDigit9Pressed: console.log("Top Left");
                 KeyNavigation.right: item2
                 focus: true 
@@ -42,7 +42,7 @@ Rectangle {
                 x: 310; y: 10
                 width: 100; height: 100; color: "green"
                 border.width: 5
-                border.color: wantsFocus?"blue":"black"
+                border.color: activeFocus?"blue":"black"
                 KeyNavigation.left: item1
                 Keys.onDigit9Pressed: console.log("Top Right");
 
@@ -62,7 +62,7 @@ Rectangle {
         x: 10; y: 300
         width: 100; height: 100; color: "green"
         border.width: 5
-        border.color: wantsFocus?"blue":"black"
+        border.color: activeFocus?"blue":"black"
 
         Keys.onDigit9Pressed: console.log("Bottom Left");
         KeyNavigation.up: myScope
diff --git a/tests/auto/declarative/qmlvisual/focusscope/test2.qml b/tests/auto/declarative/qmlvisual/focusscope/test2.qml
index 7a6ed83..19c8bed 100644
--- a/tests/auto/declarative/qmlvisual/focusscope/test2.qml
+++ b/tests/auto/declarative/qmlvisual/focusscope/test2.qml
@@ -10,27 +10,27 @@ Rectangle {
     FocusScope {
         y: 100
         focus: true
-        Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+        Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
         FocusScope {
             y: 100
             focus: true
-            Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+            Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
             FocusScope {
                 y: 100
                 focus: true
-                Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+                Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
                 FocusScope {
                     y: 100
                     focus: true
-                    Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+                    Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
 
                     FocusScope {
                         y: 100
                         focus: true
-                        Rectangle { width: 50; height: 50; color: parent.wantsFocus?"red":"blue" }
+                        Rectangle { width: 50; height: 50; color: parent.activeFocus?"red":"blue" }
                     }
                 }
             }
-- 
cgit v0.12


From cc6980310b097701e8f8026393715d802ac6f9ba Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 20 Jul 2010 13:16:15 +1000
Subject: Use snippets instead to avoid quoting license headers

---
 doc/src/snippets/declarative/comments.qml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml
index bafa26d..9be0ce5 100644
--- a/doc/src/snippets/declarative/comments.qml
+++ b/doc/src/snippets/declarative/comments.qml
@@ -38,6 +38,7 @@
 **
 ****************************************************************************/
 
+//![0]
 import Qt 4.7
 
 //![0]
-- 
cgit v0.12


From 481e52e1ef66abc583527624fdbeb1d25d97a6c7 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 20 Jul 2010 13:41:00 +1000
Subject: Indicate default values

---
 src/declarative/graphicsitems/qdeclarativegridview.cpp | 16 ++++++++++++----
 src/declarative/graphicsitems/qdeclarativelistview.cpp | 18 ++++++++++++++----
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 14a4f08..89b3958 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1293,9 +1293,15 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate)
   \qmlproperty int GridView::currentIndex
   \qmlproperty Item GridView::currentItem
 
-  \c currentIndex holds the index of the current item.
-  \c currentItem is the current item.  Note that the position of the current item
-  may only be approximate until it becomes visible in the view.
+    The \c currentIndex property holds the index of the current item, and
+    \c currentItem holds the current item. 
+
+    If highlightFollowsCurrentItem is \c true, setting either of these 
+    properties will smoothly scroll the GridView so that the current 
+    item becomes visible.
+    
+    Note that the position of the current item
+    may only be approximate until it becomes visible in the view.
 */
 int QDeclarativeGridView::currentIndex() const
 {
@@ -1385,7 +1391,7 @@ void QDeclarativeGridView::setHighlight(QDeclarativeComponent *highlight)
   \qmlproperty bool GridView::highlightFollowsCurrentItem
   This property sets whether the highlight is managed by the view.
 
-    If this property is true, the highlight is moved smoothly
+    If this property is true (the default value), the highlight is moved smoothly
     to follow the current item.  Otherwise, the
     highlight is not moved by the view, and any movement must be implemented
     by the highlight.  
@@ -1568,6 +1574,8 @@ void QDeclarativeGridView::setFlow(Flow flow)
     If this is true, key navigation that would move the current item selection
     past one end of the view instead wraps around and moves the selection to
     the other end of the view.
+
+    By default, key navigation is not wrapped.
 */
 bool QDeclarativeGridView::isWrapEnabled() const
 {
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 38bc6f5..8b616ce 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1632,8 +1632,14 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate)
     \qmlproperty int ListView::currentIndex
     \qmlproperty Item ListView::currentItem
 
-    \c currentIndex holds the index of the current item.
-    \c currentItem is the current item.  Note that the position of the current item
+    The \c currentIndex property holds the index of the current item, and
+    \c currentItem holds the current item. 
+
+    If highlightFollowsCurrentItem is \c true, setting either of these 
+    properties will smoothly scroll the ListView so that the current 
+    item becomes visible.
+    
+    Note that the position of the current item
     may only be approximate until it becomes visible in the view.
 */
 int QDeclarativeListView::currentIndex() const
@@ -1727,7 +1733,7 @@ void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
     \qmlproperty bool ListView::highlightFollowsCurrentItem
     This property holds whether the highlight is managed by the view.
 
-    If this property is true, the highlight is moved smoothly
+    If this property is true (the default value), the highlight is moved smoothly
     to follow the current item.  Otherwise, the
     highlight is not moved by the view, and any movement must be implemented
     by the highlight.  
@@ -1848,6 +1854,8 @@ void QDeclarativeListView::setHighlightRangeMode(HighlightRangeMode mode)
     \qmlproperty real ListView::spacing
 
     This property holds the spacing between items.
+
+    The default value is 0.
 */
 qreal QDeclarativeListView::spacing() const
 {
@@ -1914,11 +1922,13 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
 
 /*!
     \qmlproperty bool ListView::keyNavigationWraps
-    This property holds whether the list wraps key navigation.
+    This property holds whether the list wraps key navigation. 
 
     If this is true, key navigation that would move the current item selection
     past the end of the list instead wraps around and moves the selection to
     the start of the list, and vice-versa.
+
+    By default, key navigation is not wrapped.
 */
 bool QDeclarativeListView::isWrapEnabled() const
 {
-- 
cgit v0.12


From db04871bda0e470b51dfadef4acbcde08f910f1c Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 20 Jul 2010 14:47:34 +1000
Subject: Expand QtObject doc

---
 doc/src/snippets/declarative/qtobject.qml  | 55 ++++++++++++++++++++++++++++++
 src/declarative/qml/qdeclarativeengine.cpp | 47 +++++++++++++++++++++----
 2 files changed, 95 insertions(+), 7 deletions(-)
 create mode 100644 doc/src/snippets/declarative/qtobject.qml

diff --git a/doc/src/snippets/declarative/qtobject.qml b/doc/src/snippets/declarative/qtobject.qml
new file mode 100644
index 0000000..970fa16
--- /dev/null
+++ b/doc/src/snippets/declarative/qtobject.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+    QtObject { 
+        id: attributes
+        property string name
+        property int size
+        property variant attributes
+    }
+
+    Text { text: attributes.name }
+}
+//![0]
+
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index d1ba6ce..9dae64d 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -115,22 +115,55 @@ QT_BEGIN_NAMESPACE
 /*!
   \qmlclass QtObject QObject
   \since 4.7
-  \brief The QtObject element is the most basic element in QML
+  \brief The QtObject element is the most basic element in QML.
 
   The QtObject element is a non-visual element which contains only the
-  objectName property. It is useful for when you need an extremely
-  lightweight element to place your own custom properties in.
+  objectName property. 
+
+  It can be useful to create a QtObject if you need an extremely
+  lightweight element to enclose a set of custom properties:
+
+  \snippet doc/src/snippets/declarative/qtobject.qml 0
 
   It can also be useful for C++ integration, as it is just a plain
   QObject. See the QObject documentation for further details.
 */
 /*!
   \qmlproperty string QML:QtObject::objectName
-  This property allows you to give a name to this specific object instance.
+  This property holds the QObject::objectName for this specific object instance.
+
+  This allows a C++ application to locate an item within a QML component
+  using the QObject::findChild() method. For example, the following C++ 
+  application locates the child \l Rectangle item and dynamically changes its
+  \c color value:
+
+    \qml
+    // MyRect.qml
+
+    import Qt 4.7
+
+    Item {
+        width: 200; height: 200
+
+        Rectangle {
+            anchors.fill: parent
+            color: "red" 
+            objectName: "myRect"
+        }
+    }
+    \endqml
+
+    \code
+    // main.cpp
+
+    QDeclarativeView view;
+    view.setSource(QUrl::fromLocalFile("MyRect.qml"));
+    view.show();
 
-  See \l{scripting.html#accessing-child-qobjects}{Accessing Child QObjects}
-  in the scripting documentation for details how objectName can be used from
-  scripts.
+    QDeclarativeItem *item = view.rootObject()->findChild<QDeclarativeItem*>("myRect");
+    if (item) 
+        item->setProperty("color", QColor(Qt::yellow));
+    \endcode
 */
 
 struct StaticQtMetaObject : public QObject
-- 
cgit v0.12


From bbc400805f965129341fc3c6a98c4f8b0f9523a4 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Wed, 21 Jul 2010 14:32:34 +1000
Subject: Add missing snippet files

---
 doc/src/snippets/declarative/anchoranimation.qml | 65 +++++++++++++++++++++
 doc/src/snippets/declarative/parentanimation.qml | 74 ++++++++++++++++++++++++
 2 files changed, 139 insertions(+)
 create mode 100644 doc/src/snippets/declarative/anchoranimation.qml
 create mode 100644 doc/src/snippets/declarative/parentanimation.qml

diff --git a/doc/src/snippets/declarative/anchoranimation.qml b/doc/src/snippets/declarative/anchoranimation.qml
new file mode 100644
index 0000000..6c7aaf6
--- /dev/null
+++ b/doc/src/snippets/declarative/anchoranimation.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+    id: container
+    width: 200; height: 200
+
+    Rectangle {
+        id: myRect
+        width: 100; height: 100
+        color: "red"
+    }
+
+    states: State {
+        name: "reanchored"
+        AnchorChanges { target: myRect; anchors.right: container.right }
+    }
+
+    transitions: Transition {
+        // smoothly reanchor myRect and move into new position
+        AnchorAnimation { duration: 1000 }
+    }
+
+    Component.onCompleted: container.state = "reanchored"
+}
+//![0]
diff --git a/doc/src/snippets/declarative/parentanimation.qml b/doc/src/snippets/declarative/parentanimation.qml
new file mode 100644
index 0000000..7f11a43
--- /dev/null
+++ b/doc/src/snippets/declarative/parentanimation.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import Qt 4.7
+
+Item {
+    width: 200; height: 100
+
+    Rectangle { 
+        id: redRect
+        width: 100; height: 100
+        color: "red"
+    }
+
+    Rectangle { 
+        id: blueRect
+        x: redRect.width
+        width: 50; height: 50
+        color: "blue"
+
+        states: State {
+            name: "reparented"
+            ParentChange { target: blueRect; parent: redRect; x: 10; y: 10 }
+        }
+
+        transitions: Transition {
+            ParentAnimation {
+                NumberAnimation { properties: "x,y"; duration: 1000 }
+            }
+        }
+
+        MouseArea { anchors.fill: parent; onClicked: blueRect.state = "reparented" }
+    }
+}
+//![0]
+
-- 
cgit v0.12


From 2c6312bcb2a80431e6f0cf16d6c4c1d016d40b03 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Wed, 21 Jul 2010 15:27:32 +1000
Subject: Expand QDeclarativeExtensionPlugin docs

---
 .../declarative/cppextensions/plugins/plugin.cpp   |  6 ++
 .../declarative/cppextensions/plugins/plugins.qml  |  3 +-
 .../qml/qdeclarativeextensionplugin.cpp            | 77 ++++++++++++++++++----
 3 files changed, 73 insertions(+), 13 deletions(-)

diff --git a/examples/declarative/cppextensions/plugins/plugin.cpp b/examples/declarative/cppextensions/plugins/plugin.cpp
index 355ca3f..01d5361 100644
--- a/examples/declarative/cppextensions/plugins/plugin.cpp
+++ b/examples/declarative/cppextensions/plugins/plugin.cpp
@@ -96,11 +96,13 @@ private:
     QBasicTimer timer;
 };
 
+//![0]
 class TimeModel : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(int hour READ hour NOTIFY timeChanged)
     Q_PROPERTY(int minute READ minute NOTIFY timeChanged)
+//![0]
 
 public:
     TimeModel(QObject *parent=0) : QObject(parent)
@@ -135,6 +137,7 @@ private:
 int TimeModel::instances=0;
 MinuteTimer *TimeModel::timer=0;
 
+//![plugin]
 class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
 {
     Q_OBJECT
@@ -145,7 +148,10 @@ public:
         qmlRegisterType<TimeModel>(uri, 1, 0, "Time");
     }
 };
+//![plugin]
 
 #include "plugin.moc"
 
+//![export]
 Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);
+//![export]
diff --git a/examples/declarative/cppextensions/plugins/plugins.qml b/examples/declarative/cppextensions/plugins/plugins.qml
index 1832017..8d1085c 100644
--- a/examples/declarative/cppextensions/plugins/plugins.qml
+++ b/examples/declarative/cppextensions/plugins/plugins.qml
@@ -37,7 +37,7 @@
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
-
+//![0]
 import com.nokia.TimeExample 1.0 // import types from the plugin
 
 Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
@@ -49,3 +49,4 @@ Clock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)
     hours: time.hour
     minutes: time.minute
 }
+//![0]
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
index 0660599..448fde2 100644
--- a/src/declarative/qml/qdeclarativeextensionplugin.cpp
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -50,23 +50,76 @@ QT_BEGIN_NAMESPACE
 
     \ingroup plugins
 
-    QDeclarativeExtensionPlugin is a plugin interface that makes it
-    possible to offer extensions that can be loaded dynamically into
-    applications using the QDeclarativeEngine class.
-
-    Writing a QML extension plugin is achieved by subclassing this
-    base class, reimplementing the pure virtual registerTypes()
-    function, and exporting the class using the Q_EXPORT_PLUGIN2()
-    macro.
+    QDeclarativeExtensionPlugin is a plugin interface that makes it possible to
+    create QML extensions that can be loaded dynamically into QML applications.
+    These extensions allow custom QML types to be made available to the QML engine. 
+    
+    To write a QML extension plugin:
+    
+    \list
+    \o Subclass QDeclarativeExtensionPlugin, implement registerTypes() method
+    to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro
+    \o Write an appropriate project file for the plugin
+    \o Create a \l{The qmldir file}{qmldir file} to describe the plugin
+    \endlist
 
     QML extension plugins can be used to provide either application-specific or
     library-like plugins. Library plugins should limit themselves to registering types,
     as any manipulation of the engine's root context may cause conflicts
     or other issues in the library user's code.
 
-    See \l {Tutorial: Writing QML extensions with C++} for details on creating
-    QML extensions, including how to build a plugin with with QDeclarativeExtensionPlugin.
-    For a simple overview, see the \l{declarative/cppextensions/plugins}{plugins} example.
+
+    \section1 An example
+
+    Suppose there is a new \c TimeModel C++ class that should be made available
+    as a new QML element. It provides the current time through \c hour and \c minute 
+    properties, like this:
+
+    \snippet examples/declarative/cppextensions/plugins/plugin.cpp 0
+    \dots
+
+    To make this class available as a QML type, create a plugin that registers
+    this type using qmlRegisterType(). For this example the plugin
+    module will be named \c com.nokia.TimeExample (as defined in the project
+    file further below).
+
+    \snippet examples/declarative/cppextensions/plugins/plugin.cpp plugin
+    \codeline
+    \snippet examples/declarative/cppextensions/plugins/plugin.cpp export
+
+    This registers the \c TimeModel class with the 1.0 version of this 
+    plugin library, as a QML type called \c Time. The Q_ASSERT statement 
+    ensures the module is imported correctly by any QML components that use this plugin.
+
+    The project file defines the project as a plugin library and specifies 
+    it should be built into the \c com/nokia/TimeExample directory:
+
+    \code
+    TEMPLATE = lib
+    CONFIG += qt plugin
+    QT += declarative
+
+    DESTDIR = com/nokia/TimeExample
+    TARGET = qmlqtimeexampleplugin
+    ...
+    \endcode    
+
+    Finally, a \l{The qmldir file}{qmldir file} is required in the \c com/nokia/TimeExample directory
+    that describes the plugin. This directory includes a \c Clock.qml file that
+    should be bundled with the plugin, so it needs to be specified in the \c qmldir
+    file:
+
+    \quotefile examples/declarative/cppextensions/plugins/com/nokia/TimeExample/qmldir
+
+    Once the project is built and installed, the new \c Time element can be 
+    used by any QML component that imports the \c com.nokia.TimeExample module:
+
+    \snippet examples/declarative/cppextensions/plugins/plugins.qml 0
+
+    The full source code is available in the \l {declarative/cppextensions/plugins}{plugins example}.
+
+    The \l {Tutorial: Writing QML extensions with C++} also contains a chapter
+    on creating QML plugins.
 
     \sa QDeclarativeEngine::importPlugin(), {How to Create Qt Plugins}
 */
@@ -95,7 +148,7 @@ QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent)
 }
 
 /*!
-  Destroys the plugin.
+  \internal
  */
 QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin()
 {
-- 
cgit v0.12


From ebe6a5238947c30a613b61b521cb0d094efa2d02 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Wed, 21 Jul 2010 09:57:32 +0200
Subject: Fixed a parsing error during sis and runonphone target creation.

RevBy:    Trust me
---
 mkspecs/features/sis_targets.prf          | 2 +-
 mkspecs/features/symbian/run_on_phone.prf | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf
index 19972d7..615bbe5 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/sis_targets.prf
@@ -4,7 +4,7 @@ GENERATE_SIS_TARGETS = false
 contains(TEMPLATE, app): GENERATE_SIS_TARGETS = true
 else:!equals(DEPLOYMENT, default_deployment) {
     for(dep_item, $$list($$DEPLOYMENT)) {
-        dep_item_sources = $$eval($${dep_item}.sources)
+        eval(dep_item_sources = $${dep_item}.sources)
         !isEmpty(dep_item_sources): GENERATE_SIS_TARGETS = true
     }
 }
diff --git a/mkspecs/features/symbian/run_on_phone.prf b/mkspecs/features/symbian/run_on_phone.prf
index 818151a..6fd400a 100644
--- a/mkspecs/features/symbian/run_on_phone.prf
+++ b/mkspecs/features/symbian/run_on_phone.prf
@@ -5,7 +5,7 @@ GENERATE_RUN_TARGETS = false
 contains(TEMPLATE, app): GENERATE_RUN_TARGETS = true
 else:!equals(DEPLOYMENT, default_deployment) {
     for(dep_item, $$list($$DEPLOYMENT)) {
-        dep_item_sources = $$eval($${dep_item}.sources)
+        eval(dep_item_sources = $${dep_item}.sources)
         !isEmpty(dep_item_sources): GENERATE_RUN_TARGETS = true
     }
 }
-- 
cgit v0.12


From 17ae405bd4ff4a96c2e431d76e6bfabf5c1058e6 Mon Sep 17 00:00:00 2001
From: Tasuku Suzuki <tasuku.suzuki@nokia.com>
Date: Wed, 21 Jul 2010 10:02:37 +0200
Subject: Fix compilation with QT_NO_GRAPHICSVIEW
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Merge-request: 751
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
---
 src/gui/kernel/qstandardgestures.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index e05f8cc..127e150 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -515,11 +515,14 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
 
     const QTouchEvent *ev = static_cast<const QTouchEvent *>(event);
     const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
+#ifndef QT_NO_GRAPHICSVIEW
     const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
+#endif
 
     enum { TapRadius = 40 };
 
     switch (event->type()) {
+#ifndef QT_NO_GRAPHICSVIEW
     case QEvent::GraphicsSceneMousePress:
         d->position = gsme->screenPos();
         q->setHotSpot(d->position);
@@ -527,6 +530,7 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
             q->killTimer(d->timerId);
         d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
         return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
+#endif
     case QEvent::MouseButtonPress:
         d->position = me->globalPos();
         q->setHotSpot(d->position);
@@ -541,7 +545,9 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
             q->killTimer(d->timerId);
         d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
         return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
+#ifndef QT_NO_GRAPHICSVIEW
     case QEvent::GraphicsSceneMouseRelease:
+#endif
     case QEvent::MouseButtonRelease:
     case QEvent::TouchEnd:
         return QGestureRecognizer::CancelGesture; // get out of the MayBeGesture state
@@ -559,12 +565,14 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
             return QGestureRecognizer::MayBeGesture;
         return QGestureRecognizer::CancelGesture;
     }
+#ifndef QT_NO_GRAPHICSVIEW
     case QEvent::GraphicsSceneMouseMove: {
         QPoint delta = gsme->screenPos() - d->position.toPoint();
         if (d->timerId && delta.manhattanLength() <= TapRadius)
             return QGestureRecognizer::MayBeGesture;
         return QGestureRecognizer::CancelGesture;
     }
+#endif
     default:
         return QGestureRecognizer::Ignore;
     }
-- 
cgit v0.12


From ceff2321d7b7eaa4608a1baa5de66dbce8733342 Mon Sep 17 00:00:00 2001
From: Toby Tomkins <toby.tomkins@nokia.com>
Date: Wed, 21 Jul 2010 18:11:53 +1000
Subject: Minor modification to allow compilation on WinCE and AIX. Removed
 executable attributes.

---
 examples/tutorials/modelview/1_readonly/1_readonly.pro           | 0
 examples/tutorials/modelview/1_readonly/main.cpp                 | 0
 examples/tutorials/modelview/1_readonly/modelview.cpp            | 0
 examples/tutorials/modelview/1_readonly/modelview.h              | 0
 examples/tutorials/modelview/1_readonly/mymodel.cpp              | 0
 examples/tutorials/modelview/1_readonly/mymodel.h                | 0
 examples/tutorials/modelview/2_formatting/2_formatting.pro       | 0
 examples/tutorials/modelview/2_formatting/main.cpp               | 0
 examples/tutorials/modelview/2_formatting/modelview.cpp          | 0
 examples/tutorials/modelview/2_formatting/modelview.h            | 0
 examples/tutorials/modelview/2_formatting/mymodel.cpp            | 2 +-
 examples/tutorials/modelview/2_formatting/mymodel.h              | 0
 examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro | 0
 examples/tutorials/modelview/3_changingmodel/main.cpp            | 0
 examples/tutorials/modelview/3_changingmodel/modelview.cpp       | 0
 examples/tutorials/modelview/3_changingmodel/modelview.h         | 0
 examples/tutorials/modelview/3_changingmodel/mymodel.cpp         | 0
 examples/tutorials/modelview/3_changingmodel/mymodel.h           | 0
 examples/tutorials/modelview/4_headers/4_headers.pro             | 0
 examples/tutorials/modelview/4_headers/main.cpp                  | 0
 examples/tutorials/modelview/4_headers/modelview.cpp             | 0
 examples/tutorials/modelview/4_headers/modelview.h               | 0
 examples/tutorials/modelview/4_headers/mymodel.cpp               | 0
 examples/tutorials/modelview/4_headers/mymodel.h                 | 0
 examples/tutorials/modelview/5_edit/5_edit.pro                   | 0
 examples/tutorials/modelview/5_edit/main.cpp                     | 0
 examples/tutorials/modelview/5_edit/modelview.cpp                | 0
 examples/tutorials/modelview/5_edit/modelview.h                  | 0
 examples/tutorials/modelview/5_edit/mymodel.cpp                  | 0
 examples/tutorials/modelview/5_edit/mymodel.h                    | 0
 examples/tutorials/modelview/6_treeview/6_treeview.pro           | 0
 examples/tutorials/modelview/6_treeview/main.cpp                 | 0
 examples/tutorials/modelview/6_treeview/modelview.cpp            | 0
 examples/tutorials/modelview/6_treeview/modelview.h              | 0
 examples/tutorials/modelview/7_selections/7_selections.pro       | 0
 examples/tutorials/modelview/7_selections/main.cpp               | 0
 examples/tutorials/modelview/7_selections/modelview.cpp          | 0
 examples/tutorials/modelview/7_selections/modelview.h            | 0
 examples/tutorials/modelview/modelview.pro                       | 0
 39 files changed, 1 insertion(+), 1 deletion(-)
 mode change 100755 => 100644 examples/tutorials/modelview/1_readonly/1_readonly.pro
 mode change 100755 => 100644 examples/tutorials/modelview/1_readonly/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/1_readonly/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/1_readonly/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/1_readonly/mymodel.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/1_readonly/mymodel.h
 mode change 100755 => 100644 examples/tutorials/modelview/2_formatting/2_formatting.pro
 mode change 100755 => 100644 examples/tutorials/modelview/2_formatting/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/2_formatting/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/2_formatting/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/2_formatting/mymodel.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/2_formatting/mymodel.h
 mode change 100755 => 100644 examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
 mode change 100755 => 100644 examples/tutorials/modelview/3_changingmodel/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/3_changingmodel/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/3_changingmodel/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/3_changingmodel/mymodel.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/3_changingmodel/mymodel.h
 mode change 100755 => 100644 examples/tutorials/modelview/4_headers/4_headers.pro
 mode change 100755 => 100644 examples/tutorials/modelview/4_headers/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/4_headers/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/4_headers/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/4_headers/mymodel.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/4_headers/mymodel.h
 mode change 100755 => 100644 examples/tutorials/modelview/5_edit/5_edit.pro
 mode change 100755 => 100644 examples/tutorials/modelview/5_edit/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/5_edit/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/5_edit/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/5_edit/mymodel.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/5_edit/mymodel.h
 mode change 100755 => 100644 examples/tutorials/modelview/6_treeview/6_treeview.pro
 mode change 100755 => 100644 examples/tutorials/modelview/6_treeview/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/6_treeview/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/6_treeview/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/7_selections/7_selections.pro
 mode change 100755 => 100644 examples/tutorials/modelview/7_selections/main.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/7_selections/modelview.cpp
 mode change 100755 => 100644 examples/tutorials/modelview/7_selections/modelview.h
 mode change 100755 => 100644 examples/tutorials/modelview/modelview.pro

diff --git a/examples/tutorials/modelview/1_readonly/1_readonly.pro b/examples/tutorials/modelview/1_readonly/1_readonly.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/1_readonly/main.cpp b/examples/tutorials/modelview/1_readonly/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/1_readonly/modelview.cpp b/examples/tutorials/modelview/1_readonly/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/1_readonly/modelview.h b/examples/tutorials/modelview/1_readonly/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.cpp b/examples/tutorials/modelview/1_readonly/mymodel.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/1_readonly/mymodel.h b/examples/tutorials/modelview/1_readonly/mymodel.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/2_formatting/2_formatting.pro b/examples/tutorials/modelview/2_formatting/2_formatting.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/2_formatting/main.cpp b/examples/tutorials/modelview/2_formatting/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/2_formatting/modelview.cpp b/examples/tutorials/modelview/2_formatting/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/2_formatting/modelview.h b/examples/tutorials/modelview/2_formatting/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
old mode 100755
new mode 100644
index e34e014..f7ff504
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -89,7 +89,7 @@ QVariant MyModel::data(const QModelIndex &index, int role) const
 
         if (row == 1 && col == 2)  //change background only for cell(1,2)
         {
-            QBrush redBackground(QColor(Qt::red));
+            QBrush redBackground = QBrush(Qt::red);
             return redBackground;
         }
         break;
diff --git a/examples/tutorials/modelview/2_formatting/mymodel.h b/examples/tutorials/modelview/2_formatting/mymodel.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro b/examples/tutorials/modelview/3_changingmodel/3_changingmodel.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/3_changingmodel/main.cpp b/examples/tutorials/modelview/3_changingmodel/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.cpp b/examples/tutorials/modelview/3_changingmodel/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/3_changingmodel/modelview.h b/examples/tutorials/modelview/3_changingmodel/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.cpp b/examples/tutorials/modelview/3_changingmodel/mymodel.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/3_changingmodel/mymodel.h b/examples/tutorials/modelview/3_changingmodel/mymodel.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/4_headers/4_headers.pro b/examples/tutorials/modelview/4_headers/4_headers.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/4_headers/main.cpp b/examples/tutorials/modelview/4_headers/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/4_headers/modelview.cpp b/examples/tutorials/modelview/4_headers/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/4_headers/modelview.h b/examples/tutorials/modelview/4_headers/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/4_headers/mymodel.cpp b/examples/tutorials/modelview/4_headers/mymodel.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/4_headers/mymodel.h b/examples/tutorials/modelview/4_headers/mymodel.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/5_edit/5_edit.pro b/examples/tutorials/modelview/5_edit/5_edit.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/5_edit/main.cpp b/examples/tutorials/modelview/5_edit/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/5_edit/modelview.cpp b/examples/tutorials/modelview/5_edit/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/5_edit/modelview.h b/examples/tutorials/modelview/5_edit/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/5_edit/mymodel.cpp b/examples/tutorials/modelview/5_edit/mymodel.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/5_edit/mymodel.h b/examples/tutorials/modelview/5_edit/mymodel.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/6_treeview/6_treeview.pro b/examples/tutorials/modelview/6_treeview/6_treeview.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/6_treeview/main.cpp b/examples/tutorials/modelview/6_treeview/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/6_treeview/modelview.cpp b/examples/tutorials/modelview/6_treeview/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/6_treeview/modelview.h b/examples/tutorials/modelview/6_treeview/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/7_selections/7_selections.pro b/examples/tutorials/modelview/7_selections/7_selections.pro
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/7_selections/main.cpp b/examples/tutorials/modelview/7_selections/main.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/7_selections/modelview.cpp b/examples/tutorials/modelview/7_selections/modelview.cpp
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/7_selections/modelview.h b/examples/tutorials/modelview/7_selections/modelview.h
old mode 100755
new mode 100644
diff --git a/examples/tutorials/modelview/modelview.pro b/examples/tutorials/modelview/modelview.pro
old mode 100755
new mode 100644
-- 
cgit v0.12


From 2e63bd12bfe0a34f8708f99a0a97fc55d53cc229 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Wed, 21 Jul 2010 10:03:21 +0200
Subject: Some more change to the changelog

---
 dist/changes-4.7.0 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index e195488..09ae57b 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -65,6 +65,8 @@ QtCore
  - QMetaType
     * Significantly improved performance of the type() function
     * [QTBUG-8235] Support QEasingCurve as a built in metatype.
+    * Added possibility to register several name for the same type with
+      qRegisterMetaType<>() (ie. for typedef)
  - QState
     * [QTBUG-7741] Added a function to get the out-going transitions
  - QXmlStreamReader
@@ -74,6 +76,8 @@ QtCore
  - QAbstractAnimation
     * [QTBUG-10654] Avoids animation with loopCount == 0 to change state
       to running and stopped.
+ - QVarLenghtArray
+    * Added some API to be more consistant with other containers
 
 QtGui
 -----
@@ -187,6 +191,9 @@ QtOpenGL
    
  - [QTBUG-9706] Improved appearance of text antialiasing.
 
+ - QTreeView
+    * Optimized
+
 QtNetwork
 ---------
  - QHostInfo: Added a small 60 second DNS cache
@@ -368,7 +375,7 @@ Qt for Windows CE
 
 
 - moc
-
+  * Fixed several parsing bugs. Including changes in the normalized signature.
 
 - uic
 
-- 
cgit v0.12


From 22e0ebd883256379d950ee94de9ba9c92ecf0113 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Wed, 21 Jul 2010 10:15:25 +0200
Subject: tst_moc: workaround gcc bug.

The gcc bug was already work arounded, but moc did not understand the defines
and generated the slot anyway why it would not exist with gcc < 4.4
---
 tests/auto/moc/tst_moc.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index d871540..d3a7e03 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1344,18 +1344,21 @@ signals:
 class QTBUG12260_defaultTemplate_Object : public QObject
 { Q_OBJECT
 public slots:
-#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) //gcc bug, this does not compile
-    void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>()) { Q_UNUSED(values); }
+#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) || defined(Q_MOC_RUN)
+    void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>() ) { Q_UNUSED(values); }
+#else
+    // we want to test the previous function, but gcc < 4.4 seemed to have a bug similar to the one moc has.
+    typedef QHash<QString, QVariant> WorkaroundGCCBug;
+    void doSomething(QHash<QString, QVariant> values = WorkaroundGCCBug() ) { Q_UNUSED(values); }
 #endif
+
     void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); }
 };
 
 
 void tst_Moc::QTBUG12260_defaultTemplate()
 {
-#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3)
     QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1);
-#endif
     QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1);
 }
 
-- 
cgit v0.12


From 7a19192fb418e40732ad72e0d4aaf83527958ded Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 15 Jul 2010 11:00:10 +0200
Subject: Various configure fixes to make Qt compile with Raptor on Linux.

Based on a patch by Oleh Vasyura <ext-oleh.2.vasyura@nokia.com>.

RevBy:    Jason Barron
---
 configure | 105 ++++++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 81 insertions(+), 24 deletions(-)

diff --git a/configure b/configure
index 166f201..51628d7 100755
--- a/configure
+++ b/configure
@@ -728,7 +728,7 @@ CFG_GLIB=auto
 CFG_GSTREAMER=auto
 CFG_QGTKSTYLE=auto
 CFG_QS60STYLE=auto
-CFG_LARGEFILE=yes
+CFG_LARGEFILE=auto
 CFG_OPENSSL=auto
 CFG_PTMALLOC=no
 CFG_STL=auto
@@ -3059,12 +3059,17 @@ fi
 
 QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
 TEST_COMPILER="$CXX"
+
 [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
-if [ -z "$TEST_COMPILER" ]; then
-    echo "ERROR: Cannot set the compiler for the configuration tests"
-    exit 1
+if [ "$XPLATFORM" != "symbian-sbsv2" ]; then
+    #for Symbian we don't need this checking
+    if [ -z "$TEST_COMPILER" ]; then
+        echo "ERROR: Cannot set the compiler for the configuration tests"
+        exit 1
+    fi
 fi
 
+
 # auto-detect precompiled header support
 if [ "$CFG_PRECOMPILE" = "auto" ]; then
     if [ `echo "$CFG_MAC_ARCHS" | wc -w` -gt 1 ]; then
@@ -4482,14 +4487,26 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
 
     mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
     for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
-        if [ '!' -f "$conf" ]; then
-            ln -s "$QCONFIG_H" "$conf"
+        if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null ; then
+            # Link is not supported for Raptor build system, because of Samba mounts
+            # and zip packaging.
+            [ -e "$conf" ] && rm -rf "$conf"
+            cp -a "$QCONFIG_H" "$conf"
+        else
+            if [ '!' -f "$conf" ]; then
+                ln -s "$QCONFIG_H" "$conf"
+            fi
         fi
     done
 
     #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
-    rm -f mkspecs/default
-    ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
+    rm -rf mkspecs/default
+    if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null ; then
+#Link is not supported for Symbian build system
+        cp -a mkspecs/`echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
+    else
+        ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
+    fi
     # fix makefiles
     for mkfile in GNUmakefile Makefile; do
         EXTRA_LFLAGS=
@@ -4719,6 +4736,10 @@ case "$XPLATFORM" in *symbian*)
     QMakeVar set styles "windows s60"   #overwrite previous default
     CFG_LIBFREETYPE=no
 
+    if [ "$CFG_LARGEFILE" = auto ]; then
+        CFG_LARGEFILE=no
+    fi
+
     if test -z "$EPOCROOT"; then
         echo "Please export EPOCROOT. It should point to the sdk install dir"
         exit 1
@@ -4743,15 +4764,24 @@ case "$XPLATFORM" in *symbian*)
     )
 
     # compile a simple main that uses printf
-    if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS
-    then
-        echo "Testing your compiler failed. Could not compile a simple application."
-        echo "Fatal error; Rerun configure with -verbose to get more details."
-        exit 1;
+    if ! echo $XPLATFORM | grep symbian-sbsv2 > /dev/null; then
+        # Raptor does not support configure tests.
+        if ! "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/simple "simple" $L_FLAGS $I_FLAGS $l_FLAGS
+        then
+            echo "Testing your compiler failed. Could not compile a simple application."
+            echo "Fatal error; Rerun configure with -verbose to get more details."
+            exit 1;
+        fi
     fi
     ;;
 esac
 
+if [ "$CFG_LARGEFILE" = "auto" ]; then
+    #Large files should be enabled for all Linux systems
+    CFG_LARGEFILE=yes
+fi
+
+
 if [ "$CFG_S60" = "auto" ]; then
     if echo "$XPLATFORM" | grep symbian > /dev/null; then
         CFG_S60=yes
@@ -5067,8 +5097,11 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
             if [ "$CFG_SQL_sqlite" = "auto" ]; then # the default
                 case "$XPLATFORM" in
                     symbian*)
-                    # sqlite on symbian is typically not build in Qt but deployed as a pre-existing sis file.
-                    CFG_SQL_sqlite=no
+                    # sqlite on symbian is typically not build in Qt but deployed as a pre-existing sis file and should be marked as driver.
+                    # Configuration parameters should be set
+                    CFG_SQL_sqlite=qt
+                    QT_LFLAGS_SQLITE=-lsqlite3
+                    QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
                     ;;
                 esac
             fi
@@ -6074,7 +6107,10 @@ fi
 
 # find if the platform supports IPv6
 if [ "$CFG_IPV6" != "no" ]; then
-    if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
+    if [ "$XPLATFORM" = "symbian-sbsv2" ]; then
+        #IPV6 should always be enabled for Symbian release
+        CFG_IPV6=yes
+    elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/ipv6 "IPv6" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
         CFG_IPV6=yes
     else
         if [ "$CFG_IPV6" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
@@ -6187,7 +6223,7 @@ if [ "$CFG_GETIFADDRS" != "no" ]; then
 fi
 
 # detect OpenSSL
-if [ "$CFG_OPENSSL" != "no" ]; then
+if [ "$CFG_OPENSSL" != "no" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
         if [ "$CFG_OPENSSL" = "auto" ]; then
             CFG_OPENSSL=yes
@@ -6203,6 +6239,11 @@ if [ "$CFG_OPENSSL" != "no" ]; then
             CFG_OPENSSL=no
         fi
     fi
+else
+    if [ "$CFG_OPENSSL" = "auto" ] && [ "$XPLATFORM" = "symbian-sbsv2" ]; then
+        #OpenSSl should be enabled for Symbian release
+        CFG_OPENSSL=yes
+    fi
 fi
 
 # detect OpenVG support
@@ -6258,12 +6299,15 @@ if [ "$CFG_PTMALLOC" != "no" ]; then
     QMakeVar add QMAKE_LFLAGS "$outpath/lib/libptmalloc3.a"
 fi
 
-if [ "$CFG_ALSA" = "auto" ]; then
+if [ "$CFG_ALSA" = "auto" ] && [ "$XPLATFORM" != "symbian-sbsv2" ]; then
     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/alsa "alsa" $L_FLAGS $I_FLAGS $l_FLAGS; then
         CFG_ALSA=yes
     else
         CFG_ALSA=no
     fi
+elif [ "$XPLATFORM" = "symbian-sbsv2" ]; then
+    # Disabled for Symbian release
+    CFG_ALSA=no
 fi
 
 if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then 
@@ -6283,7 +6327,9 @@ fi
 
 if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then
     if echo "$XPLATFORM" | grep symbian > /dev/null 2>&1; then
-        "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/audio "audio" $L_FLAGS $I_FLAGS $l_FLAGS
+         if "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/audio "audio" $L_FLAGS $I_FLAGS $l_FLAGS ; then
+            CFG_AUDIO_BACKEND=yes
+         fi
     else
         CFG_AUDIO_BACKEND=yes
     fi
@@ -6292,6 +6338,9 @@ fi
 if [ "$CFG_LARGEFILE" != "yes" ] && [ "$XPLATFORM_MINGW" = "yes" ]; then
     echo "Warning: largefile support cannot be disabled for win32."
     CFG_LARGEFILE="yes"
+elif [ "$CFG_LARGEFILE" != "no" ] && echo "$XPLATFORM" | grep "symbian" > /dev/null; then
+    echo "Warning: largefile support cannot be enabled for symbian."
+    CFG_LARGEFILE="no"
 fi
 
 #-------------------------------------------------------------------------------
@@ -6669,9 +6718,9 @@ if [ "$CFG_S60" = "yes" ]; then
 fi
 
 if [ "$CFG_SYMBIAN_DEFFILES" = "yes" ]; then
-    QMAKE_CONFIG="$QMAKE_CONFIG def_files"
+    QTCONFIG_CONFIG="$QTCONFIG_CONFIG def_files"
 else
-    QMAKE_CONFIG="$QMAKE_CONFIG def_files_disabled"
+    QTCONFIG_CONFIG="$QTCONFIG_CONFIG def_files_disabled"
 fi
 
 [ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis"
@@ -7642,12 +7691,14 @@ else
     mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
     chmod -w "$outpath/src/corelib/global/qconfig.h"
     for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
-        if [ '!' -f "$conf" ]; then
+        if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null 2>&1 ; then
+            [ -e "$conf" ] && rm -rf "$conf"
+            cp -a "$outpath/src/corelib/global/qconfig.h" "$conf"
+        elif [ '!' -f "$conf" ]; then
             ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
         fi
     done
 fi
-
 #-------------------------------------------------------------------------------
 # save configuration into qconfig.pri
 #-------------------------------------------------------------------------------
@@ -7717,6 +7768,10 @@ if [ -n "$QT_GCC_MAJOR_VERSION" ]; then
     echo "QT_GCC_MINOR_VERSION = $QT_GCC_MINOR_VERSION" >> "$QTCONFIG.tmp"
     echo "QT_GCC_PATCH_VERSION = $QT_GCC_PATCH_VERSION" >> "$QTCONFIG.tmp"
 fi
+if echo "$XPLATFORM" | grep "symbian-sbsv2" > /dev/null 2>&1; then
+    echo "#Qt for symbian FPU settings" >> "$QTCONFIG.tmp"
+    echo "MMP_RULES += \"ARMFPU softvfp\"" >> "$QTCONFIG.tmp"
+fi
 # replace qconfig.pri if it differs from the newly created temp file
 if cmp -s "$QTCONFIG.tmp" "$QTCONFIG"; then
     rm -f "$QTCONFIG.tmp"
@@ -8291,7 +8346,9 @@ for file in .projects .projects.3; do
         *winmain/winmain.pro)
             [ "$XPLATFORM_MINGW" = "yes" ] || continue
             SPEC=$XQMAKESPEC ;;
-        *s60main/s60main.pro) continue ;;
+        *s60main/s60main.pro) if [ -z "`echo "$XPLATFORM" | grep "symbian" >/dev/null`"]; then
+                continue
+            fi;;
         *examples/activeqt/*) continue ;;
         */qmake/qmake.pro) continue ;;
         *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*linguist/lrelease*) SPEC=$QMAKESPEC ;;
-- 
cgit v0.12


From 74868367dce9038dfbac574196e6b2d75ab977e7 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 15 Jul 2010 11:05:37 +0200
Subject: Fixed QT_NO_FREETYPE define.

This define is also used by the OpenVG module, and therefore needs
to be defined everywhere.

RevBy:    Jason Barron
---
 configure             | 1 +
 src/gui/text/text.pri | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index 51628d7..a97c5d1 100755
--- a/configure
+++ b/configure
@@ -6687,6 +6687,7 @@ elif [ "$CFG_TIFF" = "yes" ]; then
 fi
 if [ "$CFG_LIBFREETYPE" = "no" ]; then
     QT_CONFIG="$QT_CONFIG no-freetype"
+    QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_FREETYPE"
 elif [ "$CFG_LIBFREETYPE" = "system" ]; then
     QT_CONFIG="$QT_CONFIG system-freetype"
 else
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index 34311a9..af8daa5 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -197,8 +197,6 @@ contains(QT_CONFIG, freetype) {
     # pull in the proper freetype2 include directory
     include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
     LIBS_PRIVATE += -lfreetype
-} else {
-    DEFINES *= QT_NO_FREETYPE
 }
 
 contains(QT_CONFIG, fontconfig) {
-- 
cgit v0.12


From d9e75d77ac3da86c32d280895beac2936d8869ca Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 15 Jul 2010 11:26:14 +0200
Subject: Removed the need to specify -arch symbian when compiling on Linux.

Task:     QTBUG-11385
RevBy:    Jason Barron
---
 configure                                       | 2 ++
 doc/src/snippets/code/doc_src_installation.qdoc | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index a97c5d1..1bb7522 100755
--- a/configure
+++ b/configure
@@ -2935,6 +2935,8 @@ if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
     esac
 elif [ "$XPLATFORM_MINGW" = "yes" ]; then
     [ -z "$CFG_ARCH" ] && CFG_ARCH="windows"
+elif echo "$XPLATFORM" | grep symbian > /dev/null; then
+    CFG_ARCH=symbian
 elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
     CFG_ARCH=$CFG_HOST_ARCH
 fi
diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc
index 985f3da..b4dd8fa 100644
--- a/doc/src/snippets/code/doc_src_installation.qdoc
+++ b/doc/src/snippets/code/doc_src_installation.qdoc
@@ -250,12 +250,12 @@ export PATH
 
 //! [38]
 cd /home/user/qt/%VERSION%
-./configure -platform linux-g++ -xplatform symbian/linux-armcc -arch symbian
+./configure -platform linux-g++ -xplatform symbian/linux-armcc
 //! [38]
 
 //! [39]
 cd /home/user/qt/%VERSION%
-./configure -platform linux-g++ -xplatform symbian/linux-gcce -arch symbian -no-webkit
+./configure -platform linux-g++ -xplatform symbian/linux-gcce -no-webkit
 //! [39]
 
 //! [40]
-- 
cgit v0.12


From c578c6c1d6dc2f3bb6cc53abb8da2e706a249f02 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 20 Jul 2010 14:07:25 +0200
Subject: Fixed automatic sqlite extraction on Symbian makefile build system.

Since we cannot extract to the epocroot (it is considered R/O), we
extract the header and the dso to the temporary build directories and
include them from there.

RevBy:    Trust me
---
 mkspecs/common/symbian/symbian.conf                |  1 +
 .../sqldrivers/sqlite_symbian/sqlite_symbian.pri   | 38 ++++++++++++++++++++++
 .../sqldrivers/sqlite_symbian/sqlite_symbian.pro   |  2 +-
 src/sql/drivers/drivers.pri                        |  2 ++
 4 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri

diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index c1b31e5..7ec5c6c 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -105,6 +105,7 @@ QMAKE_IDL		  = midl
 QMAKE_LIB		  = ar -ru
 QMAKE_RC		  = windres
 QMAKE_ZIP		  = zip -r -9
+QMAKE_UNZIP               = unzip -o
 
 QMAKE_TAR                 = tar -cf
 QMAKE_GZIP                = gzip -9f
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
new file mode 100644
index 0000000..ab8d846
--- /dev/null
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
@@ -0,0 +1,38 @@
+# We just want to include the sqlite3 binaries for Symbian for platforms that do not have them.
+!symbian-abld:!symbian-sbsv2 {
+    !symbian_no_export_sqlite:!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) {
+        symbian_sqlite3_zip_file = $$PWD/SQLite3_v9.2.zip
+
+        # The QMAKE_COPY section is to update timestamp on the file.
+        symbian_sqlite3_header.input = symbian_sqlite3_zip_file
+        symbian_sqlite3_header.output = sqlite3.h
+        !isEmpty(MOC_DIR):symbian_sqlite3_header.output = $$MOC_DIR/$$symbian_sqlite3_header.output
+        symbian_sqlite3_header.CONFIG = combine no_link
+        symbian_sqlite3_header.dependency_type = TYPE_C
+        symbian_sqlite3_header.commands = $$QMAKE_UNZIP -j ${QMAKE_FILE_NAME} epoc32/include/stdapis/${QMAKE_FILE_OUT_BASE}.h \
+                                          && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.h ${QMAKE_FILE_OUT}.tmp \
+                                          && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.h \
+                                          && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT}
+        QMAKE_EXTRA_COMPILERS += symbian_sqlite3_header
+
+        # The QMAKE_COPY section is to update timestamp on the file.
+        symbian_sqlite3_dso.input = symbian_sqlite3_zip_file
+        symbian_sqlite3_dso.output = sqlite3.dso
+        !isEmpty(OBJECTS_DIR):symbian_sqlite3_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_dso.output
+        symbian_sqlite3_dso.CONFIG = combine no_link target_predeps
+        symbian_sqlite3_dso.commands = $$QMAKE_UNZIP -j ${QMAKE_FILE_NAME} epoc32/release/armv5/lib/${QMAKE_FILE_OUT_BASE}.dso \
+                                       && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.dso ${QMAKE_FILE_OUT}.tmp \
+                                       && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.dso \
+                                       && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT}
+        QMAKE_EXTRA_COMPILERS += symbian_sqlite3_dso
+
+        symbian_sqlite3_ver_dso.input = symbian_sqlite3_zip_file
+        symbian_sqlite3_ver_dso.output = sqlite3{00060003}.dso
+        !isEmpty(OBJECTS_DIR):symbian_sqlite3_ver_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_ver_dso.output
+        symbian_sqlite3_ver_dso.CONFIG = $$symbian_sqlite3_dso.CONFIG
+        symbian_sqlite3_ver_dso.commands = $$symbian_sqlite3_dso.commands
+        QMAKE_EXTRA_COMPILERS += symbian_sqlite3_ver_dso
+
+        QMAKE_LIBDIR *= $$OBJECTS_DIR
+    }
+}
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
index 691cce1..0d233e6 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
@@ -2,7 +2,7 @@
 TEMPLATE = subdirs
 
 # We just want to export the sqlite3 binaries for Symbian for platforms that do not have them.
-symbian {
+symbian-abld|symbian-sbsv2 {
     !symbian_no_export_sqlite:!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) {
         BLD_INF_RULES.prj_exports +=  ":zip SQLite3_v9.2.zip"
     }
diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri
index 05e7265..c68442d 100644
--- a/src/sql/drivers/drivers.pri
+++ b/src/sql/drivers/drivers.pri
@@ -114,6 +114,8 @@ contains(sql-drivers, sqlite) {
         QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE
     }
 
+    symbian:include(../../plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri)
+
     HEADERS +=      drivers/sqlite/qsql_sqlite.h
     SOURCES +=      drivers/sqlite/qsql_sqlite.cpp
 }
-- 
cgit v0.12


From 8d15fffc4d57c55949f799e52f2f52d3b0b66321 Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Wed, 21 Jul 2010 13:44:25 +0200
Subject: Ensure that font sizes that are > 0 and < 1 are still respected

What was happening was that when a font size of 0.5 was used then it
would end up being set to be point size 0.  This now respects the
setting used.

Autotest is included in this patch for this case.

Reviewed-by: Kim
---
 src/svg/qsvgstyle_p.h                        |  2 +-
 tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h
index af3b4e5..dfea12c 100644
--- a/src/svg/qsvgstyle_p.h
+++ b/src/svg/qsvgstyle_p.h
@@ -338,7 +338,7 @@ public:
     {
         // Store the _pixel_ size in the font. Since QFont::setPixelSize() only takes an int, call
         // QFont::SetPointSize() instead. Set proper font size just before rendering.
-        m_qfont.setPointSize(size);
+        m_qfont.setPointSizeF(size);
         m_sizeSet = 1;
     }
 
diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index 106fd8c..519f4f5 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -85,6 +85,7 @@ private slots:
     void testFillInheritance();
     void testStopOffsetOpacity();
     void testUseElement();
+    void smallFont();
 
 #ifndef QT_NO_COMPRESS
     void testGzLoading();
@@ -1342,5 +1343,30 @@ void tst_QSvgRenderer::testUseElement()
     }
 }
 
+void tst_QSvgRenderer::smallFont()
+{
+    static const char *svgs[] = { "<svg width=\"50px\" height=\"50px\"><text x=\"10\" y=\"10\" font-size=\"0\">Hello world</text></svg>",
+                                  "<svg width=\"50px\" height=\"50px\"><text x=\"10\" y=\"10\" font-size=\"0.5\">Hello world</text></svg>"
+    };
+    const int COUNT = sizeof(svgs) / sizeof(svgs[0]);
+    QImage images[COUNT];
+    QPainter p;
+
+    for (int i = 0; i < COUNT; ++i) {
+        QByteArray data(svgs[i]);
+        if (i == 0) {
+            QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0");
+            QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSize: Point size <= 0 (0), must be greater than 0");
+        }
+        QSvgRenderer renderer(data);
+        images[i] = QImage(50, 50, QImage::Format_ARGB32_Premultiplied);
+        images[i].fill(-1);
+        p.begin(&images[i]);
+        renderer.render(&p);
+        p.end();
+    }
+    QVERIFY(images[0] != images[1]);
+}
+
 QTEST_MAIN(tst_QSvgRenderer)
 #include "tst_qsvgrenderer.moc"
-- 
cgit v0.12


From 55c818b8f3fdb50087d1f5553662cd4db302f495 Mon Sep 17 00:00:00 2001
From: Ritt Konstantin <ritt.ks@gmail.com>
Date: Wed, 21 Jul 2010 15:18:20 +0200
Subject: Fix a typo in harfbuzz thai line breaking.

Reviewed-by: Lars Knoll
---
 src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index e153ba9..e80e2c5 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -91,7 +91,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
     for (i = 0; i < numbreaks; ++i) {
         if (break_positions[i] > 0) {
             attributes[break_positions[i]-1].lineBreakType = HB_Break;
-            attributes[i].wordBoundary = TRUE;
+            attributes[break_positions[i]-1].wordBoundary = TRUE;
         }
     }
 
-- 
cgit v0.12


From 7995784a8c93c61cf5d907c2af5524a963a72bb0 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Wed, 21 Jul 2010 15:41:18 +0200
Subject: Added missing header to qstring.cpp.

---
 src/corelib/tools/qstring.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index b5651de..d6ab5da 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -69,6 +69,10 @@
 #include <winnls.h>
 #endif
 
+#ifdef Q_OS_SYMBIAN
+#include <e32cmn.h>
+#endif
+
 #include <limits.h>
 #include <string.h>
 #include <stdlib.h>
-- 
cgit v0.12


From d8fbc4e0264f8bfabc12bc49ed7724eb2c96c93e Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Wed, 21 Jul 2010 15:52:40 +0200
Subject: make "configure -qt-gif" work again on Windows

The value for GIF must be "plugin" and not "yes".

Reviewed-by: danimo
---
 tools/configure/configureapp.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index c3498e3..f7dac93 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -581,8 +581,8 @@ void Configure::parseCmdLine()
         // Image formats --------------------------------------------
         else if (configCmdLine.at(i) == "-no-gif")
             dictionary[ "GIF" ] = "no";
-	else if (configCmdLine.at(i) == "-qt-gif")
-            dictionary[ "GIF" ] = "yes";
+        else if (configCmdLine.at(i) == "-qt-gif")
+            dictionary[ "GIF" ] = "plugin";
 
         else if (configCmdLine.at(i) == "-no-libtiff") {
             dictionary[ "TIFF"] = "no";
-- 
cgit v0.12


From 9c2b396b2b1fefc10b0ff24c9e33b41278c84ca8 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@nokia.com>
Date: Wed, 21 Jul 2010 15:56:21 +0200
Subject: rebuild configure.exe

---
 configure.exe | Bin 1317888 -> 1317888 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/configure.exe b/configure.exe
index eea40f9..6dfd14e48 100755
Binary files a/configure.exe and b/configure.exe differ
-- 
cgit v0.12


From 9c8fe530f4068fc35a58008758ee2bc434415993 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 20 Jul 2010 14:13:32 +0200
Subject: Added automatic sqlite extraction for Symbian to QtWebKit.

Also added sqlite detection in case sqlite is not present in the SDK.
This is possible if WebKit is compiled standalone.

The inclusion part is a consequence of commit c578c6c1d6d in the Qt
repository. It will not work on Qt versions < 4.7.1, but that is ok,
since the only build system it will affect is marked as experimental
in the whole 4.7 series.

RevBy:    Kenneth Rohde Christiansen
Task:     https://bugs.webkit.org/show_bug.cgi?id=42744
---
 src/3rdparty/webkit/WebCore/WebCore.pro | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index c1661a4..2047143 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -117,8 +117,16 @@ win32-g++* {
     QMAKE_LIBDIR_POST += $$split(TMPPATH,";")
 }
 
-# Assume that symbian OS always comes with sqlite
-symbian:!CONFIG(QTDIR_build): CONFIG += system-sqlite
+symbian {
+    !CONFIG(QTDIR_build) {
+        # Test if symbian OS comes with sqlite
+        exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso):CONFIG *= system-sqlite
+    } else:!symbian-abld:!symbian-sbsv2 {
+        # When bundled with Qt, all Symbian build systems extract their own sqlite files if
+        # necessary, but on non-mmp based ones we need to specify this ourselves.
+        include($$QT_SOURCE_TREE/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri)
+    }
+}
 
 
 
-- 
cgit v0.12


From ae64f51f092d7ffb20cb50b0e9cd9b019c0e8831 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 20 Jul 2010 13:26:01 +0200
Subject: Fixed the definitions of file locations on Symbian using configure.sh

RevBy:    Trust me
---
 configure | 187 +++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 101 insertions(+), 86 deletions(-)

diff --git a/configure b/configure
index 1bb7522..515aa9b 100755
--- a/configure
+++ b/configure
@@ -3246,122 +3246,137 @@ if [ -z "$QT_INSTALL_PREFIX" ]; then
 fi
 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
 
-#docs
-if [ -z "$QT_INSTALL_DOCS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    QT_INSTALL_DOCS="/Developer/Documentation/Qt"
+if echo $XPLATFORM | grep symbian > /dev/null; then
+    [ -z "$QT_HOST_PREFIX" ] && QT_HOST_PREFIX="$QT_INSTALL_PREFIX"
+    [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS=
+    [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS=
+    [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS=
+    [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS=
+    [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="\\\\resource\\\\qt$QT_LIBINFIX\\\\plugins"
+    [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="\\\\resource\\\\qt$QT_LIBINFIX\\\\imports"
+    [ -z "$QT_INSTALL_DATA" ] && QT_INSTALL_DATA=
+    [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS="\\\\resource\\\\qt$QT_LIBINFIX\\\\translations"
+    [ -z "$QT_INSTALL_SETTINGS" ] && QT_INSTALL_SETTINGS=
+    [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES=
+    [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS=
+else
+    #docs
+    if [ -z "$QT_INSTALL_DOCS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        QT_INSTALL_DOCS="/Developer/Documentation/Qt"
+            fi
         fi
-    fi
-    [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
+        [ -z "$QT_INSTALL_DOCS" ] && QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
 
-fi
-QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
+    fi
+    QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
 
-#headers
-if [ -z "$QT_INSTALL_HEADERS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    if [ "$CFG_FRAMEWORK" = "yes" ]; then
-		QT_INSTALL_HEADERS=
+    #headers
+    if [ -z "$QT_INSTALL_HEADERS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        if [ "$CFG_FRAMEWORK" = "yes" ]; then
+		    QT_INSTALL_HEADERS=
+                fi
             fi
         fi
-    fi
-    [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
+        [ -z "$QT_INSTALL_HEADERS" ] && QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
 
-fi
-QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
+    fi
+    QT_INSTALL_HEADERS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_HEADERS"`
 
-#libs
-if [ -z "$QT_INSTALL_LIBS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    if [ "$CFG_FRAMEWORK" = "yes" ]; then
-		QT_INSTALL_LIBS="/Libraries/Frameworks"
+    #libs
+    if [ -z "$QT_INSTALL_LIBS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        if [ "$CFG_FRAMEWORK" = "yes" ]; then
+		    QT_INSTALL_LIBS="/Libraries/Frameworks"
+                fi
             fi
         fi
+        [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
     fi
-    [ -z "$QT_INSTALL_LIBS" ] && QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback
-fi
-QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
+    QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
 
-#bins
-if [ -z "$QT_INSTALL_BINS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    QT_INSTALL_BINS="/Developer/Applications/Qt"
+    #bins
+    if [ -z "$QT_INSTALL_BINS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        QT_INSTALL_BINS="/Developer/Applications/Qt"
+            fi
         fi
-    fi
-    [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
+        [ -z "$QT_INSTALL_BINS" ] && QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
 
-fi
-QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
+    fi
+    QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
 
-#plugins
-if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
+    #plugins
+    if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        QT_INSTALL_PLUGINS="/Developer/Applications/Qt/plugins"
+            fi
         fi
+        [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
     fi
-    [ -z "$QT_INSTALL_PLUGINS" ] && QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
-fi
-QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
+    QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
 
-#imports
-if [ -z "$QT_INSTALL_IMPORTS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    QT_INSTALL_IMPORTS="/Developer/Applications/Qt/imports"
+    #imports
+    if [ -z "$QT_INSTALL_IMPORTS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        QT_INSTALL_IMPORTS="/Developer/Applications/Qt/imports"
+            fi
         fi
+        [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" #fallback
     fi
-    [ -z "$QT_INSTALL_IMPORTS" ] && QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" #fallback
-fi
-QT_INSTALL_IMPORTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_IMPORTS"`
+    QT_INSTALL_IMPORTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_IMPORTS"`
 
-#data
-if [ -z "$QT_INSTALL_DATA" ]; then #default
-    QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
-fi
-QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
+    #data
+    if [ -z "$QT_INSTALL_DATA" ]; then #default
+        QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
+    fi
+    QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
 
-#translations
-if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
-    QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
-fi
-QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
+    #translations
+    if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
+        QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
+    fi
+    QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
 
-#settings
-if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
-    if [ "$PLATFORM_MAC" = "yes" ]; then
-	QT_INSTALL_SETTINGS=/Library/Preferences/Qt
-    else
-	QT_INSTALL_SETTINGS=/etc/xdg
+    #settings
+    if [ -z "$QT_INSTALL_SETTINGS" ]; then #default
+        if [ "$PLATFORM_MAC" = "yes" ]; then
+	    QT_INSTALL_SETTINGS=/Library/Preferences/Qt
+        else
+	    QT_INSTALL_SETTINGS=/etc/xdg
+        fi
     fi
-fi
-QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
+    QT_INSTALL_SETTINGS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_SETTINGS"`
 
-#examples
-if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
+    #examples
+    if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        QT_INSTALL_EXAMPLES="/Developer/Examples/Qt"
+            fi
         fi
+        [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
     fi
-    [ -z "$QT_INSTALL_EXAMPLES" ] && QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback
-fi
-QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
+    QT_INSTALL_EXAMPLES=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_EXAMPLES"`
 
-#demos
-if [ -z "$QT_INSTALL_DEMOS" ]; then #default
-    if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
-	if [ "$PLATFORM_MAC" = "yes" ]; then
-	    QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
+    #demos
+    if [ -z "$QT_INSTALL_DEMOS" ]; then #default
+        if [ "$CFG_PREFIX_INSTALL" = "no" ]; then
+	    if [ "$PLATFORM_MAC" = "yes" ]; then
+	        QT_INSTALL_DEMOS="/Developer/Examples/Qt/Demos"
+            fi
         fi
+        [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
     fi
-    [ -z "$QT_INSTALL_DEMOS" ] && QT_INSTALL_DEMOS="$QT_INSTALL_PREFIX/demos"
+    QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
 fi
-QT_INSTALL_DEMOS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DEMOS"`
 
 #-------------------------------------------------------------------------------
 # help - interactive parts of the script _after_ this section please
-- 
cgit v0.12


From 11d626de5fd87fc8cbd9d685bde8217c7ad7fae6 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Wed, 21 Jul 2010 16:13:58 +0200
Subject: Made developer builds use the build dir as prefix, also on Symbian.

Otherwise it is not possible to build projects outside of the Qt tree
without installing Qt to the SDK first.

Task:     QTBUG-11727
RevBy:    Trust me
---
 configure | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index 11496c4..075dfb3 100755
--- a/configure
+++ b/configure
@@ -3216,25 +3216,21 @@ fi
 
 #prefix
 if [ -z "$QT_INSTALL_PREFIX" ]; then
-    if [ -d "$EPOCROOT" ]; then
+    if [ "$CFG_DEV" = "yes" ]; then
+        QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
+    elif [ "$PLATFORM_QWS" = "yes" ]; then
+        QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
+        if [ "$PLATFORM" != "$XPLATFORM" ]; then
+            QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
+        fi
+    elif [ -d "$EPOCROOT" ]; then
         case "$XPLATFORM" in *symbian*)
             QT_INSTALL_PREFIX="$EPOCROOT/epoc32/"
             QT_INSTALL_LIBS="$EPOCROOT/epoc32/release/armv5/lib/"
             ;;
         esac
-    fi
-
-    if [ -z "$QT_INSTALL_PREFIX" ]; then # still empty
-        if [ "$CFG_DEV" = "yes" ]; then
-            QT_INSTALL_PREFIX="$outpath" # In Development, we use sandboxed builds by default
-        elif [ "$PLATFORM_QWS" = "yes" ]; then
-            QT_INSTALL_PREFIX="/usr/local/Trolltech/QtEmbedded-${QT_VERSION}"
-            if [ "$PLATFORM" != "$XPLATFORM" ]; then
-                    QT_INSTALL_PREFIX="${QT_INSTALL_PREFIX}-${CFG_ARCH}"
-            fi
-        else
-            QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
-        fi
+    else
+        QT_INSTALL_PREFIX="/usr/local/Trolltech/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Trolltech/Qt-$QT_VERSION
     fi
 fi
 QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
-- 
cgit v0.12


From f1d7cbd9efbdade9df5496dc684c2f7d22db7378 Mon Sep 17 00:00:00 2001
From: Romain Pokrzywka <romain@kdab.com>
Date: Wed, 21 Jul 2010 16:34:21 +0200
Subject: fix the export macros for the QtDBus module

Merge-request: 2439
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
---
 src/corelib/global/qglobal.h              |  8 ++++++
 src/dbus/dbus.pro                         |  2 +-
 src/dbus/qdbusabstractadaptor.h           |  2 +-
 src/dbus/qdbusabstractinterface.h         |  4 +--
 src/dbus/qdbusargument.h                  | 48 +++++++++++++++----------------
 src/dbus/qdbusconnection.cpp              |  2 +-
 src/dbus/qdbusconnection.h                |  2 +-
 src/dbus/qdbusconnectioninterface.h       |  2 +-
 src/dbus/qdbuscontext.h                   |  2 +-
 src/dbus/qdbuserror.h                     |  4 +--
 src/dbus/qdbusextratypes.h                |  4 +--
 src/dbus/qdbusintegrator.cpp              |  2 +-
 src/dbus/qdbusinterface.h                 |  2 +-
 src/dbus/qdbusintrospection_p.h           |  2 +-
 src/dbus/qdbusmacros.h                    |  8 ------
 src/dbus/qdbusmessage.h                   |  4 +--
 src/dbus/qdbusmetaobject_p.h              |  2 +-
 src/dbus/qdbusmetatype.h                  |  2 +-
 src/dbus/qdbuspendingcall.h               |  4 +--
 src/dbus/qdbuspendingreply.h              |  2 +-
 src/dbus/qdbusreply.h                     |  2 +-
 src/dbus/qdbusserver.h                    |  2 +-
 src/dbus/qdbusservicewatcher.h            |  2 +-
 src/dbus/qdbusthreaddebug_p.h             |  4 +--
 src/dbus/qdbusutil_p.h                    | 20 ++++++-------
 src/dbus/qdbusxmlgenerator.cpp            |  2 +-
 tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp |  2 +-
 27 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 8a3166d..7b915cd 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1277,6 +1277,11 @@ class QDataStream;
 #    else
 #      define Q_COMPAT_EXPORT Q_DECL_IMPORT
 #    endif
+#    if defined(QT_BUILD_DBUS_LIB)
+#      define Q_DBUS_EXPORT Q_DECL_EXPORT
+#    else
+#      define Q_DBUS_EXPORT Q_DECL_IMPORT
+#    endif
 #    define Q_TEMPLATEDLL
 #  elif defined(QT_DLL) /* use a Qt DLL library */
 #    define Q_CORE_EXPORT Q_DECL_IMPORT
@@ -1294,6 +1299,7 @@ class QDataStream;
 #    define Q_SCRIPT_EXPORT Q_DECL_IMPORT
 #    define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
 #    define Q_COMPAT_EXPORT Q_DECL_IMPORT
+#    define Q_DBUS_EXPORT Q_DECL_IMPORT
 #    define Q_TEMPLATEDLL
 #  endif
 #  define Q_NO_DECLARED_NOT_DEFINED
@@ -1322,6 +1328,7 @@ class QDataStream;
 #    define Q_SCRIPT_EXPORT Q_DECL_EXPORT
 #    define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
 #    define Q_COMPAT_EXPORT Q_DECL_EXPORT
+#    define Q_DBUS_EXPORT Q_DECL_EXPORT
 #  else
 #    define Q_CORE_EXPORT
 #    define Q_GUI_EXPORT
@@ -1336,6 +1343,7 @@ class QDataStream;
 #    define Q_SCRIPT_EXPORT
 #    define Q_SCRIPTTOOLS_EXPORT
 #    define Q_COMPAT_EXPORT
+#    define Q_DBUS_EXPORT
 #  endif
 #endif
 
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
index 7c59808..46a723a 100644
--- a/src/dbus/dbus.pro
+++ b/src/dbus/dbus.pro
@@ -3,7 +3,7 @@ QPRO_PWD = $$PWD
 QT = core \
     xml
 CONFIG += link_pkgconfig
-DEFINES += QDBUS_MAKEDLL \
+DEFINES += QT_BUILD_DBUS_LIB \
     DBUS_API_SUBJECT_TO_CHANGE
 QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS
 contains(QT_CONFIG, dbus-linked) { 
diff --git a/src/dbus/qdbusabstractadaptor.h b/src/dbus/qdbusabstractadaptor.h
index fa64aef..af5a3ce 100644
--- a/src/dbus/qdbusabstractadaptor.h
+++ b/src/dbus/qdbusabstractadaptor.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
 QT_MODULE(DBus)
 
 class QDBusAbstractAdaptorPrivate;
-class QDBUS_EXPORT QDBusAbstractAdaptor: public QObject
+class Q_DBUS_EXPORT QDBusAbstractAdaptor: public QObject
 {
     Q_OBJECT
 protected:
diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h
index 44f79a1..177af67 100644
--- a/src/dbus/qdbusabstractinterface.h
+++ b/src/dbus/qdbusabstractinterface.h
@@ -64,7 +64,7 @@ class QDBusPendingCall;
 
 class QDBusAbstractInterfacePrivate;
 
-class QDBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
+class Q_DBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
 {
 public:
     int qt_metacall(QMetaObject::Call, int, void**);
@@ -74,7 +74,7 @@ private:
     Q_DECLARE_PRIVATE(QDBusAbstractInterface)
 };
 
-class QDBUS_EXPORT QDBusAbstractInterface:
+class Q_DBUS_EXPORT QDBusAbstractInterface:
 #ifdef Q_QDOC
         public QObject
 #else
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 73558b6..30f2cda 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -64,7 +64,7 @@ QT_MODULE(DBus)
 class QDBusArgumentPrivate;
 class QDBusDemarshaller;
 class QDBusMarshaller;
-class QDBUS_EXPORT QDBusArgument
+class Q_DBUS_EXPORT QDBusArgument
 {
 public:
     enum ElementType {
@@ -184,43 +184,43 @@ template<> inline QVariant qdbus_cast<QVariant>(const QVariant &v, QVariant *)
     return qdbus_cast<QDBusVariant>(v).variant();
 }
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v);
 
 // QVariant types
 #ifndef QDBUS_NO_SPECIALTYPES
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line);
 
-QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line);
-QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line);
+Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line);
+Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line);
 #endif
 
 template<template <typename> class Container, typename T>
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 4382032..6f86856 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -125,7 +125,7 @@ QDBusConnectionManager::~QDBusConnectionManager()
     connectionHash.clear();
 }
 
-QDBUS_EXPORT void qDBusBindToApplication();
+Q_DBUS_EXPORT void qDBusBindToApplication();
 void qDBusBindToApplication()
 {
 }
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index a8ca551..0f365ec 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -72,7 +72,7 @@ class QDBusConnectionInterface;
 class QObject;
 
 class QDBusConnectionPrivate;
-class QDBUS_EXPORT QDBusConnection
+class Q_DBUS_EXPORT QDBusConnection
 {
     Q_GADGET
     Q_ENUMS(BusType UnregisterMode)
diff --git a/src/dbus/qdbusconnectioninterface.h b/src/dbus/qdbusconnectioninterface.h
index 1a020b7..4650e12 100644
--- a/src/dbus/qdbusconnectioninterface.h
+++ b/src/dbus/qdbusconnectioninterface.h
@@ -62,7 +62,7 @@ class QByteArray;
 /*
  * Proxy class for interface org.freedesktop.DBus
  */
-class QDBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface
+class Q_DBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface
 {
     Q_OBJECT
     Q_ENUMS(ServiceQueueOptions ServiceReplacementOptions RegisterServiceReply)
diff --git a/src/dbus/qdbuscontext.h b/src/dbus/qdbuscontext.h
index 13fbe4b..cb9310c 100644
--- a/src/dbus/qdbuscontext.h
+++ b/src/dbus/qdbuscontext.h
@@ -57,7 +57,7 @@ class QDBusConnection;
 class QDBusMessage;
 
 class QDBusContextPrivate;
-class QDBUS_EXPORT QDBusContext
+class Q_DBUS_EXPORT QDBusContext
 {
 public:
     QDBusContext();
diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h
index ff9d1df..72736d0 100644
--- a/src/dbus/qdbuserror.h
+++ b/src/dbus/qdbuserror.h
@@ -57,7 +57,7 @@ QT_MODULE(DBus)
 
 class QDBusMessage;
 
-class QDBUS_EXPORT QDBusError
+class Q_DBUS_EXPORT QDBusError
 {
 public:
     enum ErrorType {
@@ -115,7 +115,7 @@ private:
 };
 
 #ifndef QT_NO_DEBUG_STREAM
-QDBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &);
+Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &);
 #endif
 
 QT_END_NAMESPACE
diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h
index 205baff..544e63f 100644
--- a/src/dbus/qdbusextratypes.h
+++ b/src/dbus/qdbusextratypes.h
@@ -59,7 +59,7 @@ QT_MODULE(DBus)
 // defined in qhash.cpp
 Q_CORE_EXPORT uint qHash(const QString &key);
 
-class QDBUS_EXPORT QDBusObjectPath : private QString
+class Q_DBUS_EXPORT QDBusObjectPath : private QString
 {
 public:
     inline QDBusObjectPath() { }
@@ -109,7 +109,7 @@ inline uint qHash(const QDBusObjectPath &objectPath)
 { return qHash(objectPath.path()); }
 
 
-class QDBUS_EXPORT QDBusSignature : private QString
+class Q_DBUS_EXPORT QDBusSignature : private QString
 {
 public:
     inline QDBusSignature() { }
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index efa6744..1f44bd2 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -508,7 +508,7 @@ static bool shouldWatchService(const QString &service)
     return !service.isEmpty() && !service.startsWith(QLatin1Char(':'));
 }
 
-extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
+extern Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
 void qDBusAddSpyHook(QDBusSpyHook hook)
 {
     qDBusSpyHookList()->append(hook);
diff --git a/src/dbus/qdbusinterface.h b/src/dbus/qdbusinterface.h
index 02a9059..141fbe5 100644
--- a/src/dbus/qdbusinterface.h
+++ b/src/dbus/qdbusinterface.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
 QT_MODULE(DBus)
 
 class QDBusInterfacePrivate;
-class QDBUS_EXPORT QDBusInterface: public QDBusAbstractInterface
+class Q_DBUS_EXPORT QDBusInterface: public QDBusAbstractInterface
 {
     friend class QDBusConnection;
 private:
diff --git a/src/dbus/qdbusintrospection_p.h b/src/dbus/qdbusintrospection_p.h
index aa1ae57..3a69321 100644
--- a/src/dbus/qdbusintrospection_p.h
+++ b/src/dbus/qdbusintrospection_p.h
@@ -63,7 +63,7 @@
 
 QT_BEGIN_NAMESPACE
 
-class QDBUS_EXPORT QDBusIntrospection
+class Q_DBUS_EXPORT QDBusIntrospection
 {
 public:
     // forward declarations
diff --git a/src/dbus/qdbusmacros.h b/src/dbus/qdbusmacros.h
index 693a350..d8bfda5 100644
--- a/src/dbus/qdbusmacros.h
+++ b/src/dbus/qdbusmacros.h
@@ -46,14 +46,6 @@
 #include <QtCore/qmetatype.h>
 #include <QtCore/qvariant.h>
 
-#if defined(QDBUS_MAKEDLL)
-# define QDBUS_EXPORT Q_DECL_EXPORT
-#elif defined(QT_SHARED)
-# define QDBUS_EXPORT Q_DECL_IMPORT
-#else
-# define QDBUS_EXPORT
-#endif
-
 #ifndef Q_MOC_RUN
 # define Q_NOREPLY
 #endif
diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h
index f2e64b9..fa1f2c9 100644
--- a/src/dbus/qdbusmessage.h
+++ b/src/dbus/qdbusmessage.h
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
 QT_MODULE(DBus)
 
 class QDBusMessagePrivate;
-class QDBUS_EXPORT QDBusMessage
+class Q_DBUS_EXPORT QDBusMessage
 {
 public:
     enum MessageType {
@@ -120,7 +120,7 @@ private:
 };
 
 #ifndef QT_NO_DEBUG_STREAM
-QDBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &);
+Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &);
 #endif
 
 QT_END_NAMESPACE
diff --git a/src/dbus/qdbusmetaobject_p.h b/src/dbus/qdbusmetaobject_p.h
index 777ef54..07f1cc0 100644
--- a/src/dbus/qdbusmetaobject_p.h
+++ b/src/dbus/qdbusmetaobject_p.h
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
 class QDBusError;
 
 struct QDBusMetaObjectPrivate;
-struct QDBUS_EXPORT QDBusMetaObject: public QMetaObject
+struct Q_DBUS_EXPORT QDBusMetaObject: public QMetaObject
 {
     bool cached;
 
diff --git a/src/dbus/qdbusmetatype.h b/src/dbus/qdbusmetatype.h
index b487e23..9ae1944 100644
--- a/src/dbus/qdbusmetatype.h
+++ b/src/dbus/qdbusmetatype.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
 
 QT_MODULE(DBus)
 
-class QDBUS_EXPORT QDBusMetaType
+class Q_DBUS_EXPORT QDBusMetaType
 {
 public:
     typedef void (*MarshallFunction)(QDBusArgument &, const void *);
diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h
index ca0eaaa..492eb3c 100644
--- a/src/dbus/qdbuspendingcall.h
+++ b/src/dbus/qdbuspendingcall.h
@@ -62,7 +62,7 @@ class QDBusError;
 class QDBusPendingCallWatcher;
 
 class QDBusPendingCallPrivate;
-class QDBUS_EXPORT QDBusPendingCall
+class Q_DBUS_EXPORT QDBusPendingCall
 {
 public:
     QDBusPendingCall(const QDBusPendingCall &other);
@@ -96,7 +96,7 @@ private:
 };
 
 class QDBusPendingCallWatcherPrivate;
-class QDBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall
+class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall
 {
     Q_OBJECT
 public:
diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h
index 4757115..61e561e 100644
--- a/src/dbus/qdbuspendingreply.h
+++ b/src/dbus/qdbuspendingreply.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
 
 QT_MODULE(DBus)
 
-class QDBUS_EXPORT QDBusPendingReplyData: public QDBusPendingCall
+class Q_DBUS_EXPORT QDBusPendingReplyData: public QDBusPendingCall
 {
 protected:
     QDBusPendingReplyData();
diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h
index fbe7459..ba25308 100644
--- a/src/dbus/qdbusreply.h
+++ b/src/dbus/qdbusreply.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
 
 QT_MODULE(DBus)
 
-QDBUS_EXPORT void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data);
+Q_DBUS_EXPORT void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data);
 
 template<typename T>
 class QDBusReply
diff --git a/src/dbus/qdbusserver.h b/src/dbus/qdbusserver.h
index 90d40f5..8e824a8 100644
--- a/src/dbus/qdbusserver.h
+++ b/src/dbus/qdbusserver.h
@@ -57,7 +57,7 @@ class QDBusConnectionPrivate;
 class QDBusError;
 class QDBusConnection;
 
-class QDBUS_EXPORT QDBusServer: public QObject
+class Q_DBUS_EXPORT QDBusServer: public QObject
 {
     Q_OBJECT
 public:
diff --git a/src/dbus/qdbusservicewatcher.h b/src/dbus/qdbusservicewatcher.h
index c7609a8..d9a0d92 100644
--- a/src/dbus/qdbusservicewatcher.h
+++ b/src/dbus/qdbusservicewatcher.h
@@ -56,7 +56,7 @@ QT_MODULE(DBus)
 class QDBusConnection;
 
 class QDBusServiceWatcherPrivate;
-class QDBUS_EXPORT QDBusServiceWatcher: public QObject
+class Q_DBUS_EXPORT QDBusServiceWatcher: public QObject
 {
     Q_OBJECT
     Q_PROPERTY(QStringList watchedServices READ watchedServices WRITE setWatchedServices)
diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h
index e8d90c5..87cb4d6 100644
--- a/src/dbus/qdbusthreaddebug_p.h
+++ b/src/dbus/qdbusthreaddebug_p.h
@@ -63,8 +63,8 @@
 #if QDBUS_THREAD_DEBUG
 QT_BEGIN_NAMESPACE
 typedef void (*qdbusThreadDebugFunc)(int, int, QDBusConnectionPrivate *);
-QDBUS_EXPORT void qdbusDefaultThreadDebug(int, int, QDBusConnectionPrivate *);
-extern QDBUS_EXPORT qdbusThreadDebugFunc qdbusThreadDebug;
+Q_DBUS_EXPORT void qdbusDefaultThreadDebug(int, int, QDBusConnectionPrivate *);
+extern Q_DBUS_EXPORT qdbusThreadDebugFunc qdbusThreadDebug;
 QT_END_NAMESPACE
 #endif
 
diff --git a/src/dbus/qdbusutil_p.h b/src/dbus/qdbusutil_p.h
index 8a1846a..2b53c6b 100644
--- a/src/dbus/qdbusutil_p.h
+++ b/src/dbus/qdbusutil_p.h
@@ -67,25 +67,25 @@ QT_BEGIN_NAMESPACE
 
 namespace QDBusUtil
 {
-    QDBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName);
+    Q_DBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName);
 
-    QDBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName);
+    Q_DBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName);
 
-    QDBUS_EXPORT bool isValidBusName(const QString &busName);
+    Q_DBUS_EXPORT bool isValidBusName(const QString &busName);
 
-    QDBUS_EXPORT bool isValidMemberName(const QString &memberName);
+    Q_DBUS_EXPORT bool isValidMemberName(const QString &memberName);
 
-    QDBUS_EXPORT bool isValidErrorName(const QString &errorName);
+    Q_DBUS_EXPORT bool isValidErrorName(const QString &errorName);
 
-    QDBUS_EXPORT bool isValidPartOfObjectPath(const QString &path);
+    Q_DBUS_EXPORT bool isValidPartOfObjectPath(const QString &path);
 
-    QDBUS_EXPORT bool isValidObjectPath(const QString &path);
+    Q_DBUS_EXPORT bool isValidObjectPath(const QString &path);
 
-    QDBUS_EXPORT bool isValidSignature(const QString &signature);
+    Q_DBUS_EXPORT bool isValidSignature(const QString &signature);
 
-    QDBUS_EXPORT bool isValidSingleSignature(const QString &signature);
+    Q_DBUS_EXPORT bool isValidSingleSignature(const QString &signature);
 
-    QDBUS_EXPORT QString argumentToString(const QVariant &variant);
+    Q_DBUS_EXPORT QString argumentToString(const QVariant &variant);
 
     enum AllowEmptyFlag {
         EmptyAllowed,
diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp
index 463ac73..7cc5acb 100644
--- a/src/dbus/qdbusxmlgenerator.cpp
+++ b/src/dbus/qdbusxmlgenerator.cpp
@@ -53,7 +53,7 @@
 
 QT_BEGIN_NAMESPACE
 
-extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
+extern Q_DBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
                                                        const QMetaObject *base, int flags);
 
 static inline QString typeNameToXml(const char *typeName)
diff --git a/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp b/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp
index 3a80019..ba2bdd8 100644
--- a/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp
+++ b/tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp
@@ -64,7 +64,7 @@ static const char docTypeHeader[] =
 
 // in qdbusxmlgenerator.cpp
 QT_BEGIN_NAMESPACE
-extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
+extern Q_DBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
                                                        const QMetaObject *base, int flags);
 QT_END_NAMESPACE
 
-- 
cgit v0.12


From de8a755a16abf0ddd0e3d8606dc6541716bb1f6f Mon Sep 17 00:00:00 2001
From: Sebastian Sauer <sebastian.sauer@kdab.com>
Date: Wed, 21 Jul 2010 16:44:08 +0200
Subject: Improve QAccessible for QTabBar

In a QTabBar on changing the curren tab call QAccessible::updateAccessibility to allow screen-readers like JAWS to read the tabText of the newly selected tab.

Merge-request: 662
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
---
 src/gui/widgets/qtabbar.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index d692307..bbc7e5d 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1219,6 +1219,12 @@ void QTabBar::setCurrentIndex(int index)
         if (oldIndex >= 0 && oldIndex < count())
             d->layoutTab(oldIndex);
         d->layoutTab(index);
+#ifndef QT_NO_ACCESSIBILITY
+        if (QAccessible::isActive()) {
+            QAccessible::updateAccessibility(this, index + 1, QAccessible::Focus);
+            QAccessible::updateAccessibility(this, index + 1, QAccessible::Selection);
+        }
+#endif
 #ifdef QT3_SUPPORT
         emit selected(index);
 #endif
-- 
cgit v0.12


From c2f14423632c840bacd0254f90cd6132ed62a390 Mon Sep 17 00:00:00 2001
From: Sebastian Sauer <sebastian.sauer@kdab.com>
Date: Wed, 21 Jul 2010 17:09:53 +0200
Subject: Improve QAccessible for QAccessibleTabBar

On QAccessibleTabBar::text return text of the current tab for the case the QTabBar itself is asked for it's Name.

Merge-request: 2405
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
---
 src/plugins/accessible/widgets/complexwidgets.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp
index 8be1560..803786f 100644
--- a/src/plugins/accessible/widgets/complexwidgets.cpp
+++ b/src/plugins/accessible/widgets/complexwidgets.cpp
@@ -1512,10 +1512,14 @@ QString QAccessibleTabBar::text(Text t, int child) const
         default:
             break;
         }
-    } else if (child > 0) {
+    } else {
         switch (t) {
         case Name:
-            return qt_accStripAmp(tabBar()->tabText(child - 1));
+            if (child > 0)
+                return qt_accStripAmp(tabBar()->tabText(child - 1));
+            else if (tabBar()->currentIndex() != -1)
+                return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex()));
+            break;
         default:
             break;
         }
-- 
cgit v0.12


From d00d1bd5423d0bbfea7c85a0411d2b22d97fbe0f Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Wed, 21 Jul 2010 17:14:28 +0200
Subject: Use aligned load for the blending of RGB32 over RGB32

Aligned load are faster than unaligned load. This patch add a prologue
to the blending function in order to align the destination on 16 bytes
before using SSE2.

Reviewed-by: Kent Hansen
---
 src/gui/painting/qdrawhelper_sse2.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 346e177..279f685 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -110,13 +110,23 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
             const __m128i oneMinusConstAlpha =  _mm_set1_epi16(one_minus_const_alpha);
             for (int y = 0; y < h; ++y) {
                 int x = 0;
+
+                // First, align dest to 16 bytes:
+                const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;
+                const int prologLength = qMin(w, offsetToAlignOn16Bytes);
+                for (; x < prologLength; ++x) {
+                    quint32 s = src[x];
+                    s = BYTE_MUL(s, const_alpha);
+                    dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha);
+                }
+
                 for (; x < w-3; x += 4) {
                     __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
                     if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) {
-                        const __m128i dstVector = _mm_loadu_si128((__m128i *)&dst[x]);
+                        const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]);
                         __m128i result;
                         INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
-                        _mm_storeu_si128((__m128i *)&dst[x], result);
+                        _mm_store_si128((__m128i *)&dst[x], result);
                     }
                 }
                 for (; x<w; ++x) {
-- 
cgit v0.12


From 4e26c800f2274754a670b0353e3fb4afd55514c3 Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@nokia.com>
Date: Wed, 21 Jul 2010 17:36:55 +0200
Subject: Compile fix for MSVC

---
 examples/tutorials/modelview/2_formatting/mymodel.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
index e34e014..98bbe02 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -89,7 +89,8 @@ QVariant MyModel::data(const QModelIndex &index, int role) const
 
         if (row == 1 && col == 2)  //change background only for cell(1,2)
         {
-            QBrush redBackground(QColor(Qt::red));
+            QColor redColor(Qt::red);
+            QBrush redBackground(redColor);
             return redBackground;
         }
         break;
-- 
cgit v0.12


From c05f38f37fbe2192d135881de3dba087ac71ffe1 Mon Sep 17 00:00:00 2001
From: Robert Loehning <robert.loehning@nokia.com>
Date: Wed, 21 Jul 2010 19:40:24 +0200
Subject: Revert "Compile fix for MSVC"

This reverts commit 4e26c800f2274754a670b0353e3fb4afd55514c3.
Already fixed in ceff2321d7b7eaa4608a1baa5de66dbce8733342
---
 examples/tutorials/modelview/2_formatting/mymodel.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/examples/tutorials/modelview/2_formatting/mymodel.cpp b/examples/tutorials/modelview/2_formatting/mymodel.cpp
index 98bbe02..e34e014 100755
--- a/examples/tutorials/modelview/2_formatting/mymodel.cpp
+++ b/examples/tutorials/modelview/2_formatting/mymodel.cpp
@@ -89,8 +89,7 @@ QVariant MyModel::data(const QModelIndex &index, int role) const
 
         if (row == 1 && col == 2)  //change background only for cell(1,2)
         {
-            QColor redColor(Qt::red);
-            QBrush redBackground(redColor);
+            QBrush redBackground(QColor(Qt::red));
             return redBackground;
         }
         break;
-- 
cgit v0.12


From 5dd0dfcd7a079065f99c6149c15b58e69f302729 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Thu, 22 Jul 2010 13:57:46 +1000
Subject: Allow MouseArea dragging to filter mouse events from descendants This
 allows dragging a MouseArea that contains a clickable MouseArea, for example.

Task-number: QTBUG-12323
Reviewed-by: Michael Brasser
---
 .../snippets/declarative/mouseareadragfilter.qml   | 72 ++++++++++++++++
 .../graphicsitems/qdeclarativeflickable.cpp        |  2 +-
 .../graphicsitems/qdeclarativemousearea.cpp        | 96 +++++++++++++++++++++-
 .../graphicsitems/qdeclarativemousearea_p.h        | 10 ++-
 .../graphicsitems/qdeclarativemousearea_p_p.h      |  4 +-
 .../tst_qdeclarativemousearea.cpp                  | 11 +++
 6 files changed, 189 insertions(+), 6 deletions(-)
 create mode 100644 doc/src/snippets/declarative/mouseareadragfilter.qml

diff --git a/doc/src/snippets/declarative/mouseareadragfilter.qml b/doc/src/snippets/declarative/mouseareadragfilter.qml
new file mode 100644
index 0000000..52ed10c
--- /dev/null
+++ b/doc/src/snippets/declarative/mouseareadragfilter.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [dragfilter]
+import Qt 4.7
+
+Rectangle {
+    width: 480
+    height: 320
+    Rectangle {
+        x: 30; y: 30
+        width: 300; height: 240
+        color: "lightsteelblue"
+
+        MouseArea {
+            anchors.fill: parent
+            drag.target: parent;
+            drag.axis: "XAxis"
+            drag.minimumX: 30
+            drag.maximumX: 150
+            drag.filterChildren: true
+
+            Rectangle {
+                color: "yellow"
+                x: 50; y : 50
+                width: 100; height: 100
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: console.log("Clicked")
+                }
+            }
+        }
+    }
+}
+//! [dragfilter]
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 9af5f56..b286e11 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1214,6 +1214,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
 
             d->handleMousePressEvent(&mouseEvent);
             d->captureDelayedPress(event);
+            stealThisEvent = d->stealMouse;   // Update stealThisEvent in case changed by function call above
             break;
         case QEvent::GraphicsSceneMouseRelease:
             if (d->delayedPressEvent) {
@@ -1234,7 +1235,6 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
         default:
             break;
         }
-        stealThisEvent = d->stealMouse;   // Update stealThisEvent and grabber in case changed by function calls above
         grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
         if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) {
             d->clearDelayedPress();
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 8ee6093..40c621a 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -53,7 +53,7 @@ static const int PressAndHoldDelay = 800;
 
 QDeclarativeDrag::QDeclarativeDrag(QObject *parent)
 : QObject(parent), _target(0), _axis(XandYAxis), _xmin(-FLT_MAX), _xmax(FLT_MAX), _ymin(-FLT_MAX), _ymax(FLT_MAX),
-_active(false)
+_active(false), _filterChildren(false)
 {
 }
 
@@ -160,12 +160,24 @@ void QDeclarativeDrag::setActive(bool drag)
     emit activeChanged();
 }
 
+bool QDeclarativeDrag::filterChildren() const
+{
+    return _filterChildren;
+}
+
+void QDeclarativeDrag::setFilterChildren(bool filter)
+{
+    if (_filterChildren == filter)
+        return;
+    _filterChildren = filter;
+    emit filterChildrenChanged();
+}
+
 QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
 {
     delete drag;
 }
 
-
 /*!
     \qmlclass MouseArea QDeclarativeMouseArea
     \since 4.7
@@ -398,6 +410,7 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
     Q_D(QDeclarativeMouseArea);
     d->moved = false;
+    d->stealMouse = false;
     if (!d->absorb)
         QDeclarativeItem::mousePressEvent(event);
     else {
@@ -456,8 +469,10 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
         const int dragThreshold = QApplication::startDragDistance();
         qreal dx = qAbs(curLocalPos.x() - startLocalPos.x());
         qreal dy = qAbs(curLocalPos.y() - startLocalPos.y());
-        if ((d->dragX && !(dx < dragThreshold)) || (d->dragY && !(dy < dragThreshold)))
+        if ((d->dragX && !(dx < dragThreshold)) || (d->dragY && !(dy < dragThreshold))) {
             d->drag->setActive(true);
+            d->stealMouse = true;
+        }
         if (!keepMouseGrab()) {
             if ((!d->dragY && dy < dragThreshold && d->dragX && dx > dragThreshold)
                 || (!d->dragX && dx < dragThreshold && d->dragY && dy > dragThreshold)
@@ -495,6 +510,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
 void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
     Q_D(QDeclarativeMouseArea);
+    d->stealMouse = false;
     if (!d->absorb) {
         QDeclarativeItem::mouseReleaseEvent(event);
     } else {
@@ -505,6 +521,8 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
         // If we don't accept hover, we need to reset containsMouse.
         if (!acceptHoverEvents())
             setHovered(false);
+        if (scene()->mouseGrabberItem() == this)
+            ungrabMouse();
         setKeepMouseGrab(false);
     }
 }
@@ -579,6 +597,71 @@ bool QDeclarativeMouseArea::sceneEvent(QEvent *event)
     return rv;
 }
 
+bool QDeclarativeMouseArea::sendMouseEvent(QGraphicsSceneMouseEvent *event)
+{
+    Q_D(QDeclarativeMouseArea);
+    QGraphicsSceneMouseEvent mouseEvent(event->type());
+    QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect();
+
+    QGraphicsScene *s = scene();
+    QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+    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) {
+                Qt::MouseButton button = Qt::MouseButton(i);
+                mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
+            }
+        }
+        mouseEvent.setScenePos(event->scenePos());
+        mouseEvent.setLastScenePos(event->lastScenePos());
+        mouseEvent.setPos(mapFromScene(event->scenePos()));
+        mouseEvent.setLastPos(mapFromScene(event->lastScenePos()));
+
+        switch(mouseEvent.type()) {
+        case QEvent::GraphicsSceneMouseMove:
+            mouseMoveEvent(&mouseEvent);
+            break;
+        case QEvent::GraphicsSceneMousePress:
+            mousePressEvent(&mouseEvent);
+            break;
+        case QEvent::GraphicsSceneMouseRelease:
+            mouseReleaseEvent(&mouseEvent);
+            break;
+        default:
+            break;
+        }
+        grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
+        if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
+            grabMouse();
+
+        return stealThisEvent;
+    }
+    if (mouseEvent.type() == QEvent::GraphicsSceneMouseRelease) {
+        d->stealMouse = false;
+        ungrabMouse();
+    }
+    return false;
+}
+
+bool QDeclarativeMouseArea::sceneEventFilter(QGraphicsItem *i, QEvent *e)
+{
+    Q_D(QDeclarativeMouseArea);
+    if (!d->absorb || !isVisible() || !d->drag || !d->drag->filterChildren())
+        return QDeclarativeItem::sceneEventFilter(i, e);
+    switch (e->type()) {
+    case QEvent::GraphicsSceneMousePress:
+    case QEvent::GraphicsSceneMouseMove:
+    case QEvent::GraphicsSceneMouseRelease:
+        return sendMouseEvent(static_cast<QGraphicsSceneMouseEvent *>(e));
+    default:
+        break;
+    }
+
+    return QDeclarativeItem::sceneEventFilter(i, e);
+}
+
 void QDeclarativeMouseArea::timerEvent(QTimerEvent *event)
 {
     Q_D(QDeclarativeMouseArea);
@@ -759,6 +842,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
     \qmlproperty real MouseArea::drag.maximumX
     \qmlproperty real MouseArea::drag.minimumY
     \qmlproperty real MouseArea::drag.maximumY
+    \qmlproperty bool MouseArea::drag.filterChildren
 
     \c drag provides a convenient way to make an item draggable.
 
@@ -779,6 +863,12 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
     for \c rect in the above example, it cannot be dragged along the X-axis.
     This can be avoided by settng the anchor value to \c undefined in 
     an \l onPressed handler.
+
+    If \c drag.filterChildren is set to true, a drag can override descendant MouseAreas.  This
+    enables a parent MouseArea to handle drags, for example, while descendants handle clicks:
+
+    \snippet doc/src/snippets/declarative/mouseareadragfilter.qml dragfilter
+
 */
 
 QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
index 4fe3fcb..0da7515 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h
@@ -62,6 +62,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeDrag : public QObject
     Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged)
     Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
     Q_PROPERTY(bool active READ active NOTIFY activeChanged)
+    Q_PROPERTY(bool filterChildren READ filterChildren WRITE setFilterChildren NOTIFY filterChildrenChanged)
     //### consider drag and drop
 
 public:
@@ -88,6 +89,9 @@ public:
     bool active() const;
     void setActive(bool);
 
+    bool filterChildren() const;
+    void setFilterChildren(bool);
+
 Q_SIGNALS:
     void targetChanged();
     void axisChanged();
@@ -96,6 +100,7 @@ Q_SIGNALS:
     void minimumYChanged();
     void maximumYChanged();
     void activeChanged();
+    void filterChildrenChanged();
 
 private:
     QGraphicsObject *_target;
@@ -104,7 +109,8 @@ private:
     qreal _xmax;
     qreal _ymin;
     qreal _ymax;
-    bool _active;
+    bool _active : 1;
+    bool _filterChildren: 1;
     Q_DISABLE_COPY(QDeclarativeDrag)
 };
 
@@ -177,6 +183,8 @@ protected:
     void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
     void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
     bool sceneEvent(QEvent *);
+    bool sendMouseEvent(QGraphicsSceneMouseEvent *event);
+    bool sceneEventFilter(QGraphicsItem *i, QEvent *e);
     void timerEvent(QTimerEvent *event);
 
     virtual void geometryChanged(const QRectF &newGeometry,
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
index 3d7bd1e..cf9dc18 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h
@@ -68,7 +68,7 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate
 public:
     QDeclarativeMouseAreaPrivate()
       : absorb(true), hovered(false), pressed(false), longPress(false),
-      moved(false), drag(0)
+      moved(false), stealMouse(false), drag(0)
     {
     }
 
@@ -78,6 +78,7 @@ public:
     {
         Q_Q(QDeclarativeMouseArea);
         q->setAcceptedMouseButtons(Qt::LeftButton);
+        q->setFiltersChildEvents(true);
     }
 
     void saveEvent(QGraphicsSceneMouseEvent *event) {
@@ -101,6 +102,7 @@ public:
     bool moved : 1;
     bool dragX : 1;
     bool dragY : 1;
+    bool stealMouse : 1;
     QDeclarativeDrag *drag;
     QPointF startScene;
     qreal startX;
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
index 5a10372..c9bb467 100644
--- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
+++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -137,6 +137,17 @@ void tst_QDeclarativeMouseArea::dragProperties()
     QCOMPARE(yminSpy.count(),1);
     QCOMPARE(ymaxSpy.count(),1);
 
+    // filterChildren
+    QSignalSpy filterChildrenSpy(drag, SIGNAL(filterChildrenChanged()));
+
+    drag->setFilterChildren(true);
+
+    QVERIFY(drag->filterChildren());
+    QCOMPARE(filterChildrenSpy.count(), 1);
+
+    drag->setFilterChildren(true);
+    QCOMPARE(filterChildrenSpy.count(), 1);
+
     delete canvas;
 }
 
-- 
cgit v0.12


From 266a64d34d775b2ebcf1bffbf751cfe9437ceafe Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Thu, 22 Jul 2010 14:04:05 +1000
Subject: Add additional QVariant benchmarks.

---
 .../corelib/kernel/qvariant/tst_qvariant.cpp       | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
index 82dc7dd..58cec4f 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -66,6 +66,11 @@ private slots:
     void floatVariantAssignment();
     void rectVariantAssignment();
     void stringVariantAssignment();
+
+    void doubleVariantValue();
+    void floatVariantValue();
+    void rectVariantValue();
+    void stringVariantValue();
 };
 
 void tst_qvariant::testBound()
@@ -175,6 +180,46 @@ void tst_qvariant::stringVariantAssignment()
     variantAssignment<QString>(QString());
 }
 
+void tst_qvariant::doubleVariantValue()
+{
+    QVariant v(0.0);
+    QBENCHMARK {
+        for(int i = 0; i < ITERATION_COUNT; ++i) {
+            v.toDouble();
+        }
+    }
+}
+
+void tst_qvariant::floatVariantValue()
+{
+    QVariant v(0.0f);
+    QBENCHMARK {
+        for(int i = 0; i < ITERATION_COUNT; ++i) {
+            v.toFloat();
+        }
+    }
+}
+
+void tst_qvariant::rectVariantValue()
+{
+    QVariant v(QRect(1,2,3,4));
+    QBENCHMARK {
+        for(int i = 0; i < ITERATION_COUNT; ++i) {
+            v.toRect();
+        }
+    }
+}
+
+void tst_qvariant::stringVariantValue()
+{
+    QVariant v = QString();
+    QBENCHMARK {
+        for(int i = 0; i < ITERATION_COUNT; ++i) {
+            v.toString();
+        }
+    }
+}
+
 QTEST_MAIN(tst_qvariant)
 
 #include "tst_qvariant.moc"
-- 
cgit v0.12


From 0b83a2161261be525f01359397ab1c8c34827749 Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Thu, 22 Jul 2010 13:23:39 +1000
Subject: Make rootContext and engine pointers in QDeclarativeView API const

Task-number: QTBUG-12322
Reviewed-by: Aaron Kennedy
---
 src/declarative/qml/qdeclarativeengine.cpp |  4 ++--
 src/declarative/qml/qdeclarativeengine.h   |  2 +-
 src/declarative/util/qdeclarativeview.cpp  | 19 ++++++++++---------
 src/declarative/util/qdeclarativeview.h    |  4 ++--
 4 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 9dae64d..e3ebca3 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -578,9 +578,9 @@ void QDeclarativeEngine::clearComponentCache()
   component instances should be added to sub-contexts parented to the
   root context.
 */
-QDeclarativeContext *QDeclarativeEngine::rootContext()
+QDeclarativeContext *QDeclarativeEngine::rootContext() const
 {
-    Q_D(QDeclarativeEngine);
+    Q_D(const QDeclarativeEngine);
     return d->rootContext;
 }
 
diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h
index 01487f5..d971d80 100644
--- a/src/declarative/qml/qdeclarativeengine.h
+++ b/src/declarative/qml/qdeclarativeengine.h
@@ -74,7 +74,7 @@ public:
     QDeclarativeEngine(QObject *p = 0);
     virtual ~QDeclarativeEngine();
 
-    QDeclarativeContext *rootContext();
+    QDeclarativeContext *rootContext() const;
 
     void clearComponentCache();
 
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index 496f2ad..7546a50 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -132,7 +132,7 @@ class QDeclarativeViewPrivate : public QGraphicsViewPrivate, public QDeclarative
 public:
     QDeclarativeViewPrivate()
         : root(0), declarativeItemRoot(0), graphicsWidgetRoot(0), component(0), resizeMode(QDeclarativeView::SizeViewToRootObject), initialSize(0,0) {}
-    ~QDeclarativeViewPrivate() { delete root; }
+    ~QDeclarativeViewPrivate() { delete root; delete engine; }
     void execute();
     void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
     void initResize();
@@ -145,7 +145,7 @@ public:
 
     QUrl source;
 
-    QDeclarativeEngine engine;
+    QDeclarativeEngine* engine;
     QDeclarativeComponent *component;
     QBasicTimer resizetimer;
 
@@ -170,7 +170,7 @@ void QDeclarativeViewPrivate::execute()
         component = 0;
     }
     if (!source.isEmpty()) {
-        component = new QDeclarativeComponent(&engine, source, q);
+        component = new QDeclarativeComponent(engine, source, q);
         if (!component->isLoading()) {
             q->continueExecute();
         } else {
@@ -275,6 +275,7 @@ QDeclarativeView::QDeclarativeView(const QUrl &source, QWidget *parent)
 void QDeclarativeViewPrivate::init()
 {
     Q_Q(QDeclarativeView);
+    engine = new QDeclarativeEngine();
     q->setScene(&scene);
 
     q->setOptimizationFlags(QGraphicsView::DontSavePainterState);
@@ -338,10 +339,10 @@ QUrl QDeclarativeView::source() const
   Returns a pointer to the QDeclarativeEngine used for instantiating
   QML Components.
  */
-QDeclarativeEngine* QDeclarativeView::engine()
+QDeclarativeEngine* QDeclarativeView::engine() const
 {
-    Q_D(QDeclarativeView);
-    return &d->engine;
+    Q_D(const QDeclarativeView);
+    return d->engine;
 }
 
 /*!
@@ -351,10 +352,10 @@ QDeclarativeEngine* QDeclarativeView::engine()
   arranged hierarchically and this hierarchy is managed by the
   QDeclarativeEngine.
  */
-QDeclarativeContext* QDeclarativeView::rootContext()
+QDeclarativeContext* QDeclarativeView::rootContext() const
 {
-    Q_D(QDeclarativeView);
-    return d->engine.rootContext();
+    Q_D(const QDeclarativeView);
+    return d->engine->rootContext();
 }
 
 /*!
diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h
index cdcf134..d3e4948 100644
--- a/src/declarative/util/qdeclarativeview.h
+++ b/src/declarative/util/qdeclarativeview.h
@@ -75,8 +75,8 @@ public:
     QUrl source() const;
     void setSource(const QUrl&);
 
-    QDeclarativeEngine* engine();
-    QDeclarativeContext* rootContext();
+    QDeclarativeEngine* engine() const;
+    QDeclarativeContext* rootContext() const;
 
     QGraphicsObject *rootObject() const;
 
-- 
cgit v0.12


From 773a2421eefc3a9162266d1cad890208b70d3fd8 Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Thu, 22 Jul 2010 13:24:40 +1000
Subject: Update QtGui and QtDeclarative def files

Task-number:
Reviewed-by: Michael Brasser
---
 src/s60installs/bwins/QtDeclarativeu.def | 19 +++++++++++++------
 src/s60installs/bwins/QtGuiu.def         |  4 ++++
 src/s60installs/eabi/QtDeclarativeu.def  | 18 ++++++++++++------
 src/s60installs/eabi/QtGuiu.def          |  4 ++++
 4 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 8fdd72c..f6bf864 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -12,7 +12,7 @@ EXPORTS
 	??0QDeclarativeText@@QAE@PAVQDeclarativeItem@@@Z @ 11 NONAME ; QDeclarativeText::QDeclarativeText(class QDeclarativeItem *)
 	?trUtf8@QDeclarativePixmapReply@@SA?AVQString@@PBD0H@Z @ 12 NONAME ABSENT ; class QString QDeclarativePixmapReply::trUtf8(char const *, char const *, int)
 	?propertyTypeName@QDeclarativeProperty@@QBEPBDXZ @ 13 NONAME ; char const * QDeclarativeProperty::propertyTypeName(void) const
-	?wantsFocusChanged@QDeclarativeItem@@IAEX_N@Z @ 14 NONAME ; void QDeclarativeItem::wantsFocusChanged(bool)
+	?wantsFocusChanged@QDeclarativeItem@@IAEX_N@Z @ 14 NONAME ABSENT ; void QDeclarativeItem::wantsFocusChanged(bool)
 	?getStaticMetaObject@QDeclarativeDebugService@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & QDeclarativeDebugService::getStaticMetaObject(void)
 	?setLeft@QDeclarativeAnchors@@QAEXABVQDeclarativeAnchorLine@@@Z @ 16 NONAME ; void QDeclarativeAnchors::setLeft(class QDeclarativeAnchorLine const &)
 	?qt_metacall@QDeclarativeExpression@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int QDeclarativeExpression::qt_metacall(enum QMetaObject::Call, int, void * *)
@@ -265,7 +265,7 @@ EXPORTS
 	?readyRead@QPacketProtocol@@IAEXXZ @ 264 NONAME ; void QPacketProtocol::readyRead(void)
 	?qt_metacall@QDeclarativeValueType@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 265 NONAME ; int QDeclarativeValueType::qt_metacall(enum QMetaObject::Call, int, void * *)
 	?propertyType@QDeclarativePropertyPrivate@@QBEHXZ @ 266 NONAME ; int QDeclarativePropertyPrivate::propertyType(void) const
-	?engine@QDeclarativeView@@QAEPAVQDeclarativeEngine@@XZ @ 267 NONAME ; class QDeclarativeEngine * QDeclarativeView::engine(void)
+	?engine@QDeclarativeView@@QAEPAVQDeclarativeEngine@@XZ @ 267 NONAME ABSENT ; class QDeclarativeEngine * QDeclarativeView::engine(void)
 	?inputMethodQuery@QDeclarativeItem@@MBE?AVQVariant@@W4InputMethodQuery@Qt@@@Z @ 268 NONAME ; class QVariant QDeclarativeItem::inputMethodQuery(enum Qt::InputMethodQuery) const
 	?sizeHint@QDeclarativeView@@UBE?AVQSize@@XZ @ 269 NONAME ; class QSize QDeclarativeView::sizeHint(void) const
 	?flags@QDeclarativeCustomParser@@QBE?AV?$QFlags@W4Flag@QDeclarativeCustomParser@@@@XZ @ 270 NONAME ; class QFlags<enum QDeclarativeCustomParser::Flag> QDeclarativeCustomParser::flags(void) const
@@ -877,7 +877,7 @@ EXPORTS
 	?setWidth@QDeclarativeItemPrivate@@UAEXM@Z @ 876 NONAME ; void QDeclarativeItemPrivate::setWidth(float)
 	?staticMetaObject@QDeclarativeDebugWatch@@2UQMetaObject@@B @ 877 NONAME ; struct QMetaObject const QDeclarativeDebugWatch::staticMetaObject
 	??_EQDeclarativeContext@@UAE@I@Z @ 878 NONAME ; QDeclarativeContext::~QDeclarativeContext(unsigned int)
-	?rootContext@QDeclarativeView@@QAEPAVQDeclarativeContext@@XZ @ 879 NONAME ; class QDeclarativeContext * QDeclarativeView::rootContext(void)
+	?rootContext@QDeclarativeView@@QAEPAVQDeclarativeContext@@XZ @ 879 NONAME ABSENT ; class QDeclarativeContext * QDeclarativeView::rootContext(void)
 	?staticMetaObject@QDeclarativeDebugQuery@@2UQMetaObject@@B @ 880 NONAME ; struct QMetaObject const QDeclarativeDebugQuery::staticMetaObject
 	??0QDeclarativeExtensionPlugin@@QAE@PAVQObject@@@Z @ 881 NONAME ; QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(class QObject *)
 	??_EQDeclarativeOpenMetaObject@@UAE@I@Z @ 882 NONAME ; QDeclarativeOpenMetaObject::~QDeclarativeOpenMetaObject(unsigned int)
@@ -1077,7 +1077,7 @@ EXPORTS
 	??1QDeclarativeEngine@@UAE@XZ @ 1076 NONAME ; QDeclarativeEngine::~QDeclarativeEngine(void)
 	?debugId@QDeclarativeDebugContextReference@@QBEHXZ @ 1077 NONAME ; int QDeclarativeDebugContextReference::debugId(void) const
 	?propertyNameParts@QDeclarativeDomProperty@@QBE?AV?$QList@VQByteArray@@@@XZ @ 1078 NONAME ; class QList<class QByteArray> QDeclarativeDomProperty::propertyNameParts(void) const
-	?rootContext@QDeclarativeEngine@@QAEPAVQDeclarativeContext@@XZ @ 1079 NONAME ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void)
+	?rootContext@QDeclarativeEngine@@QAEPAVQDeclarativeContext@@XZ @ 1079 NONAME ABSENT ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void)
 	?resetWidth@QDeclarativeItemPrivate@@UAEXXZ @ 1080 NONAME ; void QDeclarativeItemPrivate::resetWidth(void)
 	??AQDeclarativeOpenMetaObject@@QAEAAVQVariant@@ABVQByteArray@@@Z @ 1081 NONAME ; class QVariant & QDeclarativeOpenMetaObject::operator[](class QByteArray const &)
 	?bottom@QDeclarativeItemPrivate@@QBE?AVQDeclarativeAnchorLine@@XZ @ 1082 NONAME ; class QDeclarativeAnchorLine QDeclarativeItemPrivate::bottom(void) const
@@ -1182,7 +1182,7 @@ EXPORTS
 	??_EQDeclarativeEngineDebug@@UAE@I@Z @ 1181 NONAME ; QDeclarativeEngineDebug::~QDeclarativeEngineDebug(unsigned int)
 	?bottom@QDeclarativeScaleGrid@@QBEHXZ @ 1182 NONAME ; int QDeclarativeScaleGrid::bottom(void) const
 	?d_func@QDeclarativePropertyMap@@AAEPAVQDeclarativePropertyMapPrivate@@XZ @ 1183 NONAME ; class QDeclarativePropertyMapPrivate * QDeclarativePropertyMap::d_func(void)
-	?forceFocus@QDeclarativeItem@@QAEXXZ @ 1184 NONAME ; void QDeclarativeItem::forceFocus(void)
+	?forceFocus@QDeclarativeItem@@QAEXXZ @ 1184 NONAME ABSENT ; void QDeclarativeItem::forceFocus(void)
 	?trUtf8@QDeclarativeView@@SA?AVQString@@PBD0@Z @ 1185 NONAME ; class QString QDeclarativeView::trUtf8(char const *, char const *)
 	??0QDeclarativeTransition@@QAE@PAVQObject@@@Z @ 1186 NONAME ; QDeclarativeTransition::QDeclarativeTransition(class QObject *)
 	?horizontalCenter@QDeclarativeAnchors@@QBE?AVQDeclarativeAnchorLine@@XZ @ 1187 NONAME ; class QDeclarativeAnchorLine QDeclarativeAnchors::horizontalCenter(void) const
@@ -1442,7 +1442,7 @@ EXPORTS
 	?drawRect@QDeclarativeRectangle@@AAEXAAVQPainter@@@Z @ 1441 NONAME ; void QDeclarativeRectangle::drawRect(class QPainter &)
 	?read@QDeclarativeProperty@@QBE?AVQVariant@@XZ @ 1442 NONAME ; class QVariant QDeclarativeProperty::read(void) const
 	?isEmpty@QDeclarativePropertyMap@@QBE_NXZ @ 1443 NONAME ; bool QDeclarativePropertyMap::isEmpty(void) const
-	?wantsFocus@QDeclarativeItem@@QBE_NXZ @ 1444 NONAME ; bool QDeclarativeItem::wantsFocus(void) const
+	?wantsFocus@QDeclarativeItem@@QBE_NXZ @ 1444 NONAME ABSENT ; bool QDeclarativeItem::wantsFocus(void) const
 	??6@YAAAVQDataStream@@AAV0@ABUQDeclarativeObjectData@QDeclarativeEngineDebugServer@@@Z @ 1445 NONAME ; class QDataStream & operator<<(class QDataStream &, struct QDeclarativeEngineDebugServer::QDeclarativeObjectData const &)
 	?trUtf8@QDeclarativeDebugObjectQuery@@SA?AVQString@@PBD0H@Z @ 1446 NONAME ; class QString QDeclarativeDebugObjectQuery::trUtf8(char const *, char const *, int)
 	??0QDeclarativeBinding@@QAE@ABVQString@@PAVQObject@@PAVQDeclarativeContext@@1@Z @ 1447 NONAME ; QDeclarativeBinding::QDeclarativeBinding(class QString const &, class QObject *, class QDeclarativeContext *, class QObject *)
@@ -1676,4 +1676,11 @@ EXPORTS
 	??0QDeclarativeImageProvider@@QAE@W4ImageType@0@@Z @ 1675 NONAME ; QDeclarativeImageProvider::QDeclarativeImageProvider(enum QDeclarativeImageProvider::ImageType)
 	?setMethodBody@QDeclarativeEngineDebug@@QAE_NHABVQString@@0@Z @ 1676 NONAME ; bool QDeclarativeEngineDebug::setMethodBody(int, class QString const &, class QString const &)
 	?resetBindingForObject@QDeclarativeEngineDebug@@QAE_NHABVQString@@@Z @ 1677 NONAME ; bool QDeclarativeEngineDebug::resetBindingForObject(int, class QString const &)
+	?forceActiveFocus@QDeclarativeItem@@QAEXXZ @ 1678 NONAME ; void QDeclarativeItem::forceActiveFocus(void)
+	?activeFocusChanged@QDeclarativeItem@@IAEX_N@Z @ 1679 NONAME ; void QDeclarativeItem::activeFocusChanged(bool)
+	?focusScopeItemChange@QDeclarativeItemPrivate@@UAEX_N@Z @ 1680 NONAME ; void QDeclarativeItemPrivate::focusScopeItemChange(bool)
+	?hasActiveFocus@QDeclarativeItem@@QBE_NXZ @ 1681 NONAME ; bool QDeclarativeItem::hasActiveFocus(void) const
+	?engine@QDeclarativeView@@QBEPAVQDeclarativeEngine@@XZ @ 1682 NONAME ; class QDeclarativeEngine * QDeclarativeView::engine(void) const
+	?rootContext@QDeclarativeView@@QBEPAVQDeclarativeContext@@XZ @ 1683 NONAME ; class QDeclarativeContext * QDeclarativeView::rootContext(void) const
+	?rootContext@QDeclarativeEngine@@QBEPAVQDeclarativeContext@@XZ @ 1684 NONAME ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void) const
 
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 1df9b84..b06cbba 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12879,4 +12879,8 @@ EXPORTS
 	?PreDocConstructL@QS60MainApplication@@UAEXXZ @ 12878 NONAME ; void QS60MainApplication::PreDocConstructL(void)
 	?NewAppServerL@QS60MainApplication@@UAEXAAPAVCApaAppServer@@@Z @ 12879 NONAME ; void QS60MainApplication::NewAppServerL(class CApaAppServer * &)
 	?HandleViewDeactivation@QS60MainAppUi@@UAEXABVTVwsViewId@@0@Z @ 12880 NONAME ; void QS60MainAppUi::HandleViewDeactivation(class TVwsViewId const &, class TVwsViewId const &)
+	?timeout@QTapAndHoldGesture@@SAHXZ @ 12881 NONAME ; int QTapAndHoldGesture::timeout(void)
+	?focusScopeItemChange@QGraphicsItemPrivate@@UAEX_N@Z @ 12882 NONAME ; void QGraphicsItemPrivate::focusScopeItemChange(bool)
+	?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12883 NONAME ; void QTapAndHoldGesture::setTimeout(int)
+	?childrenBoundingRectHelper@QGraphicsItemPrivate@@QAEXPAVQTransform@@PAVQRectF@@_N@Z @ 12884 NONAME ; void QGraphicsItemPrivate::childrenBoundingRectHelper(class QTransform *, class QRectF *, bool)
 
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index dd5103f..c0c9bb4 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -44,7 +44,7 @@ EXPORTS
 	_ZN16QDeclarativeInfoD1Ev @ 43 NONAME
 	_ZN16QDeclarativeInfoD2Ev @ 44 NONAME
 	_ZN16QDeclarativeItem10classBeginEv @ 45 NONAME
-	_ZN16QDeclarativeItem10forceFocusEv @ 46 NONAME
+	_ZN16QDeclarativeItem10forceFocusEv @ 46 NONAME ABSENT
 	_ZN16QDeclarativeItem10itemChangeEN13QGraphicsItem18GraphicsItemChangeERK8QVariant @ 47 NONAME
 	_ZN16QDeclarativeItem10resetWidthEv @ 48 NONAME
 	_ZN16QDeclarativeItem10sceneEventEP6QEvent @ 49 NONAME
@@ -69,7 +69,7 @@ EXPORTS
 	_ZN16QDeclarativeItem17componentCompleteEv @ 68 NONAME
 	_ZN16QDeclarativeItem17setBaselineOffsetEf @ 69 NONAME
 	_ZN16QDeclarativeItem17setImplicitHeightEf @ 70 NONAME
-	_ZN16QDeclarativeItem17wantsFocusChangedEb @ 71 NONAME
+	_ZN16QDeclarativeItem17wantsFocusChangedEb @ 71 NONAME ABSENT
 	_ZN16QDeclarativeItem18keyPressPreHandlerEP9QKeyEvent @ 72 NONAME
 	_ZN16QDeclarativeItem18setTransformOriginENS_15TransformOriginE @ 73 NONAME
 	_ZN16QDeclarativeItem19childrenRectChangedERK6QRectF @ 74 NONAME
@@ -143,7 +143,7 @@ EXPORTS
 	_ZN16QDeclarativeView11qt_metacallEN11QMetaObject4CallEiPPv @ 142 NONAME
 	_ZN16QDeclarativeView11qt_metacastEPKc @ 143 NONAME
 	_ZN16QDeclarativeView11resizeEventEP12QResizeEvent @ 144 NONAME
-	_ZN16QDeclarativeView11rootContextEv @ 145 NONAME
+	_ZN16QDeclarativeView11rootContextEv @ 145 NONAME ABSENT
 	_ZN16QDeclarativeView12sceneResizedE5QSize @ 146 NONAME
 	_ZN16QDeclarativeView13setResizeModeENS_10ResizeModeE @ 147 NONAME
 	_ZN16QDeclarativeView13setRootObjectEP7QObject @ 148 NONAME
@@ -151,7 +151,7 @@ EXPORTS
 	_ZN16QDeclarativeView15continueExecuteEv @ 150 NONAME
 	_ZN16QDeclarativeView16staticMetaObjectE @ 151 NONAME DATA 16
 	_ZN16QDeclarativeView19getStaticMetaObjectEv @ 152 NONAME
-	_ZN16QDeclarativeView6engineEv @ 153 NONAME
+	_ZN16QDeclarativeView6engineEv @ 153 NONAME ABSENT
 	_ZN16QDeclarativeView9setSourceERK4QUrl @ 154 NONAME
 	_ZN16QDeclarativeViewC1EP7QWidget @ 155 NONAME
 	_ZN16QDeclarativeViewC1ERK4QUrlP7QWidget @ 156 NONAME
@@ -202,7 +202,7 @@ EXPORTS
 	_ZN18QDeclarativeEngine10setBaseUrlERK4QUrl @ 201 NONAME
 	_ZN18QDeclarativeEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 202 NONAME
 	_ZN18QDeclarativeEngine11qt_metacastEPKc @ 203 NONAME
-	_ZN18QDeclarativeEngine11rootContextEv @ 204 NONAME
+	_ZN18QDeclarativeEngine11rootContextEv @ 204 NONAME ABSENT
 	_ZN18QDeclarativeEngine12importPluginERK7QStringS2_PS0_ @ 205 NONAME
 	_ZN18QDeclarativeEngine13addImportPathERK7QString @ 206 NONAME
 	_ZN18QDeclarativeEngine13addPluginPathERK7QString @ 207 NONAME
@@ -1075,7 +1075,7 @@ EXPORTS
 	_ZNK15QPacketProtocol17maximumPacketSizeEv @ 1074 NONAME
 	_ZNK16QDeclarativeItem10metaObjectEv @ 1075 NONAME
 	_ZNK16QDeclarativeItem10parentItemEv @ 1076 NONAME
-	_ZNK16QDeclarativeItem10wantsFocusEv @ 1077 NONAME
+	_ZNK16QDeclarativeItem10wantsFocusEv @ 1077 NONAME ABSENT
 	_ZNK16QDeclarativeItem10widthValidEv @ 1078 NONAME
 	_ZNK16QDeclarativeItem11heightValidEv @ 1079 NONAME
 	_ZNK16QDeclarativeItem11mapFromItemERK12QScriptValueff @ 1080 NONAME
@@ -1707,4 +1707,10 @@ EXPORTS
 	_ZN25QDeclarativeImageProviderC2ENS_9ImageTypeE @ 1706 NONAME
 	_ZNK25QDeclarativeImageProvider9imageTypeEv @ 1707 NONAME
 	_ZN23QDeclarativeEngineDebug21resetBindingForObjectEiRK7QString @ 1708 NONAME
+	_ZN16QDeclarativeItem16forceActiveFocusEv @ 1709 NONAME
+	_ZN16QDeclarativeItem18activeFocusChangedEb @ 1710 NONAME
+	_ZNK16QDeclarativeItem14hasActiveFocusEv @ 1711 NONAME
+	_ZNK16QDeclarativeView11rootContextEv @ 1712 NONAME
+	_ZNK16QDeclarativeView6engineEv @ 1713 NONAME
+	_ZNK18QDeclarativeEngine11rootContextEv @ 1714 NONAME
 
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 580e173..8c11002 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12084,4 +12084,8 @@ EXPORTS
 	_ZThn24_N13QS60MainAppUi15ProcessCommandLEi @ 12083 NONAME
 	_ZThn40_N13QS60MainAppUi15MopSupplyObjectE8TTypeUid @ 12084 NONAME
 	_ZThn92_N13QS60MainAppUi22HandleViewDeactivationERK10TVwsViewIdS2_ @ 12085 NONAME
+	_ZN18QTapAndHoldGesture10setTimeoutEi @ 12086 NONAME
+	_ZN18QTapAndHoldGesture7timeoutEv @ 12087 NONAME
+	_ZN20QGraphicsItemPrivate20focusScopeItemChangeEb @ 12088 NONAME
+	_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12089 NONAME
 
-- 
cgit v0.12


From ddb5e1eef379c7f32a594d91b00ff3514c46b62a Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Thu, 22 Jul 2010 15:16:17 +1000
Subject: Remove QDeclarativeItem::childrenChanged() signal overload Broke
 signal handlers in QML

Task-number: QTBUG-12335
Reviewed-by: Aaron Kennedy
---
 src/declarative/graphicsitems/qdeclarativeitem.h                 | 1 -
 src/s60installs/bwins/QtDeclarativeu.def                         | 2 +-
 src/s60installs/eabi/QtDeclarativeu.def                          | 2 +-
 tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp | 5 +++++
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitem.h b/src/declarative/graphicsitems/qdeclarativeitem.h
index cd9b910..afb1f2e 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.h
+++ b/src/declarative/graphicsitems/qdeclarativeitem.h
@@ -152,7 +152,6 @@ public:
     Q_INVOKABLE QDeclarativeItem *childAt(qreal x, qreal y) const;
 
 Q_SIGNALS:
-    void childrenChanged();
     void childrenRectChanged(const QRectF &);
     void baselineOffsetChanged(qreal);
     void stateChanged(const QString &);
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index f6bf864..19e1e01 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -813,7 +813,7 @@ EXPORTS
 	??0QDeclarativeView@@QAE@ABVQUrl@@PAVQWidget@@@Z @ 812 NONAME ; QDeclarativeView::QDeclarativeView(class QUrl const &, class QWidget *)
 	?qt_metacall@QDeclarativePixmapReply@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 813 NONAME ABSENT ; int QDeclarativePixmapReply::qt_metacall(enum QMetaObject::Call, int, void * *)
 	?valueChanged@QDeclarativeExpression@@IAEXXZ @ 814 NONAME ; void QDeclarativeExpression::valueChanged(void)
-	?childrenChanged@QDeclarativeItem@@IAEXXZ @ 815 NONAME ; void QDeclarativeItem::childrenChanged(void)
+	?childrenChanged@QDeclarativeItem@@IAEXXZ @ 815 NONAME ABSENT ; void QDeclarativeItem::childrenChanged(void)
 	??_EQDeclarativeView@@UAE@I@Z @ 816 NONAME ; QDeclarativeView::~QDeclarativeView(unsigned int)
 	?trUtf8@QDeclarativeStateGroup@@SA?AVQString@@PBD0H@Z @ 817 NONAME ; class QString QDeclarativeStateGroup::trUtf8(char const *, char const *, int)
 	?tag@QMetaMethodBuilder@@QBE?AVQByteArray@@XZ @ 818 NONAME ; class QByteArray QMetaMethodBuilder::tag(void) const
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index c0c9bb4..7868e28 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -59,7 +59,7 @@ EXPORTS
 	_ZN16QDeclarativeItem13parentChangedEPS_ @ 58 NONAME
 	_ZN16QDeclarativeItem13setParentItemEPS_ @ 59 NONAME
 	_ZN16QDeclarativeItem13smoothChangedEb @ 60 NONAME
-	_ZN16QDeclarativeItem15childrenChangedEv @ 61 NONAME
+	_ZN16QDeclarativeItem15childrenChangedEv @ 61 NONAME ABSENT
 	_ZN16QDeclarativeItem15geometryChangedERK6QRectFS2_ @ 62 NONAME
 	_ZN16QDeclarativeItem15keyReleaseEventEP9QKeyEvent @ 63 NONAME
 	_ZN16QDeclarativeItem16inputMethodEventEP17QInputMethodEvent @ 64 NONAME
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 345ce38..d76d360 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -665,6 +665,7 @@ void tst_QDeclarativeItem::propertyChanges()
     QSignalSpy childrenRectSpy(parentItem, SIGNAL(childrenRectChanged(QRectF)));
     QSignalSpy focusSpy(item, SIGNAL(focusChanged(bool)));
     QSignalSpy wantsFocusSpy(parentItem, SIGNAL(activeFocusChanged(bool)));
+    QSignalSpy childrenChangedSpy(parentItem, SIGNAL(childrenChanged()));
 
     item->setParentItem(parentItem);
     item->setWidth(100.0);
@@ -677,6 +678,10 @@ void tst_QDeclarativeItem::propertyChanges()
     QList<QVariant> parentArguments = parentSpy.first();
     QVERIFY(parentArguments.count() == 1);
     QCOMPARE(item->parentItem(), qvariant_cast<QDeclarativeItem *>(parentArguments.at(0)));
+    QCOMPARE(childrenChangedSpy.count(),1);
+
+    item->setParentItem(parentItem);
+    QCOMPARE(childrenChangedSpy.count(),1);
 
     QCOMPARE(item->width(), 100.0);
     QCOMPARE(widthSpy.count(),1);
-- 
cgit v0.12


From 0767c2ff719a35c16c72fac97e6ff612e8c71e21 Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Thu, 22 Jul 2010 14:50:01 +1000
Subject: Fix TextEdit text attribute and text stored in the internal
 QTextDocument having different contents

Task-number: QTBUG-12339
Reviewed-by: Martin Jones
---
 .../graphicsitems/qdeclarativetextedit.cpp         |  5 ++--
 .../tst_qdeclarativetextedit.cpp                   | 34 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index f7b2ebf..8117676 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -256,7 +256,6 @@ void QDeclarativeTextEdit::setText(const QString &text)
     Q_D(QDeclarativeTextEdit);
     if (QDeclarativeTextEdit::text() == text)
         return;
-    d->text = text;
     d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text));
     if (d->richText) {
 #ifndef QT_NO_TEXTHTMLPARSER
@@ -1291,9 +1290,11 @@ void QDeclarativeTextEditPrivate::init()
 
 void QDeclarativeTextEdit::q_textChanged()
 {
+    Q_D(QDeclarativeTextEdit);
+    d->text = text();
     updateSize();
     updateMicroFocus();
-    emit textChanged(text());
+    emit textChanged(d->text);
 }
 
 void QDeclarativeTextEdit::moveCursorDelegate()
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 93351a8..57a5e29 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -115,6 +115,7 @@ private slots:
     void navigation();
     void readOnly();
     void copyAndPaste();
+    void textInput();
     void openInputPanelOnClick();
     void openInputPanelOnFocus();
     void geometrySignals();
@@ -882,6 +883,12 @@ void tst_qdeclarativetextedit::copyAndPaste() {
     QCOMPARE(textEdit->text(), QString("Hello world!Hello world!"));
     QCOMPARE(textEdit->text().length(), 24);
 
+    // QTBUG-12339
+    // test that document and internal text attribute are in sync
+    QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(textEdit);
+    QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+    QCOMPARE(textEdit->text(), editPrivate->text);
+
     // select word
     textEdit->setCursorPosition(0);
     textEdit->selectWord();
@@ -961,6 +968,33 @@ public:
     bool closeInputPanelReceived;
 };
 
+void tst_qdeclarativetextedit::textInput()
+{
+    QGraphicsScene scene;
+    QGraphicsView view(&scene);
+    QDeclarativeTextEdit edit;
+    QDeclarativeItemPrivate* pri = QDeclarativeItemPrivate::get(&edit);
+    QDeclarativeTextEditPrivate *editPrivate = static_cast<QDeclarativeTextEditPrivate*>(pri);
+    edit.setPos(0, 0);
+    scene.addItem(&edit);
+    view.show();
+    QApplication::setActiveWindow(&view);
+    QTest::qWaitForWindowShown(&view);
+    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    edit.setFocus(true);
+    QVERIFY(edit.hasActiveFocus() == true);
+
+    // test that input method event is committed
+    QInputMethodEvent event;
+    event.setCommitString( "Hello world!", 0, 0);
+    QApplication::sendEvent(&view, &event);
+    QCOMPARE(edit.text(), QString("Hello world!"));
+
+    // QTBUG-12339
+    // test that document and internal text attribute are in sync
+    QCOMPARE(editPrivate->text, QString("Hello world!"));
+}
+
 void tst_qdeclarativetextedit::openInputPanelOnClick()
 {
     QGraphicsScene scene;
-- 
cgit v0.12


From 58b9468d70fcfdd178f17e89d163c6f9879221d8 Mon Sep 17 00:00:00 2001
From: Aaron Kennedy <aaron.kennedy@nokia.com>
Date: Thu, 22 Jul 2010 16:08:41 +1000
Subject: Reuse QML lexer to simplify .pragma script logic

---
 src/declarative/qml/parser/qdeclarativejslexer.cpp | 10 +--
 src/declarative/qml/qdeclarativescriptparser.cpp   | 99 ++++++++--------------
 2 files changed, 42 insertions(+), 67 deletions(-)

diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index fcaaece..65a6af2 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -103,7 +103,7 @@ Lexer::Lexer(Engine *eng, bool tokenizeComments)
       prohibitAutomaticSemicolon(false),
       tokenizeComments(tokenizeComments)
 {
-    driver->setLexer(this);
+    if (driver) driver->setLexer(this);
     // allocate space for read buffers
     buffer8 = new char[size8];
     buffer16 = new QChar[size16];
@@ -677,9 +677,9 @@ int Lexer::lex()
                     setDone(Other);
                 } else
                     state = Start;
-                driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
             } else if (current == 0) {
-                driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
                 setDone(Eof);
             }
 
@@ -689,14 +689,14 @@ int Lexer::lex()
                 setDone(Bad);
                 err = UnclosedComment;
                 errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
-                driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
             } else if (isLineTerminator()) {
                 shiftWindowsLineBreak();
                 yylineno++;
             } else if (current == '*' && next1 == '/') {
                 state = Start;
                 shift(1);
-                driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
+                if (driver) driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
             }
 
             break;
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 219d759..0d8bbb5 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -896,6 +896,14 @@ QList<QDeclarativeError> QDeclarativeScriptParser::errors() const
     return _errors;
 }
 
+static void replaceWithSpace(QString &str, int idx, int n) 
+{
+    QChar *data = str.data() + idx;
+    QChar space(' ');
+    for (int ii = 0; ii < n; ++ii)
+        *data++ = space;
+}
+
 /*
 Searches for ".pragma <value>" declarations within \a script.  Currently supported pragmas
 are:
@@ -905,83 +913,50 @@ QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extra
 {
     QDeclarativeParser::Object::ScriptBlock::Pragmas rv = QDeclarativeParser::Object::ScriptBlock::None;
 
-    const QChar forwardSlash(QLatin1Char('/'));
-    const QChar star(QLatin1Char('*'));
-    const QChar newline(QLatin1Char('\n'));
-    const QChar dot(QLatin1Char('.'));
-    const QChar semicolon(QLatin1Char(';'));
-    const QChar space(QLatin1Char(' '));
-    const QString pragma(QLatin1String(".pragma "));
-
-    const QChar *pragmaData = pragma.constData();
-
-    const QChar *data = script.constData();
-    const int length = script.count();
-    for (int ii = 0; ii < length; ++ii) {
-        const QChar &c = data[ii];
-
-        if (c.isSpace())
-            continue;
-
-        if (c == forwardSlash) {
-            ++ii;
-            if (ii >= length)
-                return rv;
-
-            const QChar &c = data[ii];
-            if (c == forwardSlash) {
-                // Find next newline
-                while (ii < length && data[++ii] != newline) {};
-            } else if (c == star) {
-                // Find next star
-                while (true) {
-                    while (ii < length && data[++ii] != star) {};
-                    if (ii + 1 >= length)
-                        return rv;
-
-                    if (data[ii + 1] == forwardSlash) {
-                        ++ii;
-                        break;
-                    }
-                }
-            } else {
-                return rv;
-            }
-        } else if (c == dot) {
-            // Could be a pragma!
-            if (ii + pragma.length() >= length ||
-                0 != ::memcmp(data + ii, pragmaData, sizeof(QChar) * pragma.length()))
-                return rv;
+    const QString pragma(QLatin1String("pragma"));
+    const QString library(QLatin1String("library"));
 
-            int pragmaStatementIdx = ii;
+    QDeclarativeJS::Lexer l(0);
+    l.setCode(script, 0);
 
-            ii += pragma.length();
+    int lastLine = -1;
 
-            while (ii < length && data[ii].isSpace()) { ++ii; }
+    int token = l.lex();
 
-            int startIdx = ii;
+    while (true) {
+        if (token != QDeclarativeJSGrammar::T_DOT)
+            return rv;
 
-            while (ii < length && data[ii].isLetter()) { ++ii; }
+        int startOffset = l.tokenOffset();
+        int startLine = l.currentLineNo();
 
-            int endIdx = ii;
+        token = l.lex();
 
-            if (ii != length && data[ii] != forwardSlash && !data[ii].isSpace() && data[ii] != semicolon)
-                return rv;
+        if (token != QDeclarativeJSGrammar::T_IDENTIFIER ||
+            l.currentLineNo() != startLine ||
+            script.mid(l.tokenOffset(), l.tokenLength()) != pragma)
+            return rv;
 
-            QString p(data + startIdx, endIdx - startIdx);
+        token = l.lex();
 
-            if (p == QLatin1String("library"))
-                rv |= QDeclarativeParser::Object::ScriptBlock::Shared;
-            else
-                return rv;
+        if (token != QDeclarativeJSGrammar::T_IDENTIFIER ||
+            l.currentLineNo() != startLine)
+            return rv;
 
-            for (int jj = pragmaStatementIdx; jj < endIdx; ++jj) script[jj] = space;
+        QString pragmaValue = script.mid(l.tokenOffset(), l.tokenLength());
+        int endOffset = l.tokenLength() + l.tokenOffset();
 
+        token = l.lex();
+        if (l.currentLineNo() == startLine)
+            return rv;
+
+        if (pragmaValue == QLatin1String("library")) {
+            rv |= QDeclarativeParser::Object::ScriptBlock::Shared;
+            replaceWithSpace(script, startOffset, endOffset - startOffset);
         } else {
             return rv;
         }
     }
-
     return rv;
 }
 
-- 
cgit v0.12


From 7f4378699182be721382555f58b518bd40e7647d Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Thu, 22 Jul 2010 16:15:10 +1000
Subject: Fix TextInput echoMode autotest on Linux

Task-number:
Reviewed-by: Michael Brasser
---
 .../declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index e5e495e..6e15a4a 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -802,6 +802,9 @@ void tst_qdeclarativetextinput::echoMode()
     QDeclarativeView *canvas = createView(SRCDIR "/data/echoMode.qml");
     canvas->show();
     canvas->setFocus();
+    QApplication::setActiveWindow(canvas);
+    QTest::qWaitForWindowShown(canvas);
+    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
 
     QVERIFY(canvas->rootObject() != 0);
 
@@ -849,6 +852,7 @@ void tst_qdeclarativetextinput::echoMode()
     QCOMPARE(input->text(), QLatin1String("a"));
     QCOMPARE(input->displayText(), QLatin1String("a"));
     input->setFocus(false);
+    QVERIFY(input->hasActiveFocus() == false);
     QCOMPARE(input->displayText(), QLatin1String("Q"));
 }
 
-- 
cgit v0.12


From 75aabee03791804772c4fe934630a27f7c2c9ae5 Mon Sep 17 00:00:00 2001
From: Aaron Kennedy <aaron.kennedy@nokia.com>
Date: Thu, 22 Jul 2010 17:05:05 +1000
Subject: Fix compiler warning

---
 src/declarative/qml/qdeclarativescriptparser.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 0d8bbb5..4d98ca8 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -919,8 +919,6 @@ QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extra
     QDeclarativeJS::Lexer l(0);
     l.setCode(script, 0);
 
-    int lastLine = -1;
-
     int token = l.lex();
 
     while (true) {
-- 
cgit v0.12


From d32adfd34f5cd2334b4041dfc0c07a5538ccdff7 Mon Sep 17 00:00:00 2001
From: Aaron Kennedy <aaron.kennedy@nokia.com>
Date: Thu, 22 Jul 2010 18:00:16 +1000
Subject: Generalize qml "registration"

While it is difficult to predict the future, the hope is that this might
give us a little more flexibility when it comes to fixing bugs etc. in
patch releases.
---
 .../graphicsitems/qdeclarativeitemsmodule.cpp      |  3 ++-
 src/declarative/qml/qdeclarative.h                 | 14 +++++-----
 src/declarative/qml/qdeclarativemetatype.cpp       | 28 +++++++++++++++++---
 src/declarative/qml/qdeclarativemetatype_p.h       |  8 +++---
 src/declarative/qml/qdeclarativeprivate.h          | 30 ++++++++++++++++++----
 src/declarative/qml/qdeclarativevaluetype.cpp      |  2 +-
 6 files changed, 64 insertions(+), 21 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index b198077..5d623dc 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -95,7 +95,8 @@ static QDeclarativePrivate::AutoParentResult qgraphicsobject_autoParent(QObject
 
 void QDeclarativeItemModule::defineModule()
 {
-    QDeclarativePrivate::registerAutoParentFunction(qgraphicsobject_autoParent);
+    QDeclarativePrivate::RegisterAutoParent autoparent = { 0, &qgraphicsobject_autoParent };
+    QDeclarativePrivate::qmlregister(QDeclarativePrivate::AutoParentRegistration, &autoparent);
 
 #ifdef QT_NO_MOVIE
     qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage",
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index 53ff51c..c6b64ae 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -116,7 +116,7 @@ int qmlRegisterType()
         0
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message);
@@ -151,7 +151,7 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin
         0
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 template<typename T>
@@ -184,7 +184,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
         0
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 template<typename T, typename E>
@@ -217,7 +217,7 @@ int qmlRegisterExtendedType()
         0
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 template<typename T, typename E>
@@ -258,7 +258,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
         0
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 template<typename T>
@@ -278,7 +278,7 @@ int qmlRegisterInterface(const char *typeName)
         qobject_interface_iid<T *>()
     };
 
-    return QDeclarativePrivate::registerType(interface);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::InterfaceRegistration, &interface);
 }
 
 template<typename T>
@@ -312,7 +312,7 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
         parser
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 class QDeclarativeContext;
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 153e2be..18b84cc 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -39,6 +39,10 @@
 **
 ****************************************************************************/
 
+#include <QtDeclarative/qdeclarativeprivate.h>
+static int registerType(const QDeclarativePrivate::RegisterType &);
+static int registerInterface(const QDeclarativePrivate::RegisterInterface &);
+
 #include "private/qdeclarativemetatype_p.h"
 
 #include "private/qdeclarativeproxymetaobject_p.h"
@@ -485,17 +489,17 @@ int QDeclarativeType::index() const
     return d->m_index;
 }
 
-int QDeclarativePrivate::registerAutoParentFunction(AutoParentFunction function)
+static int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent)
 {
     QWriteLocker lock(metaTypeDataLock());
     QDeclarativeMetaTypeData *data = metaTypeData();
 
-    data->parentFunctions.append(function);
+    data->parentFunctions.append(autoparent.function);
 
     return data->parentFunctions.count() - 1;
 }
 
-int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &interface)
+static int registerInterface(const QDeclarativePrivate::RegisterInterface &interface)
 {
     if (interface.version > 0) 
         qFatal("qmlRegisterType(): Cannot mix incompatible QML versions.");
@@ -524,7 +528,7 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterfa
     return index;
 }
 
-int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &type)
+static int registerType(const QDeclarativePrivate::RegisterType &type)
 {
     if (type.elementName) {
         for (int ii = 0; type.elementName[ii]; ++ii) {
@@ -576,6 +580,22 @@ int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &t
 }
 
 /*
+This method is "over generalized" to allow us to (potentially) register more types of things in
+the future without adding exported symbols.
+*/
+int QDeclarativePrivate::qmlregister(RegistrationType type, void *data)
+{
+    if (type == TypeRegistration) {
+        return registerType(*reinterpret_cast<RegisterType *>(data));
+    } else if (type == InterfaceRegistration) {
+        return registerInterface(*reinterpret_cast<RegisterInterface *>(data));
+    } else if (type == AutoParentRegistration) {
+        return registerAutoParentFunction(*reinterpret_cast<RegisterAutoParent *>(data));
+    }
+    return -1;
+}
+
+/*
     Have any types been registered for \a module with at least versionMajor.versionMinor, and types
     for \a module with at most versionMajor.versionMinor.
 
diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h
index 4c98b6f..f410547 100644
--- a/src/declarative/qml/qdeclarativemetatype_p.h
+++ b/src/declarative/qml/qdeclarativemetatype_p.h
@@ -63,6 +63,8 @@ QT_BEGIN_NAMESPACE
 
 class QDeclarativeType;
 class QDeclarativeCustomParser;
+class QDeclarativeTypePrivate;
+
 class Q_DECLARATIVE_EXPORT QDeclarativeMetaType
 {
 public:
@@ -103,7 +105,6 @@ public:
     static QList<QDeclarativePrivate::AutoParentFunction> parentFunctions();
 };
 
-class QDeclarativeTypePrivate;
 class Q_DECLARATIVE_EXPORT QDeclarativeType
 {
 public:
@@ -144,11 +145,12 @@ public:
     int propertyValueInterceptorCast() const;
 
     int index() const;
+
 private:
     friend class QDeclarativeTypePrivate;
     friend struct QDeclarativeMetaTypeData;
-    friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &);
-    friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &);
+    friend int registerType(const QDeclarativePrivate::RegisterType &);
+    friend int registerInterface(const QDeclarativePrivate::RegisterInterface &);
     QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &);
     QDeclarativeType(int, const QDeclarativePrivate::RegisterType &);
     ~QDeclarativeType();
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index cd859fe..b2d7451 100644
--- a/src/declarative/qml/qdeclarativeprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -42,6 +42,17 @@
 #ifndef QDECLARATIVEPRIVATE_H
 #define QDECLARATIVEPRIVATE_H
 
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
 #include <QtCore/qglobal.h>
 #include <QtCore/qvariant.h>
 #ifndef Q_OS_WIN
@@ -177,6 +188,9 @@ namespace QDeclarativePrivate
         return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();
     }
 
+    enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent };
+    typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent);
+
     struct RegisterType {
         int version;
 
@@ -214,13 +228,19 @@ namespace QDeclarativePrivate
         const char *iid;
     };
 
-    enum AutoParentResult { Parented, IncompatibleObject, IncompatibleParent };
-    typedef AutoParentResult (*AutoParentFunction)(QObject *object, QObject *parent);
+    struct RegisterAutoParent {
+        int version;
 
-    int Q_DECLARATIVE_EXPORT registerAutoParentFunction(AutoParentFunction);
-    int Q_DECLARATIVE_EXPORT registerType(const RegisterType &);
-    int Q_DECLARATIVE_EXPORT registerType(const RegisterInterface &);
+        AutoParentFunction function;
+    };
+
+    enum RegistrationType {
+        TypeRegistration       = 0, 
+        InterfaceRegistration  = 1,
+        AutoParentRegistration = 2
+    };
 
+    int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *);
 }
 
 QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index 61e550a..98e9a58 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -74,7 +74,7 @@ int qmlRegisterValueTypeEnums(const char *qmlName)
         0
     };
 
-    return QDeclarativePrivate::registerType(type);
+    return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
 }
 
 QDeclarativeValueTypeFactory::QDeclarativeValueTypeFactory()
-- 
cgit v0.12


From be227b0a01bb28f3ebebedc1aaa65cd8098edd81 Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@nokia.com>
Date: Thu, 22 Jul 2010 10:27:58 +0200
Subject: Fix the smallFont test failure for Mac and Linux

Reviewed-by: Kim
---
 src/svg/qsvgstyle.cpp                        | 2 +-
 tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp
index 0d1bad9..f228a77 100644
--- a/src/svg/qsvgstyle.cpp
+++ b/src/svg/qsvgstyle.cpp
@@ -241,7 +241,7 @@ void QSvgFontStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &states
     }
 
     if (m_sizeSet)
-        font.setPointSize(m_qfont.pointSizeF());
+        font.setPointSizeF(m_qfont.pointSizeF());
 
     if (m_styleSet)
         font.setStyle(m_qfont.style());
diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index 519f4f5..69ae996 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -1356,7 +1356,9 @@ void tst_QSvgRenderer::smallFont()
         QByteArray data(svgs[i]);
         if (i == 0) {
             QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0");
+#ifdef Q_WS_WIN
             QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSize: Point size <= 0 (0), must be greater than 0");
+#endif
         }
         QSvgRenderer renderer(data);
         images[i] = QImage(50, 50, QImage::Format_ARGB32_Premultiplied);
-- 
cgit v0.12


From 2da1f6dd814381fde2a365a328de49761c507b3b Mon Sep 17 00:00:00 2001
From: Leandro Melo <leandro.melo@nokia.com>
Date: Thu, 22 Jul 2010 11:54:20 +0200
Subject: Docs: Additional HTML extraction marks for enumerations.

Reviewed-by: Martin Smith
---
 tools/qdoc3/htmlgenerator.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 9977df0..e840a7f 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4415,8 +4415,8 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType
                     out() << "$$$" + func->name() + func->rawParameters().remove(' ');
                 }
             } else if (node->type() == Node::Property) {
-                const PropertyNode *prop = static_cast<const PropertyNode *>(node);
                 out() << "-prop";
+                const PropertyNode *prop = static_cast<const PropertyNode *>(node);
                 const NodeList &list = prop->functions();
                 foreach (const Node *propFuncNode, list) {
                     if (propFuncNode->type() == Node::Function) {
@@ -4424,6 +4424,10 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType
                         out() << "$$$" + func->name() + func->rawParameters().remove(' ');
                     }
                 }
+            } else if (node->type() == Node::Enum) {
+                const EnumNode *enumNode = static_cast<const EnumNode *>(node);
+                foreach (const EnumItem &item, enumNode->items())
+                    out() << "$$$" + item.name();
             }
         } else if (markType == BriefMark) {
             out() << "-brief";
-- 
cgit v0.12


From d8908922f339892fee4275a433e2bf6da87ae055 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Thu, 22 Jul 2010 13:27:43 +0200
Subject: qdoc: Fixed reporting of read-only status for QML properties.

Task-number: QTBUG-11512
---
 .../graphicsitems/qdeclarativeanchors_p.h          |   6 +-
 .../graphicsitems/qdeclarativeimagebase.cpp        |   7 +
 src/declarative/graphicsitems/qdeclarativeitem.cpp |  20 +-
 .../graphicsitems/qdeclarativerepeater.cpp         |   1 -
 .../qdeclarativefolderlistmodel.cpp                |   2 +-
 src/imports/particles/qdeclarativeparticles.cpp    |   8 +-
 tools/qdoc3/cppcodeparser.cpp                      |  32 ++-
 tools/qdoc3/cppcodeparser.h                        |   1 +
 tools/qdoc3/ditaxmlgenerator.cpp                   |   2 +-
 tools/qdoc3/htmlgenerator.cpp                      |  13 +-
 tools/qdoc3/node.cpp                               | 218 +++++++++++++++++++--
 tools/qdoc3/node.h                                 |  18 +-
 tools/qdoc3/test/qt-cpp-ignore.qdocconf            |   4 +-
 tools/qdoc3/tokenizer.cpp                          |   6 +-
 tools/qdoc3/tokenizer.h                            |   2 +-
 tools/qdoc3/tree.cpp                               |   9 +-
 16 files changed, 281 insertions(+), 68 deletions(-)

diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
index 1bd7608..c929797 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h
@@ -70,11 +70,11 @@ class Q_DECLARATIVE_EXPORT QDeclarativeAnchors : public QObject
     Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged)
     Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
     Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
-    Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged())
+    Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged)
     Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
     Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
-    Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged())
-    Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged())
+    Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged)
+    Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
     Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged)
     Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
 
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index 67f2327..ba40443 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -50,6 +50,13 @@
 
 QT_BEGIN_NAMESPACE
 
+
+/*!
+    \class QDeclarativeImageBase
+    \internal
+    \brief The base class for declarative images.
+ */
+
 QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent)
   : QDeclarativeItem(dd, parent)
 {
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 9a1a1a0..0c1a7af 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
 */
 
 /*!
-    \qmlclass Translate QGraphicsTranslate
+    \qmlclass Translate QDeclarativeTranslate
     \since 4.7
     \brief The Translate object provides a way to move an Item without changing its x or y properties.
 
@@ -420,7 +420,7 @@ void QDeclarativeItemKeyFilter::componentComplete()
 
 
 /*!
-    \qmlclass KeyNavigation
+    \qmlclass KeyNavigation QDeclarativeKeyNavigationAttached
     \since 4.7
     \brief The KeyNavigation attached property supports key navigation by arrow keys.
 
@@ -714,7 +714,7 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
 }
 
 /*!
-    \qmlclass Keys
+    \qmlclass Keys QDeclarativeKeysAttached
     \since 4.7
     \brief The Keys attached property provides key handling to Items.
 
@@ -2047,20 +2047,6 @@ QDeclarativeAnchorLine QDeclarativeItemPrivate::baseline() const
 }
 
 /*!
-  \qmlproperty AnchorLine Item::top
-  \qmlproperty AnchorLine Item::bottom
-  \qmlproperty AnchorLine Item::left
-  \qmlproperty AnchorLine Item::right
-  \qmlproperty AnchorLine Item::horizontalCenter
-  \qmlproperty AnchorLine Item::verticalCenter
-  \qmlproperty AnchorLine Item::baseline
-
-  The anchor lines of the item.
-
-  For more information see \l {anchor-layout}{Anchor Layouts}.
-*/
-
-/*!
   \qmlproperty AnchorLine Item::anchors.top
   \qmlproperty AnchorLine Item::anchors.bottom
   \qmlproperty AnchorLine Item::anchors.left
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 3be4014..2b268fb 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -148,7 +148,6 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
 /*!
     \internal
     \class QDeclarativeRepeater
-    \qmlclass Repeater
  */
 
 /*!
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
index 9cf81ca..2f4d1df 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -93,7 +93,7 @@ public:
 };
 
 /*!
-    \qmlclass FolderListModel
+    \qmlclass FolderListModel QDeclarativeFolderListModel
     \brief The FolderListModel provides a model of the contents of a folder in a filesystem.
 
     FolderListModel provides access to the local filesystem.  The \e folder property
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index e95dfc7..916021c 100644
--- a/src/imports/particles/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -153,7 +153,7 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle)
 }
 
 /*!
-    \qmlclass ParticleMotionLinear
+    \qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear
     \since 4.7
     \brief The ParticleMotionLinear object moves particles linearly.
 
@@ -174,7 +174,7 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte
 }
 
 /*!
-    \qmlclass ParticleMotionGravity
+    \qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity
     \since 4.7
     \brief The ParticleMotionGravity object moves particles towards a point.
 
@@ -257,7 +257,7 @@ void QDeclarativeParticleMotionGravity::advance(QDeclarativeParticle &p, int int
 }
 
 /*!
-    \qmlclass ParticleMotionWander
+    \qmlclass ParticleMotionWander QDeclarativeParticleMotionWander
     \since 4.7
     \brief The ParticleMotionWander object moves particles in a somewhat random fashion.
 
@@ -620,7 +620,7 @@ void QDeclarativeParticlesPrivate::updateOpacity(QDeclarativeParticle &p, int ag
 }
 
 /*!
-    \qmlclass Particles
+    \qmlclass Particles QDeclarativeParticles
     \since 4.7
     \brief The Particles object generates and moves particles.
     \inherits Item
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index d5108fd..a120e45 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -1120,6 +1120,17 @@ bool CppCodeParser::match(int target)
 }
 
 /*!
+  Skip to \a target. If \a target is found before the end
+  of input, return true. Otherwise return false.
+ */
+bool CppCodeParser::skipTo(int target)
+{
+    while ((tok != Tok_Eoi) && (tok != target))
+        readToken();
+    return (tok == target ? true : false);
+}
+
+/*!
   If the current token is one of the keyword thingees that
   are used in Qt, skip over it to the next token and return
   true. Otherwise just return false without reading the
@@ -1362,7 +1373,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent,
 
     if (!matchDataType(&returnType)) {
         if (tokenizer->parsingFnOrMacro()
-                && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY)))
+                && (match(Tok_Q_DECLARE_FLAGS) ||
+                    match(Tok_Q_PROPERTY) ||
+                    match(Tok_Q_PRIVATE_PROPERTY)))
             returnType = CodeChunk(previousLexeme());
         else {
             return false;
@@ -1796,11 +1809,19 @@ bool CppCodeParser::matchTypedefDecl(InnerNode *parent)
 
 bool CppCodeParser::matchProperty(InnerNode *parent)
 {
-    if (!match(Tok_Q_PROPERTY) &&
-        !match(Tok_Q_OVERRIDE) &&
-        !match(Tok_QDOC_PROPERTY))
+    int expected_tok = Tok_LeftParen;
+    if (match(Tok_Q_PRIVATE_PROPERTY)) {
+        expected_tok = Tok_Comma;
+        if (!skipTo(Tok_Comma))
+            return false;
+    }
+    else if (!match(Tok_Q_PROPERTY) &&
+             !match(Tok_Q_OVERRIDE) &&
+             !match(Tok_QDOC_PROPERTY)) {
         return false;
-    if (!match(Tok_LeftParen))
+    }
+    
+    if (!match(expected_tok))
         return false;
 
     QString name;
@@ -1949,6 +1970,7 @@ bool CppCodeParser::matchDeclList(InnerNode *parent)
             break;
         case Tok_Q_OVERRIDE:
         case Tok_Q_PROPERTY:
+        case Tok_Q_PRIVATE_PROPERTY:
         case Tok_QDOC_PROPERTY:
             matchProperty(parent);
             break;
diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h
index 3c53f72..55d9ddf 100644
--- a/tools/qdoc3/cppcodeparser.h
+++ b/tools/qdoc3/cppcodeparser.h
@@ -119,6 +119,7 @@ class CppCodeParser : public CodeParser
     QString previousLexeme();
     QString lexeme();
     bool match(int target);
+    bool skipTo(int target);
     bool matchCompat();
     bool matchTemplateAngles(CodeChunk *type = 0);
     bool matchTemplateHeader();
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index d7a9c9e..4789c67 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -4210,7 +4210,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(const Node *node,
 				out() << "<td><p>";
                 //out() << "<tr><td>"; // old
                 out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
-                if (!qpn->isWritable())
+                if (!qpn->isWritable(myTree))
                     out() << "<span class=\"qmlreadonly\">read-only</span>";
                 if (qpgn->isDefault())
                     out() << "<span class=\"qmldefault\">default</span>";
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index f281fd4..071c522 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4094,8 +4094,11 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
                 out() << "<td class=\"tblQmlPropNode\"><p>";
 
                 out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
-                if (!qpn->isWritable())
+
+                if (!qpn->isWritable(myTree)) {
+                    qDebug() << "QPN:" << qpn->name();
                     out() << "<span class=\"qmlreadonly\">read-only</span>";
+                }
                 if (qpgn->isDefault())
                     out() << "<span class=\"qmldefault\">default</span>";
                 generateQmlItem(qpn, relative, marker, false);
@@ -4111,10 +4114,10 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
         out() << "<div class=\"qmlproto\">";
         out() << "<table class=\"qmlname\">";
         //out() << "<tr>";
-		if (++numTableRows % 2 == 1)
-			out() << "<tr class=\"odd\">";
-		else
-			out() << "<tr class=\"even\">";
+        if (++numTableRows % 2 == 1)
+            out() << "<tr class=\"odd\">";
+        else
+            out() << "<tr class=\"even\">";
         out() << "<td class=\"tblQmlFuncNode\"><p>";
         out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
         generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index da62e29..28347c3 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -44,6 +44,8 @@
 */
 
 #include "node.h"
+#include "tree.h"
+#include "codemarker.h"
 #include <qdebug.h>
 
 QT_BEGIN_NAMESPACE
@@ -171,6 +173,32 @@ QString Node::accessString() const
     return "public";
 }
 
+/*!
+  Extract a class name from the type \a string and return it.
+ */
+QString Node::extractClassName(const QString &string) const
+{
+    QString result;
+    for (int i=0; i<=string.size(); ++i) {
+        QChar ch;
+        if (i != string.size())
+            ch = string.at(i);
+
+        QChar lower = ch.toLower();
+        if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) ||
+            ch.digitValue() >= 0 ||
+            ch == QLatin1Char('_') ||
+            ch == QLatin1Char(':')) {
+            result += ch;
+        }
+        else if (!result.isEmpty()) {
+            if (result != QLatin1String("const"))
+                return result;
+            result.clear();
+        }
+    }
+    return result;
+}
 
 /*!
   Returns a string representing the access specifier.
@@ -426,6 +454,9 @@ void InnerNode::setOverload(const FunctionNode *func, bool overlode)
 }
 
 /*!
+  Mark all child nodes that have no documentation as having
+  private access and internal status. qdoc will then ignore
+  them for documentation purposes.
  */
 void InnerNode::makeUndocumentedChildrenInternal()
 {
@@ -831,6 +862,7 @@ NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
 
 /*!
   \class ClassNode
+  \brief This class represents a C++ class.
  */
 
 /*!
@@ -850,8 +882,8 @@ void ClassNode::addBaseClass(Access access,
                              ClassNode *node,
                              const QString &dataTypeWithTemplateArgs)
 {
-    bas.append(RelatedClass(access, node, dataTypeWithTemplateArgs));
-    node->der.append(RelatedClass(access, this));
+    bases.append(RelatedClass(access, node, dataTypeWithTemplateArgs));
+    node->derived.append(RelatedClass(access, this));
 }
 
 /*!
@@ -859,16 +891,16 @@ void ClassNode::addBaseClass(Access access,
 void ClassNode::fixBaseClasses()
 {
     int i;
-
     i = 0;
-    while (i < bas.size()) {
-        ClassNode *baseClass = bas.at(i).node;
-        if (baseClass->access() == Node::Private) {
-            bas.removeAt(i);
-
-            const QList<RelatedClass> &basesBases = baseClass->baseClasses();
-            for (int j = basesBases.size() - 1; j >= 0; --j)
-                bas.insert(i, basesBases.at(j));
+    while (i < bases.size()) {
+        ClassNode* bc = bases.at(i).node;
+        if (bc->access() == Node::Private) {
+            RelatedClass rc = bases.at(i);
+            bases.removeAt(i);
+            ignoredBases.append(rc);
+            const QList<RelatedClass> &bb = bc->baseClasses();
+            for (int j = bb.size() - 1; j >= 0; --j)
+                bases.insert(i, bb.at(j));
         }
         else {
             ++i;
@@ -876,15 +908,13 @@ void ClassNode::fixBaseClasses()
     }
 
     i = 0;
-    while (i < der.size()) {
-        ClassNode *derivedClass = der.at(i).node;
-        if (derivedClass->access() == Node::Private) {
-            der.removeAt(i);
-
-            const QList<RelatedClass> &dersDers =
-                derivedClass->derivedClasses();
-            for (int j = dersDers.size() - 1; j >= 0; --j)
-                der.insert(i, dersDers.at(j));
+    while (i < derived.size()) {
+        ClassNode* dc = derived.at(i).node;
+        if (dc->access() == Node::Private) {
+            derived.removeAt(i);
+            const QList<RelatedClass> &dd = dc->derivedClasses();
+            for (int j = dd.size() - 1; j >= 0; --j)
+                derived.insert(i, dd.at(j));
         }
         else {
             ++i;
@@ -893,6 +923,16 @@ void ClassNode::fixBaseClasses()
 }
 
 /*!
+  Search the child list to find the property node with the
+  specified \a name.
+ */
+const PropertyNode* ClassNode::findPropertyNode(const QString& name) const
+{
+    const Node* n = findNode(name,Node::Property);
+    return (n ? static_cast<const PropertyNode*>(n) : 0);
+}
+
+/*!
   \class FakeNode
  */
 
@@ -1567,6 +1607,144 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue)
         return defaultValue;
     }
 }
+
+static QString valueType(const QString& n)
+{
+    if (n == "QPoint")
+        return "QDeclarativePointValueType";
+    if (n == "QPointF")
+        return "QDeclarativePointFValueType";
+    if (n == "QSize")
+        return "QDeclarativeSizeValueType";
+    if (n == "QSizeF")
+        return "QDeclarativeSizeFValueType";
+    if (n == "QRect")
+        return "QDeclarativeRectValueType";
+    if (n == "QRectF")
+        return "QDeclarativeRectFValueType";
+    if (n == "QVector2D")
+        return "QDeclarativeVector2DValueType";
+    if (n == "QVector3D")
+        return "QDeclarativeVector3DValueType";
+    if (n == "QVector4D")
+        return "QDeclarativeVector4DValueType";
+    if (n == "QQuaternion")
+        return "QDeclarativeQuaternionValueType";
+    if (n == "QMatrix4x4")
+        return "QDeclarativeMatrix4x4ValueType";
+    if (n == "QEasingCurve")
+        return "QDeclarativeEasingValueType";
+    if (n == "QFont")
+        return "QDeclarativeFontValueType";
+    return QString();
+}
+
+/*!
+  Returns true if a QML property or attached property is
+  read-only. The algorithm for figuring this out is long
+  amd tedious and almost certainly will break. It currently
+  doesn't work for qmlproperty bool PropertyChanges::explicit,
+  because the tokenized gets confused on "explicit" .
+ */
+bool QmlPropertyNode::isWritable(const Tree* tree) const
+{
+    Node* n = parent();
+    while (n && n->subType() != Node::QmlClass)
+        n = n->parent();
+    if (n) {
+        const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
+        const ClassNode* cn = qcn->classNode();
+        if (cn) {
+            QStringList dotSplit = name().split(QChar('.'));
+            const PropertyNode* pn = cn->findPropertyNode(dotSplit[0]);
+            if (pn) {
+                if (dotSplit.size() > 1) {
+                    QStringList path(extractClassName(pn->qualifiedDataType()));
+                    const Node* nn = tree->findNode(path,Class);
+                    if (nn) {
+                        const ClassNode* cn = static_cast<const ClassNode*>(nn);
+                        pn = cn->findPropertyNode(dotSplit[1]);
+                        if (pn) {
+                            return pn->isWritable();
+                        }
+                        else {
+                            const QList<RelatedClass>& bases = cn->baseClasses();
+                            if (!bases.isEmpty()) {
+                                for (int i=0; i<bases.size(); ++i) {
+                                    const ClassNode* cn = bases[i].node;
+                                    pn = cn->findPropertyNode(dotSplit[1]);
+                                    if (pn) {
+                                        return pn->isWritable();
+                                    }
+                                }
+                            }
+                            const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses();
+                            if (!ignoredBases.isEmpty()) {
+                                for (int i=0; i<ignoredBases.size(); ++i) {
+                                    const ClassNode* cn = ignoredBases[i].node;
+                                    pn = cn->findPropertyNode(dotSplit[1]);
+                                    if (pn) {
+                                        return pn->isWritable();
+                                    }
+                                }
+                            }
+                            QString vt = valueType(cn->name());
+                            if (!vt.isEmpty()) {
+                                QStringList path(vt);
+                                const Node* vtn = tree->findNode(path,Class);
+                                if (vtn) {
+                                    const ClassNode* cn = static_cast<const ClassNode*>(vtn);
+                                    pn = cn->findPropertyNode(dotSplit[1]);
+                                    if (pn) {
+                                        return pn->isWritable();
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                else {
+                    return pn->isWritable();
+                }
+            }
+            else {
+                const QList<RelatedClass>& bases = cn->baseClasses();
+                if (!bases.isEmpty()) {
+                    for (int i=0; i<bases.size(); ++i) {
+                        const ClassNode* cn = bases[i].node;
+                        pn = cn->findPropertyNode(dotSplit[0]);
+                        if (pn) {
+                            return pn->isWritable();
+                        }
+                    }
+                }
+                const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses();
+                if (!ignoredBases.isEmpty()) {
+                    for (int i=0; i<ignoredBases.size(); ++i) {
+                        const ClassNode* cn = ignoredBases[i].node;
+                        pn = cn->findPropertyNode(dotSplit[0]);
+                        if (pn) {
+                            return pn->isWritable();
+                        }
+                    }
+                }
+                if (isAttached()) {
+                    QString classNameAttached = cn->name() + "Attached";
+                    QStringList path(classNameAttached);
+                    const Node* nn = tree->findNode(path,Class);
+                    const ClassNode* acn = static_cast<const ClassNode*>(nn);
+                    pn = acn->findPropertyNode(dotSplit[0]);
+                    if (pn) {
+                        return pn->isWritable();
+                    }
+                }
+            }
+        }
+    }
+    location().warning(tr("Can't determine read-only status of QML property %1; writable assumed.").arg(name()));
+    return true;
+}
+
 #endif
 
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index e9f2d74..3cc0f60 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -193,6 +193,7 @@ class Node
     virtual QString fileBase() const;
     QUuid guid() const;
     QString ditaXmlHref();
+    QString extractClassName(const QString &string) const;
 
  protected:
     Node(Type type, InnerNode* parent, const QString& name);
@@ -326,6 +327,8 @@ struct RelatedClass
     QString             dataTypeWithTemplateArgs;
 };
 
+class PropertyNode;
+
 class ClassNode : public InnerNode
 {
  public:
@@ -337,8 +340,9 @@ class ClassNode : public InnerNode
                       const QString &dataTypeWithTemplateArgs = "");
     void fixBaseClasses();
 
-    const QList<RelatedClass> &baseClasses() const { return bas; }
-    const QList<RelatedClass> &derivedClasses() const { return der; }
+    const QList<RelatedClass> &baseClasses() const { return bases; }
+    const QList<RelatedClass> &derivedClasses() const { return derived; }
+    const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases; }
 
     bool hideFromMainList() const { return hidden; }
     void setHideFromMainList(bool value) { hidden = value; }
@@ -349,10 +353,12 @@ class ClassNode : public InnerNode
     void setQmlElement(const QString& value) { qmlelement = value; }
     virtual bool isAbstract() const { return abstract; }
     virtual void setAbstract(bool b) { abstract = b; }
+    const PropertyNode* findPropertyNode(const QString& name) const;
 
  private:
-    QList<RelatedClass> bas;
-    QList<RelatedClass> der;
+    QList<RelatedClass> bases;
+    QList<RelatedClass> derived;
+    QList<RelatedClass> ignoredBases;
     bool hidden;
     bool abstract;
     QString sname;
@@ -436,6 +442,8 @@ class QmlPropGroupNode : public FakeNode
     bool    att;
 };
 
+class Tree;
+
 class QmlPropertyNode : public LeafNode
 {
  public:
@@ -454,7 +462,7 @@ class QmlPropertyNode : public LeafNode
     QString qualifiedDataType() const { return dt; }
     bool isStored() const { return fromTrool(sto,true); }
     bool isDesignable() const { return fromTrool(des,false); }
-    bool isWritable() const { return fromTrool(wri,true); }
+    bool isWritable(const Tree* tree) const;
     bool isAttached() const { return att; }
     virtual bool isQmlNode() const { return true; }
 
diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
index 8cc4fd9..4963b96 100644
--- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf
+++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf
@@ -91,4 +91,6 @@ Cpp.ignoredirectives    = Q_DECLARE_HANDLE \
                           K_DECLARE_PRIVATE \
                           PHONON_OBJECT \
                           PHONON_HEIR \
-			  Q_PRIVATE_PROPERTY
+			  Q_PRIVATE_PROPERTY \
+			  Q_DECLARE_PRIVATE_D \
+			  Q_CLASSINFO
diff --git a/tools/qdoc3/tokenizer.cpp b/tools/qdoc3/tokenizer.cpp
index 7c10de6..05ad5ee 100644
--- a/tools/qdoc3/tokenizer.cpp
+++ b/tools/qdoc3/tokenizer.cpp
@@ -67,7 +67,11 @@ static const char *kwords[] = {
     "private", "protected", "public", "short", "signals", "signed",
     "slots", "static", "struct", "template", "typedef", "typename",
     "union", "unsigned", "using", "virtual", "void", "volatile",
-    "__int64", "Q_OBJECT", "Q_OVERRIDE", "Q_PROPERTY",
+    "__int64",
+    "Q_OBJECT",
+    "Q_OVERRIDE",
+    "Q_PROPERTY",
+    "Q_PRIVATE_PROPERTY",
     "Q_DECLARE_SEQUENTIAL_ITERATOR",
     "Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR",
     "Q_DECLARE_ASSOCIATIVE_ITERATOR",
diff --git a/tools/qdoc3/tokenizer.h b/tools/qdoc3/tokenizer.h
index f55d2ef..bd35965 100644
--- a/tools/qdoc3/tokenizer.h
+++ b/tools/qdoc3/tokenizer.h
@@ -75,7 +75,7 @@ enum { Tok_Eoi, Tok_Ampersand, Tok_Aster, Tok_Caret, Tok_LeftParen,
        Tok_static, Tok_struct, Tok_template, Tok_typedef, 
        Tok_typename, Tok_union, Tok_unsigned, Tok_using, Tok_virtual,
        Tok_void, Tok_volatile, Tok_int64, Tok_Q_OBJECT, Tok_Q_OVERRIDE, 
-       Tok_Q_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
+       Tok_Q_PROPERTY, Tok_Q_PRIVATE_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
        Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR, 
        Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR,
        Tok_Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR, 
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index d22a09a..56e3484 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -469,8 +469,9 @@ void Tree::resolveInheritance(NamespaceNode *rootNode)
     for (int pass = 0; pass < 2; pass++) {
         NodeList::ConstIterator c = rootNode->childNodes().begin();
         while (c != rootNode->childNodes().end()) {
-            if ((*c)->type() == Node::Class)
+            if ((*c)->type() == Node::Class) {
                 resolveInheritance(pass, (ClassNode *) *c);
+            }
             else if ((*c)->type() == Node::Namespace) {
                 NamespaceNode *ns = static_cast<NamespaceNode*>(*c);
                 resolveInheritance(ns);
@@ -542,14 +543,16 @@ void Tree::resolveInheritance(int pass, ClassNode *classe)
 	while (b != bounds.end()) {
 	    ClassNode *baseClass = (ClassNode*)findNode((*b).basePath,
                                                         Node::Class);
-            if (!baseClass && (*b).parent)
+            if (!baseClass && (*b).parent) {
                 baseClass = (ClassNode*)findNode((*b).basePath,
                                                  Node::Class,
                                                  (*b).parent);
-	    if (baseClass)
+            }
+	    if (baseClass) {
 		classe->addBaseClass((*b).access,
                                      baseClass,
                                      (*b).dataTypeWithTemplateArgs);
+            }
 	    ++b;
 	}
     }
-- 
cgit v0.12


From 6240f4a990d2f0b4a4b24c823f8875ca3b8226a4 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 22 Jul 2010 13:16:35 +0200
Subject: Switch the default value for configure's -separate-debug-info to
 "no".

The "yes" case slows us down on several occasions: (a) the CRC version used
slows down loading debug info when debugging a Qt application significantly,
(b) it does not work wit gdb 7.2's dwarf indexing (again, much slower
startup), and (c) (less important) the stripping takes extra time for each of
us when building Qt.

The flag is still supported for distributions or individuals that want to use it.

Reviewed-by: brad
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index b92a3f7..ae23509 100755
--- a/configure
+++ b/configure
@@ -733,7 +733,7 @@ CFG_OPENSSL=auto
 CFG_PTMALLOC=no
 CFG_STL=auto
 CFG_PRECOMPILE=auto
-CFG_SEPARATE_DEBUG_INFO=auto
+CFG_SEPARATE_DEBUG_INFO=no
 CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
 CFG_REDUCE_EXPORTS=auto
 CFG_MMX=auto
@@ -2307,7 +2307,7 @@ fi
 if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
     echo
     echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
-    echo "By default, Qt is built in release mode with separate debug information, so"
+    echo "Qt can be built in release mode with separate debug information, so"
     echo "-debug-and-release is not necessary anymore"
     echo
 fi
-- 
cgit v0.12


From e8cdf0c57e269489c4759ddfec04daa4f093a13f Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Thu, 22 Jul 2010 13:58:49 +0200
Subject: qdoc: Removed debug code.

---
 tools/qdoc3/htmlgenerator.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 2382bbd..1c1921b 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4109,7 +4109,6 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node,
                 out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
 
                 if (!qpn->isWritable(myTree)) {
-                    qDebug() << "QPN:" << qpn->name();
                     out() << "<span class=\"qmlreadonly\">read-only</span>";
                 }
                 if (qpgn->isDefault())
-- 
cgit v0.12


From bf15a487e4e0b5d4edca232258526e0d3cf471a0 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Wed, 21 Jul 2010 19:54:56 +0200
Subject: Premultiply the color table instead of each pixel for image
 conversion

When converting indexed images in place, each color was converted to
premultiplied. Instead, we can just convert the color table like it
is done in the non-in-place version.

Reviewed-by: Kim
---
 src/gui/image/qimage.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index e5930ac..e8c01c7 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2343,6 +2343,9 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
         data->colortable.resize(256);
         for (int i = 0; i < 256; ++i)
             data->colortable[i] = qRgb(i, i, i);
+    } else {
+        for (int i = 0; i < data->colortable.size(); ++i)
+            data->colortable[i] = PREMUL(data->colortable.at(i));
     }
     const int tableSize = data->colortable.size() - 1;
 
@@ -2352,11 +2355,11 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
         for (int pixI = 0; pixI < width; ++pixI) {
             --src_data;
             --dest_data;
-            const uint pixel = data->colortable[qMin<int>(tableSize, *src_data)];
-            *dest_data = (quint32) PREMUL(pixel);
+            *dest_data = data->colortable[qMin<int>(tableSize, *src_data)];
         }
     }
 
+    data->colortable = QVector<QRgb>();
     data->format = QImage::Format_ARGB32_Premultiplied;
     data->bytes_per_line = dst_bytes_per_line;
     data->depth = depth;
@@ -2401,6 +2404,7 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
         }
     }
 
+    data->colortable = QVector<QRgb>();
     data->format = QImage::Format_RGB32;
     data->bytes_per_line = dst_bytes_per_line;
     data->depth = depth;
@@ -2446,6 +2450,7 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
         }
     }
 
+    data->colortable = QVector<QRgb>();
     data->format = QImage::Format_RGB16;
     data->bytes_per_line = dst_bytes_per_line;
     data->depth = depth;
-- 
cgit v0.12


From 04db5e3722c9f3e32f2a0a03962abc9456139883 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Thu, 22 Jul 2010 12:54:57 +0200
Subject: Avoid qMin() for each pixel when converting indexed colors in-place

Instead of checking if the value is in boundary for each pixel, we
can fill the color table with 256 value and convert the colors directly.

This optimization is an idea of Kim Kalland.

Reviewed-by: Kim
Reviewed-by: Olivier Goffart
---
 src/gui/image/qimage.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index e8c01c7..dc70dcb 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2346,8 +2346,12 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
     } else {
         for (int i = 0; i < data->colortable.size(); ++i)
             data->colortable[i] = PREMUL(data->colortable.at(i));
+
+        // Fill the rest of the table in case src_data > colortable.size()
+        const int oldSize = data->colortable.size();
+        const QRgb lastColor = data->colortable.at(oldSize - 1);
+        data->colortable.insert(oldSize, 256 - oldSize, lastColor);
     }
-    const int tableSize = data->colortable.size() - 1;
 
     for (int i = 0; i < data->height; ++i) {
         src_data -= src_pad;
@@ -2355,7 +2359,7 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
         for (int pixI = 0; pixI < width; ++pixI) {
             --src_data;
             --dest_data;
-            *dest_data = data->colortable[qMin<int>(tableSize, *src_data)];
+            *dest_data = data->colortable.at(*src_data);
         }
     }
 
@@ -2391,8 +2395,12 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
         data->colortable.resize(256);
         for (int i = 0; i < 256; ++i)
             data->colortable[i] = qRgb(i, i, i);
+    } else {
+        // Fill the rest of the table in case src_data > colortable.size()
+        const int oldSize = data->colortable.size();
+        const QRgb lastColor = data->colortable.at(oldSize - 1);
+        data->colortable.insert(oldSize, 256 - oldSize, lastColor);
     }
-    const int tableSize = data->colortable.size() - 1;
 
     for (int i = 0; i < data->height; ++i) {
         src_data -= src_pad;
@@ -2400,7 +2408,7 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
         for (int pixI = 0; pixI < width; ++pixI) {
             --src_data;
             --dest_data;
-            *dest_data = (quint32) data->colortable[qMin<int>(tableSize, *src_data)];
+            *dest_data = (quint32) data->colortable.at(*src_data);
         }
     }
 
-- 
cgit v0.12


From c4bea746a3a94e8484b88a3a337e17591ce1d3c8 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Thu, 22 Jul 2010 13:53:54 +0200
Subject: Improve the conversion from indexted to RGB16

Instead of converting each color, we create a color table with the
RGB16 colors. The conversion can be done for each pixel directly
with the table.

Reviewed-by: Kim
Reviewed-by: Olivier Goffart
---
 src/gui/image/qimage.cpp | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index dc70dcb..713e765 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2440,12 +2440,23 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
     const int width = data->width;
     const int src_pad = data->bytes_per_line - width;
     const int dest_pad = (dst_bytes_per_line >> 1) - width;
-    if (data->colortable.size() == 0) {
-        data->colortable.resize(256);
+
+    quint16 colorTableRGB16[256];
+    if (data->colortable.isEmpty()) {
         for (int i = 0; i < 256; ++i)
-            data->colortable[i] = qRgb(i, i, i);
+            colorTableRGB16[i] = qt_colorConvert<quint16, quint32>(qRgb(i, i, i), 0);
+    } else {
+        // 1) convert the existing colors to RGB16
+        const int tableSize = data->colortable.size();
+        for (int i = 0; i < tableSize; ++i)
+            colorTableRGB16[i] = qt_colorConvert<quint16, quint32>(data->colortable.at(i), 0);
+        data->colortable = QVector<QRgb>();
+
+        // 2) fill the rest of the table in case src_data > colortable.size()
+        const quint16 lastColor = colorTableRGB16[tableSize - 1];
+        for (int i = tableSize; i < 256; ++i)
+            colorTableRGB16[i] = lastColor;
     }
-    const int tableSize = data->colortable.size() - 1;
 
     for (int i = 0; i < data->height; ++i) {
         src_data -= src_pad;
@@ -2453,12 +2464,10 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
         for (int pixI = 0; pixI < width; ++pixI) {
             --src_data;
             --dest_data;
-            const uint pixel = data->colortable[qMin<int>(tableSize, *src_data)];
-            *dest_data = qt_colorConvert<quint16, quint32>(pixel, 0);
+            *dest_data = colorTableRGB16[*src_data];
         }
     }
 
-    data->colortable = QVector<QRgb>();
     data->format = QImage::Format_RGB16;
     data->bytes_per_line = dst_bytes_per_line;
     data->depth = depth;
-- 
cgit v0.12


From 88410105978d5fb4344207cd5d296057ced0f27d Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Thu, 22 Jul 2010 14:52:29 +0200
Subject: Drag & Drop failing in itemviews on Cocoa.

While generating the QDragMoveEvent, we were always reusing the last
drop action set by the user. This is not correct, we should copy the action
only if a valid action set before. This is the behavior on Windows.

Task-number: QTBUG-9486
Reviewed-by: Denis
---
 src/gui/kernel/qcocoaview_mac.mm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 1935531..a552ce7 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -390,7 +390,10 @@ static int qCocoaViewCount = 0;
     if (QDragManager::self()->source())
         mimeData = QDragManager::self()->dragPrivate()->data;
     QDragMoveEvent qDMEvent(posDrag, qtAllowed, mimeData, QApplication::mouseButtons(), modifiers);
-    qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction);
+    if (QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction != Qt::IgnoreAction
+        && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).buttons == qDMEvent.mouseButtons()
+        && QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).modifiers == qDMEvent.keyboardModifiers())
+        qDMEvent.setDropAction(QT_PREPEND_NAMESPACE(qt_mac_dnd_answer_rec).lastAction);
     qDMEvent.accept();
     QApplication::sendEvent(qwidget, &qDMEvent);
 
-- 
cgit v0.12


From 7c086ff4e735f699451124b0fdbc380480dd418b Mon Sep 17 00:00:00 2001
From: Andy Shaw <andy.shaw@nokia.com>
Date: Thu, 22 Jul 2010 16:25:44 +0200
Subject: Remove a warning message that no longer appears after all on Windows

Reviewed-by: TrustMe
---
 tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index 69ae996..02e2921 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -1354,12 +1354,8 @@ void tst_QSvgRenderer::smallFont()
 
     for (int i = 0; i < COUNT; ++i) {
         QByteArray data(svgs[i]);
-        if (i == 0) {
+        if (i == 0)
             QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0");
-#ifdef Q_WS_WIN
-            QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSize: Point size <= 0 (0), must be greater than 0");
-#endif
-        }
         QSvgRenderer renderer(data);
         images[i] = QImage(50, 50, QImage::Format_ARGB32_Premultiplied);
         images[i].fill(-1);
-- 
cgit v0.12


From ee95770c89306ee5c2fb00c95dfc51f96c384049 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 22 Jul 2010 16:30:52 +0200
Subject: Fixed an incorrect profile inclusion.

RevBy:    Trust me
---
 src/sql/drivers/sqlite/qsql_sqlite.pri | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sql/drivers/sqlite/qsql_sqlite.pri b/src/sql/drivers/sqlite/qsql_sqlite.pri
index 3560c64..78a4e49 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.pri
+++ b/src/sql/drivers/sqlite/qsql_sqlite.pri
@@ -1,7 +1,7 @@
 HEADERS += $$PWD/qsql_sqlite.h
 SOURCES += $$PWD/qsql_sqlite.cpp
 
-symbian:include(../../plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri)
+symbian:include($$QT_SOURCE_TREE/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri)
 
 !system-sqlite:!contains(LIBS, .*sqlite3.*) {
     include($$PWD/../../../3rdparty/sqlite.pri)
-- 
cgit v0.12


From 3949e198e991d81061696e153309c113b95aa49c Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 22 Jul 2010 16:31:37 +0200
Subject: Automatically disabled unsupported modules for certain compilers.

RevBy:    Trust me
---
 configure | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure b/configure
index b92a3f7..85ab3fc 100755
--- a/configure
+++ b/configure
@@ -7080,6 +7080,13 @@ EOF
         canBuildWebKit="no"
         canBuildQtConcurrent="no"
 	;;
+    symbian/*-gcce)
+        canBuildWebKit="no"
+        canBuildQtConcurrent="no"
+        ;;
+    symbian/*-armcc)
+        canBuildQtConcurrent="no"
+        ;;
 esac
 
 if [ "$CFG_GUI" = "no" ]; then
-- 
cgit v0.12


From 34f8befe468435e97ed6498784b13cdf74d6ead5 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 22 Jul 2010 16:33:53 +0200
Subject: Made the makefile build system use QMAKE_CFLAGS.xxx properly.

Previously, the variable would be appended too soon, so not all
values would be included. Now it is one of the last steps.

RevBy:    Trust me
---
 mkspecs/features/symbian/symbian_building.prf | 8 ++++++++
 mkspecs/symbian/linux-armcc/qmake.conf        | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index ce124ec..073ef18 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -1,3 +1,11 @@
+linux-armcc {
+    QMAKE_CFLAGS += $$QMAKE_CFLAGS.ARMCC
+    QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.ARMCC
+} else:linux-gcce {
+    QMAKE_CFLAGS += $$QMAKE_CFLAGS.GCCE
+    QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.GCCE
+}
+
 # We need a target name without the INFIX'ed part, since flags are not infixed.
 equals(QMAKE_TARGET_PRODUCT, Qt4):clean_TARGET = $$replace(TARGET, "$${QT_LIBINFIX}$", "")
 else:clean_TARGET = $$TARGET
diff --git a/mkspecs/symbian/linux-armcc/qmake.conf b/mkspecs/symbian/linux-armcc/qmake.conf
index 77fb1ea..f8072e3 100644
--- a/mkspecs/symbian/linux-armcc/qmake.conf
+++ b/mkspecs/symbian/linux-armcc/qmake.conf
@@ -31,8 +31,8 @@ QMAKE_QtWebKit_CXXFLAGS	=  --arm
 # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000.
 QMAKE_QtWebKit_LFLAGS	=  --rw-base 0xE00000
 
-QMAKE_CFLAGS		+= --dllimport_runtime --preinclude rvct2_2.h  --diag_suppress 186,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --no_vfe --apcs /inter $$QMAKE_CFLAGS.ARMCC
-QMAKE_CXXFLAGS		+= $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS.ARMCC
+QMAKE_CFLAGS		+= --dllimport_runtime --preinclude rvct2_2.h  --diag_suppress 186,611,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --no_vfe --apcs /inter
+QMAKE_CXXFLAGS		+= $$QMAKE_CFLAGS
 QMAKE_LFLAGS      	+=  --symver_soname --diag_suppress 6331,6780 --bpabi --reloc --datacompressor=off --split --dll --no_scanlib
 QMAKE_LFLAGS_APP        += --entry _E32Startup
 QMAKE_LFLAGS_SHLIB      += --entry _E32Dll
-- 
cgit v0.12


From 4280c4c72fcd04e9061e08fb30f73fbd9f88b850 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 22 Jul 2010 16:33:12 +0200
Subject: Removed some warnings from armcc that are unneeded.

RevBy:    Trust me
---
 mkspecs/features/symbian/armcc_warnings.prf | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/mkspecs/features/symbian/armcc_warnings.prf b/mkspecs/features/symbian/armcc_warnings.prf
index 72bc996..3331bff 100644
--- a/mkspecs/features/symbian/armcc_warnings.prf
+++ b/mkspecs/features/symbian/armcc_warnings.prf
@@ -1,13 +1,22 @@
+# 68:   integer conversion resulted in a change of sign (sounds useful, but it's
+#       buggy and is reported even in places where it makes no sense)
 # 111:  Statement is unreachable
 # 185:  Dynamic initialization in unreachable code
+# 187:  use of "=" where "==" may have been intended
 # 191:  Type qualifier is meaningless on cast type
 # 368:  class "<class>" defines no constructor to initialize the following: <member>
 #       (Disabled because there are other ways of assigning besides constructors)
+# 830:  function "xxx" has no corresponding operator delete (to be called if an
+#       exception is thrown during initialization of an allocated object) (used a
+#       lot in 3rd party code)
+# 997:  function "xxx" is hidden by "yyy" -- virtual function override intended?
+#       (used all over the place in the Symbian SDK)
 # 1293: Assignment in condition
 # 1294: pre-ANSI C style functions declarations (used a lot in 3rd party code)
 # 2874: <variable> may be used before being set (this one sounds useful, but
 #       it's output also for class instances, making it useless in practice)
-QMAKE_CFLAGS.ARMCC += --diag_suppress 111,185,191,368,1293,1294,2874
+QMAKE_CFLAGS.ARMCC += --diag_suppress 68,111,185,187,191,368,830,997,1293,1294,2874
+QMAKE_CXXFLAGS.ARMCC += --diag_suppress 68,111,185,187,191,368,830,997,1293,1294,2874
 
 # 6780: <origvis> visibility removed from symbol '<symname>' through <impexp>
 QMAKE_LFLAGS.ARMCC += --diag_suppress 6780
-- 
cgit v0.12


From 0b68204919a81c2aeca7924711cd5e159dca7903 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Thu, 22 Jul 2010 19:04:06 +0200
Subject: If the QEventDispatcherGlibc causes warnings, it should say so

Reviewed-By: dt
---
 src/corelib/kernel/qeventdispatcher_glib.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 9c1c827..8390275 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -504,7 +504,7 @@ void QEventDispatcherGlib::registerTimer(int timerId, int interval, QObject *obj
 {
 #ifndef QT_NO_DEBUG
     if (timerId < 1 || interval < 0 || !object) {
-        qWarning("QEventDispatcherUNIX::registerTimer: invalid arguments");
+        qWarning("QEventDispatcherGlib::registerTimer: invalid arguments");
         return;
     } else if (object->thread() != thread() || thread() != QThread::currentThread()) {
         qWarning("QObject::startTimer: timers cannot be started from another thread");
@@ -520,7 +520,7 @@ bool QEventDispatcherGlib::unregisterTimer(int timerId)
 {
 #ifndef QT_NO_DEBUG
     if (timerId < 1) {
-        qWarning("QEventDispatcherUNIX::unregisterTimer: invalid argument");
+        qWarning("QEventDispatcherGlib::unregisterTimer: invalid argument");
         return false;
     } else if (thread() != QThread::currentThread()) {
         qWarning("QObject::killTimer: timers cannot be stopped from another thread");
@@ -536,7 +536,7 @@ bool QEventDispatcherGlib::unregisterTimers(QObject *object)
 {
 #ifndef QT_NO_DEBUG
     if (!object) {
-        qWarning("QEventDispatcherUNIX::unregisterTimers: invalid argument");
+        qWarning("QEventDispatcherGlib::unregisterTimers: invalid argument");
         return false;
     } else if (object->thread() != thread() || thread() != QThread::currentThread()) {
         qWarning("QObject::killTimers: timers cannot be stopped from another thread");
-- 
cgit v0.12


From f1d92df9ba30c1a7e97b29dd069db8e7bbb25636 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 22 Jul 2010 19:26:35 +0200
Subject: Fixed compiling with symbian/linux-armcc and configure -silent option

Task:     QTBUG-11927
RevBy:    Trust me
---
 mkspecs/features/symbian/symbian_building.prf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 073ef18..09a9aa9 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -162,7 +162,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
     DEFINES += __DLL__
 }
 
-contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
+contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
     !isEmpty(QMAKE_POST_LINK) {
         # No way to honor the '@' :-(
         QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "")
-- 
cgit v0.12


From 77bd18e7636a65c3a3be5e8e912484e8dc5fee02 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 22 Jul 2010 19:28:10 +0200
Subject: Added silent behavior to the most important Symbian build steps.

Task:     QTBUG-11927
RevBy:    Trust me
---
 mkspecs/features/symbian/symbian_building.prf            | 5 +++++
 src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 09a9aa9..a36193e 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -139,6 +139,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
                       $$QMAKE_POST_LINK
+    silent:QMAKE_POST_LINK = @echo postlinking $@ && $$QMAKE_POST_LINK
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.dso
     QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso
@@ -185,6 +186,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
                       $$QMAKE_ELF2E32_FLAGS \
                       && ln "$${symbianDestdir}/$${baseTarget}.exe" "$${symbianDestdir}/$${baseTarget}" \
                       $$QMAKE_POST_LINK
+    silent:QMAKE_POST_LINK = @echo postlinking $@ && $$QMAKE_POST_LINK
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe
     QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget}
@@ -251,6 +253,7 @@ symbianresources.commands = cpp -nostdinc -undef \
                             -o$${symbianDestdir}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsc \
                             -h$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsg \
                             -i${QMAKE_FILE_NAME}
+silent:symbianresources.commands = @echo rcomp $< && $$symbianresources.commands
 symbianresources.dependency_type = TYPE_C
 symbianresources.CONFIG = no_link target_predeps
 
@@ -274,6 +277,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
                                   -o$${symbianDestdir}/$${baseResourceTarget}.rsc \
                                   -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \
                                   -i$${baseResourceTarget}.rss
+    silent:symbianGenResource.commands = @echo rcomp $${baseResourceTarget}.rss && $$symbianGenResource.commands
     symbianGenResource.depends = $${baseResourceTarget}.rss
     PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
     QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
@@ -292,6 +296,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
                                      -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \
                                      -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \
                                      -i$${baseResourceTarget}_reg.rss
+    silent:symbianGenRegResource.commands = @echo rcomp $${baseResourceTarget}_reg.rss && $$symbianGenRegResource.commands
     symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
     PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
     QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
index ab8d846..494c64c 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri
@@ -13,6 +13,7 @@
                                           && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.h ${QMAKE_FILE_OUT}.tmp \
                                           && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.h \
                                           && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT}
+        silent:symbian_sqlite3_header.commands = @echo unzipping $@ && $$symbian_sqlite3_header.commands
         QMAKE_EXTRA_COMPILERS += symbian_sqlite3_header
 
         # The QMAKE_COPY section is to update timestamp on the file.
@@ -24,6 +25,7 @@
                                        && $$QMAKE_COPY ${QMAKE_FILE_OUT_BASE}.dso ${QMAKE_FILE_OUT}.tmp \
                                        && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.dso \
                                        && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT}
+        silent:symbian_sqlite3_dso.commands = @echo unzipping $@ && $$symbian_sqlite3_dso.commands
         QMAKE_EXTRA_COMPILERS += symbian_sqlite3_dso
 
         symbian_sqlite3_ver_dso.input = symbian_sqlite3_zip_file
-- 
cgit v0.12


From e2c252bbf397eaccedbf7278d0f2b065ed8ead86 Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Fri, 23 Jul 2010 09:21:32 +1000
Subject: Fix test.

---
 .../auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index bb7fc7b..174967b 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -401,6 +401,7 @@ void tst_qdeclarativebehaviors::sameValue()
 
     target->setProperty("x", 0);
     QTRY_VERIFY(target->x() != qreal(0) && target->x() != qreal(100));
+    QTRY_VERIFY(target->x() == qreal(0));   //make sure Behavior has finished.
 
     target->setX(100);
     QCOMPARE(target->x(), qreal(100));
-- 
cgit v0.12


From 62d1160250274dc355d1998357e606131527db2c Mon Sep 17 00:00:00 2001
From: Michael Brasser <michael.brasser@nokia.com>
Date: Fri, 23 Jul 2010 09:22:00 +1000
Subject: Remove unneeded member variable.

---
 src/declarative/util/qdeclarativeanimation.cpp   | 7 +++----
 src/declarative/util/qdeclarativeanimation_p_p.h | 2 --
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 3617031..1a223d5 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -2071,17 +2071,16 @@ void QDeclarativePropertyAnimation::setTo(const QVariant &t)
 QEasingCurve QDeclarativePropertyAnimation::easing() const
 {
     Q_D(const QDeclarativePropertyAnimation);
-    return d->easing;
+    return d->va->easingCurve();
 }
 
 void QDeclarativePropertyAnimation::setEasing(const QEasingCurve &e)
 {
     Q_D(QDeclarativePropertyAnimation);
-    if (d->easing == e)
+    if (d->va->easingCurve() == e)
         return;
 
-    d->easing = e;
-    d->va->setEasingCurve(d->easing);
+    d->va->setEasingCurve(e);
     emit easingChanged(e);
 }
 
diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h
index b6d6bbb..e38580c 100644
--- a/src/declarative/util/qdeclarativeanimation_p_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p_p.h
@@ -311,8 +311,6 @@ public:
     QVariant from;
     QVariant to;
 
-    QEasingCurve easing;
-
     QObject *target;
     QString propertyName;
     QString properties;
-- 
cgit v0.12


From b8b093b20331c38b890ddf945b5d9ce123cbf9c7 Mon Sep 17 00:00:00 2001
From: Aaron Kennedy <aaron.kennedy@nokia.com>
Date: Fri, 23 Jul 2010 11:31:33 +1000
Subject: Fixes undeleted timers (and endless warning from the event loop about
 invalid timers).

Authored-by: Daniel Molkentin
Reviewed-by: Marco Bubke
---
 src/declarative/util/qdeclarativepixmapcache.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 31813a6..a83cac8 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -614,7 +614,7 @@ void QDeclarativePixmapStore::unreferencePixmap(QDeclarativePixmapData *data)
     m_unreferencedCost += data->cost();
 
     if (m_timerId == -1)
-        startTimer(CACHE_EXPIRE_TIME * 1000);
+        m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);
 }
 
 void QDeclarativePixmapStore::referencePixmap(QDeclarativePixmapData *data)
-- 
cgit v0.12


From 35d0e655ad9eedf136d5b5da79e516f0e3cad56a Mon Sep 17 00:00:00 2001
From: Aaron Kennedy <aaron.kennedy@nokia.com>
Date: Fri, 23 Jul 2010 12:33:52 +1000
Subject: Compile

---
 src/declarative/qml/qdeclarativemetatype.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 18b84cc..a5c878f 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -40,9 +40,6 @@
 ****************************************************************************/
 
 #include <QtDeclarative/qdeclarativeprivate.h>
-static int registerType(const QDeclarativePrivate::RegisterType &);
-static int registerInterface(const QDeclarativePrivate::RegisterInterface &);
-
 #include "private/qdeclarativemetatype_p.h"
 
 #include "private/qdeclarativeproxymetaobject_p.h"
@@ -489,7 +486,7 @@ int QDeclarativeType::index() const
     return d->m_index;
 }
 
-static int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent)
+int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent)
 {
     QWriteLocker lock(metaTypeDataLock());
     QDeclarativeMetaTypeData *data = metaTypeData();
@@ -499,7 +496,7 @@ static int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &a
     return data->parentFunctions.count() - 1;
 }
 
-static int registerInterface(const QDeclarativePrivate::RegisterInterface &interface)
+int registerInterface(const QDeclarativePrivate::RegisterInterface &interface)
 {
     if (interface.version > 0) 
         qFatal("qmlRegisterType(): Cannot mix incompatible QML versions.");
@@ -528,7 +525,7 @@ static int registerInterface(const QDeclarativePrivate::RegisterInterface &inter
     return index;
 }
 
-static int registerType(const QDeclarativePrivate::RegisterType &type)
+int registerType(const QDeclarativePrivate::RegisterType &type)
 {
     if (type.elementName) {
         for (int ii = 0; type.elementName[ii]; ++ii) {
-- 
cgit v0.12


From 455f5d9d7850a070663c0f3d1a419988cc4b3e3a Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Fri, 23 Jul 2010 12:45:14 +1000
Subject: Fix crash in MouseArea

Task-number:
Reviewed-by: Martin Jones
---
 src/declarative/graphicsitems/qdeclarativemousearea.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 40c621a..dcdb9f6 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -521,7 +521,8 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
         // If we don't accept hover, we need to reset containsMouse.
         if (!acceptHoverEvents())
             setHovered(false);
-        if (scene()->mouseGrabberItem() == this)
+        QGraphicsScene *s = scene();
+        if (s && s->mouseGrabberItem() == this)
             ungrabMouse();
         setKeepMouseGrab(false);
     }
-- 
cgit v0.12


From 959efa8daab2715d18440ed8b890b9dd2b501fc7 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Fri, 23 Jul 2010 15:16:30 +1000
Subject: Order network configurations in service networks in priority order.

It is useful to know the priority order of the sub configurations of
a service network.

Task-number: QTBUG-11678
RevBy: juhvu <qt-info@nokia.com>
---
 src/network/bearer/qnetworkconfiguration.cpp | 19 ++++---
 src/network/bearer/qnetworkconfiguration_p.h |  3 +-
 src/plugins/bearer/symbian/symbianengine.cpp | 83 +++++++++++++++-------------
 3 files changed, 59 insertions(+), 46 deletions(-)

diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index 4108fee..d7fceba 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -343,9 +343,11 @@ bool QNetworkConfiguration::isRoamingAvailable() const
 }
 
 /*!
-    Returns all sub configurations of this network configuration.
-    Only network configurations of type \l ServiceNetwork can have children. Otherwise
-    this function returns an empty list.
+    Returns all sub configurations of this network configuration in priority order. The first sub
+    configuration in the list has the highest priority.
+
+    Only network configurations of type \l ServiceNetwork can have children. Otherwise this
+    function returns an empty list.
 */
 QList<QNetworkConfiguration> QNetworkConfiguration::children() const
 {
@@ -356,16 +358,18 @@ QList<QNetworkConfiguration> QNetworkConfiguration::children() const
 
     QMutexLocker locker(&d->mutex);
 
-    QMutableListIterator<QNetworkConfigurationPrivatePointer> iter(d->serviceNetworkMembers);
-    while (iter.hasNext()) {
-        QNetworkConfigurationPrivatePointer p = iter.next();
+    QMutableMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(d->serviceNetworkMembers);
+    while (i.hasNext()) {
+        i.next();
+
+        QNetworkConfigurationPrivatePointer p = i.value();
 
         //if we have an invalid member get rid of it -> was deleted earlier on
         {
             QMutexLocker childLocker(&p->mutex);
 
             if (!p->isValid) {
-                iter.remove();
+                i.remove();
                 continue;
             }
         }
@@ -428,6 +432,5 @@ QString QNetworkConfiguration::bearerName() const
     return d->bearerName();
 }
 
-
 QT_END_NAMESPACE
 
diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h
index 6e146e0..966dfb2 100644
--- a/src/network/bearer/qnetworkconfiguration_p.h
+++ b/src/network/bearer/qnetworkconfiguration_p.h
@@ -57,6 +57,7 @@
 
 #include <QtCore/qshareddata.h>
 #include <QtCore/qmutex.h>
+#include <QtCore/qmap.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -84,7 +85,7 @@ public:
         return bearer;
     }
 
-    QList<QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
+    QMap<unsigned int, QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
 
     mutable QMutex mutex;
 
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index ca444c1..d1160f7 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -341,55 +341,57 @@ void SymbianEngine::updateConfigurationsL()
             QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
             mutex.lock();
         }
-        QNetworkConfigurationPrivatePointer privSNAP = snapConfigurations.value(ident);
-            
+
+        // Loop through all connection methods in this SNAP
+        QMap<unsigned int, QNetworkConfigurationPrivatePointer> connections;
         for (int j=0; j < destination.ConnectionMethodCount(); j++) {
             RCmConnectionMethod connectionMethod = destination.ConnectionMethodL(j);
             CleanupClosePushL(connectionMethod);
-            
+
             TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
             QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
             // Check that IAP can be found from accessPointConfigurations list
-            QNetworkConfigurationPrivatePointer priv = accessPointConfigurations.value(iface);
-            if (!priv) {
+            QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
+            if (ptr) {
+                knownConfigs.removeOne(iface);
+            } else {
                 SymbianNetworkConfigurationPrivate *cpPriv = NULL;
                 TRAP(error, cpPriv = configFromConnectionMethodL(connectionMethod));
                 if (error == KErrNone) {
-                    QNetworkConfigurationPrivatePointer ptr(cpPriv);
+                    ptr = QNetworkConfigurationPrivatePointer(cpPriv);
                     accessPointConfigurations.insert(ptr->id, ptr);
 
                     mutex.unlock();
                     QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
                     mutex.lock();
-
-                    QMutexLocker configLocker(&privSNAP->mutex);
-                    privSNAP->serviceNetworkMembers.append(ptr);
-                }
-            } else {
-                knownConfigs.removeOne(iface);
-                // Check that IAP can be found from related SNAP's configuration list
-                bool iapFound = false;
-                QMutexLocker snapConfigLocker(&privSNAP->mutex);
-                for (int i = 0; i < privSNAP->serviceNetworkMembers.count(); i++) {
-                    if (toSymbianConfig(privSNAP->serviceNetworkMembers[i])->numericIdentifier() ==
-                        iapId) {
-                        iapFound = true;
-                        break;
-                    }
                 }
-                if (!iapFound)
-                    privSNAP->serviceNetworkMembers.append(priv);
             }
-            
+
+            if (ptr) {
+                unsigned int priority;
+                TRAPD(error, priority = destination.PriorityL(connectionMethod));
+                if (!error)
+                    connections.insert(priority, ptr);
+            }
+
             CleanupStack::PopAndDestroy(&connectionMethod);
         }
-        
+
+        QNetworkConfigurationPrivatePointer privSNAP = snapConfigurations.value(ident);
         QMutexLocker snapConfigLocker(&privSNAP->mutex);
-        if (privSNAP->serviceNetworkMembers.count() > 1) {
+
+        if (privSNAP->serviceNetworkMembers != connections) {
+            privSNAP->serviceNetworkMembers = connections;
+
             // Roaming is supported only if SNAP contains more than one IAP
-            privSNAP->roamingSupported = true;
+            privSNAP->roamingSupported = privSNAP->serviceNetworkMembers.count() > 1;
+
+            snapConfigLocker.unlock();
+            mutex.unlock();
+            QT_TRYCATCH_LEAVING(emit configurationChanged(privSNAP));
+            mutex.lock();
         }
-        
+
         CleanupStack::PopAndDestroy(&destination);
     }
     CleanupStack::PopAndDestroy(&destinations);
@@ -439,10 +441,13 @@ void SymbianEngine::updateConfigurationsL()
             QNetworkConfigurationPrivatePointer ptr2 = snapConfigurations.value(iface);
             // => Check if one of the IAPs of the SNAP is active
             QMutexLocker snapConfigLocker(&ptr2->mutex);
-            for (int i = 0; i < ptr2->serviceNetworkMembers.count(); ++i) {
-                if (toSymbianConfig(ptr2->serviceNetworkMembers[i])->numericIdentifier() ==
+            QMutableMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(ptr2->serviceNetworkMembers);
+            while (i.hasNext()) {
+                i.next();
+
+                if (toSymbianConfig(i.value())->numericIdentifier() ==
                     toSymbianConfig(ptr)->numericIdentifier()) {
-                    ptr2->serviceNetworkMembers.removeAt(i);
+                    i.remove();
                     break;
                 }
             }
@@ -791,15 +796,19 @@ void SymbianEngine::updateStatesToSnaps()
         // => Check if one of the IAPs of the SNAP is discovered or active
         //    => If one of IAPs is active, also SNAP is active
         //    => If one of IAPs is discovered but none of the IAPs is active, SNAP is discovered
-        for (int i=0; i<ptr->serviceNetworkMembers.count(); i++) {
-            QMutexLocker configLocker(&ptr->serviceNetworkMembers[i]->mutex);
+        QMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(ptr->serviceNetworkMembers);
+        while (i.hasNext()) {
+            i.next();
+
+            const QNetworkConfigurationPrivatePointer child = i.value();
+
+            QMutexLocker configLocker(&child->mutex);
 
-            if ((ptr->serviceNetworkMembers[i]->state & QNetworkConfiguration::Active)
-                    == QNetworkConfiguration::Active) {
+            if ((child->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
                 active = true;
                 break;
-            } else if ((ptr->serviceNetworkMembers[i]->state & QNetworkConfiguration::Discovered)
-                        == QNetworkConfiguration::Discovered) {
+            } else if ((child->state & QNetworkConfiguration::Discovered) ==
+                       QNetworkConfiguration::Discovered) {
                 discovered = true;
             }
         }
-- 
cgit v0.12


From 88d721fa8d28519e98207ca0249ff057faef8af0 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Fri, 23 Jul 2010 15:17:08 +1000
Subject: Show Service Network members in priority order.

The configurations returned from QNetworkConfiguration::children() are
guaranteed to be in priority order.  Ensure that this order is reflected
in the tree view.

Task-number: QTBUG-11678
RevBy: juhvu <qt-info@nokia.com>
---
 examples/network/bearermonitor/bearermonitor.cpp | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 98869ea..1959919 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -180,10 +180,8 @@ void BearerMonitor::configurationChanged(const QNetworkConfiguration &config)
 void BearerMonitor::updateSnapConfiguration(QTreeWidgetItem *parent, const QNetworkConfiguration &snap)
 {
     QMap<QString, QTreeWidgetItem *> itemMap;
-    for (int i = 0; i < parent->childCount(); ++i) {
-        QTreeWidgetItem *item = parent->child(i);
+    foreach (QTreeWidgetItem *item, parent->takeChildren())
         itemMap.insert(item->data(0, Qt::UserRole).toString(), item);
-    }
 
     QList<QNetworkConfiguration> allConfigurations = snap.children();
 
@@ -194,6 +192,8 @@ void BearerMonitor::updateSnapConfiguration(QTreeWidgetItem *parent, const QNetw
         if (item) {
             updateItem(item, config);
 
+            parent->addChild(item);
+
             if (config.type() == QNetworkConfiguration::ServiceNetwork)
                 updateSnapConfiguration(item, config);
         } else {
@@ -201,10 +201,7 @@ void BearerMonitor::updateSnapConfiguration(QTreeWidgetItem *parent, const QNetw
         }
     }
 
-    foreach (const QString &id, itemMap.keys())
-        delete itemMap.value(id);
-
-    itemMap.clear();
+    qDeleteAll(itemMap);
 }
 
 void BearerMonitor::updateConfigurations()
@@ -239,8 +236,7 @@ void BearerMonitor::updateConfigurations()
         }
     }
 
-    foreach (const QString &id, itemMap.keys())
-        delete itemMap.value(id);
+    qDeleteAll(itemMap);
 }
 
 void BearerMonitor::onlineStateChanged(bool isOnline)
-- 
cgit v0.12


From 9df05c922fc0408489cb93ae67e187b717599254 Mon Sep 17 00:00:00 2001
From: Joona Petrell <joona.t.petrell@nokia.com>
Date: Fri, 23 Jul 2010 17:17:07 +1000
Subject: Update QtDeclarative def files

---
 src/s60installs/bwins/QtDeclarativeu.def | 7 ++++---
 src/s60installs/eabi/QtDeclarativeu.def  | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 19e1e01..480d9ff 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -61,7 +61,7 @@ EXPORTS
 	??0QDeclarativeDomObject@@QAE@XZ @ 60 NONAME ; QDeclarativeDomObject::QDeclarativeDomObject(void)
 	?errors@QDeclarativeDomDocument@@QBE?AV?$QList@VQDeclarativeError@@@@XZ @ 61 NONAME ; class QList<class QDeclarativeError> QDeclarativeDomDocument::errors(void) const
 	?toChanged@QDeclarativeTransition@@IAEXXZ @ 62 NONAME ; void QDeclarativeTransition::toChanged(void)
-	?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 63 NONAME ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
+	?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 63 NONAME ABSENT ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
 	?objectOwnership@QDeclarativeEngine@@SA?AW4ObjectOwnership@1@PAVQObject@@@Z @ 64 NONAME ; enum QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(class QObject *)
 	??0QDeclarativeDebugWatch@@QAE@PAVQObject@@@Z @ 65 NONAME ; QDeclarativeDebugWatch::QDeclarativeDebugWatch(class QObject *)
 	?value@QDeclarativePropertyMap@@QBE?AVQVariant@@ABVQString@@@Z @ 66 NONAME ; class QVariant QDeclarativePropertyMap::value(class QString const &) const
@@ -79,7 +79,7 @@ EXPORTS
 	?isInvalid@QDeclarativeDomValue@@QBE_NXZ @ 78 NONAME ; bool QDeclarativeDomValue::isInvalid(void) const
 	?trUtf8@QDeclarativeText@@SA?AVQString@@PBD0H@Z @ 79 NONAME ; class QString QDeclarativeText::trUtf8(char const *, char const *, int)
 	??0QDeclarativeListReference@@QAE@ABV0@@Z @ 80 NONAME ; QDeclarativeListReference::QDeclarativeListReference(class QDeclarativeListReference const &)
-	?registerType@QDeclarativePrivate@@YAHABURegisterInterface@1@@Z @ 81 NONAME ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterInterface const &)
+	?registerType@QDeclarativePrivate@@YAHABURegisterInterface@1@@Z @ 81 NONAME ABSENT ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterInterface const &)
 	?classBegin@QDeclarativeItem@@MAEXXZ @ 82 NONAME ; void QDeclarativeItem::classBegin(void)
 	?setTransformOrigin@QDeclarativeItem@@QAEXW4TransformOrigin@1@@Z @ 83 NONAME ; void QDeclarativeItem::setTransformOrigin(enum QDeclarativeItem::TransformOrigin)
 	?request@QDeclarativePixmapCache@@SAPAVQDeclarativePixmapReply@@PAVQDeclarativeEngine@@ABVQUrl@@HH@Z @ 84 NONAME ABSENT ; class QDeclarativePixmapReply * QDeclarativePixmapCache::request(class QDeclarativeEngine *, class QUrl const &, int, int)
@@ -409,7 +409,7 @@ EXPORTS
 	?addRef@QDeclarativePixmapReply@@AAEXXZ @ 408 NONAME ABSENT ; void QDeclarativePixmapReply::addRef(void)
 	?mouseReleaseEvent@QDeclarativeText@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 409 NONAME ; void QDeclarativeText::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
 	?isCustomType@QDeclarativeDomObject@@QBE_NXZ @ 410 NONAME ; bool QDeclarativeDomObject::isCustomType(void) const
-	?registerType@QDeclarativePrivate@@YAHABURegisterType@1@@Z @ 411 NONAME ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterType const &)
+	?registerType@QDeclarativePrivate@@YAHABURegisterType@1@@Z @ 411 NONAME ABSENT ; int QDeclarativePrivate::registerType(struct QDeclarativePrivate::RegisterType const &)
 	?radius@QDeclarativeRectangle@@QBEMXZ @ 412 NONAME ; float QDeclarativeRectangle::radius(void) const
 	??0QDeclarativeComponent@@AAE@PAVQDeclarativeEngine@@PAVQDeclarativeCompiledData@@HHPAVQObject@@@Z @ 413 NONAME ; QDeclarativeComponent::QDeclarativeComponent(class QDeclarativeEngine *, class QDeclarativeCompiledData *, int, int, class QObject *)
 	?resources_count@QDeclarativeItemPrivate@@SAHPAV?$QDeclarativeListProperty@VQObject@@@@@Z @ 414 NONAME ; int QDeclarativeItemPrivate::resources_count(class QDeclarativeListProperty<class QObject> *)
@@ -1683,4 +1683,5 @@ EXPORTS
 	?engine@QDeclarativeView@@QBEPAVQDeclarativeEngine@@XZ @ 1682 NONAME ; class QDeclarativeEngine * QDeclarativeView::engine(void) const
 	?rootContext@QDeclarativeView@@QBEPAVQDeclarativeContext@@XZ @ 1683 NONAME ; class QDeclarativeContext * QDeclarativeView::rootContext(void) const
 	?rootContext@QDeclarativeEngine@@QBEPAVQDeclarativeContext@@XZ @ 1684 NONAME ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void) const
+	?qmlregister@QDeclarativePrivate@@YAHW4RegistrationType@1@PAX@Z @ 1685 NONAME ; int QDeclarativePrivate::qmlregister(enum QDeclarativePrivate::RegistrationType, void *)
 
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 7868e28..9a3cefa 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -385,9 +385,9 @@ EXPORTS
 	_ZN19QDeclarativeDomListD1Ev @ 384 NONAME
 	_ZN19QDeclarativeDomListD2Ev @ 385 NONAME
 	_ZN19QDeclarativeDomListaSERKS_ @ 386 NONAME
-	_ZN19QDeclarativePrivate12registerTypeERKNS_12RegisterTypeE @ 387 NONAME
-	_ZN19QDeclarativePrivate12registerTypeERKNS_17RegisterInterfaceE @ 388 NONAME
-	_ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 389 NONAME
+	_ZN19QDeclarativePrivate12registerTypeERKNS_12RegisterTypeE @ 387 NONAME ABSENT
+	_ZN19QDeclarativePrivate12registerTypeERKNS_17RegisterInterfaceE @ 388 NONAME ABSENT
+	_ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 389 NONAME ABSENT
 	_ZN19QDeclarativePrivate30qdeclarativeelement_destructorEP7QObject @ 390 NONAME
 	_ZN19QListModelInterface10itemsMovedEiii @ 391 NONAME
 	_ZN19QListModelInterface11qt_metacallEN11QMetaObject4CallEiPPv @ 392 NONAME
@@ -1713,4 +1713,5 @@ EXPORTS
 	_ZNK16QDeclarativeView11rootContextEv @ 1712 NONAME
 	_ZNK16QDeclarativeView6engineEv @ 1713 NONAME
 	_ZNK18QDeclarativeEngine11rootContextEv @ 1714 NONAME
+	_ZN19QDeclarativePrivate11qmlregisterENS_16RegistrationTypeEPv @ 1715 NONAME
 
-- 
cgit v0.12


From eaee97cf48feecc18d6154d3939fd4adb93ba74f Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 23 Jul 2010 09:36:36 +0200
Subject: doc: Fixed broken "Getting Started" link.

Geir will replace it soon with a link to a new "Getting Started" page.

Task-number: QTBUG-12176
---
 doc/src/index.qdoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index b5e73ed..0ecae59 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -40,8 +40,8 @@
               </div>
               <div class="section sectionlist">
                 <ul>
-                  <li><a href="">Getting started</a></li>
-                  <li><a href="installation.html">Installation &amp; first steps</a></li>
+                  <li><a href="how-to-learn-qt.html">Getting started</a></li>
+                  <li><a href="installation.html">Installation</a></li>
                   <li><a href="how-to-learn-qt.html">How to learn Qt</a></li>
                   <li><a href="tutorials.html">Tutorials</a></li>
                   <li><a href="all-examples.html">Examples</a></li>
-- 
cgit v0.12


From d9f5b8742f84124c3c0e2bdbd7b860dce2bc2225 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 23 Jul 2010 09:54:44 +0200
Subject: doc: Added missing \since 4.7 to effect propertyu.

Task-number: QTBUG-12132
---
 src/gui/graphicsview/qgraphicsitem.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6249822..36ae692 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7945,6 +7945,7 @@ void QGraphicsItemPrivate::resetHeight()
 
 /*!
   \property QGraphicsObject::effect
+  \since 4.7
   \brief the effect attached to this item
 
   \sa QGraphicsItem::setGraphicsEffect(), QGraphicsItem::graphicsEffect()
-- 
cgit v0.12


From af61eee576a409c4d128ccf87c7f72771b3ac688 Mon Sep 17 00:00:00 2001
From: Kim Motoyoshi Kalland <kim.kalland@nokia.com>
Date: Fri, 23 Jul 2010 10:22:07 +0200
Subject: Update changes-4.7.0.

---
 dist/changes-4.7.0 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index 09ae57b..fd244bf 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -131,6 +131,7 @@ QtGui
  - QImage
     * [QTBUG-9640] Prevented unneccessary copy in QImage::setAlphaChannel().
     * [QTBUG-7982] Added QImage::bitPlaneCount().
+    * [QTBUG-9072] Fixed alpha check for 1-bit-per-pixel images.
 
  - QPicture
     * [QTBUG-4974] Printing QPictures containing text to a high resolution
@@ -154,6 +155,8 @@ QtGui
     * [QTBUG-8035] Got rid of bezier intersection code in the boolean
       operators (intersect, subtract, unite) to prevent numerical
       stability issues.
+    * [QTBUG-11291] Fixed infinite recursion when drawing very large painter
+      paths.
 
  - QPixmap
     * [QTBUG-4149] Fixed QPixmap::grabWidget() on widgets that have not yet
-- 
cgit v0.12


From 39b153a92e29c967e6622118eb3ae6c55eb8580e Mon Sep 17 00:00:00 2001
From: Kim Motoyoshi Kalland <kim.kalland@nokia.com>
Date: Fri, 23 Jul 2010 11:06:22 +0200
Subject: Updated changes-4.7.0.

---
 dist/changes-4.7.0 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index fd244bf..efc601c 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -147,6 +147,11 @@ QtGui
       processors with a NEON vector unit.
     * Fixed some performance issues when drawing sub-pixmaps of large
       pixmaps and falling back to raster in the X11 paint engine.
+    * [QTBUG-7596] Safeguard ourselves against corrupt registry values for
+      ClearType gamma on Windows.
+    * [QTBUG-9218] Fixed flattening of largely scaled, thin, dashed beziers.
+    * [QTBUG-9437] Fixed crash in the raster paint engine when drawing largely
+      scaled images.
 
  - QPainterPath
     * [QTBUG-3778] Fixed bug in painter path polygon intersection code.
-- 
cgit v0.12


From 5e0371250d050f619d3c7c635377213ece733e66 Mon Sep 17 00:00:00 2001
From: Jarek Kobus <jkobus@trolltech.com>
Date: Fri, 23 Jul 2010 11:16:39 +0200
Subject: Update Polish translations

---
 translations/assistant_pl.ts | 187 +++++++++++++++++++-
 translations/designer_pl.ts  |  86 +++++++--
 translations/linguist_pl.ts  |  24 ++-
 translations/qt_help_pl.ts   |  10 +-
 translations/qt_pl.ts        | 406 ++++++++++++++++++++++++++-----------------
 5 files changed, 532 insertions(+), 181 deletions(-)

diff --git a/translations/assistant_pl.ts b/translations/assistant_pl.ts
index c8c4e5f..8d3c8a3 100644
--- a/translations/assistant_pl.ts
+++ b/translations/assistant_pl.ts
@@ -124,6 +124,11 @@ Powód:
         <source>New Folder</source>
         <translation>Nowy katalog</translation>
     </message>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/bookmarkdialog.cpp" line="+227"/>
+        <source>Rename Folder</source>
+        <translation>Zmień nazwę katalogu</translation>
+    </message>
 </context>
 <context>
     <name>BookmarkManager</name>
@@ -143,7 +148,7 @@ Powód:
         <translation>Zamierzasz usunąć katalog co spowoduje również usunięcie jego zawartości. Czy chcesz kontynuować?</translation>
     </message>
     <message>
-        <location line="+147"/>
+        <location line="+148"/>
         <source>Manage Bookmarks...</source>
         <translation>Zarządzanie zakładkami...</translation>
     </message>
@@ -189,6 +194,148 @@ Powód:
     </message>
 </context>
 <context>
+    <name>BookmarkManagerWidget</name>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/bookmarkmanagerwidget.ui"/>
+        <source>Manage Bookmarks</source>
+        <translation>Zarządzanie zakładkami</translation>
+    </message>
+    <message>
+        <location/>
+        <source>Search:</source>
+        <translation>Wyszukaj:</translation>
+    </message>
+    <message>
+        <location/>
+        <location filename="../tools/assistant/tools/assistant/bookmarkmanagerwidget.cpp" line="+258"/>
+        <source>Remove</source>
+        <translation>Usuń</translation>
+    </message>
+    <message>
+        <location/>
+        <source>Import and Backup</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location/>
+        <location filename="../tools/assistant/tools/assistant/bookmarkmanagerwidget.cpp" line="-30"/>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/bookmarkmanagerwidget.cpp" line="-142"/>
+        <source>Import...</source>
+        <translation>Importuj...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Export...</source>
+        <translation>Exportuj...</translation>
+    </message>
+    <message>
+        <location line="+112"/>
+        <source>Open File</source>
+        <translation>Otwórz plik</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <location line="+16"/>
+        <source>Files (*.xbel)</source>
+        <translation>Pliki (*.xbel)</translation>
+    </message>
+    <message>
+        <location line="-1"/>
+        <source>Save File</source>
+        <translation>Zachowaj plik</translation>
+    </message>
+    <message>
+        <location line="+12"/>
+        <source>Qt Assistant</source>
+        <translation>Qt Assistant</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Unable to save bookmarks.</source>
+        <translation>Nie można zachować zakładek.</translation>
+    </message>
+    <message>
+        <location line="+30"/>
+        <source>You are goingto delete a Folder, this will also&lt;br&gt; remove it&apos;s content. Are you sure to continue?</source>
+        <translation>Zamierzasz usunąć katalog co spowoduje również&lt;br&gt;usunięcie jego zawartości. Czy chcesz kontynuować?</translation>
+    </message>
+    <message>
+        <location line="+28"/>
+        <source>Delete Folder</source>
+        <translation>Usuń katalog</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename Folder</source>
+        <translation>Zmień nazwę katalogu</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Show Bookmark</source>
+        <translation>Pokaż zakładkę</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Show Bookmark in New Tab</source>
+        <translation>Pokaż zakładkę w nowej karcie</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Delete Bookmark</source>
+        <translation>Usuń zakładkę</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Rename Bookmark</source>
+        <translation>Zmień nazwę zakładki</translation>
+    </message>
+</context>
+<context>
+    <name>BookmarkModel</name>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/bookmarkmodel.cpp" line="+88"/>
+        <source>Name</source>
+        <translation>Nazwa</translation>
+    </message>
+    <message>
+        <location line="+0"/>
+        <source>Address</source>
+        <translation>Adres</translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Bookmarks Menu</source>
+        <translation>Menu zakładek</translation>
+    </message>
+</context>
+<context>
+    <name>BookmarkWidget</name>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/bookmarkwidget.ui"/>
+        <source>Bookmarks</source>
+        <translation>Zakładki</translation>
+    </message>
+    <message>
+        <location/>
+        <source>Filter:</source>
+        <translation>Filtr:</translation>
+    </message>
+    <message>
+        <location/>
+        <source>Add</source>
+        <translation>Dodaj</translation>
+    </message>
+    <message>
+        <location/>
+        <source>Remove</source>
+        <translation>Usuń</translation>
+    </message>
+</context>
+<context>
     <name>CentralWidget</name>
     <message>
         <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+121"/>
@@ -327,6 +474,29 @@ Powód:
     </message>
 </context>
 <context>
+    <name>FindWidget</name>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/findwidget.cpp" line="+85"/>
+        <source>Previous</source>
+        <translation>Poprzedni</translation>
+    </message>
+    <message>
+        <location line="+6"/>
+        <source>Next</source>
+        <translation>Następny</translation>
+    </message>
+    <message>
+        <location line="+5"/>
+        <source>Case Sensitive</source>
+        <translation>Uwzględniaj wielkość liter</translation>
+    </message>
+    <message>
+        <location line="+9"/>
+        <source>&lt;img src=&quot;:/trolltech/assistant/images/wrap.png&quot;&gt;&amp;nbsp;Search wrapped</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>FontPanel</name>
     <message>
         <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/>
@@ -366,6 +536,21 @@ Powód:
         <source>&lt;title&gt;Error 404...&lt;/title&gt;&lt;div align=&quot;center&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;h1&gt;The page could not be found&lt;/h1&gt;&lt;br&gt;&lt;h3&gt;&apos;%1&apos;&lt;/h3&gt;&lt;/div&gt;</source>
         <translation>&lt;title&gt;Błąd 404...&lt;/title&gt;&lt;div align=&quot;center&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;h1&gt;Strona nie może być znaleziona&lt;/h1&gt;&lt;br&gt;&lt;h3&gt;&apos;%1&apos;&lt;/h3&gt;&lt;/div&gt;</translation>
     </message>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/helpviewer_qtb.cpp" line="+230"/>
+        <source>Copy &amp;Link Location</source>
+        <translation>Skopiuj &amp;odsyłacz</translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Open Link in New Tab	Ctrl+LMB</source>
+        <translation>Otwórz odsyłacz w nowej karcie	Ctrl+LMB</translation>
+    </message>
+    <message>
+        <location filename="../tools/assistant/tools/assistant/helpviewer_qwv.cpp" line="+260"/>
+        <source>Open Link in New Tab</source>
+        <translation>Otwórz odsyłacz w nowej karcie</translation>
+    </message>
 </context>
 <context>
     <name>IndexWindow</name>
diff --git a/translations/designer_pl.ts b/translations/designer_pl.ts
index 0298a27..cadcc2b 100644
--- a/translations/designer_pl.ts
+++ b/translations/designer_pl.ts
@@ -506,7 +506,7 @@
         <translation>Usuń pasek narzędzi</translation>
     </message>
     <message>
-        <location filename="../tools/designer/src/lib/shared/qdesigner_menu.cpp" line="+1194"/>
+        <location filename="../tools/designer/src/lib/shared/qdesigner_menu.cpp" line="+1196"/>
         <source>Set action text</source>
         <translation>Ustaw tekst akcji</translation>
     </message>
@@ -587,14 +587,14 @@
         <translation>Dodaj przyciski do grupy</translation>
     </message>
     <message>
-        <location line="+8"/>
         <location filename="../tools/designer/src/lib/shared/formlayoutmenu.cpp" line="+458"/>
+        <location filename="../tools/designer/src/components/taskmenu/button_taskmenu.cpp" line="+8"/>
         <source>Add &apos;%1&apos; to &apos;%2&apos;</source>
         <extracomment>Command description for adding buttons to a QButtonGroup</extracomment>
         <translation>Dodaj &apos;%1&apos; do &apos;%2&apos;</translation>
     </message>
     <message>
-        <location line="+14"/>
+        <location filename="../tools/designer/src/components/taskmenu/button_taskmenu.cpp" line="+14"/>
         <source>Remove buttons from group</source>
         <translation>Usuń przyciski z grupy</translation>
     </message>
@@ -703,7 +703,7 @@
 <context>
     <name>ConnectionDelegate</name>
     <message>
-        <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp" line="+644"/>
+        <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp" line="+645"/>
         <source>&lt;object&gt;</source>
         <translation>&lt;obiekt&gt;</translation>
     </message>
@@ -1030,13 +1030,21 @@
     <message>
         <location filename="../tools/designer/src/lib/uilib/formbuilderextra.cpp" line="+375"/>
         <source>Invalid stretch value for &apos;%1&apos;: &apos;%2&apos;</source>
-        <extracomment>Parsing layout stretch values</extracomment>
+        <extracomment>Parsing layout stretch values
+----------
+Parsing layout stretch values
+----------
+Parsing layout stretch values</extracomment>
         <translation>Niepoprawna wartość rozciągniecia dla &apos;%1&apos;: &apos;%2&apos;</translation>
     </message>
     <message>
         <location line="+62"/>
         <source>Invalid minimum size for &apos;%1&apos;: &apos;%2&apos;</source>
-        <extracomment>Parsing grid layout minimum size values</extracomment>
+        <extracomment>Parsing grid layout minimum size values
+----------
+Parsing grid layout minimum size values
+----------
+Parsing grid layout minimum size values</extracomment>
         <translation>Niepoprawna wartość minimalna dla &apos;%1&apos;: &apos;%2&apos;</translation>
     </message>
 </context>
@@ -1445,7 +1453,7 @@ To wskazuje na niespójność w pliku ui.</translation>
         <translation>Podczas przypisywania kolejności tabulacji: widżet &apos;%1&apos; nie został znaleziony.</translation>
     </message>
     <message>
-        <location line="+908"/>
+        <location line="+923"/>
         <source>Invalid QButtonGroup reference &apos;%1&apos; referenced by &apos;%2&apos;.</source>
         <translation>Niepoprawny odnośnik QButtonGroup &apos;%1&apos;, użyty w &apos;%2&apos;.</translation>
     </message>
@@ -1988,7 +1996,7 @@ Czy chcesz spróbować ponownie?</translation>
 <context>
     <name>QDesignerMenu</name>
     <message>
-        <location filename="../tools/designer/src/lib/shared/qdesigner_menu.cpp" line="-1179"/>
+        <location filename="../tools/designer/src/lib/shared/qdesigner_menu.cpp" line="-1180"/>
         <source>Type Here</source>
         <translation>Wpisz tutaj</translation>
     </message>
@@ -2009,12 +2017,12 @@ Czy chcesz spróbować ponownie?</translation>
     </message>
     <message>
         <location line="-300"/>
-        <location line="+648"/>
+        <location line="+649"/>
         <source>Add separator</source>
         <translation>Dodaj separator</translation>
     </message>
     <message>
-        <location line="-680"/>
+        <location line="-681"/>
         <source>Insert separator</source>
         <translation>Wstaw separator</translation>
     </message>
@@ -2088,7 +2096,7 @@ Czy chcesz spróbować ponownie?</translation>
 <context>
     <name>QDesignerPropertySheet</name>
     <message>
-        <location filename="../tools/designer/src/lib/shared/qdesigner_propertysheet.cpp" line="+758"/>
+        <location filename="../tools/designer/src/lib/shared/qdesigner_propertysheet.cpp" line="+762"/>
         <source>Dynamic Properties</source>
         <translation>Dynamiczne właściwości</translation>
     </message>
@@ -2279,7 +2287,11 @@ Strony pojemników powinny być dodawane jedynie poprzez wyspecyfikowanie ich w
     <message>
         <location filename="../tools/designer/src/lib/uilib/formbuilder.cpp" line="+168"/>
         <source>An empty class name was passed on to %1 (object name: &apos;%2&apos;).</source>
-        <extracomment>Empty class name passed to widget factory method</extracomment>
+        <extracomment>Empty class name passed to widget factory method
+----------
+Empty class name passed to widget factory method
+----------
+Empty class name passed to widget factory method</extracomment>
         <translation>Pusta nazwa klasy została przekazana do %1 (nazwa obiektu: &apos;%2&apos;).</translation>
     </message>
     <message>
@@ -3960,6 +3972,54 @@ Czy chcesz nadpisać szablon?</translation>
     </message>
 </context>
 <context>
+    <name>VideoPlayerTaskMenu</name>
+    <message>
+        <location filename="../tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp" line="+79"/>
+        <source>Available Mime Types</source>
+        <translation>Dostępne typy mime</translation>
+    </message>
+    <message>
+        <location line="+24"/>
+        <source>Display supported mime types...</source>
+        <translation>Pokaż dostępne typy mime...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Load...</source>
+        <translation>Załaduj...</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Play</source>
+        <translation>Odtwórz</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Pause</source>
+        <translation>Pauza</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Stop</source>
+        <translation>Zatrzymaj</translation>
+    </message>
+    <message>
+        <location line="+32"/>
+        <source>Choose Video Player Media Source</source>
+        <translation>Wybierz źródło odtwarzacza wideo</translation>
+    </message>
+    <message>
+        <location line="+10"/>
+        <source>An error has occurred in &apos;%1&apos;: %2</source>
+        <translation>Wystąpił błąd w &quot;%1&quot;: %2</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Video Player Error</source>
+        <translation>Błąd odtwarzacza wideo</translation>
+    </message>
+</context>
+<context>
     <name>WidgetDataBase</name>
     <message>
         <location filename="../tools/designer/src/lib/shared/widgetdatabase.cpp" line="+814"/>
@@ -4147,7 +4207,7 @@ Czy chcesz nadpisać szablon?</translation>
         </translation>
     </message>
     <message>
-        <location line="+47"/>
+        <location line="+48"/>
         <source>Set automatically</source>
         <translation>Ustaw automatycznie</translation>
     </message>
diff --git a/translations/linguist_pl.ts b/translations/linguist_pl.ts
index a2cf4c9..037ffb9 100644
--- a/translations/linguist_pl.ts
+++ b/translations/linguist_pl.ts
@@ -337,9 +337,26 @@ Przyjmie on uniwersalną formę liczby pojedynczej.</translation>
     </message>
     <message numerus="yes">
         <location line="+8"/>
+        <source>    Generated %n translation(s) (%1 finished and %2 unfinished)</source>
+        <translation>
+            <numerusform>    Wygenerowano %n tłumaczenie (przetłumaczonych %1, nieprzetłumaczonych %2)</numerusform>
+            <numerusform>    Wygenerowano %n tłumaczenia (przetłumaczonych %1, nieprzetłumaczonych %2)</numerusform>
+            <numerusform>    Wygenerowano %n tłumaczeń (przetłumaczonych %1, nieprzetłumaczonych %2)</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
+        <location line="+4"/>
+        <source>    Ignored %n untranslated source text(s)</source>
+        <translation>
+            <numerusform>    Pominięto %n nieprzetłumaczony tekst źródłowy</numerusform>
+            <numerusform>    Pominięto %n nieprzetłumaczone teksty źródłowe</numerusform>
+            <numerusform>    Pominięto %n nieprzetłumaczonych tekstów źródłowych</numerusform>
+        </translation>
+    </message>
+    <message numerus="yes">
         <source>    Generated %n translation(s) (%1 finished and %2 unfinished)
 </source>
-        <translation>
+        <translation type="obsolete">
             <numerusform>Wygenerowano %n tłumaczenie (przetłumaczonych %1, nieprzetłumaczonych %2)
 </numerusform>
             <numerusform>Wygenerowano %n tłumaczenia (przetłumaczonych %1, nieprzetłumaczonych %2)
@@ -349,10 +366,9 @@ Przyjmie on uniwersalną formę liczby pojedynczej.</translation>
         </translation>
     </message>
     <message numerus="yes">
-        <location line="+4"/>
         <source>    Ignored %n untranslated source text(s)
 </source>
-        <translation>
+        <translation type="obsolete">
             <numerusform>Pominięto %n nieprzetłumaczony tekst źródłowy
 </numerusform>
             <numerusform>Pominięto %n nieprzetłumaczone teksty źródłowe
@@ -1828,7 +1844,7 @@ Linia: %2</translation>
         <translation>Qt Linguist</translation>
     </message>
     <message>
-        <location filename="../tools/linguist/shared/po.cpp" line="+817"/>
+        <location filename="../tools/linguist/shared/po.cpp" line="+870"/>
         <source>GNU Gettext localization files</source>
         <translation>Pliki GNU Gettext</translation>
     </message>
diff --git a/translations/qt_help_pl.ts b/translations/qt_help_pl.ts
index 74555cc..de3cce0 100644
--- a/translations/qt_help_pl.ts
+++ b/translations/qt_help_pl.ts
@@ -30,6 +30,14 @@
     </message>
 </context>
 <context>
+    <name>QHelp</name>
+    <message>
+        <location filename="../tools/assistant/lib/qhelp_global.cpp" line="+64"/>
+        <source>Untitled</source>
+        <translation>Nienazwany</translation>
+    </message>
+</context>
+<context>
     <name>QHelpCollectionHandler</name>
     <message>
         <location filename="../tools/assistant/lib/qhelpcollectionhandler.cpp" line="+79"/>
@@ -306,7 +314,7 @@
         <translation>Brak atrybutu w słowie kluczowym w linii %1.</translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+143"/>
         <source>The input file %1 could not be opened!</source>
         <translation>Nie można otworzyć pliku wejściowego %1!</translation>
     </message>
diff --git a/translations/qt_pl.ts b/translations/qt_pl.ts
index b366a72..53549da 100644
--- a/translations/qt_pl.ts
+++ b/translations/qt_pl.ts
@@ -4,7 +4,7 @@
 <context>
     <name>CloseButton</name>
     <message>
-        <location filename="../src/gui/widgets/qtabbar.cpp" line="+2313"/>
+        <location filename="../src/gui/widgets/qtabbar.cpp" line="+2319"/>
         <source>Close Tab</source>
         <translation>Zamknij kartę</translation>
     </message>
@@ -12,7 +12,7 @@
 <context>
     <name>FakeReply</name>
     <message>
-        <location filename="../src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp" line="+2273"/>
+        <location filename="../src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp" line="+2278"/>
         <source>Fake error !</source>
         <translation>Fałszywy błąd!</translation>
     </message>
@@ -25,7 +25,7 @@
 <context>
     <name>MAC_APPLICATION_MENU</name>
     <message>
-        <location filename="../src/gui/kernel/qapplication.cpp" line="+2320"/>
+        <location filename="../src/gui/kernel/qapplication.cpp" line="+2351"/>
         <source>Services</source>
         <translation>Usługi</translation>
     </message>
@@ -199,7 +199,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation>
 <context>
     <name>Phonon::MMF</name>
     <message>
-        <location filename="../src/3rdparty/phonon/mmf/audiooutput.cpp" line="+103"/>
+        <location filename="../src/3rdparty/phonon/mmf/audiooutput.cpp" line="+106"/>
         <source>Audio Output</source>
         <translation>Wyjście dźwięku</translation>
     </message>
@@ -396,7 +396,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation>
 <context>
     <name>Phonon::MMF::AbstractVideoPlayer</name>
     <message>
-        <location filename="../src/3rdparty/phonon/mmf/abstractvideoplayer.cpp" line="+108"/>
+        <location filename="../src/3rdparty/phonon/mmf/abstractvideoplayer.cpp" line="+110"/>
         <source>Pause failed</source>
         <translation>Zatrzymanie zakończone błędem</translation>
     </message>
@@ -411,7 +411,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation>
         <translation>Ustalanie pozycji zakończone błędem</translation>
     </message>
     <message>
-        <location line="+66"/>
+        <location line="+68"/>
         <source>Opening clip failed</source>
         <translation>Otwieranie klipu zakończone błędem</translation>
     </message>
@@ -435,7 +435,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation>
 <context>
     <name>Phonon::MMF::DsaVideoPlayer</name>
     <message>
-        <location filename="../src/3rdparty/phonon/mmf/videoplayer_dsa.cpp" line="+238"/>
+        <location filename="../src/3rdparty/phonon/mmf/videoplayer_dsa.cpp" line="+241"/>
         <location line="+15"/>
         <location line="+8"/>
         <location line="+22"/>
@@ -523,7 +523,7 @@ zainstalowałeś libgstreamer-plugins-base.</translation>
         <translation>Błąd otwierania źródła: typ źródła nie jest obsługiwany</translation>
     </message>
     <message>
-        <location line="+18"/>
+        <location line="+21"/>
         <source>Error opening source: media type could not be determined</source>
         <translation>Błąd otwierania źródła: nie można określić typu multimediów</translation>
     </message>
@@ -539,8 +539,8 @@ zainstalowałeś libgstreamer-plugins-base.</translation>
 <context>
     <name>Phonon::MMF::SurfaceVideoPlayer</name>
     <message>
-        <location filename="../src/3rdparty/phonon/mmf/videoplayer_surface.cpp" line="+126"/>
-        <location line="+16"/>
+        <location filename="../src/3rdparty/phonon/mmf/videoplayer_surface.cpp" line="+139"/>
+        <location line="+26"/>
         <source>Video display error</source>
         <translation>Błąd wyświetlacza wideo</translation>
     </message>
@@ -1281,7 +1281,7 @@ na
         <translation>Gniazdo nie jest podłączone</translation>
     </message>
     <message>
-        <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+625"/>
+        <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+620"/>
         <location filename="../src/network/socket/qabstractsocket.cpp" line="-380"/>
         <source>Socket operation timed out</source>
         <translation>Przekroczony czas operacji gniazda</translation>
@@ -1449,7 +1449,7 @@ na
 <context>
     <name>QComboBox</name>
     <message>
-        <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+1772"/>
+        <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+1776"/>
         <location line="+65"/>
         <source>Open</source>
         <translation>Otwórz</translation>
@@ -1598,7 +1598,7 @@ na
 <context>
     <name>QDeclarativeAbstractAnimation</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+166"/>
+        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+176"/>
         <source>Cannot animate non-existent property &quot;%1&quot;</source>
         <translation>Nie można animować nieistniejącej właściwości &quot;%1&quot;</translation>
     </message>
@@ -1608,7 +1608,7 @@ na
         <translation>Nie można animować właściwości (tylko do odczytu): &quot;%1&quot;</translation>
     </message>
     <message>
-        <location filename="../src/declarative/util/qdeclarativeutilmodule.cpp" line="+122"/>
+        <location filename="../src/declarative/util/qdeclarativeutilmodule.cpp" line="+120"/>
         <source>Animation is an abstract class</source>
         <translation>&quot;Animation&quot; jest klasą abstrakcyjną</translation>
     </message>
@@ -1616,7 +1616,7 @@ na
 <context>
     <name>QDeclarativeAnchorAnimation</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+2551"/>
+        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+2616"/>
         <source>Cannot set a duration of &lt; 0</source>
         <translation>Nie można ustawić ujemnego czasu trwania</translation>
     </message>
@@ -1624,12 +1624,12 @@ na
 <context>
     <name>QDeclarativeAnchors</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativeanchors.cpp" line="+180"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativeanchors.cpp" line="+204"/>
         <source>Possible anchor loop detected on fill.</source>
         <translation>Wykryto możliwe zapętlenie dla kotwicy &quot;fill&quot;.</translation>
     </message>
     <message>
-        <location line="+29"/>
+        <location line="+26"/>
         <source>Possible anchor loop detected on centerIn.</source>
         <translation>Wykryto możliwe zapętlenie dla kotwicy &quot;centerIn&quot;.</translation>
     </message>
@@ -1692,7 +1692,7 @@ na
 <context>
     <name>QDeclarativeAnimatedImage</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp" line="+86"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp" line="+102"/>
         <source>Qt was built without support for QMovie</source>
         <translation>Qt zostało zbudowane bez obsługi QMovie</translation>
     </message>
@@ -1700,7 +1700,7 @@ na
 <context>
     <name>QDeclarativeBehavior</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativebehavior.cpp" line="+127"/>
+        <location filename="../src/declarative/util/qdeclarativebehavior.cpp" line="+129"/>
         <source>Cannot change the animation assigned to a Behavior.</source>
         <translation>Nie można zmienić animacji przypisanej do &quot;Zachowania&quot;.</translation>
     </message>
@@ -1708,7 +1708,7 @@ na
 <context>
     <name>QDeclarativeBinding</name>
     <message>
-        <location filename="../src/declarative/qml/qdeclarativebinding.cpp" line="+236"/>
+        <location filename="../src/declarative/qml/qdeclarativebinding.cpp" line="+241"/>
         <source>Binding loop detected for property &quot;%1&quot;</source>
         <translation>Zapętlenie powiązania dla właściwości &quot;%1&quot;</translation>
     </message>
@@ -1716,7 +1716,7 @@ na
 <context>
     <name>QDeclarativeCompiledBindings</name>
     <message>
-        <location filename="../src/declarative/qml/qdeclarativecompiledbindings.cpp" line="+305"/>
+        <location filename="../src/declarative/qml/qdeclarativecompiledbindings.cpp" line="+372"/>
         <source>Binding loop detected for property &quot;%1&quot;</source>
         <translation>Zapętlenie powiązania dla właściwości &quot;%1&quot;</translation>
     </message>
@@ -1725,16 +1725,16 @@ na
     <name>QDeclarativeCompiler</name>
     <message>
         <location filename="../src/declarative/qml/qdeclarativecompiler.cpp" line="+186"/>
-        <location line="+1572"/>
+        <location line="+1601"/>
         <location line="+186"/>
         <location line="+81"/>
         <location line="+75"/>
-        <location line="+487"/>
+        <location line="+507"/>
         <source>Invalid property assignment: &quot;%1&quot; is a read-only property</source>
         <translation>Niepoprawne przypisanie wartości: &quot;%1&quot; jest właściwością tylko do odczytu</translation>
     </message>
     <message>
-        <location line="-2392"/>
+        <location line="-2441"/>
         <source>Invalid property assignment: unknown enumeration</source>
         <translation>Niepoprawne przypisanie wartości: nieznana wartość wyliczeniowa</translation>
     </message>
@@ -1749,32 +1749,36 @@ na
         <translation>Niepoprawne przypisanie wartości: oczekiwano url</translation>
     </message>
     <message>
-        <location line="+6"/>
+        <location line="+10"/>
         <source>Invalid property assignment: unsigned int expected</source>
         <translation>Niepoprawne przypisanie wartości: oczekiwano liczby naturalnej</translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+11"/>
         <source>Invalid property assignment: int expected</source>
         <translation>Niepoprawne przypisanie wartości: oczekiwano liczby całkowitej</translation>
     </message>
     <message>
-        <location line="+7"/>
         <source>Invalid property assignment: float expected</source>
-        <translation>Niepoprawne przypisanie wartości: oczekiwano liczby zmiennoprzecinkowej</translation>
+        <translation type="obsolete">Niepoprawne przypisanie wartości: oczekiwano liczby zmiennoprzecinkowej</translation>
     </message>
     <message>
-        <location line="+7"/>
         <source>Invalid property assignment: double expected</source>
-        <translation>Niepoprawne przypisanie wartości: oczekiwano liczby zmiennoprzecinkowej podwójnej precyzji</translation>
+        <translation type="obsolete">Niepoprawne przypisanie wartości: oczekiwano liczby zmiennoprzecinkowej podwójnej precyzji</translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+4"/>
+        <location line="+3"/>
+        <source>Invalid property assignment: number expected</source>
+        <translation>Niepoprawne przypisanie wartości: oczekiwano liczby</translation>
+    </message>
+    <message>
+        <location line="+6"/>
         <source>Invalid property assignment: color expected</source>
         <translation>Niepoprawne przypisanie wartości: oczekiwano koloru</translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+8"/>
         <source>Invalid property assignment: date expected</source>
         <translation>Niepoprawne przypisanie wartości: oczekiwano daty</translation>
     </message>
@@ -1789,7 +1793,7 @@ na
         <translation>Niepoprawne przypisanie wartości: oczekiwano daty i czasu</translation>
     </message>
     <message>
-        <location line="+8"/>
+        <location line="+9"/>
         <source>Invalid property assignment: point expected</source>
         <translation>Niepoprawne przypisanie wartości: oczekiwano punktu</translation>
     </message>
@@ -1819,12 +1823,12 @@ na
         <translation>Niepoprawne przypisanie wartości: nieobsługiwany typ &quot;%1&quot;</translation>
     </message>
     <message>
-        <location line="+275"/>
+        <location line="+277"/>
         <source>Element is not creatable.</source>
         <translation>Nie można utworzyć elementu (&quot;creatable&quot; wyłączone).</translation>
     </message>
     <message>
-        <location line="+601"/>
+        <location line="+623"/>
         <source>Component elements may not contain properties other than id</source>
         <translation>Elementy komponentu nie mogą posiadać właściwości innych niż &quot;id&quot;</translation>
     </message>
@@ -1835,12 +1839,12 @@ na
     </message>
     <message>
         <location line="+6"/>
-        <location line="+475"/>
+        <location line="+478"/>
         <source>id is not unique</source>
         <translation>Wartość &quot;id&quot; nie jest unikatowa</translation>
     </message>
     <message>
-        <location line="-465"/>
+        <location line="-468"/>
         <source>Invalid component body specification</source>
         <translation>Niepoprawna specyfikacja &quot;body&quot; komponentu</translation>
     </message>
@@ -1870,7 +1874,12 @@ na
         <translation>Przypisanie sygnału błędnie podane</translation>
     </message>
     <message>
-        <location line="+13"/>
+        <location line="+12"/>
+        <source>Cannot assign a value to a signal (expecting a script to be run)</source>
+        <translation>Nie można przypisać wartości do sygnału (oczekiwano uruchomienia skryptu)</translation>
+    </message>
+    <message>
+        <location line="+4"/>
         <source>Empty signal assignment</source>
         <translation>Przypisanie pustego sygnału</translation>
     </message>
@@ -1995,7 +2004,7 @@ na
         <translation>&quot;%1&quot; nie może operować na &quot;%2&quot;</translation>
     </message>
     <message>
-        <location line="+117"/>
+        <location line="+129"/>
         <source>Duplicate default property</source>
         <translation>Powielona domyślna właściwość</translation>
     </message>
@@ -2010,7 +2019,12 @@ na
         <translation>Nazwy właściwości nie mogą rozpoczynać się wielką literą</translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+3"/>
+        <source>Illegal property name</source>
+        <translation>Niepoprawna nazwa właściwości</translation>
+    </message>
+    <message>
+        <location line="+8"/>
         <source>Duplicate signal name</source>
         <translation>Powielona nazwa sygnału</translation>
     </message>
@@ -2020,6 +2034,11 @@ na
         <translation>Nazwy sygnałów nie mogą rozpoczynać się wielką literą</translation>
     </message>
     <message>
+        <location line="+2"/>
+        <source>Illegal signal name</source>
+        <translation>Niepoprawna nazwa sygnału</translation>
+    </message>
+    <message>
         <location line="+6"/>
         <source>Duplicate method name</source>
         <translation>Powielona nazwa medoty</translation>
@@ -2030,6 +2049,11 @@ na
         <translation>Nazwy metod nie mogą rozpoczynać się wielką literą</translation>
     </message>
     <message>
+        <location line="+2"/>
+        <source>Illegal method name</source>
+        <translation>Niepoprawna nazwa metody</translation>
+    </message>
+    <message>
         <location line="+21"/>
         <source>Property value set multiple times</source>
         <translation>Wartość właściwości ustawiona wielokrotnie</translation>
@@ -2100,7 +2124,7 @@ na
 <context>
     <name>QDeclarativeComponent</name>
     <message>
-        <location filename="../src/declarative/qml/qdeclarativecomponent.cpp" line="+458"/>
+        <location filename="../src/declarative/qml/qdeclarativecomponent.cpp" line="+507"/>
         <source>Invalid empty URL</source>
         <translation>Niepoprawny pusty URL</translation>
     </message>
@@ -2108,7 +2132,7 @@ na
 <context>
     <name>QDeclarativeCompositeTypeManager</name>
     <message>
-        <location filename="../src/declarative/qml/qdeclarativecompositetypemanager.cpp" line="+487"/>
+        <location filename="../src/declarative/qml/qdeclarativecompositetypemanager.cpp" line="+475"/>
         <location line="+266"/>
         <source>Resource %1 unavailable</source>
         <translation>Zasób %1 nie jest dostępny</translation>
@@ -2132,7 +2156,7 @@ na
 <context>
     <name>QDeclarativeConnections</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativeconnections.cpp" line="+209"/>
+        <location filename="../src/declarative/util/qdeclarativeconnections.cpp" line="+210"/>
         <location line="+60"/>
         <source>Cannot assign to non-existent property &quot;%1&quot;</source>
         <translation>Nie można przypisać wartości do nieistniejącej właściwości &quot;%1&quot;</translation>
@@ -2190,7 +2214,7 @@ na
 <context>
     <name>QDeclarativeFlipable</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativeflipable.cpp" line="+127"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativeflipable.cpp" line="+129"/>
         <source>front is a write-once property</source>
         <translation>&quot;front&quot; jest właściwością tylko do odczytu</translation>
     </message>
@@ -2203,7 +2227,7 @@ na
 <context>
     <name>QDeclarativeImportDatabase</name>
     <message>
-        <location filename="../src/declarative/qml/qdeclarativeimport.cpp" line="+303"/>
+        <location filename="../src/declarative/qml/qdeclarativeimport.cpp" line="+294"/>
         <source>module &quot;%1&quot; definition &quot;%2&quot; not readable</source>
         <translation>definicja &quot;%2&quot; modułu &quot;%1&quot; nie może zostać odczytana</translation>
     </message>
@@ -2219,18 +2243,18 @@ na
     </message>
     <message>
         <location line="+79"/>
-        <location line="+55"/>
+        <location line="+69"/>
         <source>module &quot;%1&quot; version %2.%3 is not installed</source>
         <translation>wersja %2.%3 modułu %1 nie jest zainstalowana</translation>
     </message>
     <message>
-        <location line="-53"/>
+        <location line="-67"/>
         <source>module &quot;%1&quot; is not installed</source>
         <translation>moduł &quot;%1&quot; nie jest zainstalowany</translation>
     </message>
     <message>
-        <location line="+14"/>
-        <location line="+19"/>
+        <location line="+15"/>
+        <location line="+20"/>
         <source>&quot;%1&quot;: no such directory</source>
         <translation>&quot;%1&quot;: brak katalogu</translation>
     </message>
@@ -2240,7 +2264,7 @@ na
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location line="+46"/>
+        <location line="+58"/>
         <source>- %1 is not a namespace</source>
         <translation>- %1 nie jest przestrzenią nazw</translation>
     </message>
@@ -2279,7 +2303,7 @@ na
 <context>
     <name>QDeclarativeKeyNavigationAttached</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp" line="+64"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp" line="+70"/>
         <source>KeyNavigation is only available via attached properties</source>
         <translation>&quot;KeyNavigation&quot; jest dostępny jedynie poprzez dołączone właściwości</translation>
     </message>
@@ -2295,7 +2319,7 @@ na
 <context>
     <name>QDeclarativeListModel</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativelistmodel.cpp" line="+399"/>
+        <location filename="../src/declarative/util/qdeclarativelistmodel.cpp" line="+315"/>
         <source>remove: index %1 out of range</source>
         <translation>remove: indeks %1 poza zakresem</translation>
     </message>
@@ -2331,8 +2355,8 @@ na
         <translation>set: indeks %1 poza zakresem</translation>
     </message>
     <message>
-        <location line="+39"/>
-        <location line="+15"/>
+        <location line="+41"/>
+        <location line="+17"/>
         <source>ListElement: cannot contain nested elements</source>
         <translation>ListElement: nie może zawierać zagnieżdżonych elementów</translation>
     </message>
@@ -2342,12 +2366,12 @@ na
         <translation>ListElement: nie można używać zarezerwowanej właściwości &quot;id&quot;</translation>
     </message>
     <message>
-        <location line="+49"/>
+        <location line="+53"/>
         <source>ListElement: cannot use script for property value</source>
         <translation>ListElement: nie można używać skryptu jako wartości właściwości</translation>
     </message>
     <message>
-        <location line="+29"/>
+        <location line="+31"/>
         <source>ListModel: undefined property &apos;%1&apos;</source>
         <translation>ListModel: niezdefiniowana właściwość &quot;%1&quot;</translation>
     </message>
@@ -2355,7 +2379,7 @@ na
 <context>
     <name>QDeclarativeLoader</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativeloader.cpp" line="+309"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativeloader.cpp" line="+340"/>
         <source>Loader does not support loading non-visual elements.</source>
         <translation>Ładowanie elementów niewizualnych nie jest obsługiwane.</translation>
     </message>
@@ -2546,39 +2570,54 @@ na
 <context>
     <name>QDeclarativePauseAnimation</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="-1975"/>
+        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="-2036"/>
         <source>Cannot set a duration of &lt; 0</source>
         <translation>Nie można ustawić ujemnego czasu trwania</translation>
     </message>
 </context>
 <context>
-    <name>QDeclarativePixmapCache</name>
+    <name>QDeclarativePixmap</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativepixmapcache.cpp" line="+198"/>
+        <location filename="../src/declarative/util/qdeclarativepixmapcache.cpp" line="+295"/>
         <source>Error decoding: %1: %2</source>
         <translation>Błąd dekodowania: %1: %2</translation>
     </message>
     <message>
-        <location line="+70"/>
+        <location line="+145"/>
+        <location line="+333"/>
         <source>Failed to get image from provider: %1</source>
         <translation>Pobieranie obrazka od dostawcy zakończone błędem: %1</translation>
     </message>
     <message>
-        <location line="+19"/>
-        <location line="+345"/>
+        <location line="-314"/>
+        <location line="+332"/>
         <source>Cannot open: %1</source>
         <translation>Nie można otworzyć: %1</translation>
     </message>
+</context>
+<context>
+    <name>QDeclarativePixmapCache</name>
+    <message>
+        <source>Error decoding: %1: %2</source>
+        <translation type="obsolete">Błąd dekodowania: %1: %2</translation>
+    </message>
+    <message>
+        <source>Failed to get image from provider: %1</source>
+        <translation type="obsolete">Pobieranie obrazka od dostawcy zakończone błędem: %1</translation>
+    </message>
+    <message>
+        <source>Cannot open: %1</source>
+        <translation type="obsolete">Nie można otworzyć: %1</translation>
+    </message>
     <message>
-        <location line="+37"/>
         <source>Unknown Error loading %1</source>
-        <translation>Nieznany błąd ładowania %1</translation>
+        <translation type="obsolete">Nieznany błąd ładowania %1</translation>
     </message>
 </context>
 <context>
     <name>QDeclarativePropertyAnimation</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+1102"/>
+        <location filename="../src/declarative/util/qdeclarativeanimation.cpp" line="+1171"/>
         <source>Cannot set a duration of &lt; 0</source>
         <translation>Nie można ustawić ujemnego czasu trwania</translation>
     </message>
@@ -2586,7 +2625,7 @@ na
 <context>
     <name>QDeclarativePropertyChanges</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativepropertychanges.cpp" line="+252"/>
+        <location filename="../src/declarative/util/qdeclarativepropertychanges.cpp" line="+267"/>
         <source>PropertyChanges does not support creating state-specific objects.</source>
         <translation>&quot;PropertyChanges&quot; nie obsługuje tworzenia obiektów charakterystycznych dla stanów.</translation>
     </message>
@@ -2604,7 +2643,7 @@ na
 <context>
     <name>QDeclarativeTextInput</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativetextinput.cpp" line="+797"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativetextinput.cpp" line="+805"/>
         <location line="+8"/>
         <source>Could not load cursor delegate</source>
         <translation type="unfinished"></translation>
@@ -2666,7 +2705,7 @@ na
 <context>
     <name>QDeclarativeVisualDataModel</name>
     <message>
-        <location filename="../src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp" line="+1091"/>
+        <location filename="../src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp" line="+1058"/>
         <source>Delegate component must be Item type.</source>
         <translation type="unfinished"></translation>
     </message>
@@ -2683,7 +2722,7 @@ na
 <context>
     <name>QDeclarativeXmlListModelRole</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativexmllistmodel_p.h" line="+168"/>
+        <location filename="../src/declarative/util/qdeclarativexmllistmodel_p.h" line="+174"/>
         <source>An XmlRole query must not start with &apos;/&apos;</source>
         <translation>Zapytanie XmlRole nie może rozpoczynać się od &quot;/&quot;</translation>
     </message>
@@ -2691,7 +2730,7 @@ na
 <context>
     <name>QDeclarativeXmlRoleList</name>
     <message>
-        <location filename="../src/declarative/util/qdeclarativexmllistmodel.cpp" line="+673"/>
+        <location filename="../src/declarative/util/qdeclarativexmllistmodel.cpp" line="+735"/>
         <source>An XmlListModel query must start with &apos;/&apos; or &quot;//&quot;</source>
         <translation>Zapytanie XmlListModel nie może rozpoczynać się od &quot;/&quot; ani od &quot;//&quot;</translation>
     </message>
@@ -2717,12 +2756,12 @@ na
 <context>
     <name>QDialog</name>
     <message>
-        <location filename="../src/gui/dialogs/qdialog.cpp" line="+645"/>
+        <location filename="../src/gui/dialogs/qdialog.cpp" line="+651"/>
         <source>What&apos;s This?</source>
         <translation>Co to jest?</translation>
     </message>
     <message>
-        <location line="-122"/>
+        <location line="-127"/>
         <source>Done</source>
         <translation>Zrobione</translation>
     </message>
@@ -3059,7 +3098,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
         <translation>Katalog:</translation>
     </message>
     <message>
-        <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="+464"/>
+        <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="+475"/>
         <source>Drive</source>
         <translation>Urządzenie</translation>
     </message>
@@ -3339,52 +3378,52 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
     <name>QFontDatabase</name>
     <message>
         <location filename="../src/gui/text/qfontdatabase.cpp" line="+102"/>
-        <location line="+1342"/>
+        <location line="+1347"/>
         <source>Normal</source>
         <translation>Normalny</translation>
     </message>
     <message>
-        <location line="-1339"/>
+        <location line="-1344"/>
         <location line="+12"/>
-        <location line="+1315"/>
+        <location line="+1320"/>
         <source>Bold</source>
         <translation>Pogrubiony</translation>
     </message>
     <message>
-        <location line="-1324"/>
-        <location line="+1326"/>
+        <location line="-1329"/>
+        <location line="+1331"/>
         <source>Demi Bold</source>
         <translation>Na wpół pogrubiony</translation>
     </message>
     <message>
-        <location line="-1323"/>
+        <location line="-1328"/>
         <location line="+18"/>
-        <location line="+1301"/>
+        <location line="+1306"/>
         <source>Black</source>
         <translatorcomment>it&apos;s about font weight</translatorcomment>
         <translation>Bardzo gruby</translation>
     </message>
     <message>
-        <location line="-1311"/>
+        <location line="-1316"/>
         <source>Demi</source>
         <translation>Na wpół</translation>
     </message>
     <message>
         <location line="+6"/>
-        <location line="+1311"/>
+        <location line="+1316"/>
         <source>Light</source>
         <translatorcomment>it&apos;s about font weight</translatorcomment>
         <translation>Cienki</translation>
     </message>
     <message>
-        <location line="-1165"/>
-        <location line="+1168"/>
+        <location line="-1170"/>
+        <location line="+1173"/>
         <source>Italic</source>
         <translation>Kursywa</translation>
     </message>
     <message>
-        <location line="-1165"/>
-        <location line="+1167"/>
+        <location line="-1170"/>
+        <location line="+1172"/>
         <source>Oblique</source>
         <translation>Pochyły</translation>
     </message>
@@ -3761,7 +3800,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
         <translation>Nieznany błąd</translation>
     </message>
     <message>
-        <location filename="../src/network/kernel/qhostinfo.cpp" line="+175"/>
+        <location filename="../src/network/kernel/qhostinfo.cpp" line="+171"/>
         <source>No host name given</source>
         <translation>Nie podano nazwy hosta</translation>
     </message>
@@ -3769,9 +3808,9 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
 <context>
     <name>QHostInfoAgent</name>
     <message>
-        <location filename="../src/network/kernel/qhostinfo_unix.cpp" line="+259"/>
+        <location filename="../src/network/kernel/qhostinfo_unix.cpp" line="+274"/>
         <location line="+32"/>
-        <location filename="../src/network/kernel/qhostinfo_win.cpp" line="+216"/>
+        <location filename="../src/network/kernel/qhostinfo_win.cpp" line="+215"/>
         <location line="+27"/>
         <source>Host not found</source>
         <translation>Host nie znaleziony</translation>
@@ -3792,7 +3831,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
         <translation>Nieznany błąd</translation>
     </message>
     <message>
-        <location line="-98"/>
+        <location line="-112"/>
         <location filename="../src/network/kernel/qhostinfo_win.cpp" line="-67"/>
         <source>No host name given</source>
         <translation>Nie podano nazwy hosta</translation>
@@ -4122,7 +4161,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
 <context>
     <name>QIODevice</name>
     <message>
-        <location filename="../src/corelib/global/qglobal.cpp" line="+2129"/>
+        <location filename="../src/corelib/global/qglobal.cpp" line="+2117"/>
         <source>No space left on device</source>
         <translation>Brak wolnego miejsca na urządzeniu</translation>
     </message>
@@ -4142,7 +4181,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
         <translation>Zbyt wiele otwartych plików</translation>
     </message>
     <message>
-        <location filename="../src/corelib/io/qiodevice.cpp" line="+1598"/>
+        <location filename="../src/corelib/io/qiodevice.cpp" line="+1618"/>
         <source>Unknown error</source>
         <translation>Nieznany błąd</translation>
     </message>
@@ -4259,7 +4298,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
 <context>
     <name>QLineEdit</name>
     <message>
-        <location filename="../src/gui/widgets/qlineedit.cpp" line="+2095"/>
+        <location filename="../src/gui/widgets/qlineedit.cpp" line="+2098"/>
         <source>&amp;Copy</source>
         <translation>S&amp;kopiuj</translation>
     </message>
@@ -4961,7 +5000,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
 <context>
     <name>QNetworkSessionPrivateImpl</name>
     <message>
-        <location filename="../src/plugins/bearer/icd/qnetworksession_impl.cpp" line="+1005"/>
+        <location filename="../src/plugins/bearer/icd/qnetworksession_impl.cpp" line="+1019"/>
         <source>Roaming error</source>
         <translation>Błąd roamingu</translation>
     </message>
@@ -4977,7 +5016,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
     </message>
     <message>
         <location filename="../src/plugins/bearer/qnetworksession_impl.cpp" line="+272"/>
-        <location filename="../src/plugins/bearer/symbian/qnetworksession_impl.cpp" line="+280"/>
+        <location filename="../src/plugins/bearer/symbian/qnetworksession_impl.cpp" line="+291"/>
         <source>Unknown session error.</source>
         <translation>Nieznany błąd sesji.</translation>
     </message>
@@ -5009,7 +5048,7 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
 <context>
     <name>QOCIDriver</name>
     <message>
-        <location filename="../src/sql/drivers/oci/qsql_oci.cpp" line="+1944"/>
+        <location filename="../src/sql/drivers/oci/qsql_oci.cpp" line="+1976"/>
         <source>Unable to initialize</source>
         <comment>QOCIDriver</comment>
         <translation>Nie można dokonać inicjalizacji</translation>
@@ -5171,13 +5210,19 @@ Proszę o sprawdzenie podanej nazwy pliku.</translation>
         <location filename="../src/3rdparty/phonon/phonon/pulsesupport.cpp" line="+162"/>
         <location line="+11"/>
         <source>PulseAudio Sound Server</source>
-        <translation type="unfinished"></translation>
+        <translation>Serwer dźwięku PulseAudio</translation>
     </message>
     <message>
-        <location filename="../src/declarative/util/qdeclarativexmllistmodel.cpp" line="-227"/>
+        <location filename="../src/declarative/util/qdeclarativexmllistmodel.cpp" line="-253"/>
         <source>&quot;%1&quot; duplicates a previous role name and will be disabled.</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <location line="+528"/>
+        <location line="+4"/>
+        <source>invalid query: &quot;%1&quot;</source>
+        <translation>Niepoprawne zapytanie: &quot;%1&quot;</translation>
+    </message>
 </context>
 <context>
     <name>QPPDOptionsModel</name>
@@ -6090,7 +6135,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <location line="+52"/>
         <location line="+74"/>
         <location line="+66"/>
-        <location filename="../src/corelib/io/qprocess_win.cpp" line="+406"/>
+        <location filename="../src/corelib/io/qprocess_win.cpp" line="+411"/>
         <location line="+50"/>
         <location line="+75"/>
         <location line="+42"/>
@@ -6108,18 +6153,18 @@ Proszę wybrać inną nazwę pliku.</translation>
     </message>
     <message>
         <location line="+47"/>
-        <location line="+826"/>
+        <location line="+870"/>
         <location filename="../src/corelib/io/qprocess_win.cpp" line="+140"/>
         <source>Error writing to process</source>
         <translation>Błąd zapisywania do procesu</translation>
     </message>
     <message>
-        <location line="-756"/>
+        <location line="-800"/>
         <source>Process crashed</source>
         <translation>Wystąpił błąd w procesie - proces zakończony</translation>
     </message>
     <message>
-        <location line="+959"/>
+        <location line="+1002"/>
         <source>No program defined</source>
         <translation>Nie zdefiniowano programu</translation>
     </message>
@@ -6132,7 +6177,7 @@ Proszę wybrać inną nazwę pliku.</translation>
 <context>
     <name>QProgressDialog</name>
     <message>
-        <location filename="../src/gui/dialogs/qprogressdialog.cpp" line="+196"/>
+        <location filename="../src/gui/dialogs/qprogressdialog.cpp" line="+203"/>
         <source>Cancel</source>
         <translation>Anuluj</translation>
     </message>
@@ -6848,7 +6893,7 @@ Proszę wybrać inną nazwę pliku.</translation>
 <context>
     <name>QShortcut</name>
     <message>
-        <location filename="../src/gui/kernel/qkeysequence.cpp" line="+1315"/>
+        <location filename="../src/gui/kernel/qkeysequence.cpp" line="+1331"/>
         <source>+</source>
         <translation>+</translation>
     </message>
@@ -6859,7 +6904,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Alt</translation>
     </message>
     <message>
-        <location line="-934"/>
+        <location line="-950"/>
         <source>Back</source>
         <translation>Back</translation>
     </message>
@@ -6889,22 +6934,35 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Basy w górę</translation>
     </message>
     <message>
-        <location line="+149"/>
+        <location line="+154"/>
         <source>Call</source>
+        <extracomment>Button to start a call (note: a separate button is used to end the call)</extracomment>
         <translation>Wywołaj</translation>
     </message>
     <message>
-        <location line="-21"/>
+        <location line="-22"/>
         <source>Caps Lock</source>
         <translation>Caps Lock</translation>
     </message>
     <message>
-        <location line="-145"/>
+        <location line="-149"/>
         <source>CapsLock</source>
         <translation>CapsLock</translation>
     </message>
     <message>
-        <location line="+49"/>
+        <location line="+27"/>
+        <source>Media Pause</source>
+        <extracomment>Media player pause button</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Toggle Media Play/Pause</source>
+        <extracomment>Media player button to toggle between playing and paused</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+24"/>
         <source>Monitor Brightness Up</source>
         <translation>Zwiększ jasność monitora</translation>
     </message>
@@ -7369,7 +7427,37 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Kontekst4</translation>
     </message>
     <message>
-        <location line="+7"/>
+        <location line="+6"/>
+        <source>Toggle Call/Hangup</source>
+        <extracomment>Button that will hang up if we&apos;re in call, or make a call if we&apos;re not.</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+3"/>
+        <source>Voice Dial</source>
+        <extracomment>Button to trigger voice dialling</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Last Number Redial</source>
+        <extracomment>Button to redial the last number called</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Camera Shutter</source>
+        <extracomment>Button to trigger the camera shutter (take a picture)</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+2"/>
+        <source>Camera Focus</source>
+        <extracomment>Button to focus the camera</extracomment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location line="+4"/>
         <source>Kanji</source>
         <translation>Kanji</translation>
     </message>
@@ -7525,17 +7613,17 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Ctrl</translation>
     </message>
     <message>
-        <location line="-953"/>
+        <location line="-969"/>
         <source>Del</source>
         <translation>Del</translation>
     </message>
     <message>
-        <location line="+162"/>
+        <location line="+166"/>
         <source>Delete</source>
         <translation>Delete</translation>
     </message>
     <message>
-        <location line="-153"/>
+        <location line="-157"/>
         <source>Down</source>
         <translation>Dół</translation>
     </message>
@@ -7555,37 +7643,38 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Esc</translation>
     </message>
     <message>
-        <location line="+170"/>
+        <location line="+174"/>
         <source>Escape</source>
         <translation>Escape</translation>
     </message>
     <message>
-        <location line="+809"/>
+        <location line="+821"/>
         <source>F%1</source>
         <translation>F%1</translation>
     </message>
     <message>
-        <location line="-933"/>
+        <location line="-945"/>
         <source>Favorites</source>
         <translation>Ulubione</translation>
     </message>
     <message>
-        <location line="+141"/>
+        <location line="+145"/>
         <source>Flip</source>
         <translation>Odwróć</translation>
     </message>
     <message>
-        <location line="-158"/>
+        <location line="-166"/>
         <source>Forward</source>
         <translation>Do przodu</translation>
     </message>
     <message>
-        <location line="+157"/>
+        <location line="+163"/>
         <source>Hangup</source>
+        <extracomment>Button to end a call (note: a separate button is used to start the call)</extracomment>
         <translation>Zawieś</translation>
     </message>
     <message>
-        <location line="-163"/>
+        <location line="-169"/>
         <source>Help</source>
         <translation>Pomoc</translation>
     </message>
@@ -7595,17 +7684,17 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Home</translation>
     </message>
     <message>
-        <location line="+34"/>
+        <location line="+38"/>
         <source>Home Page</source>
         <translation>Strona startowa</translation>
     </message>
     <message>
-        <location line="-39"/>
+        <location line="-43"/>
         <source>Ins</source>
         <translation>Ins</translation>
     </message>
     <message>
-        <location line="+162"/>
+        <location line="+166"/>
         <source>Insert</source>
         <translation>Insert</translation>
     </message>
@@ -7700,7 +7789,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Uruchom przeglądarkę mediów</translation>
     </message>
     <message>
-        <location line="-38"/>
+        <location line="-42"/>
         <source>Left</source>
         <translation>Lewo</translation>
     </message>
@@ -7735,13 +7824,13 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Menu</translation>
     </message>
     <message>
-        <location line="+806"/>
+        <location line="+822"/>
         <location line="+130"/>
         <source>Meta</source>
         <translation>Meta</translation>
     </message>
     <message>
-        <location line="-781"/>
+        <location line="-793"/>
         <source>No</source>
         <translation>Nie</translation>
     </message>
@@ -7756,12 +7845,12 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Number Lock</translation>
     </message>
     <message>
-        <location line="-146"/>
+        <location line="-150"/>
         <source>NumLock</source>
         <translation>NumLock</translation>
     </message>
     <message>
-        <location line="+29"/>
+        <location line="+33"/>
         <source>Open URL</source>
         <translation>Otwórz adres</translation>
     </message>
@@ -7776,7 +7865,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Strona w dół</translation>
     </message>
     <message>
-        <location line="-154"/>
+        <location line="-158"/>
         <source>Pause</source>
         <translation>Pauza</translation>
     </message>
@@ -7796,12 +7885,12 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Wydrukuj</translation>
     </message>
     <message>
-        <location line="+152"/>
+        <location line="+156"/>
         <source>Print Screen</source>
         <translation>Wydrukuj zawartość ekranu</translation>
     </message>
     <message>
-        <location line="-130"/>
+        <location line="-134"/>
         <source>Refresh</source>
         <translation>Odśwież</translation>
     </message>
@@ -7816,17 +7905,17 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Prawo</translation>
     </message>
     <message>
-        <location line="+152"/>
+        <location line="+156"/>
         <source>Scroll Lock</source>
         <translation>Scroll Lock</translation>
     </message>
     <message>
-        <location line="-146"/>
+        <location line="-150"/>
         <source>ScrollLock</source>
         <translation>ScrollLock</translation>
     </message>
     <message>
-        <location line="+26"/>
+        <location line="+30"/>
         <source>Search</source>
         <translation>Szukaj</translation>
     </message>
@@ -7837,24 +7926,24 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Wybierz</translation>
     </message>
     <message>
-        <location line="+651"/>
+        <location line="+663"/>
         <location line="+138"/>
         <source>Shift</source>
         <translation>Shift</translation>
     </message>
     <message>
-        <location line="-965"/>
+        <location line="-981"/>
         <source>Space</source>
         <extracomment>This and all following &quot;incomprehensible&quot; strings in QShortcut context are key names. Please use the localized names appearing on actual keyboards or whatever is commonly used.</extracomment>
         <translation>Spacja</translation>
     </message>
     <message>
-        <location line="+49"/>
+        <location line="+53"/>
         <source>Standby</source>
         <translation>Tryb oczekiwania</translation>
     </message>
     <message>
-        <location line="-18"/>
+        <location line="-22"/>
         <source>Stop</source>
         <translation>Zatrzymaj</translation>
     </message>
@@ -7864,12 +7953,12 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>SysReq</translation>
     </message>
     <message>
-        <location line="+161"/>
+        <location line="+165"/>
         <source>System Request</source>
         <translation>Żądanie systemu</translation>
     </message>
     <message>
-        <location line="-170"/>
+        <location line="-174"/>
         <source>Tab</source>
         <translation>Tabulator</translation>
     </message>
@@ -7904,7 +7993,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Zrób głośniej</translation>
     </message>
     <message>
-        <location line="+142"/>
+        <location line="+146"/>
         <source>Yes</source>
         <translation>Tak</translation>
     </message>
@@ -8116,7 +8205,7 @@ Proszę wybrać inną nazwę pliku.</translation>
 <context>
     <name>QSslSocket</name>
     <message>
-        <location filename="../src/network/ssl/qsslsocket_openssl.cpp" line="+550"/>
+        <location filename="../src/network/ssl/qsslsocket_openssl.cpp" line="+837"/>
         <source>Unable to write data: %1</source>
         <translation></translation>
     </message>
@@ -8126,7 +8215,8 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Nie można odszyfrować danych: %1</translation>
     </message>
     <message>
-        <location line="+76"/>
+        <location line="+78"/>
+        <location line="+10"/>
         <source>Error while reading: %1</source>
         <translation>Błąd podczas czytania: %1</translation>
     </message>
@@ -8136,7 +8226,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Błąd podczas nawiązania sesji SSL: %1</translation>
     </message>
     <message>
-        <location line="-524"/>
+        <location line="-812"/>
         <source>Error creating SSL context (%1)</source>
         <translation>Błąd tworzenia kontekstu (%1)</translation>
     </message>
@@ -8146,7 +8236,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Niepoprawna lub pusta lista szyfrów (%1)</translation>
     </message>
     <message>
-        <location line="+45"/>
+        <location line="+57"/>
         <source>Private key does not certify public key, %1</source>
         <translation>Prywatny klucz nie uwiarygodnia publicznego, %1</translation>
     </message>
@@ -8361,7 +8451,7 @@ Proszę wybrać inną nazwę pliku.</translation>
 <context>
     <name>QTabBar</name>
     <message>
-        <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="-326"/>
+        <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="-330"/>
         <source>Scroll Left</source>
         <translation>Przewiń w lewo</translation>
     </message>
@@ -8382,7 +8472,7 @@ Proszę wybrać inną nazwę pliku.</translation>
 <context>
     <name>QTextControl</name>
     <message>
-        <location filename="../src/gui/text/qtextcontrol.cpp" line="+2049"/>
+        <location filename="../src/gui/text/qtextcontrol.cpp" line="+2057"/>
         <source>&amp;Copy</source>
         <translation>S&amp;kopiuj</translation>
     </message>
@@ -9083,12 +9173,12 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Nieznany</translation>
     </message>
     <message>
-        <location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp" line="+248"/>
+        <location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp" line="+256"/>
         <source>Web Inspector - %2</source>
         <translation>Wizytator sieciowy - %2</translation>
     </message>
     <message>
-        <location filename="../src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp" line="+347"/>
+        <location filename="../src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp" line="+355"/>
         <source>Redirection limit reached</source>
         <translation>Osiągnięto limit przekierowań</translation>
     </message>
@@ -9197,7 +9287,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         </translation>
     </message>
     <message>
-        <location filename="../src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp" line="+1979"/>
+        <location filename="../src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp" line="+2083"/>
         <source>JavaScript Alert - %1</source>
         <translation>Ostrzeżenie JavaScript - %1</translation>
     </message>
@@ -9222,7 +9312,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Skrypt na tej stronie nie działa poprawnie. Czy chcesz przerwać ten skrypt?</translation>
     </message>
     <message>
-        <location line="+376"/>
+        <location line="+395"/>
         <source>Move the cursor to the next character</source>
         <translation>Przesuń kursor do następnego znaku</translation>
     </message>
@@ -9443,7 +9533,7 @@ Proszę wybrać inną nazwę pliku.</translation>
 <context>
     <name>QWidget</name>
     <message>
-        <location filename="../src/gui/kernel/qwidget.cpp" line="+5793"/>
+        <location filename="../src/gui/kernel/qwidget.cpp" line="+5856"/>
         <source>*</source>
         <translation>*</translation>
     </message>
@@ -11536,7 +11626,7 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>&quot;processContent&quot; dżokera w wywiedzionym elemencie jest słabszy od dżokera w podstawowym elemencie.</translation>
     </message>
     <message>
-        <location line="+240"/>
+        <location line="+270"/>
         <source>Derived particle allows content that is not allowed in the base particle.</source>
         <translation>Wywiedziony element pozwala na zawartość która jest niedozwolona w podstawowym elemencie.</translation>
     </message>
@@ -12277,12 +12367,4 @@ Proszę wybrać inną nazwę pliku.</translation>
         <translation>Atrybut &quot;%1&quot; zawiera niepoprawną zawartość QName: %2.</translation>
     </message>
 </context>
-<context>
-    <name>S60MediaPlayerControl</name>
-    <message>
-        <location filename="../src/plugins/mediaservices/symbian/mediaplayer/s60mediaplayercontrol.cpp" line="+231"/>
-        <source>Media couldn&apos;t be resolved</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
 </TS>
-- 
cgit v0.12


From 1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d Mon Sep 17 00:00:00 2001
From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Date: Thu, 22 Jul 2010 16:22:07 +0200
Subject: Register a few gesture-related types in the meta-type system.

Reviewed-by: Zeno Albisser
Reviewed-by: Volker Hilsheimer
---
 src/corelib/global/qnamespace.h | 3 +++
 src/gui/kernel/qgesture.h       | 3 +++
 src/imports/gestures/plugin.cpp | 7 +++++++
 3 files changed, 13 insertions(+)

diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index a12e121..68702c4 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -90,6 +90,9 @@ Qt {
     Q_ENUMS(InputMethodHint)
     Q_FLAGS(WindowFlags WindowStates InputMethodHints)
     Q_ENUMS(ConnectionType)
+#ifndef QT_NO_GESTURES
+    Q_ENUMS(GestureState)
+#endif
 #endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN))
 
 #if defined(Q_MOC_RUN)
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index 8f410b1..dcb0264 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -134,6 +134,7 @@ class Q_GUI_EXPORT QPinchGesture : public QGesture
 {
     Q_OBJECT
     Q_DECLARE_PRIVATE(QPinchGesture)
+    Q_FLAGS(ChangeFlags ChangeFlag)
 
 public:
     enum ChangeFlag {
@@ -191,6 +192,8 @@ public:
     friend class QPinchGestureRecognizer;
 };
 
+Q_DECLARE_OPERATORS_FOR_FLAGS(QPinchGesture::ChangeFlags)
+
 QT_END_NAMESPACE
 
 Q_DECLARE_METATYPE(QPinchGesture::ChangeFlags)
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp
index 1fc23ca..8f85553 100644
--- a/src/imports/gestures/plugin.cpp
+++ b/src/imports/gestures/plugin.cpp
@@ -55,6 +55,13 @@ public:
         Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures"));
 #ifndef QT_NO_GESTURES
         qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser);
+
+        qmlRegisterUncreatableType<QGesture>(uri, 1, 0, "Gesture", QLatin1String("Do not create objects of this type."));
+        qmlRegisterUncreatableType<QPanGesture>(uri, 1, 0, "PanGesture", QLatin1String("Do not create objects of this type."));
+        qmlRegisterUncreatableType<QTapGesture>(uri, 1, 0, "TapGesture", QLatin1String("Do not create objects of this type."));
+        qmlRegisterUncreatableType<QTapAndHoldGesture>(uri, 1, 0, "TapAndHoldGesture", QLatin1String("Do not create objects of this type."));
+        qmlRegisterUncreatableType<QPinchGesture>(uri, 1, 0, "PinchGesture", QLatin1String("Do not create objects of this type."));
+        qmlRegisterUncreatableType<QSwipeGesture>(uri, 1, 0, "SwipeGesture", QLatin1String("Do not create objects of this type."));
 #endif
     }
 };
-- 
cgit v0.12


From ca92c8e4bf6d9bcd843d020c974c6e2ed515cf15 Mon Sep 17 00:00:00 2001
From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Date: Thu, 22 Jul 2010 16:29:09 +0200
Subject: Report errors when evaluating JavaScript expressions from the
 GestureArea QML plugin.

Before the patch if the evaluation fails (for any reason - because you access
invalid or non-existing property, or because of a spelling mistake, etc), the
expression will be silently ignored, making if very hard to figure out what is
going wrong.

The patch makes sure the error description will be printed on the output.

Reviewed-by: Warwick Allison
---
 src/imports/gestures/qdeclarativegesturearea.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 243ba0f..a8f98f1 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -261,7 +261,10 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
     bool accept = true;
     for (Bindings::Iterator it = bindings.begin(); it != bindings.end(); ++it) {
         if ((gesture = event->gesture(it.key()))) {
-            it.value()->evaluate();
+            QDeclarativeExpression *expr = it.value();
+            expr->evaluate();
+            if (expr->hasError())
+                qmlInfo(q_func()) << expr->error();
             event->setAccepted(true); // XXX only if value returns true?
         }
     }
-- 
cgit v0.12


From 1d5bc6d586445c477823e4f7fe03530634bf869d Mon Sep 17 00:00:00 2001
From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Date: Thu, 22 Jul 2010 17:04:56 +0200
Subject: Fixed the scope when evaluating GestureArea javascript expressions

In the QML gesture example we access properties of the gesture by just
accessing the "gesture" property, which is in fact in a GestureArea. To make it
work I've set the GestureArea as a scope of the evaluated javascript
expression.

Reviewed-by: Warwick Allison
---
 src/imports/gestures/qdeclarativegesturearea.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index a8f98f1..ed936d5 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -228,7 +228,7 @@ void QDeclarativeGestureArea::connectSignals()
         ds >> gesturetype;
         QString script;
         ds >> script;
-        QDeclarativeExpression *exp = new QDeclarativeExpression(qmlContext(this), 0, script);
+        QDeclarativeExpression *exp = new QDeclarativeExpression(qmlContext(this), this, script);
         d->bindings.insert(Qt::GestureType(gesturetype),exp);
         grabGesture(Qt::GestureType(gesturetype));
     }
-- 
cgit v0.12


From 06384dfe674e021c3e6bb66427b4adef4bceb181 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 23 Jul 2010 13:26:20 +0200
Subject: qdoc: Cleaned up the Inherits and Inherited by lines for QML
 elements.

---
 tools/qdoc3/htmlgenerator.cpp | 36 ++++++++++++++----------------------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 1b62dc4..5c7e4e5 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1256,20 +1256,18 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
     generateHeader(title, inner, marker);
     sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
     generateTableOfContents(inner,marker,&sections);
-    generateTitle(title, subtitleText, SmallSubTitle, inner, marker);
-
-#ifdef QDOC_QML
-    if (classe && !classe->qmlElement().isEmpty()) {
-        generateInstantiatedBy(classe,marker);
-    }
-#endif
-    
+    generateTitle(title, subtitleText, SmallSubTitle, inner, marker);    
     generateBrief(inner, marker);
     generateIncludes(inner, marker);
     generateStatus(inner, marker);
     if (classe) {
         generateInherits(classe, marker);
         generateInheritedBy(classe, marker);
+#ifdef QDOC_QML
+        if (!classe->qmlElement().isEmpty()) {
+            generateInstantiatedBy(classe,marker);
+        }
+#endif
     }
     generateThreadSafeness(inner, marker);
     generateSince(inner, marker);
@@ -1552,10 +1550,10 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
     else if (fake->subType() == Node::QmlClass) {
         const QmlClassNode* qml_cn = static_cast<const QmlClassNode*>(fake);
         const ClassNode* cn = qml_cn->classNode();
-        generateQmlInherits(qml_cn, marker);
-        generateQmlInstantiates(qml_cn, marker);
         generateBrief(qml_cn, marker);
+        generateQmlInherits(qml_cn, marker);
         generateQmlInheritedBy(qml_cn, marker);
+        generateQmlInstantiates(qml_cn, marker);
         sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
         s = sections.begin();
         while (s != sections.end()) {
@@ -4180,16 +4178,14 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn,
             const Node* n = myTree->findNode(strList,Node::Fake);
             if (n && n->subType() == Node::QmlClass) {
                 const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
-                out() << "<p class=\"centerAlign\">";
                 Text text;
-                text << "[Inherits ";
+                text << Atom::ParaLeft << "Inherits ";
                 text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
                 text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
                 text << Atom(Atom::String, linkPair.second);
                 text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-                text << "]";
+                text << Atom::ParaRight;
                 generateText(text, cn, marker);
-                out() << "</p>";
             }
         }
     }
@@ -4227,9 +4223,8 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
 {
     const ClassNode* cn = qcn->classNode();
     if (cn && (cn->status() != Node::Internal)) {
-        out() << "<p class=\"centerAlign\">";
         Text text;
-        text << "[";
+        text << Atom::ParaLeft;
         text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
         text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
         QString name = qcn->name();
@@ -4242,9 +4237,8 @@ void HtmlGenerator::generateQmlInstantiates(const QmlClassNode* qcn,
         text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
         text << Atom(Atom::String, cn->name());
         text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-        text << "]";
+        text << Atom::ParaRight;
         generateText(text, qcn, marker);
-        out() << "</p>";
     }
 }
 
@@ -4261,9 +4255,8 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn,
     if (cn &&  cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) {
         const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake);
         if (n && n->subType() == Node::QmlClass) {
-            out() << "<p class=\"centerAlign\">";
             Text text;
-            text << "[";
+            text << Atom::ParaLeft;
             text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
             text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
             text << Atom(Atom::String, cn->name());
@@ -4273,9 +4266,8 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn,
             text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
             text << Atom(Atom::String, n->name());
             text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
-            text << "]";
+            text << Atom::ParaRight;
             generateText(text, cn, marker);
-            out() << "</p>";
         }
     }
 }
-- 
cgit v0.12


From 22c482836b57540df89df261cdd5f9c4dadf0daa Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 23 Jul 2010 14:39:38 +0200
Subject: qdoc: Cleaned up the TOC for QML element pages.

---
 tools/qdoc3/htmlgenerator.cpp | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 5c7e4e5..416d44a 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1474,7 +1474,13 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
       Generate the TOC for the new doc format.
       Don't generate a TOC for the home page.
     */
-    if (fake->name() != QString("index.html"))
+    const QmlClassNode* qml_cn = 0;
+    if (fake->subType() == Node::QmlClass) {
+        qml_cn = static_cast<const QmlClassNode*>(fake);
+        sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
+        generateTableOfContents(fake,marker,&sections);
+    }
+    else if (fake->name() != QString("index.html"))
         generateTableOfContents(fake,marker,0);
 
     generateTitle(fullTitle,
@@ -1548,16 +1554,15 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
     }
 #ifdef QDOC_QML
     else if (fake->subType() == Node::QmlClass) {
-        const QmlClassNode* qml_cn = static_cast<const QmlClassNode*>(fake);
         const ClassNode* cn = qml_cn->classNode();
         generateBrief(qml_cn, marker);
         generateQmlInherits(qml_cn, marker);
         generateQmlInheritedBy(qml_cn, marker);
         generateQmlInstantiates(qml_cn, marker);
-        sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
         s = sections.begin();
         while (s != sections.end()) {
-            out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << "\n";
+            out() << "<a name=\"" << registerRef((*s).name.toLower())
+                  << "\"></a>" << divNavTop << "\n";
             out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
             generateQmlSummary(*s,fake,marker);
             ++s;
@@ -2061,7 +2066,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
         }
     }
     else if (sections && ((node->type() == Node::Class) ||
-                          (node->type() == Node::Namespace))) {
+                          (node->type() == Node::Namespace) ||
+                          (node->subType() == Node::QmlClass))) {
         QList<Section>::ConstIterator s = sections->begin();
         while (s != sections->end()) {
             if (!s->members.isEmpty() || !s->reimpMembers.isEmpty()) {
-- 
cgit v0.12


From 24cdab32de2abd8669f281dd54c8da1124514915 Mon Sep 17 00:00:00 2001
From: Pierre Rossi <pierre.rossi@nokia.com>
Date: Fri, 23 Jul 2010 14:53:58 +0200
Subject: Fix QLineEdit's Highlight color when inactive.

This commit also updates QPalette's documentation regarding the current
ColorGroup and operator==.

Task-number: QTBUG-697
Reviewed-by: ogoffart
---
 src/gui/kernel/qpalette.cpp            | 10 ++++++++++
 src/gui/widgets/qlineedit.cpp          |  3 ++-
 tests/auto/qlineedit/tst_qlineedit.cpp | 18 +++++++++++++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 98e8f66..38ec806 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -868,11 +868,21 @@ void QPalette::detach()
 
     Returns true (slowly) if this palette is different from \a p;
     otherwise returns false (usually quickly).
+
+    \note The current ColorGroup is not taken into account when
+    comparing palettes
+
+    \sa operator==
 */
 
 /*!
     Returns true (usually quickly) if this palette is equal to \a p;
     otherwise returns false (slowly).
+
+    \note The current ColorGroup is not taken into account when
+    comparing palettes
+
+    \sa operator!=
 */
 bool QPalette::operator==(const QPalette &p) const
 {
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index d7311ef..981e934 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1949,7 +1949,8 @@ void QLineEdit::paintEvent(QPaintEvent *)
     if (d->control->hasSelectedText() || (d->cursorVisible && !d->control->inputMask().isEmpty() && !d->control->isReadOnly())){
         flags |= QLineControl::DrawSelections;
         // Palette only used for selections/mask and may not be in sync
-        if(d->control->palette() != pal)
+        if (d->control->palette() != pal
+           || d->control->palette().currentColorGroup() != pal.currentColorGroup())
             d->control->setPalette(pal);
     }
 
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index b34e559..e0747f8 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -66,7 +66,6 @@
 #include <qspinbox.h>
 #include <qdebug.h>
 
-
 //TESTED_CLASS=
 //TESTED_FILES=
 
@@ -275,6 +274,7 @@ private slots:
     void taskQTBUG_7902_contextMenuCrash();
 #endif
     void taskQTBUG_7395_readOnlyShortcut();
+    void QTBUG697_paletteCurrentColorGroup();
 
 #ifdef QT3_SUPPORT
     void validateAndSet_data();
@@ -3714,5 +3714,21 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut()
     QCOMPARE(spy.count(), 1);
 }
 
+void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
+{
+    testWidget->setText("               ");
+    QPalette p = testWidget->palette();
+    p.setBrush(QPalette::Active, QPalette::Highlight, Qt::green);
+    p.setBrush(QPalette::Inactive, QPalette::Highlight, Qt::red);
+    testWidget->setPalette(p);
+    testWidget->selectAll();
+    QImage img(testWidget->rect().size(),QImage::Format_ARGB32 );
+    testWidget->render(&img);
+    QCOMPARE(img.pixel(10, testWidget->height()/2), QColor(Qt::green).rgb());
+    QApplication::setActiveWindow(0);
+    testWidget->render(&img);
+    QCOMPARE(img.pixel(10, testWidget->height()/2), QColor(Qt::red).rgb());
+}
+
 QTEST_MAIN(tst_QLineEdit)
 #include "tst_qlineedit.moc"
-- 
cgit v0.12


From 28c23cdd08c3d6d9f8440047a15efcd865fa4a8c Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 23 Jul 2010 16:39:26 +0200
Subject: Make it possible for Qt modules to extend QT_CONFIG

This is done by reading the module files from within qconfig.pri.

Task-number: QTBUG-12379
Rubber-stamped-by: Joerg Bornemann
Rubber-stamped-by: Marius Storm-Olsen
---
 configure                        | 3 +++
 tools/configure/configureapp.cpp | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/configure b/configure
index aa48c84..de67ed1 100755
--- a/configure
+++ b/configure
@@ -7864,6 +7864,9 @@ QT_LIBINFIX = $QT_LIBINFIX
 QT_NAMESPACE = $QT_NAMESPACE
 QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
 
+#modules
+for(mod,$$list($$files($$[QMAKE_MKSPECS]/modules/qt_*.pri))):include($$mod)
+
 EOF
 if [ "$CFG_RPATH" = "yes" ]; then
     echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp"
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index f7dac93..b7de052 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2925,6 +2925,8 @@ void Configure::generateCachefile()
             configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
         }
 
+        configStream << "#modules" << endl << "for(mod,$$list($$files($$[QMAKE_MKSPECS]/modules/qt_*.pri))):include($$mod)" << endl;
+
         configStream.flush();
         configFile.close();
     }
-- 
cgit v0.12


From a7bf97f437a8d4e44a9256a89d7d6ba239577949 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 23 Jul 2010 16:51:17 +0200
Subject: Updated WebKit to 669858f9bbd4913fd16c642090375c81acbfdb04

---
 mkspecs/modules/qt_webkit_version.pri              |  1 +
 src/3rdparty/webkit/.tag                           |  2 +-
 src/3rdparty/webkit/VERSION                        |  2 +-
 src/3rdparty/webkit/WebCore/ChangeLog              | 16 +++++++++++
 src/3rdparty/webkit/WebKit/qt/ChangeLog            | 32 ++++++++++++++++++++++
 .../webkit/WebKit/qt/qt_webkit_version.pri         |  1 +
 .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp      |  3 ++
 7 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/mkspecs/modules/qt_webkit_version.pri b/mkspecs/modules/qt_webkit_version.pri
index ffd192c..d8cf06c 100644
--- a/mkspecs/modules/qt_webkit_version.pri
+++ b/mkspecs/modules/qt_webkit_version.pri
@@ -2,3 +2,4 @@ QT_WEBKIT_VERSION = 4.7.0
 QT_WEBKIT_MAJOR_VERSION = 4
 QT_WEBKIT_MINOR_VERSION = 7
 QT_WEBKIT_PATCH_VERSION = 0
+QT_CONFIG *= webkit
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 1d1c8ed..79165f6 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-ad96ca2f9b57271da4ea7432022ac686ee0981c2
+669858f9bbd4913fd16c642090375c81acbfdb04
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 2e5ebd0..e492154 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
 
 and has the sha1 checksum
 
-        ad96ca2f9b57271da4ea7432022ac686ee0981c2
+        669858f9bbd4913fd16c642090375c81acbfdb04
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index a993a97..1f7ca09 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-21  Kristian Amlie <kristian.amlie@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added automatic sqlite extraction for Symbian to QtWebKit.
+
+        Also added sqlite detection in case sqlite is not present in the SDK.
+        This is possible if WebKit is compiled standalone.
+
+        The inclusion part is a consequence of commit c578c6c1d6d in the Qt
+        repository. It will not work on Qt versions < 4.7.1, but that is ok,
+        since the only build system it will affect is marked as experimental
+        in the whole 4.7 series.
+
+        * WebCore.pro:
+
 2010-05-14  Abhishek Arya  <inferno@chromium.org>
 
         Reviewed by David Hyatt.
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 63d5568..1075b24 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,35 @@
+2010-07-23  David Boddie  <dboddie@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        Doc: Fixed incorrect QML property type.
+
+        * declarative/qdeclarativewebview.cpp:
+
+2010-07-23  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        [Qt] Build fix for Qt apps
+
+        Add webkit to QT_CONFIG. qconfig.pri will read qt_webkit_version.pri and
+        that's how it will pick up webkit in QT_CONFIG.
+
+        * qt_webkit_version.pri:
+
+2010-07-09  Kent Hansen  <kent.hansen@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Skip test that never terminates on maemo5
+
+        Due to https://bugs.webkit.org/show_bug.cgi?id=38538
+        the tst_QWebPage::infiniteLoopJS() autotest never terminates.
+        Skip the test so that the test case may run to completion.
+
+        Patch by Dominik Holland <dominik.holland@nokia.com>
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::infiniteLoopJS):
+
 2010-07-09  Simon Hausmann <simon.hausmann@nokia.com>
 
         Unreviewed trivial Symbian build fix.
diff --git a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index ffd192c..d8cf06c 100644
--- a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
@@ -2,3 +2,4 @@ QT_WEBKIT_VERSION = 4.7.0
 QT_WEBKIT_MAJOR_VERSION = 4
 QT_WEBKIT_MINOR_VERSION = 7
 QT_WEBKIT_PATCH_VERSION = 0
+QT_CONFIG *= webkit
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 0f2ca22..b7ffb8a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -219,6 +219,9 @@ public slots:
 
 void tst_QWebPage::infiniteLoopJS()
 {
+#ifdef Q_WS_MAEMO_5
+    QSKIP("Test never terminates on Maemo 5 : https://bugs.webkit.org/show_bug.cgi?id=38538", SkipAll);
+#endif
     JSTestPage* newPage = new JSTestPage(m_view);
     m_view->setPage(newPage);
     m_view->setHtml(QString("<html><bodytest</body></html>"), QUrl());
-- 
cgit v0.12


From 9d2760f619782145e0861300901531a56c12991a Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Fri, 23 Jul 2010 16:06:08 +0200
Subject: QScriptEngineAgent:  ensure that the top of the backtrace is correct
 in exceptionThrow

Reviewed-by: Jedrzej Nowacki
---
 src/script/api/qscriptengineagent.cpp              |  3 +
 .../qscriptengineagent/tst_qscriptengineagent.cpp  | 83 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)

diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 28905e8..0b5828a 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -134,9 +134,12 @@ void QScriptEngineAgentPrivate::returnEvent(const JSC::DebuggerCallFrame& frame,
 void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
 {
     JSC::CallFrame *oldFrame = engine->currentFrame;
+    int oldAgentLineNumber = engine->agentLineNumber;
     engine->currentFrame = frame.callFrame();
     QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
+    engine->agentLineNumber = value.property(QLatin1String("lineNumber")).toInt32();
     q_ptr->exceptionThrow(sourceID, value, hasHandler);
+    engine->agentLineNumber = oldAgentLineNumber;
     engine->currentFrame = oldFrame;
     engine->setCurrentException(value);
 };
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index a0f10dd..ed00b96 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -116,6 +116,8 @@ private slots:
     void evaluateProgram_SyntaxError();
     void evaluateNullProgram();
     void QTBUG6108();
+    void backtraces_data();
+    void backtraces();
 
 private:
     double m_testProperty;
@@ -2379,5 +2381,86 @@ void tst_QScriptEngineAgent::QTBUG6108()
     QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId);
 }
 
+class BacktraceSpy : public QScriptEngineAgent
+{
+public:
+    BacktraceSpy(QScriptEngine *engine, const QStringList &expectedbacktrace, int breakpoint)
+        : QScriptEngineAgent(engine), expectedbacktrace(expectedbacktrace), breakpoint(breakpoint), ok(false) {}
+
+    QStringList expectedbacktrace;
+    int breakpoint;
+    bool ok;
+
+protected:
+
+    void exceptionThrow(qint64 , const QScriptValue &, bool)
+    {  check();  }
+
+    void positionChange(qint64 , int lineNumber, int )
+    {
+        if (lineNumber == breakpoint)
+            check();
+    }
+
+private:
+    void check()
+    {
+        QCOMPARE(engine()->currentContext()->backtrace(), expectedbacktrace);
+        ok = true;
+    }
+};
+
+
+void tst_QScriptEngineAgent::backtraces_data()
+{
+    QTest::addColumn<QString>("code");
+    QTest::addColumn<int>("breakpoint");
+    QTest::addColumn<QStringList>("expectedbacktrace");
+
+    {
+        QString source(
+            "function foo() {\n"
+            "  var a = 5\n"
+            "}\n"
+            "foo('hello', { })\n"
+            "var r = 0;");
+
+        QStringList expected;
+        expected
+            << "foo('hello', [object Object]) at filename.js:2"
+            << "<global>() at filename.js:4";
+        QTest::newRow("simple breakpoint") << source <<  2 << expected;
+    }
+
+    {
+        QString source(
+            "function foo() {\n"
+            "  error = err\n" //this must throw
+            "}\n"
+            "foo('hello', { })\n"
+            "var r = 0;");
+
+        QStringList expected;
+        expected
+            << "foo('hello', [object Object]) at filename.js:2"
+            << "<global>() at filename.js:4";
+        QTest::newRow("throw because of error") << source <<  -100 << expected;
+    }
+}
+
+void tst_QScriptEngineAgent::backtraces()
+{
+    QFETCH(QString, code);
+    QFETCH(int, breakpoint);
+    QFETCH(QStringList, expectedbacktrace);
+
+    QScriptEngine eng;
+    BacktraceSpy *spy = new BacktraceSpy(&eng, expectedbacktrace, breakpoint);
+    eng.setAgent(spy);
+    QLatin1String filename("filename.js");
+    eng.evaluate(code, filename);
+    QVERIFY(spy->ok);
+}
+
 QTEST_MAIN(tst_QScriptEngineAgent)
 #include "tst_qscriptengineagent.moc"
-- 
cgit v0.12


From 1b0bc13c14083d6146517ba1d8a63a6a503733b9 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Fri, 23 Jul 2010 19:04:42 +0200
Subject: Stabilize tst_qlineedit.cpp

---
 tests/auto/qlineedit/tst_qlineedit.cpp | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index e0747f8..8951130 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -3716,18 +3716,26 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut()
 
 void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
 {
-    testWidget->setText("               ");
-    QPalette p = testWidget->palette();
+    QLineEdit le;
+    le.setText("               ");
+    QPalette p = le.palette();
     p.setBrush(QPalette::Active, QPalette::Highlight, Qt::green);
     p.setBrush(QPalette::Inactive, QPalette::Highlight, Qt::red);
-    testWidget->setPalette(p);
-    testWidget->selectAll();
-    QImage img(testWidget->rect().size(),QImage::Format_ARGB32 );
-    testWidget->render(&img);
-    QCOMPARE(img.pixel(10, testWidget->height()/2), QColor(Qt::green).rgb());
+    le.setPalette(p);
+
+    le.show();
+    QApplication::setActiveWindow(&le);
+    QTest::qWaitForWindowShown(&le);
+    le.setFocus();
+    QTRY_VERIFY(le.hasFocus());
+    le.selectAll();
+
+    QImage img(le.size(),QImage::Format_ARGB32 );
+    le.render(&img);
+    QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::green).rgb());
     QApplication::setActiveWindow(0);
-    testWidget->render(&img);
-    QCOMPARE(img.pixel(10, testWidget->height()/2), QColor(Qt::red).rgb());
+    le.render(&img);
+    QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb());
 }
 
 QTEST_MAIN(tst_QLineEdit)
-- 
cgit v0.12


From 725d8e061ededee9a5ddf0914aabd0f6aa2ee741 Mon Sep 17 00:00:00 2001
From: Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com>
Date: Fri, 23 Jul 2010 17:03:42 +0200
Subject: Drawer widget in a MainWindow disappears after returning from full
 screen mode.

The problem was in the toggleDrawer function. We were not checking the
status of the last transition before setting the new transition, so
all the transition were treated as non-intentional.

Task-number: QTBUG-11373
Reviewed-by: Prasanth
---
 src/gui/kernel/qwidget_mac.mm      |  4 +++-
 tests/auto/qwidget/tst_qwidget.cpp | 23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index c788711..8ae6a99 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1599,12 +1599,14 @@ void QWidgetPrivate::toggleDrawers(bool visible)
             continue;
         QWidget *widget = static_cast<QWidget*>(object);
         if(qt_mac_is_macdrawer(widget)) {
+            bool oldState = widget->testAttribute(Qt::WA_WState_ExplicitShowHide);
             if(visible) {
                 if (!widget->testAttribute(Qt::WA_WState_ExplicitShowHide))
                     widget->show();
             } else {
                 widget->hide();
-                widget->setAttribute(Qt::WA_WState_ExplicitShowHide, false);
+                if(!oldState)
+                    widget->setAttribute(Qt::WA_WState_ExplicitShowHide, false);
             }
         }
     }
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 2d559c8..f20d27a 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -397,6 +397,9 @@ private slots:
     void childAt();
 #ifdef Q_WS_MAC
     void childAt_unifiedToolBar();
+#ifdef QT_MAC_USE_COCOA
+    void taskQTBUG_11373();
+#endif // QT_MAC_USE_COCOA
 #endif
 
 private:
@@ -10435,6 +10438,26 @@ void tst_QWidget::childAt_unifiedToolBar()
     QCOMPARE(mainWindow.childAt(toolBarTopLeft), static_cast<QWidget *>(toolBar));
     QCOMPARE(mainWindow.childAt(labelTopLeft), static_cast<QWidget *>(label));
 }
+
+#ifdef QT_MAC_USE_COCOA
+void tst_QWidget::taskQTBUG_11373()
+{
+    QMainWindow * myWindow = new QMainWindow();
+    QWidget * center = new QWidget();
+    myWindow -> setCentralWidget(center);
+    QWidget * drawer = new QWidget(myWindow, Qt::Drawer);
+    drawer -> hide();
+    QCOMPARE(drawer->isVisible(), false);
+    myWindow -> show();
+    myWindow -> raise();
+    // The drawer shouldn't be visible now.
+    QCOMPARE(drawer->isVisible(), false);
+    myWindow -> setWindowState(Qt::WindowFullScreen);
+    myWindow -> setWindowState(Qt::WindowNoState);
+    // The drawer should still not be visible, since we haven't shown it.
+    QCOMPARE(drawer->isVisible(), false);
+}
+#endif // QT_MAC_USE_COCOA
 #endif
 
 QTEST_MAIN(tst_QWidget)
-- 
cgit v0.12


From 1fe3c3f38701c3af27c5385acfb8458d1b85bfca Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Sat, 24 Jul 2010 15:35:42 +0200
Subject: Fix quoting for module reading in qconfig.pri

Patch by Fathi Boudra <fathi.boudra@nokia.com>

Task-number: QTBUG-12379
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index de67ed1..ffd38d0 100755
--- a/configure
+++ b/configure
@@ -7865,7 +7865,7 @@ QT_NAMESPACE = $QT_NAMESPACE
 QT_NAMESPACE_MAC_CRC = $QT_NAMESPACE_MAC_CRC
 
 #modules
-for(mod,$$list($$files($$[QMAKE_MKSPECS]/modules/qt_*.pri))):include($$mod)
+for(mod,\$\$list(\$\$files(\$\$[QMAKE_MKSPECS]/modules/qt_*.pri))):include(\$\$mod)
 
 EOF
 if [ "$CFG_RPATH" = "yes" ]; then
-- 
cgit v0.12

-- 
cgit v0.12


From 3e8597ff6029d33d629191370d9fed7d37d3962a Mon Sep 17 00:00:00 2001
From: Evan Nguyen <evan.nguyen@nokia.com>
Date: Mon, 26 Jul 2010 14:18:37 +1000
Subject: Q_INVOKABLES added to Qt-DBus

Task-number: QTBUG-12397
---
 src/dbus/qdbusconnection.h                       |   3 +
 src/dbus/qdbusintegrator.cpp                     |  22 ++--
 src/dbus/qdbusinterface.cpp                      |   2 +-
 src/dbus/qdbusxmlgenerator.cpp                   |   8 +-
 tests/auto/qdbusinterface/tst_qdbusinterface.cpp | 138 +++++++++++++++++++++--
 5 files changed, 153 insertions(+), 20 deletions(-)

diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index 0f365ec..eedda16 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -85,16 +85,19 @@ public:
         ExportScriptableSlots = 0x10,
         ExportScriptableSignals = 0x20,
         ExportScriptableProperties = 0x40,
+        ExportScriptableInvokables = 0x80,
         ExportScriptableContents = 0xf0,
 
         ExportNonScriptableSlots = 0x100,
         ExportNonScriptableSignals = 0x200,
         ExportNonScriptableProperties = 0x400,
+        ExportNonScriptableInvokables = 0x800,
         ExportNonScriptableContents = 0xf00,
 
         ExportAllSlots = ExportScriptableSlots|ExportNonScriptableSlots,
         ExportAllSignals = ExportScriptableSignals|ExportNonScriptableSignals,
         ExportAllProperties = ExportScriptableProperties|ExportNonScriptableProperties,
+        ExportAllInvokables = ExportScriptableInvokables|ExportNonScriptableInvokables,
         ExportAllContents = ExportScriptableContents|ExportNonScriptableContents,
 
 #ifndef Q_QDOC
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 1f44bd2..e1b90b8 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -508,7 +508,7 @@ static bool shouldWatchService(const QString &service)
     return !service.isEmpty() && !service.startsWith(QLatin1Char(':'));
 }
 
-extern Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
+extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
 void qDBusAddSpyHook(QDBusSpyHook hook)
 {
     qDBusSpyHookList()->append(hook);
@@ -618,7 +618,7 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
             continue;
 
         // check type:
-        if (mm.methodType() != QMetaMethod::Slot)
+        if (mm.methodType() != QMetaMethod::Slot && mm.methodType() != QMetaMethod::Method)
             continue;
 
         // check name:
@@ -682,10 +682,17 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
         if (isAsync && metaTypes.count() > i + 1)
             continue;
 
-        if (isScriptable && (flags & QDBusConnection::ExportScriptableSlots) == 0)
-            continue;           // not exported
-        if (!isScriptable && (flags & QDBusConnection::ExportNonScriptableSlots) == 0)
-            continue;           // not exported
+        if (mm.methodType() == QMetaMethod::Slot) {
+            if (isScriptable && (flags & QDBusConnection::ExportScriptableSlots) == 0)
+                continue;           // scriptable slots not exported
+            if (!isScriptable && (flags & QDBusConnection::ExportNonScriptableSlots) == 0)
+                continue;           // non-scriptable slots not exported
+        } else {
+            if (isScriptable && (flags & QDBusConnection::ExportScriptableInvokables) == 0)
+                continue;           // scriptable invokables not exported
+            if (!isScriptable && (flags & QDBusConnection::ExportNonScriptableInvokables) == 0)
+                continue;           // non-scriptable invokables not exported
+        }
 
         // if we got here, this slot matched
         return idx;
@@ -1379,7 +1386,8 @@ void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node, const QDBusMes
         return;                 // internal filters have already run or an error has been sent
 
     // try the object itself:
-    if (node.flags & (QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportNonScriptableSlots)) {
+    if (node.flags & (QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportNonScriptableSlots) ||
+        node.flags & (QDBusConnection::ExportScriptableInvokables|QDBusConnection::ExportNonScriptableInvokables)) {
         bool interfaceFound = true;
         if (!msg.interface().isEmpty())
             interfaceFound = qDBusInterfaceInObject(node.obj, msg.interface());
diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp
index b989cab..248bf65 100644
--- a/src/dbus/qdbusinterface.cpp
+++ b/src/dbus/qdbusinterface.cpp
@@ -277,7 +277,7 @@ int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv)
             // signal relay from D-Bus world to Qt world
             QMetaObject::activate(q, metaObject, id, argv);
 
-        } else if (mm.methodType() == QMetaMethod::Slot) {
+        } else if (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method) {
             // method call relay from Qt world to D-Bus world
             // get D-Bus equivalent signature
             QString methodName = QLatin1String(metaObject->dbusNameForMethod(id));
diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp
index 7cc5acb..1222ac7 100644
--- a/src/dbus/qdbusxmlgenerator.cpp
+++ b/src/dbus/qdbusxmlgenerator.cpp
@@ -133,7 +133,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
         if (mm.methodType() == QMetaMethod::Signal)
             // adding a signal
             isSignal = true;
-        else if (mm.methodType() == QMetaMethod::Slot && mm.access() == QMetaMethod::Public)
+        else if (mm.access() == QMetaMethod::Public && (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method))
             isSignal = false;
         else
             continue;           // neither signal nor public slot
@@ -141,9 +141,9 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
         if (isSignal && !(flags & (QDBusConnection::ExportScriptableSignals |
                                    QDBusConnection::ExportNonScriptableSignals)))
             continue;           // we're not exporting any signals
-        if (!isSignal && !(flags & (QDBusConnection::ExportScriptableSlots |
-                                    QDBusConnection::ExportNonScriptableSlots)))
-            continue;           // we're not exporting any slots
+        if (!isSignal && (!(flags & (QDBusConnection::ExportScriptableSlots | QDBusConnection::ExportNonScriptableSlots)) &&
+                          !(flags & (QDBusConnection::ExportScriptableInvokables | QDBusConnection::ExportNonScriptableInvokables))))
+            continue;           // we're not exporting any slots or invokables
 
         QString xml = QString::fromLatin1("    <%1 name=\"%2\">\n")
                       .arg(isSignal ? QLatin1String("signal") : QLatin1String("method"))
diff --git a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
index d8ff2d3..a870e47 100644
--- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
+++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp
@@ -70,18 +70,34 @@ class MyObject: public QObject
 "      <arg direction=\"in\" type=\"v\" name=\"ping\" />\n"
 "      <arg direction=\"out\" type=\"v\" name=\"ping\" />\n"
 "    </method>\n"
+"    <method name=\"ping_invokable\" >\n"
+"      <arg direction=\"in\" type=\"v\" name=\"ping_invokable\" />\n"
+"      <arg direction=\"out\" type=\"v\" name=\"ping_invokable\" />\n"
+"    </method>\n"
 "    <method name=\"ping\" >\n"
 "      <arg direction=\"in\" type=\"v\" name=\"ping1\" />\n"
 "      <arg direction=\"in\" type=\"v\" name=\"ping2\" />\n"
 "      <arg direction=\"out\" type=\"v\" name=\"pong1\" />\n"
 "      <arg direction=\"out\" type=\"v\" name=\"pong2\" />\n"
 "    </method>\n"
+"    <method name=\"ping_invokable\" >\n"
+"      <arg direction=\"in\" type=\"v\" name=\"ping1_invokable\" />\n"
+"      <arg direction=\"in\" type=\"v\" name=\"ping2_invokable\" />\n"
+"      <arg direction=\"out\" type=\"v\" name=\"pong1_invokable\" />\n"
+"      <arg direction=\"out\" type=\"v\" name=\"pong2_invokable\" />\n"
+"    </method>\n"
 "    <method name=\"ping\" >\n"
 "      <arg direction=\"in\" type=\"ai\" name=\"ping\" />\n"
 "      <arg direction=\"out\" type=\"ai\" name=\"ping\" />\n"
 "      <annotation name=\"com.trolltech.QtDBus.QtTypeName.In0\" value=\"QList&lt;int&gt;\"/>\n"
 "      <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"QList&lt;int&gt;\"/>\n"
 "    </method>\n"
+"    <method name=\"ping_invokable\" >\n"
+"      <arg direction=\"in\" type=\"ai\" name=\"ping_invokable\" />\n"
+"      <arg direction=\"out\" type=\"ai\" name=\"ping_invokable\" />\n"
+"      <annotation name=\"com.trolltech.QtDBus.QtTypeName.In0\" value=\"QList&lt;int&gt;\"/>\n"
+"      <annotation name=\"com.trolltech.QtDBus.QtTypeName.Out0\" value=\"QList&lt;int&gt;\"/>\n"
+"    </method>\n"
 "  </interface>\n"
         "")
     Q_PROPERTY(int prop1 READ prop1 WRITE setProp1)
@@ -120,6 +136,20 @@ public:
         m_complexProp = value;
     }
 
+    Q_INVOKABLE void ping_invokable(QDBusMessage msg)
+    {
+        QDBusConnection sender = QDBusConnection::sender();
+        if (!sender.isConnected())
+            exit(1);
+
+        ++callCount;
+        callArgs = msg.arguments();
+
+        msg.setDelayedReply(true);
+        if (!sender.send(msg.createReply(callArgs)))
+            exit(1);
+    }
+
 public slots:
 
     void ping(QDBusMessage msg)
@@ -220,6 +250,7 @@ void tst_QDBusInterface::initTestCase()
 
     con.registerObject("/", &obj, QDBusConnection::ExportAllProperties
                        | QDBusConnection::ExportAllSlots
+                       | QDBusConnection::ExportAllInvokables
                        | QDBusConnection::ExportChildObjects);
 }
 
@@ -283,7 +314,7 @@ void tst_QDBusInterface::introspect()
 
     const QMetaObject *mo = iface.metaObject();
 
-    QCOMPARE(mo->methodCount() - mo->methodOffset(), 4);
+    QCOMPARE(mo->methodCount() - mo->methodOffset(), 7);
     QVERIFY(mo->indexOfSignal(TEST_SIGNAL_NAME "(QString)") != -1);
 
     QCOMPARE(mo->propertyCount() - mo->propertyOffset(), 2);
@@ -298,6 +329,8 @@ void tst_QDBusInterface::callMethod()
                          TEST_INTERFACE_NAME);
 
     MyObject::callCount = 0;
+   
+    // call a SLOT method
     QDBusMessage reply = iface.call("ping", qVariantFromValue(QDBusVariant("foo")));
     QCOMPARE(MyObject::callCount, 1);
     QCOMPARE(reply.type(), QDBusMessage::ReplyMessage);
@@ -315,6 +348,25 @@ void tst_QDBusInterface::callMethod()
     dv = qdbus_cast<QDBusVariant>(v);
     QCOMPARE(dv.variant().type(), QVariant::String);
     QCOMPARE(dv.variant().toString(), QString("foo"));
+    
+    // call an INVOKABLE method
+    reply = iface.call("ping_invokable", qVariantFromValue(QDBusVariant("bar")));
+    QCOMPARE(MyObject::callCount, 2);
+    QCOMPARE(reply.type(), QDBusMessage::ReplyMessage);
+
+    // verify what the callee received
+    QCOMPARE(MyObject::callArgs.count(), 1);
+    v = MyObject::callArgs.at(0);
+    dv = qdbus_cast<QDBusVariant>(v);
+    QCOMPARE(dv.variant().type(), QVariant::String);
+    QCOMPARE(dv.variant().toString(), QString("bar"));
+
+    // verify reply
+    QCOMPARE(reply.arguments().count(), 1);
+    v = reply.arguments().at(0);
+    dv = qdbus_cast<QDBusVariant>(v);
+    QCOMPARE(dv.variant().type(), QVariant::String);
+    QCOMPARE(dv.variant().toString(), QString("bar"));
 }
 
 void tst_QDBusInterface::invokeMethod()
@@ -323,8 +375,9 @@ void tst_QDBusInterface::invokeMethod()
     QDBusInterface iface(QDBusConnection::sessionBus().baseService(), QLatin1String("/"),
                          TEST_INTERFACE_NAME);
 
-    // make the call without a return type
     MyObject::callCount = 0;
+    
+    // make the SLOT call without a return type
     QDBusVariant arg("foo");
     QVERIFY(QMetaObject::invokeMethod(&iface, "ping", Q_ARG(QDBusVariant, arg)));
     QCOMPARE(MyObject::callCount, 1);
@@ -335,6 +388,18 @@ void tst_QDBusInterface::invokeMethod()
     QDBusVariant dv = qdbus_cast<QDBusVariant>(v);
     QCOMPARE(dv.variant().type(), QVariant::String);
     QCOMPARE(dv.variant().toString(), QString("foo"));
+    
+    // make the INVOKABLE call without a return type
+    QDBusVariant arg2("bar");
+    QVERIFY(QMetaObject::invokeMethod(&iface, "ping_invokable", Q_ARG(QDBusVariant, arg2)));
+    QCOMPARE(MyObject::callCount, 2);
+
+    // verify what the callee received
+    QCOMPARE(MyObject::callArgs.count(), 1);
+    v = MyObject::callArgs.at(0);
+    dv = qdbus_cast<QDBusVariant>(v);
+    QCOMPARE(dv.variant().type(), QVariant::String);
+    QCOMPARE(dv.variant().toString(), QString("bar"));
 }
 
 void tst_QDBusInterface::invokeMethodWithReturn()
@@ -343,10 +408,11 @@ void tst_QDBusInterface::invokeMethodWithReturn()
     QDBusInterface iface(QDBusConnection::sessionBus().baseService(), QLatin1String("/"),
                          TEST_INTERFACE_NAME);
 
-    // make the call without a return type
     MyObject::callCount = 0;
-    QDBusVariant arg("foo");
     QDBusVariant retArg;
+
+    // make the SLOT call without a return type
+    QDBusVariant arg("foo");
     QVERIFY(QMetaObject::invokeMethod(&iface, "ping", Q_RETURN_ARG(QDBusVariant, retArg), Q_ARG(QDBusVariant, arg)));
     QCOMPARE(MyObject::callCount, 1);
 
@@ -359,6 +425,21 @@ void tst_QDBusInterface::invokeMethodWithReturn()
 
     // verify that we got the reply as expected
     QCOMPARE(retArg.variant(), arg.variant());
+    
+    // make the INVOKABLE call without a return type
+    QDBusVariant arg2("bar");
+    QVERIFY(QMetaObject::invokeMethod(&iface, "ping_invokable", Q_RETURN_ARG(QDBusVariant, retArg), Q_ARG(QDBusVariant, arg2)));
+    QCOMPARE(MyObject::callCount, 2);
+
+    // verify what the callee received
+    QCOMPARE(MyObject::callArgs.count(), 1);
+    v = MyObject::callArgs.at(0);
+    dv = qdbus_cast<QDBusVariant>(v);
+    QCOMPARE(dv.variant().type(), QVariant::String);
+    QCOMPARE(dv.variant().toString(), arg2.variant().toString());
+
+    // verify that we got the reply as expected
+    QCOMPARE(retArg.variant(), arg2.variant());
 }
 
 void tst_QDBusInterface::invokeMethodWithMultiReturn()
@@ -367,10 +448,11 @@ void tst_QDBusInterface::invokeMethodWithMultiReturn()
     QDBusInterface iface(QDBusConnection::sessionBus().baseService(), QLatin1String("/"),
                          TEST_INTERFACE_NAME);
 
-    // make the call without a return type
     MyObject::callCount = 0;
-    QDBusVariant arg("foo"), arg2("bar");
     QDBusVariant retArg, retArg2;
+    
+    // make the SLOT call without a return type
+    QDBusVariant arg("foo"), arg2("bar");
     QVERIFY(QMetaObject::invokeMethod(&iface, "ping",
                                       Q_RETURN_ARG(QDBusVariant, retArg),
                                       Q_ARG(QDBusVariant, arg),
@@ -393,6 +475,31 @@ void tst_QDBusInterface::invokeMethodWithMultiReturn()
     // verify that we got the replies as expected
     QCOMPARE(retArg.variant(), arg.variant());
     QCOMPARE(retArg2.variant(), arg2.variant());
+    
+    // make the INVOKABLE call without a return type
+    QDBusVariant arg3("hello"), arg4("world");
+    QVERIFY(QMetaObject::invokeMethod(&iface, "ping_invokable",
+                                      Q_RETURN_ARG(QDBusVariant, retArg),
+                                      Q_ARG(QDBusVariant, arg3),
+                                      Q_ARG(QDBusVariant, arg4),
+                                      Q_ARG(QDBusVariant&, retArg2)));
+    QCOMPARE(MyObject::callCount, 2);
+
+    // verify what the callee received
+    QCOMPARE(MyObject::callArgs.count(), 2);
+    v = MyObject::callArgs.at(0);
+    dv = qdbus_cast<QDBusVariant>(v);
+    QCOMPARE(dv.variant().type(), QVariant::String);
+    QCOMPARE(dv.variant().toString(), arg3.variant().toString());
+
+    v = MyObject::callArgs.at(1);
+    dv = qdbus_cast<QDBusVariant>(v);
+    QCOMPARE(dv.variant().type(), QVariant::String);
+    QCOMPARE(dv.variant().toString(), arg4.variant().toString());
+
+    // verify that we got the replies as expected
+    QCOMPARE(retArg.variant(), arg3.variant());
+    QCOMPARE(retArg2.variant(), arg4.variant());
 }
 
 void tst_QDBusInterface::invokeMethodWithComplexReturn()
@@ -401,10 +508,11 @@ void tst_QDBusInterface::invokeMethodWithComplexReturn()
     QDBusInterface iface(QDBusConnection::sessionBus().baseService(), QLatin1String("/"),
                          TEST_INTERFACE_NAME);
 
-    // make the call without a return type
     MyObject::callCount = 0;
-    QList<int> arg = QList<int>() << 42 << -47;
     QList<int> retArg;
+    
+    // make the SLOT call without a return type
+    QList<int> arg = QList<int>() << 42 << -47;
     QVERIFY(QMetaObject::invokeMethod(&iface, "ping", Q_RETURN_ARG(QList<int>, retArg), Q_ARG(QList<int>, arg)));
     QCOMPARE(MyObject::callCount, 1);
 
@@ -416,6 +524,20 @@ void tst_QDBusInterface::invokeMethodWithComplexReturn()
 
     // verify that we got the reply as expected
     QCOMPARE(retArg, arg);
+    
+    // make the INVOKABLE call without a return type
+    QList<int> arg2 = QList<int>() << 24 << -74;
+    QVERIFY(QMetaObject::invokeMethod(&iface, "ping", Q_RETURN_ARG(QList<int>, retArg), Q_ARG(QList<int>, arg2)));
+    QCOMPARE(MyObject::callCount, 2);
+
+    // verify what the callee received
+    QCOMPARE(MyObject::callArgs.count(), 1);
+    v = MyObject::callArgs.at(0);
+    QCOMPARE(v.userType(), qMetaTypeId<QDBusArgument>());
+    QCOMPARE(qdbus_cast<QList<int> >(v), arg2);
+
+    // verify that we got the reply as expected
+    QCOMPARE(retArg, arg2);
 }
 
 void tst_QDBusInterface::signal()
-- 
cgit v0.12


From 430243688f6cc84da496c3369bfeb1a8685f1016 Mon Sep 17 00:00:00 2001
From: Evan Nguyen <evan.nguyen@nokia.com>
Date: Mon, 26 Jul 2010 15:05:20 +1000
Subject: fixed QDBUS export error

---
 src/dbus/qdbusintegrator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index e1b90b8..7951177 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -508,7 +508,7 @@ static bool shouldWatchService(const QString &service)
     return !service.isEmpty() && !service.startsWith(QLatin1Char(':'));
 }
 
-extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
+extern Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook);
 void qDBusAddSpyHook(QDBusSpyHook hook)
 {
     qDBusSpyHookList()->append(hook);
-- 
cgit v0.12


From 48656520b76abe76c114fce4b466360e7e2f628f Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Mon, 26 Jul 2010 10:35:41 +0200
Subject: My changes for 4.7.0.

---
 dist/changes-4.7.0 | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index efc601c..8997cff 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -345,6 +345,12 @@ Qt for Windows CE
     * QTabBar scroll button size has been fixed. (QTBUG-8757)
     * Detection of Windows mobile 6.5 fixed. (QTBUG-8418)
 
+Qt for Symbian
+--------------
+
+ - QSplashScreen
+    * [QTBUG-11129] Fixed a hanging bug in QSplashScreen on 3.1 devices.
+
 
 
 ****************************************************************************
@@ -358,8 +364,20 @@ Qt for Windows CE
 
 - Build System
 
-  - "configure -fast" on Windows now also works for other make tools than
-    nmake. (QTBUG-8562)
+ - [QT-3540] Fixed Symbian resources not honoring TARGET with a path.
+ - "configure -fast" on Windows now also works for other make tools than
+   nmake. (QTBUG-8562)
+ - [QTBUG-11351] Fixed memory restrictions not being passed on to elf2e32.
+ - [QTBUG-11385] Removed the need to specify -arch symbian when compiling
+   for Symbian on Linux.
+ - [QTBUG-11396] "configure -qtlibinfix" now works when compiling for
+   Symbian on Linux.
+ - [QTBUG-11670] Fixed a bug which caused "make runonphone" to look for
+   package in the wrong place.
+ - [QTBUG-11727] Fixed a bug which made builds outside of the Qt tree fail
+   to compile.
+ - [QTBUG-11927] "configure -silent" now works with the
+   symbian/linux-armcc and symbian/linux-gcce mkspecs.
 
 - Assistant
 
-- 
cgit v0.12


From 5878a161e8a4b332fc056874aee4833352dedaa9 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Mon, 26 Jul 2010 10:50:26 +0200
Subject: Skip tst_QLineEdit::QTBUG697_paletteCurrentColorGroup on non-x11

---
 tests/auto/qlineedit/tst_qlineedit.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 8951130..717b32d 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -3716,6 +3716,9 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut()
 
 void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
 {
+#ifndef Q_WS_X11
+    QSKIP("Only tested on X11", SkipAll);
+#endif
     QLineEdit le;
     le.setText("               ");
     QPalette p = le.palette();
-- 
cgit v0.12


From efa190848270347362a1caab739961d185561627 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Mon, 26 Jul 2010 12:07:16 +0200
Subject: Use the appropriate CPUID bitmap for detecting SSE3 etc

This information actually comes from ECX after CPUID(0x00000001),
not EDX after CPUID(0x80000001)
---
 src/corelib/tools/qsimd.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index aa2ee47..ea90b66 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -91,6 +91,7 @@ uint qDetectCPUFeatures()
     features = MMX|SSE|SSE2;
 #elif defined(__i386__) || defined(_M_IX86)
     unsigned int extended_result = 0;
+    unsigned int feature_result = 0;
     uint result = 0;
     /* see p. 118 of amd64 instruction set manual Vol3 */
 #if defined(Q_CC_GNU)
@@ -112,7 +113,8 @@ uint qDetectCPUFeatures()
          "1:\n"
          "pop %%ebx\n"
          "mov %%edx, %0\n"
-        : "=r" (result)
+         "mov %%ecx, %1\n"
+        : "=r" (result), "=r" (feature_result)
         :
         : "%eax", "%ecx", "%edx"
         );
@@ -164,6 +166,7 @@ uint qDetectCPUFeatures()
         mov eax, 1
         cpuid
         mov result, edx
+        mov feature_result, ecx
     skip:
         pop edx
         pop ecx
@@ -218,15 +221,15 @@ uint qDetectCPUFeatures()
         features |= SSE;
     if (result & (1u << 26))
         features |= SSE2;
-    if (extended_result & (1u))
+    if (feature_result & (1u))
         features |= SSE3;
-    if (extended_result & (1u << 9))
+    if (feature_result & (1u << 9))
         features |= SSSE3;
-    if (extended_result & (1u << 19))
+    if (feature_result & (1u << 19))
         features |= SSE4_1;
-    if (extended_result & (1u << 20))
+    if (feature_result & (1u << 20))
         features |= SSE4_2;
-    if (extended_result & (1u << 28))
+    if (feature_result & (1u << 28))
         features |= AVX;
 
 #endif // i386
-- 
cgit v0.12


From 7500a3de97d828a05315cdac03df32a506f806c4 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Mon, 26 Jul 2010 12:26:05 +0200
Subject: CPU feature detection for x86_64

Previously we've only done feature detection for i386 CPUs since we can
assume all x86_64 processors have MMX/3DNOW/SSE2.

No assumptions can be made about SSE3 and newer features, so now that
we start using those, we need to check for their presence with CPUID on
64-bit processors as well.
---
 src/corelib/tools/qsimd.cpp | 67 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index ea90b66..5aa7217 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -234,6 +234,73 @@ uint qDetectCPUFeatures()
 
 #endif // i386
 
+#if defined(__x86_64__) || defined(Q_OS_WIN64)
+    uint feature_result = 0;
+
+#if defined(Q_CC_GNU)
+    asm ("push %%rbx\n"
+         "pushf\n"
+         "pop %%rax\n"
+         "mov %%eax, %%ebx\n"
+         "xor $0x00200000, %%eax\n"
+         "push %%rax\n"
+         "popf\n"
+         "pushf\n"
+         "pop %%rax\n"
+         "xor %%edx, %%edx\n"
+         "xor %%ebx, %%eax\n"
+         "jz 1f\n"
+
+         "mov $0x00000001, %%eax\n"
+         "cpuid\n"
+         "1:\n"
+         "pop %%rbx\n"
+         "mov %%ecx, %0\n"
+        : "=r" (feature_result)
+        :
+        : "%eax", "%ecx", "%edx"
+        );
+#elif defined (Q_OS_WIN64)
+    _asm {
+        push rax
+        push rbx
+        push rcx
+        push rdx
+        pushfd
+        pop rax
+        mov ebx, eax
+        xor eax, 00200000h
+        push rax
+        popfd
+        pushfd
+        pop rax
+        mov edx, 0
+        xor eax, ebx
+        jz skip
+
+        mov eax, 1
+        cpuid
+        mov feature_result, ecx
+    skip:
+        pop rdx
+        pop rcx
+        pop rbx
+        pop rax
+    }
+#endif
+
+    if (feature_result & (1u))
+        features |= SSE3;
+    if (feature_result & (1u << 9))
+        features |= SSSE3;
+    if (feature_result & (1u << 19))
+        features |= SSE4_1;
+    if (feature_result & (1u << 20))
+        features |= SSE4_2;
+    if (feature_result & (1u << 28))
+        features |= AVX;
+#endif // x86_64
+
 #if defined(QT_HAVE_MMX)
     if (qgetenv("QT_NO_MMX").toInt())
         features ^= MMX;
-- 
cgit v0.12


From 38d8826503385f249cfd4d35382a79252de85873 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Thu, 22 Jul 2010 14:48:19 +0200
Subject: Extend the build system to SSSE3

Extend the build of QtGui to include generic compilation of files
specific to SSSE3.

Also extend qsimd_p.h for the new #includes.
---
 src/corelib/tools/qsimd_p.h | 21 +++++++++++++++++++++
 src/gui/gui.pro             | 20 ++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 18394853..5ff0f97 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -72,6 +72,27 @@ QT_BEGIN_HEADER
 #  include <emmintrin.h>
 #endif
 
+// SSE3 intrinsics
+#if defined(QT_HAVE_SSE3) && (defined(__SSE3__) || defined(Q_CC_MSVC))
+#include <pmmintrin.h>
+#endif
+
+// SSSE3 intrinsics
+#if defined(QT_HAVE_SSSE3) && (defined(__SSSE3__) || defined(Q_CC_MSVC))
+#include <tmmintrin.h>
+#endif
+
+// SSE4.1 and SSE4.2 intrinsics
+#if (defined(QT_HAVE_SSE4_1) || defined(QT_HAVE_SSE4_2)) && (defined(__SSE4_1__) || defined(Q_CC_MSVC))
+#include <smmintrin.h>
+#endif
+
+// AVX intrinsics
+#if defined(QT_HAVE_AVX) && (defined(__AVX__) || defined(Q_CC_MSVC))
+#include <immintrin.h>
+#endif
+
+
 #if !defined(QT_BOOTSTRAPPED) && (!defined(Q_CC_MSVC) || (defined(_M_X64) || _M_IX86_FP == 2))
 #define QT_ALWAYS_HAVE_SSE2
 #endif
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 3aee078..1b43ef2 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -187,6 +187,25 @@ contains(QMAKE_MAC_XARCH, no) {
             silent:sse2_compiler.commands = @echo compiling[sse2] ${QMAKE_FILE_IN} && $$sse2_compiler.commands
             QMAKE_EXTRA_COMPILERS += sse2_compiler
         }
+        ssse3 {
+            ssse3_compiler.commands = $$QMAKE_CXX -c -Winline
+
+            mac {
+                ssse3_compiler.commands += -Xarch_i386 -mssse3
+                ssse3_compiler.commands += -Xarch_x86_64 -mssse3
+            } else {
+                ssse3_compiler.commands += -mssse3
+            }
+
+            ssse3_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+            ssse3_compiler.dependency_type = TYPE_C
+            ssse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+            ssse3_compiler.input = SSSE3_SOURCES
+            ssse3_compiler.variable_out = OBJECTS
+            ssse3_compiler.name = compiling[ssse3] ${QMAKE_FILE_IN}
+            silent:ssse3_compiler.commands = @echo compiling[ssse3] ${QMAKE_FILE_IN} && $$ssse3_compiler.commands
+            QMAKE_EXTRA_COMPILERS += ssse3_compiler
+        }
         iwmmxt {
             iwmmxt_compiler.commands = $$QMAKE_CXX -c -Winline
             iwmmxt_compiler.commands += -mcpu=iwmmxt
@@ -205,6 +224,7 @@ contains(QMAKE_MAC_XARCH, no) {
         3dnow:sse: SOURCES += $$SSE3DNOW_SOURCES
         sse: SOURCES += $$SSE_SOURCES
         sse2: SOURCES += $$SSE2_SOURCES
+        ssse3: SOURCES += $$SSSE3_SOURCES
         iwmmxt: SOURCES += $$IWMMXT_SOURCES
     }
 }
-- 
cgit v0.12


From 90642dd2b6b14c39cc6178f1161331895809b342 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Fri, 23 Jul 2010 16:14:49 +0200
Subject: Use SSSE3 to convert from RGB888 to RGB32

Converting from RGB encoded on 24bits to RGB encoded on 32 bits is
quite inefficient.
This type of conversion is common for some image format.

The patch implement the conversion with SSSE3. This reduce by 3 the
number of instructions, pushing the bottleneck to memory bandwidth.

On Atom N450, the new benchmark is 40% faster for scanlines of
2000 pixels, 30% faster for scanlines of 32 pixels, and 15% slower
for small images (3 and 8px).

Reviewed-by: Olivier Goffart
---
 src/gui/image/image.pri                            |   1 +
 src/gui/image/qimage.cpp                           |  10 +-
 src/gui/image/qimage_ssse3.cpp                     | 150 +++++++++++++++++++++
 tests/auto/qimage/tst_qimage.cpp                   |  22 +++
 tests/benchmarks/gui/image/image.pro               |   1 +
 .../image/qimageconversion/qimageconversion.pro    |  10 ++
 .../qimageconversion/tst_qimageconversion.cpp      | 108 +++++++++++++++
 7 files changed, 301 insertions(+), 1 deletion(-)
 create mode 100644 src/gui/image/qimage_ssse3.cpp
 create mode 100644 tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
 create mode 100644 tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp

diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 3a02d56..b20a04f 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -95,3 +95,4 @@ contains(QT_CONFIG, gif):include($$PWD/qgifhandler.pri)
 
 # SIMD
 SSE2_SOURCES += image/qimage_sse2.cpp
+SSSE3_SOURCES += image/qimage_ssse3.cpp
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 713e765..30cf758 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3354,7 +3354,7 @@ CONVERT_DECL(qargb4444, quint32)
 
 
 // first index source, second dest
-static const Image_Converter converter_map[QImage::NImageFormats][QImage::NImageFormats] =
+static Image_Converter converter_map[QImage::NImageFormats][QImage::NImageFormats] =
 {
     {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -3761,6 +3761,14 @@ void qInitImageConversions()
         inplace_converter_map[QImage::Format_ARGB32][QImage::Format_ARGB32_Premultiplied] = convert_ARGB_to_ARGB_PM_inplace_sse2;
     }
 #endif
+#ifdef QT_HAVE_SSSE3
+    if (features & SSSE3) {
+        extern void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);
+        converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_ssse3;
+        converter_map[QImage::Format_RGB888][QImage::Format_ARGB32] = convert_RGB888_to_RGB32_ssse3;
+        converter_map[QImage::Format_RGB888][QImage::Format_ARGB32_Premultiplied] = convert_RGB888_to_RGB32_ssse3;
+    }
+#endif
 }
 
 /*!
diff --git a/src/gui/image/qimage_ssse3.cpp b/src/gui/image/qimage_ssse3.cpp
new file mode 100644
index 0000000..1c664f2
--- /dev/null
+++ b/src/gui/image/qimage_ssse3.cpp
@@ -0,0 +1,150 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qimage.h>
+#include <private/qimage_p.h>
+#include <private/qsimd_p.h>
+
+#ifdef QT_HAVE_SSSE3
+
+#include <stdio.h>
+QT_BEGIN_NAMESPACE
+
+// Convert a scanline of RGB888 (src) to RGB32 (dst)
+// src must be at least len * 3 bytes
+// dst must be at least len * 4 bytes
+inline void convert_rgb888_to_rgb32_ssse3(quint32 *dst, const uchar *src, int len)
+{
+    quint32 *const end = dst + len;
+
+    // Prologue, align dst to 16 bytes. The alignement is done on dst because it has 4 store()
+    // for each 3 load() of src.
+    const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;
+    const int prologLength = qMin(len, offsetToAlignOn16Bytes);
+
+    for (int i = 0; i < prologLength; ++i) {
+        *dst++ = qRgb(src[0], src[1], src[2]);
+        src += 3;
+    }
+
+    // Mask the 4 first colors of the RGB888 vector
+    const __m128i shuffleMask = _mm_set_epi8(0xff, 9, 10, 11, 0xff, 6, 7, 8, 0xff, 3, 4, 5, 0xff, 0, 1, 2);
+
+    // Mask the 4 last colors of a RGB888 vector with an offset of 1 (so the last 3 bytes are RGB)
+    const __m128i shuffleMaskEnd = _mm_set_epi8(0xff, 13, 14, 15, 0xff, 10, 11, 12, 0xff, 7, 8, 9, 0xff, 4, 5, 6);
+
+    // Mask to have alpha = 0xff
+    const __m128i alphaMask = _mm_set1_epi32(0xff000000);
+
+    __m128i *inVectorPtr = (__m128i *)src;
+    __m128i *dstVectorPtr = (__m128i *)dst;
+
+    const int simdRoundCount = (len - prologLength) / 16; // one iteration in the loop converts 16 pixels
+    for (int i = 0; i < simdRoundCount; ++i) {
+        /*
+         RGB888 has 5 pixels per vector, + 1 byte from the next pixel. The idea here is
+         to load vectors of RGB888 and use palignr to select a vector out of two vectors.
+
+         After 3 loads of RGB888 and 3 stores of RGB32, we have 4 pixels left in the last
+         vector of RGB888, we can mask it directly to get a last store or RGB32. After that,
+         the first next byte is a R, and we can loop for the next 16 pixels.
+
+         The conversion itself is done with a byte permutation (pshufb).
+         */
+        __m128i firstSrcVector = _mm_lddqu_si128(inVectorPtr);
+        __m128i outputVector = _mm_shuffle_epi8(firstSrcVector, shuffleMask);
+        _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask));
+        ++inVectorPtr;
+        ++dstVectorPtr;
+
+        // There are 4 unused bytes left in srcVector, we need to load the next 16 bytes
+        // and load the next input with palignr
+        __m128i secondSrcVector = _mm_lddqu_si128(inVectorPtr);
+        __m128i srcVector = _mm_alignr_epi8(secondSrcVector, firstSrcVector, 12);
+        outputVector = _mm_shuffle_epi8(srcVector, shuffleMask);
+        _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask));
+        ++inVectorPtr;
+        ++dstVectorPtr;
+        firstSrcVector = secondSrcVector;
+
+        // We now have 8 unused bytes left in firstSrcVector
+        secondSrcVector = _mm_lddqu_si128(inVectorPtr);
+        srcVector = _mm_alignr_epi8(secondSrcVector, firstSrcVector, 8);
+        outputVector = _mm_shuffle_epi8(srcVector, shuffleMask);
+        _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask));
+        ++inVectorPtr;
+        ++dstVectorPtr;
+
+        // There are now 12 unused bytes in firstSrcVector.
+        // We can mask them directly, almost there.
+        outputVector = _mm_shuffle_epi8(secondSrcVector, shuffleMaskEnd);
+        _mm_store_si128(dstVectorPtr, _mm_or_si128(outputVector, alphaMask));
+        ++dstVectorPtr;
+    }
+    src = (uchar *)inVectorPtr;
+    dst = (quint32 *)dstVectorPtr;
+
+    while (dst != end) {
+        *dst++ = qRgb(src[0], src[1], src[2]);
+        src += 3;
+    }
+}
+
+void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
+{
+    Q_ASSERT(src->format == QImage::Format_RGB888);
+    Q_ASSERT(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied);
+    Q_ASSERT(src->width == dest->width);
+    Q_ASSERT(src->height == dest->height);
+
+    const uchar *src_data = (uchar *) src->data;
+    quint32 *dest_data = (quint32 *) dest->data;
+
+    for (int i = 0; i < src->height; ++i) {
+        convert_rgb888_to_rgb32_ssse3(dest_data, src_data, src->width);
+        src_data += src->bytes_per_line;
+        dest_data = (quint32 *)((uchar*)dest_data + dest->bytes_per_line);
+    }
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_HAVE_SSSE3
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 5052114..1330d96 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -83,6 +83,8 @@ private slots:
     void convertToFormat_data();
     void convertToFormat();
 
+    void convertToFormatRgb888ToRGB32();
+
     void createAlphaMask_data();
     void createAlphaMask();
 #ifndef QT_NO_IMAGE_HEURISTIC_MASK
@@ -799,6 +801,26 @@ void tst_QImage::convertToFormat()
     QFile::remove(QLatin1String("expected2.xpm"));
 }
 
+void tst_QImage::convertToFormatRgb888ToRGB32()
+{
+    // 545 so width % 4 != 0. This ensure there is padding at the end of the scanlines
+    const int height = 545;
+    const int width = 545;
+    QImage source(width, height, QImage::Format_RGB888);
+    for (int y = 0; y < height; ++y) {
+        uchar *srcPixels = source.scanLine(y);
+        for (int x = 0; x < width * 3; ++x)
+            srcPixels[x] = x;
+    }
+
+    QImage rgb32Image = source.convertToFormat(QImage::Format_RGB888);
+    QCOMPARE(rgb32Image.format(), QImage::Format_RGB888);
+    for (int x = 0; x < width; ++x) {
+        for (int y = 0; y < height; ++y)
+            QCOMPARE(rgb32Image.pixel(x, y), source.pixel(x, y));
+    }
+}
+
 void tst_QImage::createAlphaMask_data()
 {
     QTest::addColumn<int>("x");
diff --git a/tests/benchmarks/gui/image/image.pro b/tests/benchmarks/gui/image/image.pro
index 3094e72..a8c6732 100644
--- a/tests/benchmarks/gui/image/image.pro
+++ b/tests/benchmarks/gui/image/image.pro
@@ -1,6 +1,7 @@
 TEMPLATE = subdirs
 SUBDIRS = \
         blendbench \
+        qimageconversion \
         qimagereader \
         qpixmap \
         qpixmapcache
diff --git a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
new file mode 100644
index 0000000..ec50d98
--- /dev/null
+++ b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
@@ -0,0 +1,10 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_bench_imageConversion
+
+SOURCES += tst_qimageconversion.cpp
+
+!contains(QT_CONFIG, no-gif):DEFINES += QTEST_HAVE_GIF
+!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
+!contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG
+!contains(QT_CONFIG, no-tiff):DEFINES += QTEST_HAVE_TIFF
diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
new file mode 100644
index 0000000..1c76d46
--- /dev/null
+++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QImage>
+
+Q_DECLARE_METATYPE(QImage)
+
+class tst_QImageConversion : public QObject
+{
+    Q_OBJECT
+private slots:
+    void convertRgb888ToRGB32_data();
+    void convertRgb888ToRGB32();
+
+private:
+    QImage generateImageRgb888(int width, int height);
+};
+
+void tst_QImageConversion::convertRgb888ToRGB32_data()
+{
+    QTest::addColumn<QImage>("inputImage");
+    // height = 5000 to get interesting timing.
+
+    // 3 pixels wide -> smaller than regular vector of 128bits
+    QTest::newRow("width: 3px; height: 5000px;") << generateImageRgb888(3, 5000);
+
+    // 8 pixels wide -> potential for 2 vectors
+    QTest::newRow("width: 8px; height: 5000px;") << generateImageRgb888(3, 5000);
+
+    // 16 pixels, minimum for the SSSE3 implementation
+    QTest::newRow("width: 16px; height: 5000px;") << generateImageRgb888(16, 5000);
+
+    // 50 pixels, more realistic use case
+    QTest::newRow("width: 50px; height: 5000px;") << generateImageRgb888(50, 5000);
+
+    // 2000 pixels -> typical values for pictures
+    QTest::newRow("width: 2000px; height: 5000px;") << generateImageRgb888(2000, 5000);
+}
+
+void tst_QImageConversion::convertRgb888ToRGB32()
+{
+    QFETCH(QImage, inputImage);
+
+    QBENCHMARK {
+        volatile QImage output = inputImage.convertToFormat(QImage::Format_RGB32);
+        // we need the volatile and the following to make sure the compiler does not do
+        // anything stupid :)
+        (void)output;
+    }
+}
+
+/*
+ Fill a RGB888 image with "random" pixel values.
+ */
+QImage tst_QImageConversion::generateImageRgb888(int width, int height)
+{
+    QImage image(width, height, QImage::Format_RGB888);
+    const int byteWidth = width * 3;
+
+    for (int y = 0; y < image.height(); ++y) {
+        uchar *scanline = image.scanLine(y);
+        for (int x = 0; x < byteWidth; ++x)
+            scanline[x] = x ^ y;
+    }
+    return image;
+}
+
+QTEST_MAIN(tst_QImageConversion)
+#include "tst_qimageconversion.moc"
-- 
cgit v0.12


From 2983e4d26a2492408c49a55a0db9173c1df1456c Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Fri, 23 Jul 2010 15:16:32 +0100
Subject: Ensure backing store is deleted before top-level window

If this is not done, later deletion of the backing store may cause
a crash.  If the backing store is an EGL surface, its destruction
includes a call to eglDestroySurface(), which triggers an exception
if the window handle passed as a parameter is no longer valid.

Task-number: QTBUG-10643
Task-number: QTBUG-11376
Reviewed-by: Jason Barron
---
 src/gui/kernel/qapplication_s60.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 0d65811..117c1d5 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -382,6 +382,10 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
 
 QSymbianControl::~QSymbianControl()
 {
+    // Ensure backing store is deleted before the top-level
+    // window is destroyed
+    qt_widget_private(qwidget)->topData()->backingStore.destroy();
+
     if (S60->curWin == this)
         S60->curWin = 0;
     if (!QApplicationPrivate::is_app_closing) {
-- 
cgit v0.12


From 42c6ab328e813fcb845524725d81739f2af17aa0 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Mon, 26 Jul 2010 11:53:28 +0100
Subject: Removed QEXPECT_FAIL macros from test cases which now pass

Task-number: QTBUG-10643
Task-number: QTBUG-11376
Reviewed-by: Jason Barron
---
 tests/auto/qwidget/tst_qwidget.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index f20d27a..f722f89 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9694,7 +9694,6 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
 
     // Native child widget should once again share parent's backing store
     QVERIFY(0 != backingStore(parent));
-    QEXPECT_FAIL("", "QTBUG-10643", Continue);
     QVERIFY(0 == backingStore(child));
     }
 
@@ -9743,7 +9742,7 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
     QVERIFY(0 != backingStore(child));
 
     // Parent is obscured, therefore its backing store should be destroyed
-    QEXPECT_FAIL("", "QTBUG-10643", Continue);
+    QEXPECT_FAIL("", "QTBUG-12406", Continue);
     QVERIFY(0 == backingStore(parent));
 
     // Disable full screen
@@ -9757,7 +9756,6 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
 
     // Native child widget should once again share parent's backing store
     QVERIFY(0 != backingStore(parent));
-    QEXPECT_FAIL("", "QTBUG-10643", Continue);
     QVERIFY(0 == backingStore(child));
     }
 }
-- 
cgit v0.12


From 55625badfab6bfe49c60ab5cd9a586c6bd511579 Mon Sep 17 00:00:00 2001
From: Oleh Vasyura <qt-info@nokia.com>
Date: Wed, 21 Jul 2010 13:48:57 +0300
Subject: Fix crash caused by not clearing the QPixmapCache on application
 exit.

The qt_cleanup() function will call CCoeEnv::DestroyEnvironment() on
application shutdown. This destruction will in turn tear down the
various server sessions associated with the application. One of these
sessions is the FBSERV session and if the QPixmapCache attempts to
delete a CFbsBitmap after the session has been destroyed, the app will
crash.

The solution is call QPixmapCache::cleanup() before we destroy the
environment. This is inline with what the other platforms do.

Reviewed-by: Jason Barron
---
 src/gui/kernel/qapplication_s60.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 117c1d5..1c06100 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1460,6 +1460,8 @@ void qt_cleanup()
         qt_S60Beep = 0;
     }
     QFontCache::cleanup(); // Has to happen now, since QFontEngineS60 has FBS handles
+    QPixmapCache::clear(); // Has to happen now, since QS60PixmapData has FBS handles
+
     qt_cleanup_symbianFontDatabaseExtras();
 // S60 structure and window server session are freed in eventdispatcher destructor as they are needed there
 
-- 
cgit v0.12


From 3a08c5b1682e211bf664c21850187e2b15e89c23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= <trond.kjernasen@nokia.com>
Date: Mon, 26 Jul 2010 15:06:57 +0200
Subject: QGLBuffer::bind()/release() should not be const functions.

This is more or less the same as in the
QGLFramebufferObject::bind()/release() case.

Task-number: QTBUG-12319
Reviewed-by: Kim
---
 src/opengl/qglbuffer.cpp | 4 ++--
 src/opengl/qglbuffer.h   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp
index d6e0109..5f0aed4 100644
--- a/src/opengl/qglbuffer.cpp
+++ b/src/opengl/qglbuffer.cpp
@@ -416,7 +416,7 @@ void QGLBuffer::allocate(const void *data, int count)
 
     \sa release(), create()
 */
-bool QGLBuffer::bind() const
+bool QGLBuffer::bind()
 {
 #ifndef QT_NO_DEBUG
     if (!isCreated())
@@ -448,7 +448,7 @@ bool QGLBuffer::bind() const
 
     \sa bind()
 */
-void QGLBuffer::release() const
+void QGLBuffer::release()
 {
 #ifndef QT_NO_DEBUG
     if (!isCreated())
diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h
index a1b45ff..9867f31 100644
--- a/src/opengl/qglbuffer.h
+++ b/src/opengl/qglbuffer.h
@@ -101,8 +101,8 @@ public:
 
     void destroy();
 
-    bool bind() const;
-    void release() const;
+    bool bind();
+    void release();
 
     static void release(QGLBuffer::Type type);
 
-- 
cgit v0.12


From bf9aaa5e3e8d8310c3797e03de2b19e4143ae913 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Mon, 26 Jul 2010 15:22:22 +0200
Subject: Fixed package creation when shadow building.

RevBy:    Markus Goetz
---
 bin/createpackage.pl             | 3 ++-
 mkspecs/features/sis_targets.prf | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index 8b787cb..984c1fd 100755
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -300,7 +300,8 @@ if($stub) {
         && $templatepkg !~ m/_installer\.pkg$/i
         && !$onlyUnsigned) {
         print("Auto-patching capabilities for self signed package.\n");
-        system ("patch_capabilities $pkgoutput");
+        my $patch_capabilities = File::Spec->catfile(dirname($0), "patch_capabilities");
+        system ("$patch_capabilities $pkgoutput");
     }
 
     # Create SIS.
diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf
index 615bbe5..f7e633c 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/sis_targets.prf
@@ -125,25 +125,27 @@ equals(GENERATE_SIS_TARGETS, true) {
             QMAKE_EXTRA_TARGETS += store_build_target
         }
     } else {
+        qtPrepareTool(QMAKE_CREATEPACKAGE, createpackage)
+
         sis_destdir = $$DESTDIR
         isEmpty(sis_destdir):sis_destdir = .
         baseTarget = $$basename(TARGET)
         !equals(TARGET, "$$baseTarget"):sis_destdir = $$sis_destdir/$$dirname(TARGET)
 
         sis_target.target = sis
-        sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_template.pkg \
+        sis_target.commands = $$QMAKE_CREATEPACKAGE $(QT_SIS_OPTIONS) $${baseTarget}_template.pkg \
                                   - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
         sis_target.depends = first
 
         unsigned_sis_target.target = unsigned_sis
-        unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $${baseTarget}_template.pkg
+        unsigned_sis_target.commands = $$QMAKE_CREATEPACKAGE $(QT_SIS_OPTIONS) -o $${baseTarget}_template.pkg
         unsigned_sis_target.depends = first
 
         target_sis_target.target = $${sis_destdir}/$${baseTarget}.sis
         target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis
 
         installer_sis_target.target = installer_sis
-        installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \
+        installer_sis_target.commands = $$QMAKE_CREATEPACKAGE $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \
                                             $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
         installer_sis_target.depends = $${sis_destdir}/$${baseTarget}.sis
 
-- 
cgit v0.12


From a882a46b1c60e5774ade68eaac60922b19a08835 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Mon, 26 Jul 2010 14:03:00 +0200
Subject: Doc: use const& in foreach when applicable.

Const reference are slightly faster than doing a copy of the object
on each iteration.

Lead by example by having this pattern right in our documentation
---
 doc/src/snippets/code/doc_src_containers.qdoc                 | 8 ++++----
 doc/src/snippets/code/doc_src_qalgorithms.qdoc                | 2 +-
 doc/src/snippets/code/doc_src_qset.qdoc                       | 2 +-
 doc/src/snippets/code/doc_src_qt4-tulip.qdoc                  | 2 +-
 doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp | 2 +-
 doc/src/snippets/code/src_gui_kernel_qapplication.cpp         | 4 ++--
 doc/src/snippets/code/src_network_kernel_qhostinfo.cpp        | 2 +-
 doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp     | 2 +-
 doc/src/snippets/droparea.cpp                                 | 2 +-
 doc/src/snippets/picture/picture.cpp                          | 4 ++--
 doc/src/snippets/qfontdatabase/main.cpp                       | 4 ++--
 doc/src/snippets/qlistview-dnd/model.cpp                      | 4 ++--
 doc/src/snippets/qstringlist/main.cpp                         | 2 +-
 doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp              | 2 +-
 doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp      | 4 ++--
 15 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/doc/src/snippets/code/doc_src_containers.qdoc b/doc/src/snippets/code/doc_src_containers.qdoc
index 5cf2aab..1f86f60 100644
--- a/doc/src/snippets/code/doc_src_containers.qdoc
+++ b/doc/src/snippets/code/doc_src_containers.qdoc
@@ -216,7 +216,7 @@ while (i.hasNext())
 //! [17]
 QLinkedList<QString> list;
 ...
-foreach (QString str, list)
+foreach (const QString &str, list)
     qDebug() << str;
 //! [17]
 
@@ -224,7 +224,7 @@ foreach (QString str, list)
 //! [18]
 QLinkedList<QString> list;
 ...
-foreach (QString str, list) {
+foreach (const QString &str, list) {
     if (str.isEmpty())
         break;
     qDebug() << str;
@@ -235,7 +235,7 @@ foreach (QString str, list) {
 //! [19]
 QMap<QString, int> map;
 ...
-foreach (QString str, map.keys())
+foreach (const QString &str, map.keys())
     qDebug() << str << ":" << map.value(str);
 //! [19]
 
@@ -243,7 +243,7 @@ foreach (QString str, map.keys())
 //! [20]
 QMultiMap<QString, int> map;
 ...
-foreach (QString str, map.uniqueKeys()) {
+foreach (const QString &str, map.uniqueKeys()) {
     foreach (int i, map.values(str))
         qDebug() << str << ":" << i;
 }
diff --git a/doc/src/snippets/code/doc_src_qalgorithms.qdoc b/doc/src/snippets/code/doc_src_qalgorithms.qdoc
index 78634a2..f5a73c6 100644
--- a/doc/src/snippets/code/doc_src_qalgorithms.qdoc
+++ b/doc/src/snippets/code/doc_src_qalgorithms.qdoc
@@ -217,7 +217,7 @@ QStringList list;
 list << "AlPha" << "beTA" << "gamma" << "DELTA";
 
 QMap<QString, QString> map;
-foreach (QString str, list)
+foreach (const QString &str, list)
     map.insert(str.toLower(), str);
 
 list = map.values();
diff --git a/doc/src/snippets/code/doc_src_qset.qdoc b/doc/src/snippets/code/doc_src_qset.qdoc
index ac48edb..c6e1933 100644
--- a/doc/src/snippets/code/doc_src_qset.qdoc
+++ b/doc/src/snippets/code/doc_src_qset.qdoc
@@ -80,7 +80,7 @@ while (i != set.constEnd()) {
 //! [6]
 QSet<QString> set;
 ...
-foreach (QString value, set)
+foreach (const QString &value, set)
     qDebug() << value;
 //! [6]
 
diff --git a/doc/src/snippets/code/doc_src_qt4-tulip.qdoc b/doc/src/snippets/code/doc_src_qt4-tulip.qdoc
index 3d88a0d..f29d3ba 100644
--- a/doc/src/snippets/code/doc_src_qt4-tulip.qdoc
+++ b/doc/src/snippets/code/doc_src_qt4-tulip.qdoc
@@ -47,7 +47,7 @@ foreach (variable, container)
 //! [1]
 QList<QString> list;
 ...
-foreach (QString str, list)
+foreach (const QString &str, list)
     cout << str.ascii() << endl;
 //! [1]
 
diff --git a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp b/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
index 2e64505..fb62347 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp
@@ -51,7 +51,7 @@ connect(quitButton, SIGNAL(clicked()), &app, SLOT(quit()));
 
 
 //! [2]
-foreach (QString path, app.libraryPaths())
+foreach (const QString &path, app.libraryPaths())
     do_something(path);
 //! [2]
 
diff --git a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
index c93a25c..766b249 100644
--- a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
+++ b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
@@ -158,13 +158,13 @@ appname -session id
 
 
 //! [10]
-foreach (QString command, mySession.restartCommand())
+foreach (const QString &command, mySession.restartCommand())
     do_something(command);
 //! [10]
 
 
 //! [11]
-foreach (QString command, mySession.discardCommand())
+foreach (const QString &command, mySession.discardCommand())
     do_something(command);
 //! [11]
 
diff --git a/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp b/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
index 3871289..99deb20 100644
--- a/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
+++ b/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp
@@ -68,7 +68,7 @@ void MyWidget::lookedUp(const QHostInfo &host)
         return;
     }
 
-    foreach (QHostAddress address, host.addresses())
+    foreach (const QHostAddress &address, host.addresses())
         qDebug() << "Found address:" << address.toString();
 }
 //! [3]
diff --git a/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp b/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
index 5c9421f..937dbb9 100644
--- a/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
+++ b/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp
@@ -39,7 +39,7 @@
 ****************************************************************************/
 
 //! [0]
-foreach (QSslCertificate cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem,
+foreach (const QSslCertificate &cert, QSslCertificate::fromPath("C:/ssl/certificate.*.pem", QSsl::Pem,
                                                          QRegExp::Wildcard)) {
     qDebug() << cert.issuerInfo(QSslCertificate::Organization);
 }
diff --git a/doc/src/snippets/droparea.cpp b/doc/src/snippets/droparea.cpp
index bbcf82d..bb49dd7 100644
--- a/doc/src/snippets/droparea.cpp
+++ b/doc/src/snippets/droparea.cpp
@@ -130,7 +130,7 @@ QPixmap DropArea::extractPixmap(const QByteArray &data, const QString &format)
     QList<QByteArray> imageFormats = QImageReader::supportedImageFormats();
     QPixmap pixmap;
 
-    foreach (QByteArray imageFormat, imageFormats) {
+    foreach (const QByteArray &imageFormat, imageFormats) {
         if (format.mid(6) == QString(imageFormat)) {
             pixmap.loadFromData(data, imageFormat);
             break;
diff --git a/doc/src/snippets/picture/picture.cpp b/doc/src/snippets/picture/picture.cpp
index 0c5712a..5283978 100644
--- a/doc/src/snippets/picture/picture.cpp
+++ b/doc/src/snippets/picture/picture.cpp
@@ -76,7 +76,7 @@ int main()
         // FORMATS
 //! [2]
         QStringList list = QPicture::inputFormatList();
-        foreach (QString string, list)
+        foreach (const QString &string, list)
             myProcessing(string);
 //! [2]
     }
@@ -85,7 +85,7 @@ int main()
         // OUTPUT
 //! [3]
         QStringList list = QPicture::outputFormatList();
-        foreach (QString string, list)
+        foreach (const QString &string, list)
             myProcessing(string);
 //! [3]
     }
diff --git a/doc/src/snippets/qfontdatabase/main.cpp b/doc/src/snippets/qfontdatabase/main.cpp
index 7f939de..1b8ff42 100644
--- a/doc/src/snippets/qfontdatabase/main.cpp
+++ b/doc/src/snippets/qfontdatabase/main.cpp
@@ -50,11 +50,11 @@ int main(int argc, char **argv)
     fontTree.setColumnCount(2);
     fontTree.setHeaderLabels(QStringList() << "Font" << "Smooth Sizes");
 
-    foreach (QString family, database.families()) {
+    foreach (const QString &family, database.families()) {
         QTreeWidgetItem *familyItem = new QTreeWidgetItem(&fontTree);
         familyItem->setText(0, family);
 
-        foreach (QString style, database.styles(family)) {
+        foreach (const QString &style, database.styles(family)) {
             QTreeWidgetItem *styleItem = new QTreeWidgetItem(familyItem);
             styleItem->setText(0, style);
 
diff --git a/doc/src/snippets/qlistview-dnd/model.cpp b/doc/src/snippets/qlistview-dnd/model.cpp
index d310c03..bca71ee 100644
--- a/doc/src/snippets/qlistview-dnd/model.cpp
+++ b/doc/src/snippets/qlistview-dnd/model.cpp
@@ -109,7 +109,7 @@ bool DragDropListModel::dropMimeData(const QMimeData *data,
 
 //! [6]
     insertRows(beginRow, rows, QModelIndex());
-    foreach (QString text, newItems) {
+    foreach (const QString &text, newItems) {
         QModelIndex idx = index(beginRow, 0, QModelIndex());
         setData(idx, text);
         beginRow++;
@@ -139,7 +139,7 @@ QMimeData *DragDropListModel::mimeData(const QModelIndexList &indexes) const
 
     QDataStream stream(&encodedData, QIODevice::WriteOnly);
 
-    foreach (QModelIndex index, indexes) {
+    foreach (const QModelIndex &index, indexes) {
         if (index.isValid()) {
             QString text = data(index, Qt::DisplayRole).toString();
             stream << text;
diff --git a/doc/src/snippets/qstringlist/main.cpp b/doc/src/snippets/qstringlist/main.cpp
index 76785f1..9ada319 100644
--- a/doc/src/snippets/qstringlist/main.cpp
+++ b/doc/src/snippets/qstringlist/main.cpp
@@ -118,7 +118,7 @@ Widget::Widget(QWidget *parent)
 
     result.clear();
 //! [12]
-    foreach (QString str, list) {
+    foreach (const QString &str, list) {
         if (str.contains("Bill"))
             result += str;
     }
diff --git a/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp b/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp
index 2d01240..620a716 100644
--- a/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp
+++ b/doc/src/snippets/qtreeview-dnd/dragdropmodel.cpp
@@ -123,7 +123,7 @@ QMimeData *DragDropModel::mimeData(const QModelIndexList &indexes) const
 
     QDataStream stream(&encodedData, QIODevice::WriteOnly);
 
-    foreach (QModelIndex index, indexes) {
+    foreach (const QModelIndex &index, indexes) {
         if (index.isValid()) {
             QString text = data(index, Qt::DisplayRole).toString();
             stream << index.internalId() << index.row() << index.column() << text;
diff --git a/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp b/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
index 6a49be8..35d2fa7 100644
--- a/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
+++ b/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp
@@ -72,9 +72,9 @@ int main(int argc, char *argv[])
         << (QStringList() << "David Bradley" << "42")
         << (QStringList() << "Knut Walters" << "25")
         << (QStringList() << "Andrea Jones" << "34");
-    foreach (QStringList row, rows) {
+    foreach (const QStringList &row, rows) {
         QList<QStandardItem *> items;
-        foreach (QString text, row)
+        foreach (const QString &text, row)
             items.append(new QStandardItem(text));
         model.appendRow(items);
     }
-- 
cgit v0.12


From 2ecb7eebdc950eb559b9203d70077301b8b5a3b1 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Mon, 26 Jul 2010 15:40:10 +0200
Subject: QDeclarativeEngineDebugServer: Fix crash when trying to update
 non-properties.

QDeclarativePropertyPrivate::setBinding would delete the binding if
it cannot set the property. Then the call to binding->update() would
crash.  So test for (property.isProperty()) before.

Also this will display a warning in the application output if the
property cannot be changed.

Reviewed-by: Lasse Holmstedt
---
 src/declarative/qml/qdeclarativeenginedebug.cpp | 30 ++++++++++++-------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 008d054..1837366 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -485,24 +485,22 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId,
 
     if (object && context) {
 
+        QDeclarativeProperty property(object, propertyName, context);
         if (isLiteralValue) {
-            QDeclarativeProperty literalProperty(object, propertyName, context);
-            literalProperty.write(expression);
+            property.write(expression);
+        } else if (hasValidSignal(object, propertyName)) {
+            QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString());
+            QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
+        } else if (property.isProperty()) {
+            QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
+            binding->setTarget(property);
+            binding->setNotifyOnValueChanged(true);
+            QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
+            if (oldBinding)
+                oldBinding->destroy();
+            binding->update();
         } else {
-            if (hasValidSignal(object, propertyName)) {
-                QDeclarativeProperty property(object, propertyName);
-                QDeclarativeExpression *declarativeExpression = new QDeclarativeExpression(context, object, expression.toString());
-                QDeclarativePropertyPrivate::setSignalExpression(property, declarativeExpression);
-            } else {
-                QDeclarativeBinding *binding = new QDeclarativeBinding(expression.toString(), object, context);
-                QDeclarativeProperty property(object, propertyName, context);
-                binding->setTarget(property);
-                binding->setNotifyOnValueChanged(true);
-                QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
-                if (oldBinding)
-                    oldBinding->destroy();
-                binding->update();
-            }
+            qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object;
         }
     }
 }
-- 
cgit v0.12


From d6203cfeb0e096575c1fc0254dddc07a3d65d24c Mon Sep 17 00:00:00 2001
From: Michael Dominic K <mdk@codethink.co.uk>
Date: Wed, 21 Jul 2010 11:17:33 +0200
Subject: Do check after all if we have partialUpdateSupport.

Task-number: QTBUG-12266
Merge-request: 752
Reviewed-by: Trond
---
 src/opengl/qwindowsurface_gl.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index e9da452..6b82ed3 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -494,10 +494,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
                 }
             }
 #endif
-            if (d_ptr->paintedRegion.boundingRect() != geometry()) {
-                // Emits warning if not supported. Should never happen unless
-                // setPartialUpdateSupport(true) has been called.
-                context()->d_func()->swapRegion(&d_ptr->paintedRegion);
+            if (d_ptr->paintedRegion.boundingRect() != geometry() && 
+                hasPartialUpdateSupport()) {
+                context()->d_func()->swapRegion(&d_ptr->paintedRegion);             
             } else
                 context()->swapBuffers();
 
-- 
cgit v0.12


From 9f657356f897d8bf4c92965a8bc1af82107e2379 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Mon, 26 Jul 2010 16:31:43 +0200
Subject: Updated WebKit to 0be9ff9f2b1ec2b748885ac15299bc1c65aca590

Integrated changes:

|| <https://webkit.org/b/42474> || Spatial navigation: do not consider outline for focusable element boundaries ||
|| <https://webkit.org/b/41484> || [Qt] Clamp color stops passed to QGradient to 1.0 ||
|| <https://webkit.org/b/29381> || [Qt] [Regression] QWebView::setHtml() executes script body twice ||
|| <https://webkit.org/b/30879> || Loading HTML with a JS alert() when the DocumentLoader has been set to not defer data load results in ASSERT ||
---
 src/3rdparty/webkit/.tag                           |  2 +-
 src/3rdparty/webkit/JavaScriptCore/ChangeLog       | 14 +++++
 .../webkit/JavaScriptCore/runtime/TimeoutChecker.h |  1 +
 src/3rdparty/webkit/VERSION                        |  2 +-
 src/3rdparty/webkit/WebCore/ChangeLog              | 64 ++++++++++++++++++++++
 .../webkit/WebCore/loader/MainResourceLoader.cpp   |  4 ++
 .../webkit/WebCore/page/SpatialNavigation.cpp      | 11 +---
 .../WebCore/platform/graphics/qt/GradientQt.cpp    |  2 +-
 src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp    |  4 ++
 src/3rdparty/webkit/WebKit/qt/ChangeLog            | 48 ++++++++++++++++
 .../qt/WebCoreSupport/FrameLoaderClientQt.cpp      | 12 +++-
 .../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h |  2 +
 .../WebKit/qt/tests/qwebframe/tst_qwebframe.cpp    | 28 ++++++++++
 13 files changed, 182 insertions(+), 12 deletions(-)

diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 79165f6..3cb818d 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-669858f9bbd4913fd16c642090375c81acbfdb04
+0be9ff9f2b1ec2b748885ac15299bc1c65aca590
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index 8fa3a72..ea680ac 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-30  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml()
+
+        This ensures that long-running JavaScript (for example due to a modal alert() dialog),
+        will not trigger a deferred load after only 500ms (the default tokenizer delay) while
+        still giving a reasonable timeout (10 seconds) to prevent deadlock.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29381
+
+        * runtime/TimeoutChecker.h: Add getter for the timeout interval
+
 2010-05-18  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.h b/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.h
index 7bfa6d0..5925641 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/TimeoutChecker.h
@@ -40,6 +40,7 @@ namespace JSC {
         TimeoutChecker();
 
         void setTimeoutInterval(unsigned timeoutInterval) { m_timeoutInterval = timeoutInterval; }
+        unsigned timeoutInterval() const { return m_timeoutInterval; }
         
         unsigned ticksUntilNextCheck() { return m_ticksUntilNextCheck; }
         
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index e492154..f12f6b5 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
 
 and has the sha1 checksum
 
-        669858f9bbd4913fd16c642090375c81acbfdb04
+        0be9ff9f2b1ec2b748885ac15299bc1c65aca590
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 1f7ca09..f7f2803 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,67 @@
+2010-07-01  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Clamp color stops passed to QGradient to 1.0
+        [https://bugs.webkit.org/show_bug.cgi?id=41484
+
+        Fixes an issue where color stops would be silently dropped from radial gradients.
+
+        * platform/graphics/qt/GradientQt.cpp:
+        (WebCore::Gradient::platformGradient):
+
+2010-07-07  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Prevent assertion/duplicate loads for non-deferred subtitute-data loads
+
+        https://bugs.webkit.org/show_bug.cgi?id=30879
+
+        MainResourceLoader uses the member m_initialRequest to store requests for future
+        deferred loads. When doing the actual load in handleDataLoadNow(), we therefore
+        have to clear this request so that subsequent entries into the loader will not
+        start yet another load.
+
+        This can happen as a result of a PageGroupLoadDeferrer going out of scope when
+        returning from Chrome::runJavaScriptAlert(), which calls setDeferredLoading(false),
+        but only in the case of using both substitute-data and non-deferred main resource
+        load together. That's why two new DRT functions were added:
+
+         * queueLoadHTMLString()
+         * setDeferMainResourceLoad()
+
+        The change adds DRT hooks for Mac, Win and Qt for these two functions. For Mac
+        and Win the hook uses new SPI in WebDataSource. For Qt a new static member was
+        added to the FrameLoaderClientQt and accessed though DumpRenderTreeSupportQt.
+
+        Test: fast/loader/non-deferred-substitute-load.html
+
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::handleDataLoadNow):
+
+2010-07-16  Antonio Gomes  <tonikitoo@webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial navigation: do not consider outline for focusable element boundaries
+        https://bugs.webkit.org/show_bug.cgi?id=42474
+
+        Test: fast/events/spatial-navigation/snav-zero-margin-content.html
+
+        Currently in WebCore::renderRectRelativeToRootDocument function, we are calling
+        RenderObject::absoluteClippedOverflowRect to obtain the rect boundary of a given
+        renderer/element. This method deals with outline, which is out of elements boundary.
+        It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc"
+        are inaccessible.
+
+        Patch replaces RenderObject::absoluteClippedOverflowRect by Node::getRect,
+        which returns only the absolute bounding box rect of the Element.
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::renderRectRelativeToRootDocument):
+        (WebCore::checkNegativeCoordsForNode):
+
 2010-07-21  Kristian Amlie <kristian.amlie@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/WebCore/loader/MainResourceLoader.cpp b/src/3rdparty/webkit/WebCore/loader/MainResourceLoader.cpp
index 28587e2..54c5c34 100644
--- a/src/3rdparty/webkit/WebCore/loader/MainResourceLoader.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/MainResourceLoader.cpp
@@ -464,6 +464,10 @@ void MainResourceLoader::handleDataLoadNow(MainResourceLoaderTimer*)
     KURL url = m_substituteData.responseURL();
     if (url.isEmpty())
         url = m_initialRequest.url();
+
+    // Clear the initial request here so that subsequent entries into the
+    // loader will not think there's still a deferred load left to do.
+    m_initialRequest = ResourceRequest();
         
     ResourceResponse response(url, m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding(), "");
     didReceiveResponse(response);
diff --git a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp
index a80626f..fdacebb 100644
--- a/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp
+++ b/src/3rdparty/webkit/WebCore/page/SpatialNavigation.cpp
@@ -102,14 +102,9 @@ void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate&
 // FIXME: This function does not behave correctly with transformed frames.
 static IntRect renderRectRelativeToRootDocument(RenderObject* render)
 {
-    ASSERT(render);
+    ASSERT(render && render->node());
 
-    IntRect rect(render->absoluteClippedOverflowRect());
-
-    if (rect.isEmpty()) {
-        Element* e = static_cast<Element*>(render->node());
-        rect = e->getRect();
-    }
+    IntRect rect = render->node()->getRect();
 
     // In cases when the |render|'s associated node is in a scrollable inner
     // document, we only consider its scrollOffset if it is not offscreen.
@@ -516,7 +511,7 @@ static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect)
 {
     ASSERT(node || node->renderer());
 
-    if (curRect.x() > 0 && curRect.y() > 0)
+    if (curRect.x() >= 0 && curRect.y() >= 0)
         return true;
 
     bool canBeScrolled = false;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GradientQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GradientQt.cpp
index 8b9e2d7..1ec3203 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GradientQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GradientQt.cpp
@@ -65,7 +65,7 @@ QGradient* Gradient::platformGradient()
             lastStop = stopIterator->stop;
         if (m_radial && m_r0)
             lastStop = m_r0 / m_r1 + lastStop * (1.0f - m_r0 / m_r1);
-        m_gradient->setColorAt(lastStop, stopColor);
+        m_gradient->setColorAt(qMin(lastStop, qreal(1.0f)), stopColor);
         // Keep the lastStop as orginal value, since the following stopColor depend it
         lastStop = stopIterator->stop;
         ++stopIterator;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index cc7b11c..4fe784f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -959,6 +959,10 @@ void QWebFrame::load(const QNetworkRequest &req,
 
   The \a html is loaded immediately; external objects are loaded asynchronously.
 
+  If a script in the \a html runs longer than the default script timeout (currently 10 seconds),
+  for example due to being blocked by a modal JavaScript alert dialog, this method will return
+  as soon as possible after the timeout and any subsequent \a html will be loaded asynchronously.
+
   When using this method WebKit assumes that external resources such as JavaScript programs or style
   sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external
   script can be specified through the charset attribute of the HTML script tag. It is also possible
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 1075b24..b2bff0c 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,51 @@
+2009-10-30  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Use the default timeout interval for JS as the HTML tokenizer delay for setHtml()
+
+        This ensures that long-running JavaScript (for example due to a modal alert() dialog),
+        will not trigger a deferred load after only 500ms (the default tokenizer delay) while
+        still giving a reasonable timeout (10 seconds) to prevent deadlock.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29381
+
+        * Api/qwebframe.cpp: Document the behaviour
+        * WebCoreSupport/FrameLoaderClientQt.cpp: set the custom tokenizer delay for substitute loads
+        * tests/qwebframe/tst_qwebframe.cpp: Add test
+
+2010-07-07  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Prevent assertion/duplicate loads for non-deferred subtitute-data loads
+
+        https://bugs.webkit.org/show_bug.cgi?id=30879
+
+        MainResourceLoader uses the member m_initialRequest to store requests for future
+        deferred loads. When doing the actual load in handleDataLoadNow(), we therefore
+        have to clear this request so that subsequent entries into the loader will not
+        start yet another load.
+
+        This can happen as a result of a PageGroupLoadDeferrer going out of scope when
+        returning from Chrome::runJavaScriptAlert(), which calls setDeferredLoading(false),
+        but only in the case of using both substitute-data and non-deferred main resource
+        load together. That's why two new DRT functions were added:
+
+         * queueLoadHTMLString()
+         * setDeferMainResourceLoad()
+
+        The change adds DRT hooks for Mac, Win and Qt for these two functions. For Mac
+        and Win the hook uses new SPI in WebDataSource. For Qt a new static member was
+        added to the FrameLoaderClientQt and accessed though DumpRenderTreeSupportQt.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::setDeferMainResourceDataLoad):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createDocumentLoader):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
 2010-07-23  David Boddie  <dboddie@trolltech.com>
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 686bfcc..713fa39 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -38,6 +38,7 @@
 #include "FrameTree.h"
 #include "FrameView.h"
 #include "DocumentLoader.h"
+#include "JSDOMWindowBase.h"
 #include "MIMETypeRegistry.h"
 #include "ResourceResponse.h"
 #include "Page.h"
@@ -141,6 +142,8 @@ static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceRespon
 namespace WebCore
 {
 
+bool FrameLoaderClientQt::deferMainResourceDataLoad = true;
+
 FrameLoaderClientQt::FrameLoaderClientQt()
     : m_frame(0)
     , m_webFrame(0)
@@ -812,8 +815,15 @@ bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
 WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
 {
     RefPtr<DocumentLoader> loader = DocumentLoader::create(request, substituteData);
-    if (substituteData.isValid())
+    if (!deferMainResourceDataLoad || substituteData.isValid()) {
         loader->setDeferMainResourceDataLoad(false);
+        // Use the default timeout interval for JS as the HTML tokenizer delay. This ensures
+        // that long-running JavaScript will still allow setHtml() to be synchronous, while
+        // still giving a reasonable timeout to prevent deadlock.
+        double delay = JSDOMWindowBase::commonJSGlobalData()->timeoutChecker.timeoutInterval() / 1000.0f;
+        m_frame->page()->setCustomHTMLTokenizerTimeDelay(delay);
+    } else
+        m_frame->page()->setCustomHTMLTokenizerTimeDelay(-1);
     return loader.release();
 }
 
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index adeb31c..515cf9a 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -211,6 +211,8 @@ namespace WebCore {
 
         QString chooseFile(const QString& oldFile);
 
+        static bool deferMainResourceDataLoad;
+
     private:
         Frame *m_frame;
         QWebFrame *m_webFrame;
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 76fdba3..e584f97 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -598,6 +598,7 @@ private slots:
     void setHtml();
     void setHtmlWithResource();
     void setHtmlWithBaseURL();
+    void setHtmlWithJSAlert();
     void ipv6HostEncoding();
     void metaData();
 #if !defined(Q_WS_MAEMO_5)
@@ -2485,6 +2486,33 @@ void tst_QWebFrame::setHtmlWithBaseURL()
     QCOMPARE(m_view->page()->history()->count(), 0);
 }
 
+class MyPage : public QWebPage
+{
+public:
+    MyPage() :  QWebPage(), alerts(0) {}
+    int alerts;
+
+protected:
+    virtual void javaScriptAlert(QWebFrame*, const QString& msg)
+    {
+        alerts++;
+        QCOMPARE(msg, QString("foo"));
+        // Should not be enough to trigger deferred loading, since we've upped the HTML
+        // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing()
+        QTest::qWait(1000);
+    }
+};
+
+void tst_QWebFrame::setHtmlWithJSAlert()
+{
+    QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>");
+    MyPage page;
+    m_view->setPage(&page);
+    page.mainFrame()->setHtml(html);
+    QCOMPARE(page.alerts, 1);
+    QCOMPARE(m_view->page()->mainFrame()->toHtml(), html);
+}
+
 class TestNetworkManager : public QNetworkAccessManager
 {
 public:
-- 
cgit v0.12


From 64087b078f3767a2190f2b4a0d4aca2a6165ebda Mon Sep 17 00:00:00 2001
From: Kevin Wright <kevin.wright@nokia.com>
Date: Mon, 26 Jul 2010 18:44:10 +0200
Subject: Fixed the following sub-tasks for QTBUG-12192

* Qt Simulator link missing

* Integration and add-ins (on the front page, link leads to an alternative start page)

* Qt Creator (on the front page link leads to Manual version 1.3)

* Getting Started (on the front page) link broken

* More... (in Global Declarations) link broken

Additionally:

There was an issue with the documentation used within Assistant/Creator that appears to have no bug report filed. An alternate "offline" form of the documentation (inspired by the newly redesigned online version) was being installed, but had significant issues within Assistant and Creator. It appears that within qdoc3 some changes had been made towards using this newer documentation format, but those changes were not working properly.

I fixed qdoc3 so that the original offline documentation design is the default, but there is room to use the configuration files to call the any of the three documentation designs (new online, new offline, and old offline).
---
 doc/src/index.qdoc                          |   5 +-
 tools/qdoc3/config.h                        |   1 +
 tools/qdoc3/htmlgenerator.cpp               | 203 +++++++++++++++++-----------
 tools/qdoc3/htmlgenerator.h                 |   5 +
 tools/qdoc3/test/assistant.qdocconf         |   3 +
 tools/qdoc3/test/designer.qdocconf          |   3 +
 tools/qdoc3/test/linguist.qdocconf          |   3 +
 tools/qdoc3/test/qdeclarative.qdocconf      |   3 +
 tools/qdoc3/test/qmake.qdocconf             |   3 +
 tools/qdoc3/test/qt-api-only.qdocconf       |   3 +
 tools/qdoc3/test/qt-build-docs.qdocconf     |   3 +
 tools/qdoc3/test/qt-html-templates.qdocconf |   3 +
 tools/qdoc3/test/qt.qdocconf                |   4 +-
 13 files changed, 162 insertions(+), 80 deletions(-)

diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index 0ecae59..bd3ac05 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -94,11 +94,12 @@
               </div>
               <div class="section sectionlist">
                 <ul>
-                  <li><a href="http://doc.qt.nokia.com/qtcreator-1.3/index.html">Qt Creator</a></li>
+                  <li><a href="http://doc.qt.nokia.com/qtcreator-2.0/index.html">Qt Creator</a></li>
                   <li><a href="designer-manual.html">Qt Designer</a></li>
                   <li><a href="linguist-manual.html">Qt Linguist</a></li>
                   <li><a href="assistant-manual.html">Qt Assistant</a></li>
-                  <li><a href="http://doc.qt.nokia.com/">Integration and add-ins</a></li>
+                  <li><a href="http://doc.qt.nokia.com/qtsimulator-1.0/simulator-description.html">Qt Simulator</a></li>
+                  <li><a href="http://qt.nokia.com/developer/eclipse-integration">Integration</a> and <a href="http://qt.nokia.com/products/appdev">add-ins</a></li>
                   <li><a href="qvfb.html">Virtual Framebuffer</a></li>
                 </ul>
               </div>
diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h
index af58a3f..b087b1c 100644
--- a/tools/qdoc3/config.h
+++ b/tools/qdoc3/config.h
@@ -143,6 +143,7 @@ class Config
 #define CONFIG_NATURALLANGUAGE          "naturallanguage"
 #define CONFIG_OBSOLETELINKS            "obsoletelinks"
 #define CONFIG_ONLINE                   "online"
+#define CONFIG_OFFLINE                  "offline"
 #define CONFIG_CREATOR                  "creator"
 #define CONFIG_OUTPUTDIR                "outputdir"
 #define CONFIG_OUTPUTENCODING           "outputencoding"
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 416d44a..76d8c0d 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -219,7 +219,8 @@ HtmlGenerator::HtmlGenerator()
       inTableHeader(false),
       numTableRows(0),
       threeColumnEnumValueTable(true),
-      offlineDocs(true),
+      offlineDocs(false),
+      onlineDocs(false),
       creatorDocs(true),
       funcLeftParen("\\S(\\()"),
       myTree(0),
@@ -271,6 +272,12 @@ void HtmlGenerator::initializeGenerator(const Config &config)
     postPostHeader = config.getString(HtmlGenerator::format() +
                                       Config::dot +
                                       HTMLGENERATOR_POSTPOSTHEADER);
+    creatorPostHeader = config.getString(HtmlGenerator::format() +
+                                  Config::dot +
+                                  HTMLGENERATOR_CREATORPOSTHEADER);
+    creatorPostPostHeader = config.getString(HtmlGenerator::format() +
+                                      Config::dot +
+                                      HTMLGENERATOR_CREATORPOSTPOSTHEADER);
     footer = config.getString(HtmlGenerator::format() +
                               Config::dot +
                               HTMLGENERATOR_FOOTER);
@@ -282,8 +289,13 @@ void HtmlGenerator::initializeGenerator(const Config &config)
                                           HTMLGENERATOR_GENERATEMACREFS);
 
     project = config.getString(CONFIG_PROJECT);
-    offlineDocs = !config.getBool(CONFIG_ONLINE);
-    creatorDocs = false; //!config.getBool(CONFIG_CREATOR);
+
+    onlineDocs = config.getBool(CONFIG_ONLINE);
+
+    offlineDocs = config.getBool(CONFIG_OFFLINE);
+
+    creatorDocs = config.getBool(CONFIG_CREATOR);
+
     projectDescription = config.getString(CONFIG_DESCRIPTION);
     if (projectDescription.isEmpty() && !project.isEmpty())
         projectDescription = project + " Reference Documentation";
@@ -1615,7 +1627,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
     }
     else {
         generateExtractionMark(fake, DetailedDescriptionMark);
-        out() << "<div class=\"descr\">\n"; // QTBUG-9504
+        out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504
     }
 
     generateBody(fake, marker);
@@ -1781,64 +1793,94 @@ void HtmlGenerator::generateHeader(const QString& title,
         else
             shortVersion = "Qt " + shortVersion + ": ";
     }
-	// Generating page title
+
+    // Generating page title
     out() << "  <title>" << shortVersion << protectEnc(title) << "</title>\n";
-	// Adding style sheet
-	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />";
-	// Adding jquery and functions - providing online tools and search features
-	out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
-	out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
-	// Adding style and js for small windows
-	out() << "  <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
-	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
-	out() << "  <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
-	out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />";
+    // Adding style sheet
+    out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n";
+    // Adding jquery and functions - providing online tools and search features
+    out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
+    out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+    // Adding style and js for small windows
+    out() << "  <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
+    out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
+    out() << "  <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
+    out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />\n";
 	
-	// Adding syntax highlighter 	// future release
+    // Adding syntax highlighter 	// future release
 	
-	// Setting assistant configuration
-    if (offlineDocs)
-	{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
-		out() << "</head>\n";
-		out() << "<body class=\"offline \">\n"; // offline for  Assistant
-	}	
-    if (creatorDocs)
-	{
-		out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />"; // Only for Qt Creator
-		out() << "</head>\n";
-		out() << "<body class=\"offline narrow creator\">\n"; // offline for Creator
-	}	
-	// Setting online doc configuration
-    else
-		{
-		// Browser spec styles
-		out() << "  <!--[if IE]>\n";
-		out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
-		out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
-		out() << "<![endif]-->\n";
-		out() << "<!--[if lt IE 7]>\n";
-		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
-		out() << "<![endif]-->\n";
-		out() << "<!--[if IE 7]>\n";
-		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
-		out() << "<![endif]-->\n";
-		out() << "<!--[if IE 8]>\n";
-		out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
-		out() << "<![endif]-->\n";
+    // Setting some additional style sheet related details depending on configuration (e.g. online/offline)
+
+    
+    if(onlineDocs==true) // onlineDocs is for the web
+    {
+        // Browser spec styles
+	out() << "  <!--[if IE]>\n";
+	out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
+	out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
+	out() << "<![endif]-->\n";
+	out() << "<!--[if lt IE 7]>\n";
+	out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
+	out() << "<![endif]-->\n";
+	out() << "<!--[if IE 7]>\n";
+	out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
+	out() << "<![endif]-->\n";
+	out() << "<!--[if IE 8]>\n";
+	out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
+	out() << "<![endif]-->\n";
 		
-		out() << "</head>\n";
-		// CheckEmptyAndLoadList activating search
-		out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
-		}
+	out() << "</head>\n";
+	// CheckEmptyAndLoadList activating search
+	out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
+    }   
+    else if (offlineDocs == true) // offlineDocs is for ???
+    {
+	out() << "</head>\n";
+	out() << "<body class=\"offline \">\n"; // offline		
+    }	  
+    else if (creatorDocs == true) // creatorDocs is for Assistant/Creator
+    {
+	out() << "</head>\n";
+	out() << "<body class=\"offline narrow creator\">\n"; // offline narrow
+    }	
+    // default -- not used except if one forgets to set any of the above settings to true
+    else
+    {
+	out() << "</head>\n";
+	out() << "<body>\n";		
+    }
 
 #ifdef GENERATE_MAC_REFS    
     if (mainPage)
         generateMacRef(node, marker);
-#endif    
-    out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version());
-    generateBreadCrumbs(title,node,marker);
-    out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+#endif   
+ 
+
+    if(onlineDocs==true) // onlineDocs is for the web
+    {
+        out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+        generateBreadCrumbs(title,node,marker);
+        out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+    }   
+    else if (offlineDocs == true) // offlineDocs is for ???
+    {
+        out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+        generateBreadCrumbs(title,node,marker);
+        out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());	
+    }	  
+    else if (creatorDocs == true) // creatorDocs is for Assistant/Creator
+    {
+        out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+        generateBreadCrumbs(title,node,marker);
+        out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());	
+    }	
+    // default -- not used except if one forgets to set any of the above settings to true
+    else
+    {
+        out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
+        generateBreadCrumbs(title,node,marker);
+        out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());	
+    }
 
 #if 0 // Removed for new doc format. MWS
     if (node && !node->links().empty())
@@ -1873,29 +1915,33 @@ void HtmlGenerator::generateFooter(const Node *node)
     out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version())
           << QString(address).replace("\\" + COMMAND_VERSION, myTree->version());
 	
-	    if (offlineDocs)
-		{
-          out() << "</body>\n";
-		}
-	    if (creatorDocs)
-		{
-          out() << "</body>\n";
-		}
-		else
-		{
-			out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
-			out() << "  <!-- <script type=\"text/javascript\">\n";
-			out() << "  var _gaq = _gaq || [];\n";
-			out() << "  _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
-			out() << "  _gaq.push(['_trackPageview']);\n";
-			out() << "  (function() {\n";
-			out() << "  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
-			out() << "  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
-			out() << "  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
-			out() << "  })();\n";
-			out() << "  </script> -->\n";
-			out() << "</body>\n";
-		}
+	    if (onlineDocs == true)
+	    {
+	    	    out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+	    	    out() << "  <!-- <script type=\"text/javascript\">\n";
+	    	    out() << "  var _gaq = _gaq || [];\n";
+	    	    out() << "  _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
+	    	    out() << "  _gaq.push(['_trackPageview']);\n";
+	    	    out() << "  (function() {\n";
+	    	    out() << "  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
+	    	    out() << "  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
+	    	    out() << "  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
+	    	    out() << "  })();\n";
+	    	    out() << "  </script> -->\n";
+	    	    out() << "</body>\n";
+	    }	
+	    else if (offlineDocs == true)
+	    {
+	    	    out() << "</body>\n";
+	    }
+	    else if (creatorDocs == true)
+	    {
+	    	    out() << "</body>\n";
+	    }
+	    else
+	    {
+	    	    out() << "</body>\n";
+	    }
           out() <<   "</html>\n";
 }
 
@@ -1907,11 +1953,14 @@ void HtmlGenerator::generateBrief(const Node *node, CodeMarker *marker,
         generateExtractionMark(node, BriefMark);
         out() << "<p>";
         generateText(brief, node, marker);
+
         if (!relative || node == relative)
             out() << " <a href=\"#";
         else
             out() << " <a href=\"" << linkForNode(node, relative) << "#";
         out() << registerRef("details") << "\">More...</a></p>\n";
+
+
         generateExtractionMark(node, EndMark);
     }
 }
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index aaf2318..d92c349 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -294,6 +294,7 @@ class HtmlGenerator : public PageGenerator
     bool inTableHeader;
     int numTableRows;
     bool threeColumnEnumValueTable;
+    bool onlineDocs;
     bool offlineDocs;
     bool creatorDocs;
     QString link;
@@ -302,6 +303,8 @@ class HtmlGenerator : public PageGenerator
     QString style;
     QString postHeader;
     QString postPostHeader;
+    QString creatorPostHeader;
+    QString creatorPostPostHeader;
     QString footer;
     QString address;
     bool pleaseGenerateMacRef;
@@ -339,6 +342,8 @@ class HtmlGenerator : public PageGenerator
 #define HTMLGENERATOR_GENERATEMACREFS   "generatemacrefs" // ### document me
 #define HTMLGENERATOR_POSTHEADER        "postheader"
 #define HTMLGENERATOR_POSTPOSTHEADER    "postpostheader"
+#define HTMLGENERATOR_CREATORPOSTHEADER        "postheader"
+#define HTMLGENERATOR_CREATORPOSTPOSTHEADER    "postpostheader"
 #define HTMLGENERATOR_STYLE             "style"
 #define HTMLGENERATOR_STYLESHEETS       "stylesheets"
 #define HTMLGENERATOR_CUSTOMHEADELEMENTS "customheadelements"
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 8d5fa89..efe3b3b 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -7,6 +7,9 @@ include(qt-defines.qdocconf)
 project                 = Qt Assistant
 description             = Qt Assistant Manual
 url                     = http://qt.nokia.com/doc/4.7
+online                  = false
+offline                 = false
+creator                 = true
 
 indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
 
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index b1f37dc..0595417 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -7,6 +7,9 @@ include(qt-defines.qdocconf)
 project                 = Qt Designer
 description             = Qt Designer Manual
 url                     = http://qt.nokia.com/doc/4.7
+online                  = false
+offline                 = false
+creator                 = true
 
 indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
 
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index 26fb55c..7dd57fb 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -7,6 +7,9 @@ include(qt-defines.qdocconf)
 project                 = Qt Linguist
 description             = Qt Linguist Manual
 url                     = http://qt.nokia.com/doc/4.7
+online                  = false
+offline                 = false
+creator                 = true
 
 indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
 
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index facec5c..0cff98e 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -8,6 +8,9 @@ project                 = Qml
 description             = Qml Reference Documentation
 url                     = http://qt.nokia.com/doc/4.7/
 qmlonly                 = true
+online                  = false
+offline                 = false
+creator                 = true
 
 edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \
                           QtXmlPatterns QtTest
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index f069129..c666288 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -7,6 +7,9 @@ include(qt-defines.qdocconf)
 project                 = QMake
 description             = QMake Manual
 url                     = http://qt.nokia.com/doc/4.7
+online                  = false
+offline                 = false
+creator                 = true
 
 indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
 
diff --git a/tools/qdoc3/test/qt-api-only.qdocconf b/tools/qdoc3/test/qt-api-only.qdocconf
index bf6c0dc..1ec0c6b 100644
--- a/tools/qdoc3/test/qt-api-only.qdocconf
+++ b/tools/qdoc3/test/qt-api-only.qdocconf
@@ -5,6 +5,9 @@ include(qt-build-docs.qdocconf)
 # qmake.qdocconf).
 
 url                     = ./
+online                  = false
+offline                 = false
+creator                 = true
 
 # Ensures that the documentation for the tools is not included in the generated
 # .qhp file.
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 4ac4f47..f663016 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -7,6 +7,9 @@ include(qt-defines.qdocconf)
 project                 = Qt
 description             = Qt Reference Documentation
 url                     = http://qt.nokia.com/doc/4.7
+online                  = false
+offline                 = false
+creator                 = true
 
 sourceencoding          = UTF-8
 outputencoding          = UTF-8
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index b428a90..e439708 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -3,6 +3,9 @@ HTML.stylesheets        =  style/style.css \
 									style/style_ie7.css \
 									style/style_ie8.css \
 									style/style_ie6.css
+
+HTML.creatorpostheader         = "**\n"
+HTML.creatorpostpostheader         = "***\n"
 									
 HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
 			  "    <div class=\"content\"> \n" \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index e4ed1bc..08492e3 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -9,7 +9,9 @@ versionsym              =
 version                 = %VERSION%
 description             = Qt Reference Documentation
 url                     = http://qt.nokia.com/doc/4.7
-online                  = true
+online                  = false
+offline                 = false
+creator                 = true
 
 sourceencoding          = UTF-8
 outputencoding          = UTF-8
-- 
cgit v0.12


From bc7d7cd128b3ec30bcd64bcc0f1d23009f76caf9 Mon Sep 17 00:00:00 2001
From: Peter Hartmann <peter.hartmann@nokia.com>
Date: Mon, 26 Jul 2010 18:54:28 +0200
Subject: update changelog for 4.7.0

---
 dist/changes-4.7.0 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index 8997cff..518d362 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -216,6 +216,7 @@ QtNetwork
   * [QTBUG-9618] [MR 2372] send secure cookies only over secure connections
   * [QTBUG-7713] Fix bug related to re-sending request
   * [QTBUG-7673] Fix issue with some webservers
+  * [QTBUG-11029] do not accept cookies with non-alpha-numerical domain
  - Sockets
   * Better support for derived QTcpServer
   * [QTBUG-7054] Fix error handling with waitFor*() for socket engine
@@ -223,6 +224,10 @@ QtNetwork
  - SSL
   * [QTBUG-2515] Do not make OpenSSL prompt for a password
   * [QTBUG-6504, QTBUG-8924, QTBUG-5645] Fix memleak
+  * [QTBUG-9973] QSslCertificate: support large serial numbers
+  * [QTBUG-8833] make QSslSocket::systemCaCertificates() use system certs
+  * [QT-3567] QSslSocket: improve error handling (fixes Secunia Advisory SA40389)
+  * [QBTUG-4455, MR 731] Fix handling of SSL certificates with wildcard domain names
 
 QtScript
 --------
@@ -245,6 +250,7 @@ QtXmlPatterns
  - [QTBUG-8920] fixed crash with anonymous types in XsdSchemaChecker
  - [QTBUG-8394] include/import/redefine schemas only once
  - QXmlSchema: fix crash with referencing elements
+ - [QBTUG-6485] QXmlSchema: allow usage of xsd:all
 
 Qt Plugins
 ----------
@@ -471,6 +477,4 @@ QtCore:
 
 QtNetwork:
   - Qt does no longer provide its own CA bundle, but uses system APIs for
-    retrieving the default system certificates. On Symbian,
-    QSslSocket::systemCaCertificates() provides an empty list of
-    certificates.
+    retrieving the default system certificates.
-- 
cgit v0.12


From b4b0bdda668e9845623995c788d88a774dd52d98 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Tue, 27 Jul 2010 10:30:07 +1000
Subject: Document 'this' as undefined in QML

Task-number: QTBUG-12396
Reviewed-by: Aaron Kennedy
---
 doc/src/declarative/javascriptblocks.qdoc | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index c41e38e..18da3d2 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -236,6 +236,31 @@ This restriction exists as the QML environment is not yet fully established.
 To run code after the environment setup has completed, refer to
 \l {Running JavaScript at Startup}.
 
+\o The value of \c this is currently undefined in QML
+
+The value of \c this is undefined in QML.  To refer to any element, provide
+an \c id.  For example:
+
+\qml
+Item {
+    width: 200; height: 100
+    function mouseAreaClicked(area) {
+        console.log("Clicked in area at: " + area.x + ", " + area.y);
+    }
+    // This will not work because this is undefined
+    MouseArea {
+        height: 50; width: 200
+        onClicked: mouseAreaClicked(this)
+    }
+    // This will pass area2 to the function
+    MouseArea {
+        id: area2
+        y: 50; height: 50; width: 200
+        onClicked: mouseAreaClicked(area2)
+    }
+}
+\endqml
+
 \endlist
 
 */
-- 
cgit v0.12


From a0ae434a452deea022e3b7117e946e95542aa884 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 26 Jul 2010 10:33:51 +1000
Subject: Cherry pick fix for MOBILITY-1144 from Qt Mobility.

426ff79e49d4abb659167541bb67846443b9707e
---
 src/plugins/bearer/symbian/qnetworksession_impl.cpp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index f89ed0a..99737d7 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -1044,6 +1044,11 @@ void QNetworkSessionPrivateImpl::RunL()
             TInt error = KErrNone;
             QNetworkConfiguration newActiveConfig = activeConfiguration();
             if (!newActiveConfig.isValid()) {
+                // RConnection startup was successfull but no configuration
+                // was found. That indicates that user has chosen to create a
+                // new WLAN configuration (from scan results), but that new
+                // configuration does not have access to Internet (Internet
+                // Connectivity Test, ICT, failed).
                 error = KErrGeneral;
             } else {
                 // Use name of the IAP to open global 'Open C' RConnection
@@ -1053,16 +1058,24 @@ void QNetworkSessionPrivateImpl::RunL()
                 strcpy(ifr.ifr_name, nameAsByteArray.constData());
                 error = setdefaultif(&ifr);
             }
-            
             if (error != KErrNone) {
                 isOpen = false;
                 isOpening = false;
                 iError = QNetworkSession::UnknownSessionError;
                 QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
-                Cancel();
                 if (ipConnectionNotifier) {
                     ipConnectionNotifier->StopNotifications();
                 }
+                if (!newActiveConfig.isValid()) {
+                    // No valid configuration, bail out.
+                    // Status updates from QNCM won't be received correctly
+                    // because there is no configuration to associate them with so transit here.
+                    iConnection.Close();
+                    newState(QNetworkSession::Closing);
+                    newState(QNetworkSession::Disconnected);
+                } else {
+                    Cancel();
+                }
                 QT_TRYCATCH_LEAVING(syncStateWithInterface());
                 return;
             }
-- 
cgit v0.12


From 0664d3ad029b4d80d9ffac75f4f1c6c47bac2641 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 26 Jul 2010 12:02:36 +1000
Subject: Cherry pick fix for MOBILITY-1145 from Qt Mobility.

f17d8a5dbef076046ff504fecb1fd445c9b785ac
---
 src/plugins/bearer/symbian/qnetworksession_impl.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 99737d7..d6b4975 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -1130,7 +1130,9 @@ void QNetworkSessionPrivateImpl::RunL()
             isOpening = false;
             activeConfig = QNetworkConfiguration();
             serviceConfig = QNetworkConfiguration();
-            if (publicConfig.state() == QNetworkConfiguration::Undefined ||
+            if (statusCode == KErrCancel) {
+                iError = QNetworkSession::SessionAbortedError;
+            } else if (publicConfig.state() == QNetworkConfiguration::Undefined ||
                 publicConfig.state() == QNetworkConfiguration::Defined) {
                 iError = QNetworkSession::InvalidConfigurationError;
             } else {
-- 
cgit v0.12


From e9e0a82b1a5a71cefdd1711c51b786088b40bafd Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 26 Jul 2010 12:11:03 +1000
Subject: Fix typo in docs.

---
 doc/src/network-programming/bearermanagement.qdoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc
index 67c13f2..bc016df 100644
--- a/doc/src/network-programming/bearermanagement.qdoc
+++ b/doc/src/network-programming/bearermanagement.qdoc
@@ -191,7 +191,7 @@ closed via \l{QNetworkSession::close()}, respectively. If the session
 is \l{QNetworkSession::Disconnected}{disconnected} at the time of the
 \l{QNetworkSession::open()}{open()} call the underlying interface is started;
 otherwise only the reference counter against the global session is
-incremeted. The opposite behavior can be observed when using
+incremented. The opposite behavior can be observed when using
 \l{QNetworkSession::close()}{close()}.
 
 In some use cases it may be necessary to turn the interface off despite of
-- 
cgit v0.12


From c16f0a839743af36b36aea9c35f0d5ddfda3d6ac Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 26 Jul 2010 12:42:06 +1000
Subject: Cherry pick fix for MOBILITY-1077 from Qt Mobility.

7ef45318255c5cf1f10508753c9a2c55fc2cb8c0
321bd8b7b54e34a983b1ba142af836cf3e153a66
---
 examples/network/bearercloud/cloud.cpp |  5 +++++
 src/network/bearer/qnetworksession.cpp | 12 ++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp
index 2856c71..980efbf 100644
--- a/examples/network/bearercloud/cloud.cpp
+++ b/examples/network/bearercloud/cloud.cpp
@@ -245,6 +245,8 @@ void Cloud::stateChanged(QNetworkSession::State state)
     else
         finalOpacity = 1.0;
 
+#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) && \
+    !defined(Q_OS_SYMBIAN) && !defined(Q_OS_WINCE)
     QString tooltip;
 
     if (configuration.name().isEmpty())
@@ -302,6 +304,9 @@ void Cloud::stateChanged(QNetworkSession::State state)
     tooltip += tr("<br>Sent data: %1 bytes").arg(session->bytesWritten());
 
     setToolTip(tooltip);
+#else
+    Q_UNUSED(state);
+#endif
 }
 //! [2]
 
diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp
index 1ed6cbb..65de539 100644
--- a/src/network/bearer/qnetworksession.cpp
+++ b/src/network/bearer/qnetworksession.cpp
@@ -629,8 +629,10 @@ void QNetworkSession::reject()
     If the session is based on a service network configuration the number of 
     sent bytes across all active member configurations are returned.
 
-    This function may not always be supported on all platforms and returns
-    0. The platform capability can be detected via QNetworkConfigurationManager::DataStatistics.
+    This function may not always be supported on all platforms and returns 0.
+    The platform capability can be detected via QNetworkConfigurationManager::DataStatistics.
+
+    \note On some platforms this function may run the main event loop.
 */
 quint64 QNetworkSession::bytesWritten() const
 {
@@ -646,8 +648,10 @@ quint64 QNetworkSession::bytesWritten() const
     If the session is based on a service network configuration the number of 
     sent bytes across all active member configurations are returned.
 
-    This function may not always be supported on all platforms and returns
-    0. The platform capability can be detected via QNetworkConfigurationManager::DataStatistics.
+    This function may not always be supported on all platforms and returns 0.
+    The platform capability can be detected via QNetworkConfigurationManager::DataStatistics.
+
+    \note On some platforms this function may run the main event loop.
 */
 quint64 QNetworkSession::bytesReceived() const
 {
-- 
cgit v0.12


From 9ea7bb34e4b41e1263acb8a175f61566046f9bf6 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 27 Jul 2010 09:59:59 +1000
Subject: various doc fixes

---
 doc/src/declarative/dynamicobjects.qdoc                       |  2 +-
 .../tutorials/extending/chapter6-plugins/chartsplugin.cpp     |  2 +-
 .../tutorials/extending/chapter6-plugins/chartsplugin.h       |  2 +-
 src/declarative/qml/qdeclarativecomponent.cpp                 |  4 +++-
 src/declarative/qml/qdeclarativeengine.cpp                    |  2 +-
 src/declarative/qml/qdeclarativeimageprovider.cpp             |  3 ---
 src/declarative/util/qdeclarativetimer.cpp                    | 11 +++++------
 src/declarative/util/qdeclarativetransition.cpp               |  4 ++--
 8 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 6bce4fa..300799c 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -148,7 +148,7 @@ lots of dynamically created items, however, you may receive a worthwhile
 performance benefit if unused items are deleted.
 
 Note that you should never manually delete items that were dynamically created
-by QML elements (such as \l Loader). Also, you should generally avoid deleting
+by QML elements (such as \l Loader and \l Repeater). Also, you should generally avoid deleting
 items that you did not dynamically create yourself.
 
 Items can be deleted using the \c destroy() method. This method has an optional
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
index 5aa2a4b..c4d8b61 100644
--- a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.cpp
@@ -41,7 +41,7 @@
 //![0]
 #include "piechart.h"
 #include "pieslice.h"
-#include <QtDeclarative/qdeclarative.h>
+#include <qdeclarative.h>
 
 void ChartsPlugin::registerTypes(const char *uri)
 {
diff --git a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
index 797d1e7..c055e8b 100644
--- a/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
+++ b/examples/declarative/tutorials/extending/chapter6-plugins/chartsplugin.h
@@ -41,7 +41,7 @@
 #define CHARTSPLUGIN_H
 
 //![0]
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
+#include <QDeclarativeExtensionPlugin>
 
 class ChartsPlugin : public QDeclarativeExtensionPlugin
 {
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 36c4b49..7bc6184 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -119,6 +119,8 @@ class QByteArray;
 
     \qml
     Item {
+        width: 100; height: 100
+
         Component {
             id: redSquare
 
@@ -146,7 +148,7 @@ class QByteArray;
     to specify how each list item is to be displayed.
 
     Component objects can also be dynamically generated using
-    \l{Qt::createComponent}{Qt.createComponent()}.
+    \l{Qt::createComponent()}{Qt.createComponent()}.
 */
 
 /*!
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index e3ebca3..e313c97 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -228,7 +228,7 @@ There are also string based constructors for these types. See \l{qdeclarativebas
 
 \section1 Date/Time Formatters
 
-The Qt object contains several functions for formatting dates and times.
+The Qt object contains several functions for formatting QDateTime, QDate and QTime values.
 
 \list
     \o \l{QML:Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index a294c38..241df87 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -212,9 +212,6 @@ QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, c
     In all cases, \a size must be set to the original size of the image. This
     is used to set the \l {Item::}{width} and \l {Item::}{height} of image
     elements that should be automatically sized to the loaded image.
-
-    \note this method may be called by multiple threads, so ensure the
-    implementation of this method is reentrant.
 */
 QPixmap QDeclarativeImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize)
 {
diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp
index 576995f..838a8f3 100644
--- a/src/declarative/util/qdeclarativetimer.cpp
+++ b/src/declarative/util/qdeclarativetimer.cpp
@@ -73,11 +73,12 @@ public:
     \since 4.7
     \brief The Timer item triggers a handler at a specified interval.
 
-    A timer can be used to trigger an action either once, or repeatedly
+    A Timer can be used to trigger an action either once, or repeatedly
     at a given interval.
 
-    Here is a timer that shows the current date and time, and updates
-    the text every 500 milliseconds:
+    Here is a Timer that shows the current date and time, and updates
+    the text every 500 milliseconds. It uses the JavaScript \c Date
+    object to access the current time.
 
     \qml
     import Qt 4.7
@@ -88,9 +89,7 @@ public:
             onTriggered: time.text = Date().toString()
         }
 
-        Text {
-            id: time
-        }
+        Text { id: time }
     }
     \endqml
 
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 6561b8c..582191b 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -66,13 +66,13 @@ QT_BEGIN_NAMESPACE
    
     \snippet doc/src/snippets/declarative/transition.qml 0
 
-    To specify multiple transitions, specify \l Item::transitions as a list:
+    To define multiple transitions, specify \l Item::transitions as a list:
 
     \qml
     Item {
         ...
         transitions: [
-            Transition { ... }
+            Transition { ... },
             Transition { ... }
         ]
     }
-- 
cgit v0.12


From 6c7ed006b0a1f006e11fd5f78dd996d65114fc98 Mon Sep 17 00:00:00 2001
From: Bea Lam <bea.lam@nokia.com>
Date: Tue, 27 Jul 2010 11:09:14 +1000
Subject: Document that animations have to be started/stopped as a group

---
 src/declarative/util/qdeclarativeanimation.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 1a223d5..9806957 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -1557,6 +1557,10 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro
     sources. The \l PropertyAnimation documentation shows a variety of methods
     for creating animations.
 
+    \note Once an animation has been grouped into a SequentialAnimation or 
+    ParallelAnimation, it cannot be individually started and stopped; the
+    SequentialAnimation or ParallelAnimation must be started and stopped as a group.
+    
     \sa ParallelAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
 
@@ -1622,6 +1626,10 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
     sources. The \l PropertyAnimation documentation shows a variety of methods
     for creating animations.
 
+    \note Once an animation has been grouped into a SequentialAnimation or 
+    ParallelAnimation, it cannot be individually started and stopped; the
+    SequentialAnimation or ParallelAnimation must be started and stopped as a group.
+
     \sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
 */
 /*!
-- 
cgit v0.12


From 589c42c4f3cb51bc23592f8fdbfb7af08998929b Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Tue, 27 Jul 2010 17:01:40 +1000
Subject: Make tst_qdatetime failures more verbose.

---
 tests/auto/qdatetime/tst_qdatetime.cpp | 56 ++++++++++++++++++++++++----------
 1 file changed, 40 insertions(+), 16 deletions(-)

diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index 0900b35..1a82a4c 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -961,14 +961,26 @@ void tst_QDateTime::currentDateTime()
     upperBound.setTime_t(buf2);
     upperBound = upperBound.addSecs(1);
 
-    QVERIFY(lowerBound < upperBound);
-
-    QVERIFY(lowerBound <= dt1);
-    QVERIFY(dt1 < upperBound);
-    QVERIFY(lowerBound <= dt2);
-    QVERIFY(dt2 < upperBound);
-    QVERIFY(lowerBound <= dt3);
-    QVERIFY(dt3 < upperBound);
+    QString details = QString("\n"
+        "lowerBound: %1\n"
+        "dt1:        %2\n"
+        "dt2:        %3\n"
+        "dt3:        %4\n"
+        "upperBound: %5\n")
+        .arg(lowerBound.toTime_t())
+        .arg(dt1.toTime_t())
+        .arg(dt2.toTime_t())
+        .arg(dt3.toTime_t())
+        .arg(upperBound.toTime_t());
+
+    QVERIFY2(lowerBound < upperBound, qPrintable(details));
+
+    QVERIFY2(lowerBound <= dt1, qPrintable(details));
+    QVERIFY2(dt1 < upperBound, qPrintable(details));
+    QVERIFY2(lowerBound <= dt2, qPrintable(details));
+    QVERIFY2(dt2 < upperBound, qPrintable(details));
+    QVERIFY2(lowerBound <= dt3, qPrintable(details));
+    QVERIFY2(dt3 < upperBound, qPrintable(details));
 
     QVERIFY(dt1.timeSpec() == Qt::LocalTime);
     QVERIFY(dt2.timeSpec() == Qt::LocalTime);
@@ -1000,14 +1012,26 @@ void tst_QDateTime::currentDateTimeUtc()
     upperBound.setTime_t(buf2);
     upperBound = upperBound.addSecs(1);
 
-    QVERIFY(lowerBound < upperBound);
-
-    QVERIFY(lowerBound <= dt1);
-    QVERIFY(dt1 < upperBound);
-    QVERIFY(lowerBound <= dt2);
-    QVERIFY(dt2 < upperBound);
-    QVERIFY(lowerBound <= dt3);
-    QVERIFY(dt3 < upperBound);
+    QString details = QString("\n"
+        "lowerBound: %1\n"
+        "dt1:        %2\n"
+        "dt2:        %3\n"
+        "dt3:        %4\n"
+        "upperBound: %5\n")
+        .arg(lowerBound.toTime_t())
+        .arg(dt1.toTime_t())
+        .arg(dt2.toTime_t())
+        .arg(dt3.toTime_t())
+        .arg(upperBound.toTime_t());
+
+    QVERIFY2(lowerBound < upperBound, qPrintable(details));
+
+    QVERIFY2(lowerBound <= dt1, qPrintable(details));
+    QVERIFY2(dt1 < upperBound, qPrintable(details));
+    QVERIFY2(lowerBound <= dt2, qPrintable(details));
+    QVERIFY2(dt2 < upperBound, qPrintable(details));
+    QVERIFY2(lowerBound <= dt3, qPrintable(details));
+    QVERIFY2(dt3 < upperBound, qPrintable(details));
 
     QVERIFY(dt1.timeSpec() == Qt::UTC);
     QVERIFY(dt2.timeSpec() == Qt::LocalTime);
-- 
cgit v0.12


From a02eba0de0fcf9a17d489ee1f92977c95d3afd76 Mon Sep 17 00:00:00 2001
From: Kevin Wright <kevin.wright@nokia.com>
Date: Tue, 27 Jul 2010 09:22:24 +0200
Subject: Modified file/directory names and text to remove disallowed
 terminology.

---
 doc/src/examples/fingerpaint.qdoc                 |   6 +-
 doc/src/examples/multitouch-dials.qdoc            |  36 ----
 doc/src/examples/multitouch-knobs.qdoc            |  36 ----
 doc/src/examples/pinchzoom.qdoc                   |   6 +-
 doc/src/getting-started/examples.qdoc             |  16 +-
 doc/src/images/multitouch-dials-example.png       | Bin 17676 -> 0 bytes
 doc/src/images/multitouch-examples.png            | Bin 6691 -> 0 bytes
 doc/src/images/multitouch-fingerpaint-example.png | Bin 17026 -> 0 bytes
 doc/src/images/multitouch-knobs-example.png       | Bin 1290 -> 0 bytes
 doc/src/images/multitouch-pinchzoom-example.png   | Bin 48154 -> 0 bytes
 doc/src/qt4-intro.qdoc                            |   8 +-
 examples/examples.pro                             |   2 +-
 examples/multitouch/dials/dials.pro               |   2 -
 examples/multitouch/dials/dials.ui                |  77 --------
 examples/multitouch/dials/main.cpp                |  58 ------
 examples/multitouch/fingerpaint/fingerpaint.pro   |  11 --
 examples/multitouch/fingerpaint/main.cpp          |  51 -----
 examples/multitouch/fingerpaint/mainwindow.cpp    | 217 ----------------------
 examples/multitouch/fingerpaint/mainwindow.h      |  88 ---------
 examples/multitouch/fingerpaint/scribblearea.cpp  | 211 ---------------------
 examples/multitouch/fingerpaint/scribblearea.h    |  80 --------
 examples/multitouch/knobs/knob.cpp                |  88 ---------
 examples/multitouch/knobs/knob.h                  |  54 ------
 examples/multitouch/knobs/knobs.pro               |   2 -
 examples/multitouch/knobs/main.cpp                |  64 -------
 examples/multitouch/multitouch.pro                |   2 -
 examples/multitouch/pinchzoom/graphicsview.cpp    |  85 ---------
 examples/multitouch/pinchzoom/graphicsview.h      |  55 ------
 examples/multitouch/pinchzoom/images/cheese.jpg   | Bin 3029 -> 0 bytes
 examples/multitouch/pinchzoom/main.cpp            |  86 ---------
 examples/multitouch/pinchzoom/mice.qrc            |   5 -
 examples/multitouch/pinchzoom/mouse.cpp           | 199 --------------------
 examples/multitouch/pinchzoom/mouse.h             |  70 -------
 examples/multitouch/pinchzoom/pinchzoom.pro       |  16 --
 src/gui/kernel/qevent.cpp                         |   8 +-
 src/gui/kernel/qgesture.cpp                       |   6 +-
 tests/auto/guiapplauncher/tst_guiapplauncher.cpp  |   8 +-
 37 files changed, 30 insertions(+), 1623 deletions(-)
 delete mode 100644 doc/src/examples/multitouch-dials.qdoc
 delete mode 100644 doc/src/examples/multitouch-knobs.qdoc
 delete mode 100644 doc/src/images/multitouch-dials-example.png
 delete mode 100644 doc/src/images/multitouch-examples.png
 delete mode 100644 doc/src/images/multitouch-fingerpaint-example.png
 delete mode 100644 doc/src/images/multitouch-knobs-example.png
 delete mode 100644 doc/src/images/multitouch-pinchzoom-example.png
 delete mode 100644 examples/multitouch/dials/dials.pro
 delete mode 100644 examples/multitouch/dials/dials.ui
 delete mode 100644 examples/multitouch/dials/main.cpp
 delete mode 100644 examples/multitouch/fingerpaint/fingerpaint.pro
 delete mode 100644 examples/multitouch/fingerpaint/main.cpp
 delete mode 100644 examples/multitouch/fingerpaint/mainwindow.cpp
 delete mode 100644 examples/multitouch/fingerpaint/mainwindow.h
 delete mode 100644 examples/multitouch/fingerpaint/scribblearea.cpp
 delete mode 100644 examples/multitouch/fingerpaint/scribblearea.h
 delete mode 100644 examples/multitouch/knobs/knob.cpp
 delete mode 100644 examples/multitouch/knobs/knob.h
 delete mode 100644 examples/multitouch/knobs/knobs.pro
 delete mode 100644 examples/multitouch/knobs/main.cpp
 delete mode 100644 examples/multitouch/multitouch.pro
 delete mode 100644 examples/multitouch/pinchzoom/graphicsview.cpp
 delete mode 100644 examples/multitouch/pinchzoom/graphicsview.h
 delete mode 100644 examples/multitouch/pinchzoom/images/cheese.jpg
 delete mode 100644 examples/multitouch/pinchzoom/main.cpp
 delete mode 100644 examples/multitouch/pinchzoom/mice.qrc
 delete mode 100644 examples/multitouch/pinchzoom/mouse.cpp
 delete mode 100644 examples/multitouch/pinchzoom/mouse.h
 delete mode 100644 examples/multitouch/pinchzoom/pinchzoom.pro

diff --git a/doc/src/examples/fingerpaint.qdoc b/doc/src/examples/fingerpaint.qdoc
index f438082..4b62570 100644
--- a/doc/src/examples/fingerpaint.qdoc
+++ b/doc/src/examples/fingerpaint.qdoc
@@ -26,11 +26,11 @@
 ****************************************************************************/
 
 /*!
-    \example multitouch/fingerpaint
+    \example touch/fingerpaint
     \title Finger Paint Example
 
-    The Finger Paint example shows the use of multi-touch with a custom widget
+    The Finger Paint example shows the use of touch with a custom widget
     to create a simple painting application.
 
-    \image multitouch-fingerpaint-example.png
+    \image touch-fingerpaint-example.png
 */
diff --git a/doc/src/examples/multitouch-dials.qdoc b/doc/src/examples/multitouch-dials.qdoc
deleted file mode 100644
index 632c4f6..0000000
--- a/doc/src/examples/multitouch-dials.qdoc
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
-**
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of this
-** file.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-    \example multitouch/dials
-    \title Multi-Touch Dials Example
-
-    The Multi-Touch Dials example shows how to apply multi-touch to a set of
-    standard Qt widgets.
-
-    \image multitouch-dials-example.png
-*/
diff --git a/doc/src/examples/multitouch-knobs.qdoc b/doc/src/examples/multitouch-knobs.qdoc
deleted file mode 100644
index 14ee597..0000000
--- a/doc/src/examples/multitouch-knobs.qdoc
+++ /dev/null
@@ -1,36 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in a
-** written agreement between you and Nokia.
-**
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of this
-** file.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-    \example multitouch/knobs
-    \title Multi-Touch Knobs Example
-
-    The Multi-Touch Knobs example shows how to create custom controls that
-    accept multi-touch input.
-
-    \image multitouch-knobs-example.png
-*/
diff --git a/doc/src/examples/pinchzoom.qdoc b/doc/src/examples/pinchzoom.qdoc
index e091230..198cbb3 100644
--- a/doc/src/examples/pinchzoom.qdoc
+++ b/doc/src/examples/pinchzoom.qdoc
@@ -26,11 +26,11 @@
 ****************************************************************************/
 
 /*!
-    \example multitouch/pinchzoom
+    \example touch/pinchzoom
     \title Pinch Zoom Example
 
-    The Pinch Zoom example shows how to use low-level multi-touch information
+    The Pinch Zoom example shows how to use low-level touch information
     to recognize a gesture.
 
-    \image multitouch-pinchzoom-example.png
+    \image touch-pinchzoom-example.png
 */
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index a32d120..b2895ba 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -837,19 +837,19 @@
 */
 
 /*!
-    \page examples-multitouch.html
+    \page examples-touch.html
     \ingroup all-examples
-    \title Multi-Touch Examples
-    \brief Using Qt's multi-touch input capability
+    \title Touch Input Examples
+    \brief Using Qt's touch input capability
 
-    Support for multi-touch input makes it possible for developers to create
+    Support for touch input makes it possible for developers to create
     extensible and intuitive user interfaces.
 
     \list
-    \o \l{multitouch/dials}{Multi-Touch Dials}
-    \o \l{multitouch/fingerpaint}{Finger Paint}
-    \o \l{multitouch/knobs}{Multi-Touch Knobs}
-    \o \l{multitouch/pinchzoom}{Pinch Zoom}
+    \o \l{touch/dials}{Touch Dials}
+    \o \l{touch/fingerpaint}{Finger Paint}
+    \o \l{touch/knobs}{Touch Knobs}
+    \o \l{touch/pinchzoom}{Pinch Zoom}
     \endlist
 */
 
diff --git a/doc/src/images/multitouch-dials-example.png b/doc/src/images/multitouch-dials-example.png
deleted file mode 100644
index 60e1776..0000000
Binary files a/doc/src/images/multitouch-dials-example.png and /dev/null differ
diff --git a/doc/src/images/multitouch-examples.png b/doc/src/images/multitouch-examples.png
deleted file mode 100644
index b053cf3..0000000
Binary files a/doc/src/images/multitouch-examples.png and /dev/null differ
diff --git a/doc/src/images/multitouch-fingerpaint-example.png b/doc/src/images/multitouch-fingerpaint-example.png
deleted file mode 100644
index c741b65..0000000
Binary files a/doc/src/images/multitouch-fingerpaint-example.png and /dev/null differ
diff --git a/doc/src/images/multitouch-knobs-example.png b/doc/src/images/multitouch-knobs-example.png
deleted file mode 100644
index 1cbd90d..0000000
Binary files a/doc/src/images/multitouch-knobs-example.png and /dev/null differ
diff --git a/doc/src/images/multitouch-pinchzoom-example.png b/doc/src/images/multitouch-pinchzoom-example.png
deleted file mode 100644
index 1079fb2..0000000
Binary files a/doc/src/images/multitouch-pinchzoom-example.png and /dev/null differ
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index 052e1c9..8867fd9 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -597,9 +597,9 @@
 
     See \l{The State Machine Framework} documentation for more information.
 
-    \section1 Multi-Touch and Gestures
+    \section1 Touch and Gestures
 
-    Support for multi-touch input enables users to interact with many
+    Support for touch input enables users to interact with many
     parts of a user interface at the same time, and provides the basis
     for gestures. Additional infrastructure for gesture recognition
     allows a sequence of touch inputs to be combined to create gestures
@@ -613,12 +613,12 @@
     \list
         \o Allows users to interact with applications in more natural ways.
         \o Simplifies finger-based interaction with UI components.
-        \o Combines support for common basic gestures and multi-touch gestures
+        \o Combines support for common basic gestures and touch gestures
            in a single general framework.
         \o Enables extensibility by design.
     \endlist
 
-    See the QTouchEvent class documentation for more information on multi-touch
+    See the QTouchEvent class documentation for more information on touch
     input and QGestureEvent for gestures.
 
     \section1 DOM access API
diff --git a/examples/examples.pro b/examples/examples.pro
index 9a83216..1fdd774 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -26,7 +26,7 @@ SUBDIRS       = \
                 tutorials \
                 widgets \
                 uitools \
-                multitouch \
+                touch \
                 gestures
 }
 
diff --git a/examples/multitouch/dials/dials.pro b/examples/multitouch/dials/dials.pro
deleted file mode 100644
index e592232..0000000
--- a/examples/multitouch/dials/dials.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES += main.cpp
-FORMS += dials.ui
diff --git a/examples/multitouch/dials/dials.ui b/examples/multitouch/dials/dials.ui
deleted file mode 100644
index 8ca7ae9..0000000
--- a/examples/multitouch/dials/dials.ui
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Dials</class>
- <widget class="QWidget" name="Dials">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QDial" name="dial_1">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="QDial" name="dial_2">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="2">
-    <widget class="QDial" name="dial_3">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="3">
-    <widget class="QDial" name="dial_4">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <widget class="QDial" name="dial_5">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QDial" name="dial_6">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="2">
-    <widget class="QDial" name="dial_7">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="3">
-    <widget class="QDial" name="dial_8">
-     <property name="notchesVisible">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/examples/multitouch/dials/main.cpp b/examples/multitouch/dials/main.cpp
deleted file mode 100644
index 4c7cc1e..0000000
--- a/examples/multitouch/dials/main.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QWidget>
-#include <QDial>
-
-#include "ui_dials.h"
-
-int main(int argc, char **argv)
-{
-    QApplication app(argc, argv);
-    QWidget window;
-    Ui::Dials dialsUi;
-    dialsUi.setupUi(&window);
-    QList<QAbstractSlider *> sliders = window.findChildren<QAbstractSlider *>();
-    foreach (QAbstractSlider *slider, sliders)
-        slider->setAttribute(Qt::WA_AcceptTouchEvents);
-    window.showMaximized();
-    return app.exec();
-}
diff --git a/examples/multitouch/fingerpaint/fingerpaint.pro b/examples/multitouch/fingerpaint/fingerpaint.pro
deleted file mode 100644
index 1d45635..0000000
--- a/examples/multitouch/fingerpaint/fingerpaint.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-HEADERS       = mainwindow.h \
-                scribblearea.h
-SOURCES       = main.cpp \
-                mainwindow.cpp \
-                scribblearea.cpp
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/multitouch/fingerpaint
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fingerpaint.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/multitouch/fingerpaint
-INSTALLS += target sources
diff --git a/examples/multitouch/fingerpaint/main.cpp b/examples/multitouch/fingerpaint/main.cpp
deleted file mode 100644
index 1d9b61d..0000000
--- a/examples/multitouch/fingerpaint/main.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "mainwindow.h"
-
-int main(int argc, char *argv[])
-{
-    QApplication app(argc, argv);
-    MainWindow window;
-    window.showMaximized();
-    return app.exec();
-}
diff --git a/examples/multitouch/fingerpaint/mainwindow.cpp b/examples/multitouch/fingerpaint/mainwindow.cpp
deleted file mode 100644
index ec42da3..0000000
--- a/examples/multitouch/fingerpaint/mainwindow.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "mainwindow.h"
-#include "scribblearea.h"
-
-//! [0]
-MainWindow::MainWindow()
-{
-    scribbleArea = new ScribbleArea;
-    setCentralWidget(scribbleArea);
-
-    createActions();
-    createMenus();
-
-    setWindowTitle(tr("Finger Paint"));
-    resize(500, 500);
-}
-//! [0]
-
-//! [1]
-void MainWindow::closeEvent(QCloseEvent *event)
-//! [1] //! [2]
-{
-    if (maybeSave()) {
-        event->accept();
-    } else {
-        event->ignore();
-    }
-}
-//! [2]
-
-//! [3]
-void MainWindow::open()
-//! [3] //! [4]
-{
-    if (maybeSave()) {
-        QString fileName = QFileDialog::getOpenFileName(this,
-                                   tr("Open File"), QDir::currentPath());
-        if (!fileName.isEmpty())
-            scribbleArea->openImage(fileName);
-    }
-}
-//! [4]
-
-//! [5]
-void MainWindow::save()
-//! [5] //! [6]
-{
-    QAction *action = qobject_cast<QAction *>(sender());
-    QByteArray fileFormat = action->data().toByteArray();
-    saveFile(fileFormat);
-}
-//! [6]
-
-//! [11]
-void MainWindow::about()
-//! [11] //! [12]
-{
-    QMessageBox::about(this, tr("About Scribble"),
-            tr("<p>The <b>Scribble</b> example shows how to use QMainWindow as the "
-               "base widget for an application, and how to reimplement some of "
-               "QWidget's event handlers to receive the events generated for "
-               "the application's widgets:</p><p> We reimplement the mouse event "
-               "handlers to facilitate drawing, the paint event handler to "
-               "update the application and the resize event handler to optimize "
-               "the application's appearance. In addition we reimplement the "
-               "close event handler to intercept the close events before "
-               "terminating the application.</p><p> The example also demonstrates "
-               "how to use QPainter to draw an image in real time, as well as "
-               "to repaint widgets.</p>"));
-}
-//! [12]
-
-//! [13]
-void MainWindow::createActions()
-//! [13] //! [14]
-{
-    openAct = new QAction(tr("&Open..."), this);
-    openAct->setShortcut(tr("Ctrl+O"));
-    connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
-    foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
-        QString text = tr("%1...").arg(QString(format).toUpper());
-
-        QAction *action = new QAction(text, this);
-        action->setData(format);
-        connect(action, SIGNAL(triggered()), this, SLOT(save()));
-        saveAsActs.append(action);
-    }
-
-    printAct = new QAction(tr("&Print..."), this);
-    connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print()));
-
-    exitAct = new QAction(tr("E&xit"), this);
-    exitAct->setShortcut(tr("Ctrl+Q"));
-    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
-
-    clearScreenAct = new QAction(tr("&Clear Screen"), this);
-    clearScreenAct->setShortcut(tr("Ctrl+L"));
-    connect(clearScreenAct, SIGNAL(triggered()),
-            scribbleArea, SLOT(clearImage()));
-
-    aboutAct = new QAction(tr("&About"), this);
-    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
-    aboutQtAct = new QAction(tr("About &Qt"), this);
-    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-//! [14]
-
-//! [15]
-void MainWindow::createMenus()
-//! [15] //! [16]
-{
-    saveAsMenu = new QMenu(tr("&Save As"), this);
-    foreach (QAction *action, saveAsActs)
-        saveAsMenu->addAction(action);
-
-    fileMenu = new QMenu(tr("&File"), this);
-    fileMenu->addAction(openAct);
-    fileMenu->addMenu(saveAsMenu);
-    fileMenu->addAction(printAct);
-    fileMenu->addSeparator();
-    fileMenu->addAction(exitAct);
-
-    optionMenu = new QMenu(tr("&Options"), this);
-    optionMenu->addAction(clearScreenAct);
-
-    helpMenu = new QMenu(tr("&Help"), this);
-    helpMenu->addAction(aboutAct);
-    helpMenu->addAction(aboutQtAct);
-
-    menuBar()->addMenu(fileMenu);
-    menuBar()->addMenu(optionMenu);
-    menuBar()->addMenu(helpMenu);
-}
-//! [16]
-
-//! [17]
-bool MainWindow::maybeSave()
-//! [17] //! [18]
-{
-    if (scribbleArea->isModified()) {
-       QMessageBox::StandardButton ret;
-       ret = QMessageBox::warning(this, tr("Scribble"),
-                          tr("The image has been modified.\n"
-                             "Do you want to save your changes?"),
-                          QMessageBox::Save | QMessageBox::Discard
-			  | QMessageBox::Cancel);
-        if (ret == QMessageBox::Save) {
-            return saveFile("png");
-        } else if (ret == QMessageBox::Cancel) {
-            return false;
-        }
-    }
-    return true;
-}
-//! [18]
-
-//! [19]
-bool MainWindow::saveFile(const QByteArray &fileFormat)
-//! [19] //! [20]
-{
-    QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
-
-    QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
-                               initialPath,
-                               tr("%1 Files (*.%2);;All Files (*)")
-                               .arg(QString(fileFormat.toUpper()))
-                               .arg(QString(fileFormat)));
-    if (fileName.isEmpty()) {
-        return false;
-    } else {
-        return scribbleArea->saveImage(fileName, fileFormat);
-    }
-}
-//! [20]
diff --git a/examples/multitouch/fingerpaint/mainwindow.h b/examples/multitouch/fingerpaint/mainwindow.h
deleted file mode 100644
index 714748e..0000000
--- a/examples/multitouch/fingerpaint/mainwindow.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QList>
-#include <QMainWindow>
-
-class ScribbleArea;
-
-//! [0]
-class MainWindow : public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    MainWindow();
-
-protected:
-    void closeEvent(QCloseEvent *event);
-
-private slots:
-    void open();
-    void save();
-    void about();
-
-private:
-    void createActions();
-    void createMenus();
-    bool maybeSave();
-    bool saveFile(const QByteArray &fileFormat);
-
-    ScribbleArea *scribbleArea;
-
-    QMenu *saveAsMenu;
-    QMenu *fileMenu;
-    QMenu *optionMenu;
-    QMenu *helpMenu;
-
-    QAction *openAct;
-    QList<QAction *> saveAsActs;
-    QAction *exitAct;
-    QAction *printAct;
-    QAction *clearScreenAct;
-    QAction *aboutAct;
-    QAction *aboutQtAct;
-};
-//! [0]
-
-#endif
diff --git a/examples/multitouch/fingerpaint/scribblearea.cpp b/examples/multitouch/fingerpaint/scribblearea.cpp
deleted file mode 100644
index f16c334..0000000
--- a/examples/multitouch/fingerpaint/scribblearea.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "scribblearea.h"
-
-//! [0]
-ScribbleArea::ScribbleArea(QWidget *parent)
-    : QWidget(parent)
-{
-    setAttribute(Qt::WA_AcceptTouchEvents);
-    setAttribute(Qt::WA_StaticContents);
-    modified = false;
-
-    myPenColors
-            << QColor("green")
-            << QColor("purple")
-            << QColor("red")
-            << QColor("blue")
-            << QColor("yellow")
-
-            << QColor("pink")
-            << QColor("orange")
-            << QColor("brown")
-            << QColor("grey")
-            << QColor("black");
-}
-//! [0]
-
-//! [1]
-bool ScribbleArea::openImage(const QString &fileName)
-//! [1] //! [2]
-{
-    QImage loadedImage;
-    if (!loadedImage.load(fileName))
-        return false;
-
-    QSize newSize = loadedImage.size().expandedTo(size());
-    resizeImage(&loadedImage, newSize);
-    image = loadedImage;
-    modified = false;
-    update();
-    return true;
-}
-//! [2]
-
-//! [3]
-bool ScribbleArea::saveImage(const QString &fileName, const char *fileFormat)
-//! [3] //! [4]
-{
-    QImage visibleImage = image;
-    resizeImage(&visibleImage, size());
-
-    if (visibleImage.save(fileName, fileFormat)) {
-        modified = false;
-        return true;
-    } else {
-        return false;
-    }
-}
-//! [4]
-
-//! [9]
-void ScribbleArea::clearImage()
-//! [9] //! [10]
-{
-    image.fill(qRgb(255, 255, 255));
-    modified = true;
-    update();
-}
-//! [10]
-
-//! [12] //! [13]
-void ScribbleArea::paintEvent(QPaintEvent *event)
-//! [13] //! [14]
-{
-    QPainter painter(this);
-    const QRect rect = event->rect();
-    painter.drawImage(rect.topLeft(), image, rect);
-}
-//! [14]
-
-//! [15]
-void ScribbleArea::resizeEvent(QResizeEvent *event)
-//! [15] //! [16]
-{
-    if (width() > image.width() || height() > image.height()) {
-        int newWidth = qMax(width() + 128, image.width());
-        int newHeight = qMax(height() + 128, image.height());
-        resizeImage(&image, QSize(newWidth, newHeight));
-        update();
-    }
-    QWidget::resizeEvent(event);
-}
-//! [16]
-
-//! [19]
-void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
-//! [19] //! [20]
-{
-    if (image->size() == newSize)
-        return;
-
-    QImage newImage(newSize, QImage::Format_RGB32);
-    newImage.fill(qRgb(255, 255, 255));
-    QPainter painter(&newImage);
-    painter.drawImage(QPoint(0, 0), *image);
-    *image = newImage;
-}
-//! [20]
-
-//! [21]
-void ScribbleArea::print()
-{
-#ifndef QT_NO_PRINTER
-    QPrinter printer(QPrinter::HighResolution);
-
-    QPrintDialog *printDialog = new QPrintDialog(&printer, this);
-//! [21] //! [22]
-    if (printDialog->exec() == QDialog::Accepted) {
-        QPainter painter(&printer);
-        QRect rect = painter.viewport();
-        QSize size = image.size();
-        size.scale(rect.size(), Qt::KeepAspectRatio);
-        painter.setViewport(rect.x(), rect.y(), size.width(), size.height());
-        painter.setWindow(image.rect());
-        painter.drawImage(0, 0, image);
-    }
-#endif // QT_NO_PRINTER
-}
-//! [22]
-
-bool ScribbleArea::event(QEvent *event)
-{
-    switch (event->type()) {
-    case QEvent::TouchBegin:
-    case QEvent::TouchUpdate:
-    case QEvent::TouchEnd:
-    {
-        QList<QTouchEvent::TouchPoint> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints();
-        foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) {
-            switch (touchPoint.state()) {
-            case Qt::TouchPointStationary:
-                // don't do anything if this touch point hasn't moved
-                continue;
-            default:
-                {
-                    QRectF rect = touchPoint.rect();
-                    if (rect.isEmpty()) {
-                        qreal diameter = qreal(50) * touchPoint.pressure();
-                        rect.setSize(QSizeF(diameter, diameter));
-                    }
-
-                    QPainter painter(&image);
-                    painter.setPen(Qt::NoPen);
-                    painter.setBrush(myPenColors.at(touchPoint.id() % myPenColors.count()));
-                    painter.drawEllipse(rect);
-                    painter.end();
-
-                    modified = true;
-                    int rad = 2;
-                    update(rect.toRect().adjusted(-rad,-rad, +rad, +rad));
-                }
-                break;
-            }
-        }
-        break;
-    }
-    default:
-        return QWidget::event(event);
-    }
-    return true;
-}
diff --git a/examples/multitouch/fingerpaint/scribblearea.h b/examples/multitouch/fingerpaint/scribblearea.h
deleted file mode 100644
index 2e4fbda..0000000
--- a/examples/multitouch/fingerpaint/scribblearea.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SCRIBBLEAREA_H
-#define SCRIBBLEAREA_H
-
-#include <QColor>
-#include <QImage>
-#include <QPoint>
-#include <QWidget>
-
-//! [0]
-class ScribbleArea : public QWidget
-{
-    Q_OBJECT
-
-public:
-    ScribbleArea(QWidget *parent = 0);
-
-    bool openImage(const QString &fileName);
-    bool saveImage(const QString &fileName, const char *fileFormat);
-
-    bool isModified() const { return modified; }
-
-public slots:
-    void clearImage();
-    void print();
-
-protected:
-    void paintEvent(QPaintEvent *event);
-    void resizeEvent(QResizeEvent *event);
-    bool event(QEvent *event);
-
-private:
-    void resizeImage(QImage *image, const QSize &newSize);
-
-    bool modified;
-    QList<QColor> myPenColors;
-    QImage image;
-};
-//! [0]
-
-#endif
diff --git a/examples/multitouch/knobs/knob.cpp b/examples/multitouch/knobs/knob.cpp
deleted file mode 100644
index 6ddd9b3..0000000
--- a/examples/multitouch/knobs/knob.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "knob.h"
-
-#include <QBrush>
-#include <QTouchEvent>
-
-Knob::Knob()
-    : QGraphicsEllipseItem(-50, -50, 100, 100)
-{
-    setAcceptTouchEvents(true);
-    setBrush(Qt::lightGray);
-
-    QGraphicsEllipseItem *leftItem = new QGraphicsEllipseItem(0, 0, 20, 20, this);
-    leftItem->setPos(-40, -10);
-    leftItem->setBrush(Qt::darkGreen);
-
-    QGraphicsEllipseItem *rightItem = new QGraphicsEllipseItem(0, 0, 20, 20, this);
-    rightItem->setPos(20, -10);
-    rightItem->setBrush(Qt::darkRed);
-}
-
-bool Knob::sceneEvent(QEvent *event)
-{
-    switch (event->type()) {
-    case QEvent::TouchBegin:
-    case QEvent::TouchUpdate:
-    case QEvent::TouchEnd:
-    {
-        QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event);
-
-        if (touchEvent->touchPoints().count() == 2) {
-            const QTouchEvent::TouchPoint &touchPoint1 = touchEvent->touchPoints().first();
-            const QTouchEvent::TouchPoint &touchPoint2 = touchEvent->touchPoints().last();
-
-            QLineF line1(touchPoint1.lastScenePos(), touchPoint2.lastScenePos());
-            QLineF line2(touchPoint1.scenePos(), touchPoint2.scenePos());
-
-            rotate(line2.angleTo(line1));
-        }
-
-        break;
-    }
-
-    default:
-        return QGraphicsItem::sceneEvent(event);
-    }
-
-    return true;
-}
diff --git a/examples/multitouch/knobs/knob.h b/examples/multitouch/knobs/knob.h
deleted file mode 100644
index d4e8730..0000000
--- a/examples/multitouch/knobs/knob.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef KNOB_H
-#define KNOB_H
-
-#include <QGraphicsItem>
-
-class Knob : public QGraphicsEllipseItem
-{
-public:
-    Knob();
-
-    bool sceneEvent(QEvent *event);
-};
-
-#endif // KNOB_H
diff --git a/examples/multitouch/knobs/knobs.pro b/examples/multitouch/knobs/knobs.pro
deleted file mode 100644
index 90f0ba5..0000000
--- a/examples/multitouch/knobs/knobs.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-HEADERS = knob.h
-SOURCES = main.cpp knob.cpp
diff --git a/examples/multitouch/knobs/main.cpp b/examples/multitouch/knobs/main.cpp
deleted file mode 100644
index 0866f78..0000000
--- a/examples/multitouch/knobs/main.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QGraphicsView>
-
-#include "knob.h"
-
-int main(int argc, char **argv)
-{
-    QApplication app(argc, argv);
-
-    QGraphicsScene scene;
-    QGraphicsView view(&scene);
-
-    Knob *knob1 = new Knob;
-    knob1->setPos(-110, 0);
-    Knob *knob2 = new Knob;
-
-    scene.addItem(knob1);
-    scene.addItem(knob2);
-
-    view.showMaximized();
-    view.fitInView(scene.sceneRect().adjusted(-20, -20, 20, 20), Qt::KeepAspectRatio);
-
-    return app.exec();
-}
diff --git a/examples/multitouch/multitouch.pro b/examples/multitouch/multitouch.pro
deleted file mode 100644
index d5983eb..0000000
--- a/examples/multitouch/multitouch.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = pinchzoom fingerpaint knobs dials
diff --git a/examples/multitouch/pinchzoom/graphicsview.cpp b/examples/multitouch/pinchzoom/graphicsview.cpp
deleted file mode 100644
index 041e494..0000000
--- a/examples/multitouch/pinchzoom/graphicsview.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "graphicsview.h"
-
-#include <QScrollBar>
-#include <QTouchEvent>
-
-GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent)
-    : QGraphicsView(scene, parent), totalScaleFactor(1)
-{
-    viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
-    setDragMode(ScrollHandDrag);
-}
-
-bool GraphicsView::viewportEvent(QEvent *event)
-{
-    switch (event->type()) {
-    case QEvent::TouchBegin:
-    case QEvent::TouchUpdate:
-    case QEvent::TouchEnd:
-    {
-        QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event);
-        QList<QTouchEvent::TouchPoint> touchPoints = touchEvent->touchPoints();
-        if (touchPoints.count() == 2) {
-            // determine scale factor
-            const QTouchEvent::TouchPoint &touchPoint0 = touchPoints.first();
-            const QTouchEvent::TouchPoint &touchPoint1 = touchPoints.last();
-            qreal currentScaleFactor =
-                    QLineF(touchPoint0.pos(), touchPoint1.pos()).length()
-                    / QLineF(touchPoint0.startPos(), touchPoint1.startPos()).length();
-            if (touchEvent->touchPointStates() & Qt::TouchPointReleased) {
-                // if one of the fingers is released, remember the current scale
-                // factor so that adding another finger later will continue zooming
-                // by adding new scale factor to the existing remembered value.
-                totalScaleFactor *= currentScaleFactor;
-                currentScaleFactor = 1;
-            }
-            setTransform(QTransform().scale(totalScaleFactor * currentScaleFactor,
-                                            totalScaleFactor * currentScaleFactor));
-        }
-        return true;
-    }
-    default:
-        break;
-    }
-    return QGraphicsView::viewportEvent(event);
-}
diff --git a/examples/multitouch/pinchzoom/graphicsview.h b/examples/multitouch/pinchzoom/graphicsview.h
deleted file mode 100644
index c762786..0000000
--- a/examples/multitouch/pinchzoom/graphicsview.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-#include <QGraphicsView>
-
-class GraphicsView : public QGraphicsView
-{
-    Q_OBJECT
-
-public:
-    GraphicsView(QGraphicsScene *scene = 0, QWidget *parent = 0);
-
-    bool viewportEvent(QEvent *event);
-
-private:
-    qreal totalScaleFactor;
-};
diff --git a/examples/multitouch/pinchzoom/images/cheese.jpg b/examples/multitouch/pinchzoom/images/cheese.jpg
deleted file mode 100644
index dea5795..0000000
Binary files a/examples/multitouch/pinchzoom/images/cheese.jpg and /dev/null differ
diff --git a/examples/multitouch/pinchzoom/main.cpp b/examples/multitouch/pinchzoom/main.cpp
deleted file mode 100644
index 8abc993..0000000
--- a/examples/multitouch/pinchzoom/main.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "graphicsview.h"
-#include "mouse.h"
-
-#include <QtGui>
-
-#include <math.h>
-
-static const int MouseCount = 7;
-
-//! [0]
-int main(int argc, char **argv)
-{
-    QApplication app(argc, argv);
-    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
-//! [0]
-
-//! [1]
-    QGraphicsScene scene;
-    scene.setSceneRect(-300, -300, 600, 600);
-//! [1] //! [2]
-    scene.setItemIndexMethod(QGraphicsScene::NoIndex);
-//! [2]
-
-//! [3]
-    for (int i = 0; i < MouseCount; ++i) {
-        Mouse *mouse = new Mouse;
-        mouse->setPos(::sin((i * 6.28) / MouseCount) * 200,
-                      ::cos((i * 6.28) / MouseCount) * 200);
-        scene.addItem(mouse);
-    }
-//! [3]
-
-//! [4]
-    GraphicsView view(&scene);
-    view.setRenderHint(QPainter::Antialiasing);
-    view.setBackgroundBrush(QPixmap(":/images/cheese.jpg"));
-//! [4] //! [5]
-    view.setCacheMode(QGraphicsView::CacheBackground);
-    view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
-//! [5] //! [6]
-    view.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Colliding Mice"));
-    view.showMaximized();
-
-    return app.exec();
-}
-//! [6]
diff --git a/examples/multitouch/pinchzoom/mice.qrc b/examples/multitouch/pinchzoom/mice.qrc
deleted file mode 100644
index accdb4d..0000000
--- a/examples/multitouch/pinchzoom/mice.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
-    <qresource prefix="/" >
-        <file>images/cheese.jpg</file>
-    </qresource>
-</RCC>
diff --git a/examples/multitouch/pinchzoom/mouse.cpp b/examples/multitouch/pinchzoom/mouse.cpp
deleted file mode 100644
index 82617fe..0000000
--- a/examples/multitouch/pinchzoom/mouse.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "mouse.h"
-
-#include <QGraphicsScene>
-#include <QPainter>
-#include <QStyleOption>
-
-#include <math.h>
-
-static const double Pi = 3.14159265358979323846264338327950288419717;
-static double TwoPi = 2.0 * Pi;
-
-static qreal normalizeAngle(qreal angle)
-{
-    while (angle < 0)
-        angle += TwoPi;
-    while (angle > TwoPi)
-        angle -= TwoPi;
-    return angle;
-}
-
-//! [0]
-Mouse::Mouse()
-    : angle(0), speed(0), mouseEyeDirection(0),
-      color(qrand() % 256, qrand() % 256, qrand() % 256)
-{
-    rotate(qrand() % (360 * 16));
-    startTimer(1000 / 33);
-}
-//! [0]
-
-//! [1]
-QRectF Mouse::boundingRect() const
-{
-    qreal adjust = 0.5;
-    return QRectF(-18 - adjust, -22 - adjust,
-                  36 + adjust, 60 + adjust);
-}
-//! [1]
-
-//! [2]
-QPainterPath Mouse::shape() const
-{
-    QPainterPath path;
-    path.addRect(-10, -20, 20, 40);
-    return path;
-}
-//! [2]
-
-//! [3]
-void Mouse::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
-    // Body
-    painter->setBrush(color);
-    painter->drawEllipse(-10, -20, 20, 40);
-
-    // Eyes
-    painter->setBrush(Qt::white);
-    painter->drawEllipse(-10, -17, 8, 8);
-    painter->drawEllipse(2, -17, 8, 8);
-
-    // Nose
-    painter->setBrush(Qt::black);
-    painter->drawEllipse(QRectF(-2, -22, 4, 4));
-
-    // Pupils
-    painter->drawEllipse(QRectF(-8.0 + mouseEyeDirection, -17, 4, 4));
-    painter->drawEllipse(QRectF(4.0 + mouseEyeDirection, -17, 4, 4));
-
-    // Ears
-    painter->setBrush(scene()->collidingItems(this).isEmpty() ? Qt::darkYellow : Qt::red);
-    painter->drawEllipse(-17, -12, 16, 16);
-    painter->drawEllipse(1, -12, 16, 16);
-
-    // Tail
-    QPainterPath path(QPointF(0, 20));
-    path.cubicTo(-5, 22, -5, 22, 0, 25);
-    path.cubicTo(5, 27, 5, 32, 0, 30);
-    path.cubicTo(-5, 32, -5, 42, 0, 35);
-    painter->setBrush(Qt::NoBrush);
-    painter->drawPath(path);
-}
-//! [3]
-
-//! [4]
-void Mouse::timerEvent(QTimerEvent *)
-{
-//! [4]
-    // Don't move too far away
-//! [5]
-    QLineF lineToCenter(QPointF(0, 0), mapFromScene(0, 0));
-    if (lineToCenter.length() > 150) {
-        qreal angleToCenter = ::acos(lineToCenter.dx() / lineToCenter.length());
-        if (lineToCenter.dy() < 0)
-            angleToCenter = TwoPi - angleToCenter;
-        angleToCenter = normalizeAngle((Pi - angleToCenter) + Pi / 2);
-
-        if (angleToCenter < Pi && angleToCenter > Pi / 4) {
-            // Rotate left
-            angle += (angle < -Pi / 2) ? 0.25 : -0.25;
-        } else if (angleToCenter >= Pi && angleToCenter < (Pi + Pi / 2 + Pi / 4)) {
-            // Rotate right
-            angle += (angle < Pi / 2) ? 0.25 : -0.25;
-        }
-    } else if (::sin(angle) < 0) {
-        angle += 0.25;
-    } else if (::sin(angle) > 0) {
-        angle -= 0.25;
-//! [5] //! [6]
-    }
-//! [6]
-
-    // Try not to crash with any other mice
-//! [7]
-    QList<QGraphicsItem *> dangerMice = scene()->items(QPolygonF()
-                                                       << mapToScene(0, 0)
-                                                       << mapToScene(-30, -50)
-                                                       << mapToScene(30, -50));
-    foreach (QGraphicsItem *item, dangerMice) {
-        if (item == this)
-            continue;
-        
-        QLineF lineToMouse(QPointF(0, 0), mapFromItem(item, 0, 0));
-        qreal angleToMouse = ::acos(lineToMouse.dx() / lineToMouse.length());
-        if (lineToMouse.dy() < 0)
-            angleToMouse = TwoPi - angleToMouse;
-        angleToMouse = normalizeAngle((Pi - angleToMouse) + Pi / 2);
-
-        if (angleToMouse >= 0 && angleToMouse < Pi / 2) {
-            // Rotate right
-            angle += 0.5;
-        } else if (angleToMouse <= TwoPi && angleToMouse > (TwoPi - Pi / 2)) {
-            // Rotate left
-            angle -= 0.5;
-//! [7] //! [8]
-        }
-//! [8] //! [9]
-    }
-//! [9]
-
-    // Add some random movement
-//! [10]
-    if (dangerMice.size() > 1 && (qrand() % 10) == 0) {
-        if (qrand() % 1)
-            angle += (qrand() % 100) / 500.0;
-        else
-            angle -= (qrand() % 100) / 500.0;
-    }
-//! [10]
-
-//! [11]
-    speed += (-50 + qrand() % 100) / 100.0;
-
-    qreal dx = ::sin(angle) * 10;
-    mouseEyeDirection = (qAbs(dx / 5) < 1) ? 0 : dx / 5;
-
-    rotate(dx);
-    setPos(mapToParent(0, -(3 + sin(speed) * 3)));
-}
-//! [11]
diff --git a/examples/multitouch/pinchzoom/mouse.h b/examples/multitouch/pinchzoom/mouse.h
deleted file mode 100644
index 241f8ab..0000000
--- a/examples/multitouch/pinchzoom/mouse.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-**   * Redistributions of source code must retain the above copyright
-**     notice, this list of conditions and the following disclaimer.
-**   * Redistributions in binary form must reproduce the above copyright
-**     notice, this list of conditions and the following disclaimer in
-**     the documentation and/or other materials provided with the
-**     distribution.
-**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-**     the names of its contributors may be used to endorse or promote
-**     products derived from this software without specific prior written
-**     permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MOUSE_H
-#define MOUSE_H
-
-#include <QGraphicsObject>
-
-//! [0]
-class Mouse : public QGraphicsObject
-{
-    Q_OBJECT
-
-public:
-    Mouse();
-
-    QRectF boundingRect() const;
-    QPainterPath shape() const;
-    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
-               QWidget *widget);
-
-protected:
-    void timerEvent(QTimerEvent *event);
-
-private:
-    qreal angle;
-    qreal speed;
-    qreal mouseEyeDirection;
-    QColor color;
-};
-//! [0]
-
-#endif
diff --git a/examples/multitouch/pinchzoom/pinchzoom.pro b/examples/multitouch/pinchzoom/pinchzoom.pro
deleted file mode 100644
index bd87cf7..0000000
--- a/examples/multitouch/pinchzoom/pinchzoom.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-HEADERS += \
-        mouse.h \
-        graphicsview.h
-SOURCES += \
-	main.cpp \
-        mouse.cpp \
-        graphicsview.cpp
-
-RESOURCES += \
-	mice.qrc
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/multitouch/pinchzoom
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pinchzoom.pro images
-sources.path = $$[QT_INSTALL_EXAMPLES]/multitouch/pinchzoom
-INSTALLS += target sources
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 92eed33..bbc9e0b 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3627,7 +3627,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
     \brief The QTouchEvent class contains parameters that describe a touch event.
     \since 4.6
     \ingroup events
-    \ingroup multitouch
+    \ingroup touch
 
     \section1 Enabling Touch Events
 
@@ -3641,7 +3641,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
 
     Similarly to QMouseEvent, Qt automatically grabs each touch point on the first press inside a
     widget, and the widget will receive all updates for the touch point until it is released.
-    Note that it is possible for a widget to receive events for multiple touch points, and that
+    Note that it is possible for a widget to receive events for numerous touch points, and that
     multiple widgets may be receiving touch events at the same time.
 
     \section1 Event Handling
@@ -3717,7 +3717,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
 
     \i As mentioned above, enabling touch events means multiple widgets can be receiving touch
     events simultaneously. Combined with the default QWidget::event() handling for QTouchEvents,
-    this gives you great flexibility in designing multi-touch user interfaces. Be aware of the
+    this gives you great flexibility in designing touch user interfaces. Be aware of the
     implications. For example, it is possible that the user is moving a QSlider with one finger and
     pressing a QPushButton with another. The signals emitted by these widgets will be
     interleaved.
@@ -3729,7 +3729,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
 
     \i QTouchEvents are not affected by a \l{QWidget::grabMouse()}{mouse grab} or an
     \l{QApplication::activePopupWidget()}{active pop-up widget}. The behavior of QTouchEvents is
-    undefined when opening a pop-up or grabbing the mouse while there are multiple active touch
+    undefined when opening a pop-up or grabbing the mouse while there are more than one active touch
     points.
 
     \endlist
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 6359ecf..4a4452a 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -306,10 +306,10 @@ void QPanGesture::setAcceleration(qreal value)
     \class QPinchGesture
     \since 4.6
     \brief The QPinchGesture class describes a pinch gesture made my the user.
-    \ingroup multitouch
+    \ingroup touch
     \ingroup gestures
 
-    A pinch gesture is a form of multitouch user input in which the user typically
+    A pinch gesture is a form of touch user input in which the user typically
     touches two points on the input device with a thumb and finger, before moving
     them closer together or further apart to change the scale factor, zoom, or level
     of detail of the user interface.
@@ -389,7 +389,7 @@ void QPanGesture::setAcceleration(qreal value)
     \brief the current scale factor
 
     The scale factor measures the scale factor associated with the distance
-    between two of the user's inputs on a multitouch device.
+    between two of the user's inputs on a touch device.
 
     \sa totalScaleFactor, lastScaleFactor
 */
diff --git a/tests/auto/guiapplauncher/tst_guiapplauncher.cpp b/tests/auto/guiapplauncher/tst_guiapplauncher.cpp
index 048ea35..4b3ce18 100644
--- a/tests/auto/guiapplauncher/tst_guiapplauncher.cpp
+++ b/tests/auto/guiapplauncher/tst_guiapplauncher.cpp
@@ -128,10 +128,10 @@ const struct Example examples[] = {
     {"mainwindows/menus Example", "mainwindows/menus", "menus", 10, -1},
     {"mainwindows/recentfiles Example", "mainwindows/recentfiles", "recentfiles", 10, -1},
     {"mainwindows/sdi Example", "mainwindows/sdi", "sdi", 10, -1},
-    {"multitouch/dials Example", "multitouch/dials", "dials", 10, -1},
-    {"multitouch/fingerpaint Example", "multitouch/fingerpaint", "fingerpaint", 10, -1},
-    {"multitouch/knobs Example", "multitouch/knobs", "knobs", 10, -1},
-    {"multitouch/pinchzoom Example", "multitouch/pinchzoom", "pinchzoom", 10, -1},
+    {"touch/dials Example", "touch/dials", "dials", 10, -1},
+    {"touch/fingerpaint Example", "touch/fingerpaint", "fingerpaint", 10, -1},
+    {"touch/knobs Example", "touch/knobs", "knobs", 10, -1},
+    {"touch/pinchzoom Example", "touch/pinchzoom", "pinchzoom", 10, -1},
     {"opengl/2dpainting Example", "opengl/2dpainting", "2dpainting", 10, -1},
     {"opengl/grabber Example", "opengl/grabber", "grabber", 10, -1},
     {"opengl/hellogl Example", "opengl/hellogl", "hellogl", 10, -1},
-- 
cgit v0.12


From a98af1c7f1bba3c791d08e76e4896e48ea6ea019 Mon Sep 17 00:00:00 2001
From: Kevin Wright <kevin.wright@nokia.com>
Date: Tue, 27 Jul 2010 09:32:59 +0200
Subject: Added files that had been renamed.

---
 doc/src/examples/touch-dials.qdoc            |  36 +++++
 doc/src/examples/touch-knobs.qdoc            |  36 +++++
 doc/src/images/touch-dials-example.png       | Bin 0 -> 17676 bytes
 doc/src/images/touch-examples.png            | Bin 0 -> 6691 bytes
 doc/src/images/touch-fingerpaint-example.png | Bin 0 -> 17026 bytes
 doc/src/images/touch-knobs-example.png       | Bin 0 -> 1290 bytes
 doc/src/images/touch-pinchzoom-example.png   | Bin 0 -> 48154 bytes
 examples/touch/dials/dials.pro               |   8 +
 examples/touch/dials/dials.ui                |  77 ++++++++++
 examples/touch/dials/main.cpp                |  58 +++++++
 examples/touch/fingerpaint/fingerpaint.pro   |  11 ++
 examples/touch/fingerpaint/main.cpp          |  51 +++++++
 examples/touch/fingerpaint/mainwindow.cpp    | 217 +++++++++++++++++++++++++++
 examples/touch/fingerpaint/mainwindow.h      |  88 +++++++++++
 examples/touch/fingerpaint/scribblearea.cpp  | 211 ++++++++++++++++++++++++++
 examples/touch/fingerpaint/scribblearea.h    |  80 ++++++++++
 examples/touch/knobs/knob.cpp                |  88 +++++++++++
 examples/touch/knobs/knob.h                  |  54 +++++++
 examples/touch/knobs/knobs.pro               |   8 +
 examples/touch/knobs/main.cpp                |  64 ++++++++
 examples/touch/pinchzoom/graphicsview.cpp    |  85 +++++++++++
 examples/touch/pinchzoom/graphicsview.h      |  55 +++++++
 examples/touch/pinchzoom/main.cpp            |  86 +++++++++++
 examples/touch/pinchzoom/mice.qrc            |   5 +
 examples/touch/pinchzoom/mouse.cpp           | 199 ++++++++++++++++++++++++
 examples/touch/pinchzoom/mouse.h             |  70 +++++++++
 examples/touch/pinchzoom/pinchzoom.pro       |  16 ++
 examples/touch/touch.pro                     |   2 +
 28 files changed, 1605 insertions(+)
 create mode 100644 doc/src/examples/touch-dials.qdoc
 create mode 100644 doc/src/examples/touch-knobs.qdoc
 create mode 100644 doc/src/images/touch-dials-example.png
 create mode 100644 doc/src/images/touch-examples.png
 create mode 100644 doc/src/images/touch-fingerpaint-example.png
 create mode 100644 doc/src/images/touch-knobs-example.png
 create mode 100644 doc/src/images/touch-pinchzoom-example.png
 create mode 100644 examples/touch/dials/dials.pro
 create mode 100644 examples/touch/dials/dials.ui
 create mode 100644 examples/touch/dials/main.cpp
 create mode 100644 examples/touch/fingerpaint/fingerpaint.pro
 create mode 100644 examples/touch/fingerpaint/main.cpp
 create mode 100644 examples/touch/fingerpaint/mainwindow.cpp
 create mode 100644 examples/touch/fingerpaint/mainwindow.h
 create mode 100644 examples/touch/fingerpaint/scribblearea.cpp
 create mode 100644 examples/touch/fingerpaint/scribblearea.h
 create mode 100644 examples/touch/knobs/knob.cpp
 create mode 100644 examples/touch/knobs/knob.h
 create mode 100644 examples/touch/knobs/knobs.pro
 create mode 100644 examples/touch/knobs/main.cpp
 create mode 100644 examples/touch/pinchzoom/graphicsview.cpp
 create mode 100644 examples/touch/pinchzoom/graphicsview.h
 create mode 100644 examples/touch/pinchzoom/main.cpp
 create mode 100644 examples/touch/pinchzoom/mice.qrc
 create mode 100644 examples/touch/pinchzoom/mouse.cpp
 create mode 100644 examples/touch/pinchzoom/mouse.h
 create mode 100644 examples/touch/pinchzoom/pinchzoom.pro
 create mode 100644 examples/touch/touch.pro

diff --git a/doc/src/examples/touch-dials.qdoc b/doc/src/examples/touch-dials.qdoc
new file mode 100644
index 0000000..552d752
--- /dev/null
+++ b/doc/src/examples/touch-dials.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+    \example touch/dials
+    \title Touch Dials Example
+
+    The Touch Dials example shows how to apply touch to a set of
+    standard Qt widgets.
+
+    \image touch-dials-example.png
+*/
diff --git a/doc/src/examples/touch-knobs.qdoc b/doc/src/examples/touch-knobs.qdoc
new file mode 100644
index 0000000..deb4c28
--- /dev/null
+++ b/doc/src/examples/touch-knobs.qdoc
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in a
+** written agreement between you and Nokia.
+**
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of this
+** file.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+    \example touch/knobs
+    \title Touch Knobs Example
+
+    The Touch Knobs example shows how to create custom controls that
+    accept touch input.
+
+    \image touch-knobs-example.png
+*/
diff --git a/doc/src/images/touch-dials-example.png b/doc/src/images/touch-dials-example.png
new file mode 100644
index 0000000..60e1776
Binary files /dev/null and b/doc/src/images/touch-dials-example.png differ
diff --git a/doc/src/images/touch-examples.png b/doc/src/images/touch-examples.png
new file mode 100644
index 0000000..b053cf3
Binary files /dev/null and b/doc/src/images/touch-examples.png differ
diff --git a/doc/src/images/touch-fingerpaint-example.png b/doc/src/images/touch-fingerpaint-example.png
new file mode 100644
index 0000000..c741b65
Binary files /dev/null and b/doc/src/images/touch-fingerpaint-example.png differ
diff --git a/doc/src/images/touch-knobs-example.png b/doc/src/images/touch-knobs-example.png
new file mode 100644
index 0000000..1cbd90d
Binary files /dev/null and b/doc/src/images/touch-knobs-example.png differ
diff --git a/doc/src/images/touch-pinchzoom-example.png b/doc/src/images/touch-pinchzoom-example.png
new file mode 100644
index 0000000..1079fb2
Binary files /dev/null and b/doc/src/images/touch-pinchzoom-example.png differ
diff --git a/examples/touch/dials/dials.pro b/examples/touch/dials/dials.pro
new file mode 100644
index 0000000..8963153
--- /dev/null
+++ b/examples/touch/dials/dials.pro
@@ -0,0 +1,8 @@
+SOURCES += main.cpp
+FORMS += dials.ui
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/touch/dials
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS dials.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/touch/dials
+INSTALLS += target sources
diff --git a/examples/touch/dials/dials.ui b/examples/touch/dials/dials.ui
new file mode 100644
index 0000000..8ca7ae9
--- /dev/null
+++ b/examples/touch/dials/dials.ui
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dials</class>
+ <widget class="QWidget" name="Dials">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QDial" name="dial_1">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QDial" name="dial_2">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QDial" name="dial_3">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="3">
+    <widget class="QDial" name="dial_4">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QDial" name="dial_5">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QDial" name="dial_6">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QDial" name="dial_7">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="3">
+    <widget class="QDial" name="dial_8">
+     <property name="notchesVisible">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/examples/touch/dials/main.cpp b/examples/touch/dials/main.cpp
new file mode 100644
index 0000000..4c7cc1e
--- /dev/null
+++ b/examples/touch/dials/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QWidget>
+#include <QDial>
+
+#include "ui_dials.h"
+
+int main(int argc, char **argv)
+{
+    QApplication app(argc, argv);
+    QWidget window;
+    Ui::Dials dialsUi;
+    dialsUi.setupUi(&window);
+    QList<QAbstractSlider *> sliders = window.findChildren<QAbstractSlider *>();
+    foreach (QAbstractSlider *slider, sliders)
+        slider->setAttribute(Qt::WA_AcceptTouchEvents);
+    window.showMaximized();
+    return app.exec();
+}
diff --git a/examples/touch/fingerpaint/fingerpaint.pro b/examples/touch/fingerpaint/fingerpaint.pro
new file mode 100644
index 0000000..f1c9d4c
--- /dev/null
+++ b/examples/touch/fingerpaint/fingerpaint.pro
@@ -0,0 +1,11 @@
+HEADERS       = mainwindow.h \
+                scribblearea.h
+SOURCES       = main.cpp \
+                mainwindow.cpp \
+                scribblearea.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/touch/fingerpaint
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS fingerpaint.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/touch/fingerpaint
+INSTALLS += target sources
diff --git a/examples/touch/fingerpaint/main.cpp b/examples/touch/fingerpaint/main.cpp
new file mode 100644
index 0000000..1d9b61d
--- /dev/null
+++ b/examples/touch/fingerpaint/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+    QApplication app(argc, argv);
+    MainWindow window;
+    window.showMaximized();
+    return app.exec();
+}
diff --git a/examples/touch/fingerpaint/mainwindow.cpp b/examples/touch/fingerpaint/mainwindow.cpp
new file mode 100644
index 0000000..ec42da3
--- /dev/null
+++ b/examples/touch/fingerpaint/mainwindow.cpp
@@ -0,0 +1,217 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "mainwindow.h"
+#include "scribblearea.h"
+
+//! [0]
+MainWindow::MainWindow()
+{
+    scribbleArea = new ScribbleArea;
+    setCentralWidget(scribbleArea);
+
+    createActions();
+    createMenus();
+
+    setWindowTitle(tr("Finger Paint"));
+    resize(500, 500);
+}
+//! [0]
+
+//! [1]
+void MainWindow::closeEvent(QCloseEvent *event)
+//! [1] //! [2]
+{
+    if (maybeSave()) {
+        event->accept();
+    } else {
+        event->ignore();
+    }
+}
+//! [2]
+
+//! [3]
+void MainWindow::open()
+//! [3] //! [4]
+{
+    if (maybeSave()) {
+        QString fileName = QFileDialog::getOpenFileName(this,
+                                   tr("Open File"), QDir::currentPath());
+        if (!fileName.isEmpty())
+            scribbleArea->openImage(fileName);
+    }
+}
+//! [4]
+
+//! [5]
+void MainWindow::save()
+//! [5] //! [6]
+{
+    QAction *action = qobject_cast<QAction *>(sender());
+    QByteArray fileFormat = action->data().toByteArray();
+    saveFile(fileFormat);
+}
+//! [6]
+
+//! [11]
+void MainWindow::about()
+//! [11] //! [12]
+{
+    QMessageBox::about(this, tr("About Scribble"),
+            tr("<p>The <b>Scribble</b> example shows how to use QMainWindow as the "
+               "base widget for an application, and how to reimplement some of "
+               "QWidget's event handlers to receive the events generated for "
+               "the application's widgets:</p><p> We reimplement the mouse event "
+               "handlers to facilitate drawing, the paint event handler to "
+               "update the application and the resize event handler to optimize "
+               "the application's appearance. In addition we reimplement the "
+               "close event handler to intercept the close events before "
+               "terminating the application.</p><p> The example also demonstrates "
+               "how to use QPainter to draw an image in real time, as well as "
+               "to repaint widgets.</p>"));
+}
+//! [12]
+
+//! [13]
+void MainWindow::createActions()
+//! [13] //! [14]
+{
+    openAct = new QAction(tr("&Open..."), this);
+    openAct->setShortcut(tr("Ctrl+O"));
+    connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+
+    foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
+        QString text = tr("%1...").arg(QString(format).toUpper());
+
+        QAction *action = new QAction(text, this);
+        action->setData(format);
+        connect(action, SIGNAL(triggered()), this, SLOT(save()));
+        saveAsActs.append(action);
+    }
+
+    printAct = new QAction(tr("&Print..."), this);
+    connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print()));
+
+    exitAct = new QAction(tr("E&xit"), this);
+    exitAct->setShortcut(tr("Ctrl+Q"));
+    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+    clearScreenAct = new QAction(tr("&Clear Screen"), this);
+    clearScreenAct->setShortcut(tr("Ctrl+L"));
+    connect(clearScreenAct, SIGNAL(triggered()),
+            scribbleArea, SLOT(clearImage()));
+
+    aboutAct = new QAction(tr("&About"), this);
+    connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+    aboutQtAct = new QAction(tr("About &Qt"), this);
+    connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+}
+//! [14]
+
+//! [15]
+void MainWindow::createMenus()
+//! [15] //! [16]
+{
+    saveAsMenu = new QMenu(tr("&Save As"), this);
+    foreach (QAction *action, saveAsActs)
+        saveAsMenu->addAction(action);
+
+    fileMenu = new QMenu(tr("&File"), this);
+    fileMenu->addAction(openAct);
+    fileMenu->addMenu(saveAsMenu);
+    fileMenu->addAction(printAct);
+    fileMenu->addSeparator();
+    fileMenu->addAction(exitAct);
+
+    optionMenu = new QMenu(tr("&Options"), this);
+    optionMenu->addAction(clearScreenAct);
+
+    helpMenu = new QMenu(tr("&Help"), this);
+    helpMenu->addAction(aboutAct);
+    helpMenu->addAction(aboutQtAct);
+
+    menuBar()->addMenu(fileMenu);
+    menuBar()->addMenu(optionMenu);
+    menuBar()->addMenu(helpMenu);
+}
+//! [16]
+
+//! [17]
+bool MainWindow::maybeSave()
+//! [17] //! [18]
+{
+    if (scribbleArea->isModified()) {
+       QMessageBox::StandardButton ret;
+       ret = QMessageBox::warning(this, tr("Scribble"),
+                          tr("The image has been modified.\n"
+                             "Do you want to save your changes?"),
+                          QMessageBox::Save | QMessageBox::Discard
+			  | QMessageBox::Cancel);
+        if (ret == QMessageBox::Save) {
+            return saveFile("png");
+        } else if (ret == QMessageBox::Cancel) {
+            return false;
+        }
+    }
+    return true;
+}
+//! [18]
+
+//! [19]
+bool MainWindow::saveFile(const QByteArray &fileFormat)
+//! [19] //! [20]
+{
+    QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
+
+    QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
+                               initialPath,
+                               tr("%1 Files (*.%2);;All Files (*)")
+                               .arg(QString(fileFormat.toUpper()))
+                               .arg(QString(fileFormat)));
+    if (fileName.isEmpty()) {
+        return false;
+    } else {
+        return scribbleArea->saveImage(fileName, fileFormat);
+    }
+}
+//! [20]
diff --git a/examples/touch/fingerpaint/mainwindow.h b/examples/touch/fingerpaint/mainwindow.h
new file mode 100644
index 0000000..714748e
--- /dev/null
+++ b/examples/touch/fingerpaint/mainwindow.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QList>
+#include <QMainWindow>
+
+class ScribbleArea;
+
+//! [0]
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow();
+
+protected:
+    void closeEvent(QCloseEvent *event);
+
+private slots:
+    void open();
+    void save();
+    void about();
+
+private:
+    void createActions();
+    void createMenus();
+    bool maybeSave();
+    bool saveFile(const QByteArray &fileFormat);
+
+    ScribbleArea *scribbleArea;
+
+    QMenu *saveAsMenu;
+    QMenu *fileMenu;
+    QMenu *optionMenu;
+    QMenu *helpMenu;
+
+    QAction *openAct;
+    QList<QAction *> saveAsActs;
+    QAction *exitAct;
+    QAction *printAct;
+    QAction *clearScreenAct;
+    QAction *aboutAct;
+    QAction *aboutQtAct;
+};
+//! [0]
+
+#endif
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp
new file mode 100644
index 0000000..f16c334
--- /dev/null
+++ b/examples/touch/fingerpaint/scribblearea.cpp
@@ -0,0 +1,211 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+
+#include "scribblearea.h"
+
+//! [0]
+ScribbleArea::ScribbleArea(QWidget *parent)
+    : QWidget(parent)
+{
+    setAttribute(Qt::WA_AcceptTouchEvents);
+    setAttribute(Qt::WA_StaticContents);
+    modified = false;
+
+    myPenColors
+            << QColor("green")
+            << QColor("purple")
+            << QColor("red")
+            << QColor("blue")
+            << QColor("yellow")
+
+            << QColor("pink")
+            << QColor("orange")
+            << QColor("brown")
+            << QColor("grey")
+            << QColor("black");
+}
+//! [0]
+
+//! [1]
+bool ScribbleArea::openImage(const QString &fileName)
+//! [1] //! [2]
+{
+    QImage loadedImage;
+    if (!loadedImage.load(fileName))
+        return false;
+
+    QSize newSize = loadedImage.size().expandedTo(size());
+    resizeImage(&loadedImage, newSize);
+    image = loadedImage;
+    modified = false;
+    update();
+    return true;
+}
+//! [2]
+
+//! [3]
+bool ScribbleArea::saveImage(const QString &fileName, const char *fileFormat)
+//! [3] //! [4]
+{
+    QImage visibleImage = image;
+    resizeImage(&visibleImage, size());
+
+    if (visibleImage.save(fileName, fileFormat)) {
+        modified = false;
+        return true;
+    } else {
+        return false;
+    }
+}
+//! [4]
+
+//! [9]
+void ScribbleArea::clearImage()
+//! [9] //! [10]
+{
+    image.fill(qRgb(255, 255, 255));
+    modified = true;
+    update();
+}
+//! [10]
+
+//! [12] //! [13]
+void ScribbleArea::paintEvent(QPaintEvent *event)
+//! [13] //! [14]
+{
+    QPainter painter(this);
+    const QRect rect = event->rect();
+    painter.drawImage(rect.topLeft(), image, rect);
+}
+//! [14]
+
+//! [15]
+void ScribbleArea::resizeEvent(QResizeEvent *event)
+//! [15] //! [16]
+{
+    if (width() > image.width() || height() > image.height()) {
+        int newWidth = qMax(width() + 128, image.width());
+        int newHeight = qMax(height() + 128, image.height());
+        resizeImage(&image, QSize(newWidth, newHeight));
+        update();
+    }
+    QWidget::resizeEvent(event);
+}
+//! [16]
+
+//! [19]
+void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
+//! [19] //! [20]
+{
+    if (image->size() == newSize)
+        return;
+
+    QImage newImage(newSize, QImage::Format_RGB32);
+    newImage.fill(qRgb(255, 255, 255));
+    QPainter painter(&newImage);
+    painter.drawImage(QPoint(0, 0), *image);
+    *image = newImage;
+}
+//! [20]
+
+//! [21]
+void ScribbleArea::print()
+{
+#ifndef QT_NO_PRINTER
+    QPrinter printer(QPrinter::HighResolution);
+
+    QPrintDialog *printDialog = new QPrintDialog(&printer, this);
+//! [21] //! [22]
+    if (printDialog->exec() == QDialog::Accepted) {
+        QPainter painter(&printer);
+        QRect rect = painter.viewport();
+        QSize size = image.size();
+        size.scale(rect.size(), Qt::KeepAspectRatio);
+        painter.setViewport(rect.x(), rect.y(), size.width(), size.height());
+        painter.setWindow(image.rect());
+        painter.drawImage(0, 0, image);
+    }
+#endif // QT_NO_PRINTER
+}
+//! [22]
+
+bool ScribbleArea::event(QEvent *event)
+{
+    switch (event->type()) {
+    case QEvent::TouchBegin:
+    case QEvent::TouchUpdate:
+    case QEvent::TouchEnd:
+    {
+        QList<QTouchEvent::TouchPoint> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints();
+        foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) {
+            switch (touchPoint.state()) {
+            case Qt::TouchPointStationary:
+                // don't do anything if this touch point hasn't moved
+                continue;
+            default:
+                {
+                    QRectF rect = touchPoint.rect();
+                    if (rect.isEmpty()) {
+                        qreal diameter = qreal(50) * touchPoint.pressure();
+                        rect.setSize(QSizeF(diameter, diameter));
+                    }
+
+                    QPainter painter(&image);
+                    painter.setPen(Qt::NoPen);
+                    painter.setBrush(myPenColors.at(touchPoint.id() % myPenColors.count()));
+                    painter.drawEllipse(rect);
+                    painter.end();
+
+                    modified = true;
+                    int rad = 2;
+                    update(rect.toRect().adjusted(-rad,-rad, +rad, +rad));
+                }
+                break;
+            }
+        }
+        break;
+    }
+    default:
+        return QWidget::event(event);
+    }
+    return true;
+}
diff --git a/examples/touch/fingerpaint/scribblearea.h b/examples/touch/fingerpaint/scribblearea.h
new file mode 100644
index 0000000..2e4fbda
--- /dev/null
+++ b/examples/touch/fingerpaint/scribblearea.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SCRIBBLEAREA_H
+#define SCRIBBLEAREA_H
+
+#include <QColor>
+#include <QImage>
+#include <QPoint>
+#include <QWidget>
+
+//! [0]
+class ScribbleArea : public QWidget
+{
+    Q_OBJECT
+
+public:
+    ScribbleArea(QWidget *parent = 0);
+
+    bool openImage(const QString &fileName);
+    bool saveImage(const QString &fileName, const char *fileFormat);
+
+    bool isModified() const { return modified; }
+
+public slots:
+    void clearImage();
+    void print();
+
+protected:
+    void paintEvent(QPaintEvent *event);
+    void resizeEvent(QResizeEvent *event);
+    bool event(QEvent *event);
+
+private:
+    void resizeImage(QImage *image, const QSize &newSize);
+
+    bool modified;
+    QList<QColor> myPenColors;
+    QImage image;
+};
+//! [0]
+
+#endif
diff --git a/examples/touch/knobs/knob.cpp b/examples/touch/knobs/knob.cpp
new file mode 100644
index 0000000..6ddd9b3
--- /dev/null
+++ b/examples/touch/knobs/knob.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "knob.h"
+
+#include <QBrush>
+#include <QTouchEvent>
+
+Knob::Knob()
+    : QGraphicsEllipseItem(-50, -50, 100, 100)
+{
+    setAcceptTouchEvents(true);
+    setBrush(Qt::lightGray);
+
+    QGraphicsEllipseItem *leftItem = new QGraphicsEllipseItem(0, 0, 20, 20, this);
+    leftItem->setPos(-40, -10);
+    leftItem->setBrush(Qt::darkGreen);
+
+    QGraphicsEllipseItem *rightItem = new QGraphicsEllipseItem(0, 0, 20, 20, this);
+    rightItem->setPos(20, -10);
+    rightItem->setBrush(Qt::darkRed);
+}
+
+bool Knob::sceneEvent(QEvent *event)
+{
+    switch (event->type()) {
+    case QEvent::TouchBegin:
+    case QEvent::TouchUpdate:
+    case QEvent::TouchEnd:
+    {
+        QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event);
+
+        if (touchEvent->touchPoints().count() == 2) {
+            const QTouchEvent::TouchPoint &touchPoint1 = touchEvent->touchPoints().first();
+            const QTouchEvent::TouchPoint &touchPoint2 = touchEvent->touchPoints().last();
+
+            QLineF line1(touchPoint1.lastScenePos(), touchPoint2.lastScenePos());
+            QLineF line2(touchPoint1.scenePos(), touchPoint2.scenePos());
+
+            rotate(line2.angleTo(line1));
+        }
+
+        break;
+    }
+
+    default:
+        return QGraphicsItem::sceneEvent(event);
+    }
+
+    return true;
+}
diff --git a/examples/touch/knobs/knob.h b/examples/touch/knobs/knob.h
new file mode 100644
index 0000000..d4e8730
--- /dev/null
+++ b/examples/touch/knobs/knob.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef KNOB_H
+#define KNOB_H
+
+#include <QGraphicsItem>
+
+class Knob : public QGraphicsEllipseItem
+{
+public:
+    Knob();
+
+    bool sceneEvent(QEvent *event);
+};
+
+#endif // KNOB_H
diff --git a/examples/touch/knobs/knobs.pro b/examples/touch/knobs/knobs.pro
new file mode 100644
index 0000000..ef01c9a
--- /dev/null
+++ b/examples/touch/knobs/knobs.pro
@@ -0,0 +1,8 @@
+HEADERS = knob.h
+SOURCES = main.cpp knob.cpp
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/touch/knobs
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS knobs.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/touch/knobs
+INSTALLS += target sources
diff --git a/examples/touch/knobs/main.cpp b/examples/touch/knobs/main.cpp
new file mode 100644
index 0000000..0866f78
--- /dev/null
+++ b/examples/touch/knobs/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QGraphicsView>
+
+#include "knob.h"
+
+int main(int argc, char **argv)
+{
+    QApplication app(argc, argv);
+
+    QGraphicsScene scene;
+    QGraphicsView view(&scene);
+
+    Knob *knob1 = new Knob;
+    knob1->setPos(-110, 0);
+    Knob *knob2 = new Knob;
+
+    scene.addItem(knob1);
+    scene.addItem(knob2);
+
+    view.showMaximized();
+    view.fitInView(scene.sceneRect().adjusted(-20, -20, 20, 20), Qt::KeepAspectRatio);
+
+    return app.exec();
+}
diff --git a/examples/touch/pinchzoom/graphicsview.cpp b/examples/touch/pinchzoom/graphicsview.cpp
new file mode 100644
index 0000000..041e494
--- /dev/null
+++ b/examples/touch/pinchzoom/graphicsview.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "graphicsview.h"
+
+#include <QScrollBar>
+#include <QTouchEvent>
+
+GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent)
+    : QGraphicsView(scene, parent), totalScaleFactor(1)
+{
+    viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
+    setDragMode(ScrollHandDrag);
+}
+
+bool GraphicsView::viewportEvent(QEvent *event)
+{
+    switch (event->type()) {
+    case QEvent::TouchBegin:
+    case QEvent::TouchUpdate:
+    case QEvent::TouchEnd:
+    {
+        QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event);
+        QList<QTouchEvent::TouchPoint> touchPoints = touchEvent->touchPoints();
+        if (touchPoints.count() == 2) {
+            // determine scale factor
+            const QTouchEvent::TouchPoint &touchPoint0 = touchPoints.first();
+            const QTouchEvent::TouchPoint &touchPoint1 = touchPoints.last();
+            qreal currentScaleFactor =
+                    QLineF(touchPoint0.pos(), touchPoint1.pos()).length()
+                    / QLineF(touchPoint0.startPos(), touchPoint1.startPos()).length();
+            if (touchEvent->touchPointStates() & Qt::TouchPointReleased) {
+                // if one of the fingers is released, remember the current scale
+                // factor so that adding another finger later will continue zooming
+                // by adding new scale factor to the existing remembered value.
+                totalScaleFactor *= currentScaleFactor;
+                currentScaleFactor = 1;
+            }
+            setTransform(QTransform().scale(totalScaleFactor * currentScaleFactor,
+                                            totalScaleFactor * currentScaleFactor));
+        }
+        return true;
+    }
+    default:
+        break;
+    }
+    return QGraphicsView::viewportEvent(event);
+}
diff --git a/examples/touch/pinchzoom/graphicsview.h b/examples/touch/pinchzoom/graphicsview.h
new file mode 100644
index 0000000..c762786
--- /dev/null
+++ b/examples/touch/pinchzoom/graphicsview.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#pragma once
+#include <QGraphicsView>
+
+class GraphicsView : public QGraphicsView
+{
+    Q_OBJECT
+
+public:
+    GraphicsView(QGraphicsScene *scene = 0, QWidget *parent = 0);
+
+    bool viewportEvent(QEvent *event);
+
+private:
+    qreal totalScaleFactor;
+};
diff --git a/examples/touch/pinchzoom/main.cpp b/examples/touch/pinchzoom/main.cpp
new file mode 100644
index 0000000..8abc993
--- /dev/null
+++ b/examples/touch/pinchzoom/main.cpp
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "graphicsview.h"
+#include "mouse.h"
+
+#include <QtGui>
+
+#include <math.h>
+
+static const int MouseCount = 7;
+
+//! [0]
+int main(int argc, char **argv)
+{
+    QApplication app(argc, argv);
+    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
+//! [0]
+
+//! [1]
+    QGraphicsScene scene;
+    scene.setSceneRect(-300, -300, 600, 600);
+//! [1] //! [2]
+    scene.setItemIndexMethod(QGraphicsScene::NoIndex);
+//! [2]
+
+//! [3]
+    for (int i = 0; i < MouseCount; ++i) {
+        Mouse *mouse = new Mouse;
+        mouse->setPos(::sin((i * 6.28) / MouseCount) * 200,
+                      ::cos((i * 6.28) / MouseCount) * 200);
+        scene.addItem(mouse);
+    }
+//! [3]
+
+//! [4]
+    GraphicsView view(&scene);
+    view.setRenderHint(QPainter::Antialiasing);
+    view.setBackgroundBrush(QPixmap(":/images/cheese.jpg"));
+//! [4] //! [5]
+    view.setCacheMode(QGraphicsView::CacheBackground);
+    view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
+//! [5] //! [6]
+    view.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Colliding Mice"));
+    view.showMaximized();
+
+    return app.exec();
+}
+//! [6]
diff --git a/examples/touch/pinchzoom/mice.qrc b/examples/touch/pinchzoom/mice.qrc
new file mode 100644
index 0000000..accdb4d
--- /dev/null
+++ b/examples/touch/pinchzoom/mice.qrc
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/" >
+        <file>images/cheese.jpg</file>
+    </qresource>
+</RCC>
diff --git a/examples/touch/pinchzoom/mouse.cpp b/examples/touch/pinchzoom/mouse.cpp
new file mode 100644
index 0000000..82617fe
--- /dev/null
+++ b/examples/touch/pinchzoom/mouse.cpp
@@ -0,0 +1,199 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mouse.h"
+
+#include <QGraphicsScene>
+#include <QPainter>
+#include <QStyleOption>
+
+#include <math.h>
+
+static const double Pi = 3.14159265358979323846264338327950288419717;
+static double TwoPi = 2.0 * Pi;
+
+static qreal normalizeAngle(qreal angle)
+{
+    while (angle < 0)
+        angle += TwoPi;
+    while (angle > TwoPi)
+        angle -= TwoPi;
+    return angle;
+}
+
+//! [0]
+Mouse::Mouse()
+    : angle(0), speed(0), mouseEyeDirection(0),
+      color(qrand() % 256, qrand() % 256, qrand() % 256)
+{
+    rotate(qrand() % (360 * 16));
+    startTimer(1000 / 33);
+}
+//! [0]
+
+//! [1]
+QRectF Mouse::boundingRect() const
+{
+    qreal adjust = 0.5;
+    return QRectF(-18 - adjust, -22 - adjust,
+                  36 + adjust, 60 + adjust);
+}
+//! [1]
+
+//! [2]
+QPainterPath Mouse::shape() const
+{
+    QPainterPath path;
+    path.addRect(-10, -20, 20, 40);
+    return path;
+}
+//! [2]
+
+//! [3]
+void Mouse::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+{
+    // Body
+    painter->setBrush(color);
+    painter->drawEllipse(-10, -20, 20, 40);
+
+    // Eyes
+    painter->setBrush(Qt::white);
+    painter->drawEllipse(-10, -17, 8, 8);
+    painter->drawEllipse(2, -17, 8, 8);
+
+    // Nose
+    painter->setBrush(Qt::black);
+    painter->drawEllipse(QRectF(-2, -22, 4, 4));
+
+    // Pupils
+    painter->drawEllipse(QRectF(-8.0 + mouseEyeDirection, -17, 4, 4));
+    painter->drawEllipse(QRectF(4.0 + mouseEyeDirection, -17, 4, 4));
+
+    // Ears
+    painter->setBrush(scene()->collidingItems(this).isEmpty() ? Qt::darkYellow : Qt::red);
+    painter->drawEllipse(-17, -12, 16, 16);
+    painter->drawEllipse(1, -12, 16, 16);
+
+    // Tail
+    QPainterPath path(QPointF(0, 20));
+    path.cubicTo(-5, 22, -5, 22, 0, 25);
+    path.cubicTo(5, 27, 5, 32, 0, 30);
+    path.cubicTo(-5, 32, -5, 42, 0, 35);
+    painter->setBrush(Qt::NoBrush);
+    painter->drawPath(path);
+}
+//! [3]
+
+//! [4]
+void Mouse::timerEvent(QTimerEvent *)
+{
+//! [4]
+    // Don't move too far away
+//! [5]
+    QLineF lineToCenter(QPointF(0, 0), mapFromScene(0, 0));
+    if (lineToCenter.length() > 150) {
+        qreal angleToCenter = ::acos(lineToCenter.dx() / lineToCenter.length());
+        if (lineToCenter.dy() < 0)
+            angleToCenter = TwoPi - angleToCenter;
+        angleToCenter = normalizeAngle((Pi - angleToCenter) + Pi / 2);
+
+        if (angleToCenter < Pi && angleToCenter > Pi / 4) {
+            // Rotate left
+            angle += (angle < -Pi / 2) ? 0.25 : -0.25;
+        } else if (angleToCenter >= Pi && angleToCenter < (Pi + Pi / 2 + Pi / 4)) {
+            // Rotate right
+            angle += (angle < Pi / 2) ? 0.25 : -0.25;
+        }
+    } else if (::sin(angle) < 0) {
+        angle += 0.25;
+    } else if (::sin(angle) > 0) {
+        angle -= 0.25;
+//! [5] //! [6]
+    }
+//! [6]
+
+    // Try not to crash with any other mice
+//! [7]
+    QList<QGraphicsItem *> dangerMice = scene()->items(QPolygonF()
+                                                       << mapToScene(0, 0)
+                                                       << mapToScene(-30, -50)
+                                                       << mapToScene(30, -50));
+    foreach (QGraphicsItem *item, dangerMice) {
+        if (item == this)
+            continue;
+        
+        QLineF lineToMouse(QPointF(0, 0), mapFromItem(item, 0, 0));
+        qreal angleToMouse = ::acos(lineToMouse.dx() / lineToMouse.length());
+        if (lineToMouse.dy() < 0)
+            angleToMouse = TwoPi - angleToMouse;
+        angleToMouse = normalizeAngle((Pi - angleToMouse) + Pi / 2);
+
+        if (angleToMouse >= 0 && angleToMouse < Pi / 2) {
+            // Rotate right
+            angle += 0.5;
+        } else if (angleToMouse <= TwoPi && angleToMouse > (TwoPi - Pi / 2)) {
+            // Rotate left
+            angle -= 0.5;
+//! [7] //! [8]
+        }
+//! [8] //! [9]
+    }
+//! [9]
+
+    // Add some random movement
+//! [10]
+    if (dangerMice.size() > 1 && (qrand() % 10) == 0) {
+        if (qrand() % 1)
+            angle += (qrand() % 100) / 500.0;
+        else
+            angle -= (qrand() % 100) / 500.0;
+    }
+//! [10]
+
+//! [11]
+    speed += (-50 + qrand() % 100) / 100.0;
+
+    qreal dx = ::sin(angle) * 10;
+    mouseEyeDirection = (qAbs(dx / 5) < 1) ? 0 : dx / 5;
+
+    rotate(dx);
+    setPos(mapToParent(0, -(3 + sin(speed) * 3)));
+}
+//! [11]
diff --git a/examples/touch/pinchzoom/mouse.h b/examples/touch/pinchzoom/mouse.h
new file mode 100644
index 0000000..241f8ab
--- /dev/null
+++ b/examples/touch/pinchzoom/mouse.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MOUSE_H
+#define MOUSE_H
+
+#include <QGraphicsObject>
+
+//! [0]
+class Mouse : public QGraphicsObject
+{
+    Q_OBJECT
+
+public:
+    Mouse();
+
+    QRectF boundingRect() const;
+    QPainterPath shape() const;
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+               QWidget *widget);
+
+protected:
+    void timerEvent(QTimerEvent *event);
+
+private:
+    qreal angle;
+    qreal speed;
+    qreal mouseEyeDirection;
+    QColor color;
+};
+//! [0]
+
+#endif
diff --git a/examples/touch/pinchzoom/pinchzoom.pro b/examples/touch/pinchzoom/pinchzoom.pro
new file mode 100644
index 0000000..804536b
--- /dev/null
+++ b/examples/touch/pinchzoom/pinchzoom.pro
@@ -0,0 +1,16 @@
+HEADERS += \
+        mouse.h \
+        graphicsview.h
+SOURCES += \
+	main.cpp \
+        mouse.cpp \
+        graphicsview.cpp
+
+RESOURCES += \
+	mice.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/touch/pinchzoom
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pinchzoom.pro images
+sources.path = $$[QT_INSTALL_EXAMPLES]/touch/pinchzoom
+INSTALLS += target sources
diff --git a/examples/touch/touch.pro b/examples/touch/touch.pro
new file mode 100644
index 0000000..d5983eb
--- /dev/null
+++ b/examples/touch/touch.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = pinchzoom fingerpaint knobs dials
-- 
cgit v0.12


From 475a3c275ba173cb130a838b6053cb45d405887e Mon Sep 17 00:00:00 2001
From: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Date: Tue, 27 Jul 2010 10:23:44 +0200
Subject: Check the gesturemanager pointer before accessing it.

This fixes a crash when a static QWidget is destroyed after the QApplication
object.

Task-number: QTBUG-12025
Reviewed-by: Zeno Albisser
---
 src/gui/graphicsview/qgraphicsitem.cpp |  7 ++++---
 src/gui/kernel/qapplication.cpp        | 10 ++++++----
 src/gui/kernel/qwidget.cpp             |  4 ++--
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 5fffefb..a2ae385 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1453,9 +1453,10 @@ QGraphicsItem::~QGraphicsItem()
 #ifndef QT_NO_GESTURES
     if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
         QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
-        QGestureManager *manager = QGestureManager::instance();
-        foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
-            manager->cleanupCachedGestures(o, type);
+        if (QGestureManager *manager = QGestureManager::instance()) {
+            foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
+                manager->cleanupCachedGestures(o, type);
+        }
     }
 #endif
 
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index aaf479f..5c333b0 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -5791,10 +5791,12 @@ Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window,
 #ifndef QT_NO_GESTURES
 QGestureManager* QGestureManager::instance()
 {
-    QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
-    if (!qAppPriv->gestureManager)
-        qAppPriv->gestureManager = new QGestureManager(qApp);
-    return qAppPriv->gestureManager;
+    if (QApplicationPrivate *qAppPriv = QApplicationPrivate::instance()) {
+        if (!qAppPriv->gestureManager)
+            qAppPriv->gestureManager = new QGestureManager(qApp);
+        return qAppPriv->gestureManager;
+    }
+    return 0;
 }
 #endif // QT_NO_GESTURES
 
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index fed8d0a..aaa29a1 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -12049,8 +12049,8 @@ void QWidget::ungrabGesture(Qt::GestureType gesture)
 {
     Q_D(QWidget);
     if (d->gestureContext.remove(gesture)) {
-        QGestureManager *manager = QGestureManager::instance();
-        manager->cleanupCachedGestures(this, gesture);
+        if (QGestureManager *manager = QGestureManager::instance())
+            manager->cleanupCachedGestures(this, gesture);
     }
 }
 #endif // QT_NO_GESTURES
-- 
cgit v0.12


From 4519cfcf6dc4915f015e9b5f2d72ac35d0cee0bf Mon Sep 17 00:00:00 2001
From: Tasuku Suzuki <tasuku.suzuki@nokia.com>
Date: Tue, 27 Jul 2010 11:05:12 +0200
Subject: Fix QT_NO_DATESTRING

Merge-request: 730
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
---
 src/declarative/qml/qdeclarativecompiler.cpp         | 8 ++++----
 src/declarative/qml/qdeclarativeengine.cpp           | 6 +++---
 src/declarative/qml/qdeclarativeengine_p.h           | 2 +-
 src/declarative/qml/qdeclarativestringconverters.cpp | 8 ++++----
 src/declarative/qml/qdeclarativestringconverters_p.h | 2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 23307c9..febcdef 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -240,7 +240,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop,
             if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: color expected"));
             }
             break;
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
         case QVariant::Date:
             {
             bool ok;
@@ -262,7 +262,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop,
             if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: datetime expected"));
             }
             break;
-#endif // QT_NO_TEXTDATE
+#endif // QT_NO_DATESTRING
         case QVariant::Point:
         case QVariant::PointF:
             {
@@ -416,7 +416,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
             instr.storeColor.value = c.rgba();
             }
             break;
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
         case QVariant::Date:
             {
             QDate d = QDeclarativeStringConverters::dateFromString(string);
@@ -450,7 +450,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
             instr.storeDateTime.valueIndex = index;
             }
             break;
-#endif // QT_NO_TEXTDATE
+#endif // QT_NO_DATESTRING
         case QVariant::Point:
         case QVariant::PointF:
             {
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index e3ebca3..facdc4e 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -329,7 +329,7 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr
         qtObject.setProperty(QLatin1String("tint"), newFunction(QDeclarativeEnginePrivate::tint, 2));
     }
 
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
     //date/time formatting
     qtObject.setProperty(QLatin1String("formatDate"),newFunction(QDeclarativeEnginePrivate::formatDate, 2));
     qtObject.setProperty(QLatin1String("formatTime"),newFunction(QDeclarativeEnginePrivate::formatTime, 2));
@@ -1301,7 +1301,7 @@ QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEn
 \qmlmethod string Qt::formatDate(datetime date, variant format)
 Returns the string representation of \c date, formatted according to \c format.
 */
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
 QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptEngine*engine)
 {
     int argCount = ctxt->argumentCount();
@@ -1442,7 +1442,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr
     }
     return engine->newVariant(qVariantFromValue(date.toString(enumFormat)));
 }
-#endif // QT_NO_TEXTDATE
+#endif // QT_NO_DATESTRING
 
 /*!
 \qmlmethod color Qt::rgba(real red, real green, real blue, real alpha)
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index a5c8c38..3b5dd5a 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -304,7 +304,7 @@ public:
     static QScriptValue consoleLog(QScriptContext*, QScriptEngine*);
     static QScriptValue quit(QScriptContext*, QScriptEngine*);
 
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
     static QScriptValue formatDate(QScriptContext*, QScriptEngine*);
     static QScriptValue formatTime(QScriptContext*, QScriptEngine*);
     static QScriptValue formatDateTime(QScriptContext*, QScriptEngine*);
diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp
index 8bd2cf1..7534a2c 100644
--- a/src/declarative/qml/qdeclarativestringconverters.cpp
+++ b/src/declarative/qml/qdeclarativestringconverters.cpp
@@ -106,14 +106,14 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int p
         return QVariant(uint(qRound(s.toDouble(ok))));
     case QMetaType::QColor:
         return QVariant::fromValue(colorFromString(s, ok));
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
     case QMetaType::QDate:
         return QVariant::fromValue(dateFromString(s, ok));
     case QMetaType::QTime:
         return QVariant::fromValue(timeFromString(s, ok));
     case QMetaType::QDateTime:
         return QVariant::fromValue(dateTimeFromString(s, ok));
-#endif // QT_NO_TEXTDATE
+#endif // QT_NO_DATESTRING
     case QMetaType::QPointF:
         return QVariant::fromValue(pointFFromString(s, ok));
     case QMetaType::QPoint:
@@ -152,7 +152,7 @@ QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok)
     }
 }
 
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
 QDate QDeclarativeStringConverters::dateFromString(const QString &s, bool *ok)
 {
     QDate d = QDate::fromString(s, Qt::ISODate);
@@ -173,7 +173,7 @@ QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, boo
     if (ok) *ok =  d.isValid();
     return d;
 }
-#endif // QT_NO_TEXTDATE
+#endif // QT_NO_DATESTRING
 
 //expects input of "x,y"
 QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *ok)
diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h
index 842d1b3..e6b0abe 100644
--- a/src/declarative/qml/qdeclarativestringconverters_p.h
+++ b/src/declarative/qml/qdeclarativestringconverters_p.h
@@ -73,7 +73,7 @@ namespace QDeclarativeStringConverters
     QVariant Q_DECLARATIVE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0);
 
     QColor Q_DECLARATIVE_EXPORT colorFromString(const QString &, bool *ok = 0);
-#ifndef QT_NO_TEXTDATE
+#ifndef QT_NO_DATESTRING
     QDate Q_DECLARATIVE_EXPORT dateFromString(const QString &, bool *ok = 0); 
     QTime Q_DECLARATIVE_EXPORT timeFromString(const QString &, bool *ok = 0);
     QDateTime Q_DECLARATIVE_EXPORT dateTimeFromString(const QString &, bool *ok = 0);
-- 
cgit v0.12


From c3b2f89b85696c01062ddcd9d21a05cebf51b078 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Mon, 26 Jul 2010 16:26:38 +0200
Subject: Clean the CompositionFunction tables of drawhelper

Some instructions sets were defining partial table of composition
functions. To work around that, qInitDrawhelperAsm() was resetting
the composition function of QPainter::CompositionMode_Destination and
anything above QPainter::CompositionMode_Xor.

This was a problem because it makes it impossible to implement fast
path for those composition mode.

This patch export prototypes for the generic functions of each
composition mode. The specialized implementations now define a complete
table.

Reviewed-by: Andreas Kling
---
 src/gui/painting/qdrawhelper.cpp          | 127 ++++++++++++++----------------
 src/gui/painting/qdrawhelper_iwmmxt.cpp   |  25 +++++-
 src/gui/painting/qdrawhelper_mmx.cpp      |  23 +++++-
 src/gui/painting/qdrawhelper_mmx3dnow.cpp |  25 +++++-
 src/gui/painting/qdrawhelper_p.h          |  35 ++++++++
 src/gui/painting/qdrawhelper_sse.cpp      |  25 +++++-
 src/gui/painting/qdrawhelper_sse3dnow.cpp |  25 +++++-
 7 files changed, 208 insertions(+), 77 deletions(-)

diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ca9556b..a77c379 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -1314,7 +1314,7 @@ static void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint
     comp_func_Clear_impl(dest, length, const_alpha);
 }
 
-static void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
 {
     comp_func_Clear_impl(dest, length, const_alpha);
 }
@@ -1338,7 +1338,7 @@ static void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint colo
     }
 }
 
-static void QT_FASTCALL comp_func_Source(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Source(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255) {
         ::memcpy(dest, src, length * sizeof(uint));
@@ -1356,7 +1356,7 @@ static void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)
 {
 }
 
-static void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
+void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
 {
 }
 
@@ -1381,7 +1381,7 @@ static void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint
     }
 }
 
-static void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1419,7 +1419,7 @@ static void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length,
     }
 }
 
-static void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1461,7 +1461,7 @@ static void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint co
     }
 }
 
-static void QT_FASTCALL comp_func_SourceIn(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_SourceIn(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1498,7 +1498,7 @@ static void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, ui
     }
 }
 
-static void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1540,7 +1540,7 @@ static void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint c
     }
 }
 
-static void QT_FASTCALL comp_func_SourceOut(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_SourceOut(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1576,7 +1576,7 @@ static void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, u
     }
 }
 
-static void QT_FASTCALL comp_func_DestinationOut(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationOut(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1613,7 +1613,7 @@ static void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint
     }
 }
 
-static void QT_FASTCALL comp_func_SourceAtop(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_SourceAtop(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1653,7 +1653,7 @@ static void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length,
     }
 }
 
-static void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1695,7 +1695,7 @@ static void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color,
     }
 }
 
-static void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint const_alpha)
 {
     PRELOAD_INIT2(dest, src)
     if (const_alpha == 255) {
@@ -1794,7 +1794,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Plus_impl(uint *dest, const uin
     }
 }
 
-static void QT_FASTCALL comp_func_Plus(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Plus(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Plus_impl(dest, src, length, QFullCoverage());
@@ -1866,7 +1866,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(uint *dest, const
     }
 }
 
-static void QT_FASTCALL comp_func_Multiply(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Multiply(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Multiply_impl(dest, src, length, QFullCoverage());
@@ -1934,7 +1934,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(uint *dest, const u
     }
 }
 
-static void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Screen_impl(dest, src, length, QFullCoverage());
@@ -2013,7 +2013,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(uint *dest, const
     }
 }
 
-static void QT_FASTCALL comp_func_Overlay(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Overlay(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Overlay_impl(dest, src, length, QFullCoverage());
@@ -2086,7 +2086,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(uint *dest, const u
     }
 }
 
-static void QT_FASTCALL comp_func_Darken(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Darken(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Darken_impl(dest, src, length, QFullCoverage());
@@ -2159,7 +2159,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(uint *dest, const
     }
 }
 
-static void QT_FASTCALL comp_func_Lighten(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Lighten(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Lighten_impl(dest, src, length, QFullCoverage());
@@ -2242,7 +2242,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(uint *dest, con
     }
 }
 
-static void QT_FASTCALL comp_func_ColorDodge(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_ColorDodge(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
@@ -2325,7 +2325,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(uint *dest, cons
     }
 }
 
-static void QT_FASTCALL comp_func_ColorBurn(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_ColorBurn(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
@@ -2405,7 +2405,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(uint *dest, cons
     }
 }
 
-static void QT_FASTCALL comp_func_HardLight(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_HardLight(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_HardLight_impl(dest, src, length, QFullCoverage());
@@ -2496,7 +2496,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(uint *dest, cons
     }
 }
 
-static void QT_FASTCALL comp_func_SoftLight(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_SoftLight(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
@@ -2569,7 +2569,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(uint *dest, con
     }
 }
 
-static void QT_FASTCALL comp_func_Difference(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Difference(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Difference_impl(dest, src, length, QFullCoverage());
@@ -2636,7 +2636,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(uint *dest, cons
     }
 }
 
-static void QT_FASTCALL comp_func_Exclusion(uint *dest, const uint *src, int length, uint const_alpha)
+void QT_FASTCALL comp_func_Exclusion(uint *dest, const uint *src, int length, uint const_alpha)
 {
     if (const_alpha == 255)
         comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
@@ -2659,10 +2659,10 @@ static void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,
         *dest++ |= color;
 }
 
-static void QT_FASTCALL rasterop_SourceOrDestination(uint *dest,
-                                                     const uint *src,
-                                                     int length,
-                                                     uint const_alpha)
+void QT_FASTCALL rasterop_SourceOrDestination(uint *dest,
+                                              const uint *src,
+                                              int length,
+                                              uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--)
@@ -2680,10 +2680,10 @@ static void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest,
         *dest++ &= color;
 }
 
-static void QT_FASTCALL rasterop_SourceAndDestination(uint *dest,
-                                                      const uint *src,
-                                                      int length,
-                                                      uint const_alpha)
+void QT_FASTCALL rasterop_SourceAndDestination(uint *dest,
+                                               const uint *src,
+                                               int length,
+                                               uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -2703,10 +2703,10 @@ static void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest,
         *dest++ ^= color;
 }
 
-static void QT_FASTCALL rasterop_SourceXorDestination(uint *dest,
-                                                      const uint *src,
-                                                      int length,
-                                                      uint const_alpha)
+void QT_FASTCALL rasterop_SourceXorDestination(uint *dest,
+                                               const uint *src,
+                                               int length,
+                                               uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -2728,10 +2728,10 @@ static void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest,
     }
 }
 
-static void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *dest,
-                                                            const uint *src,
-                                                            int length,
-                                                            uint const_alpha)
+void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *dest,
+                                                     const uint *src,
+                                                     int length,
+                                                     uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -2753,10 +2753,10 @@ static void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest,
     }
 }
 
-static void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *dest,
-                                                           const uint *src,
-                                                           int length,
-                                                           uint const_alpha)
+void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *dest,
+                                                    const uint *src,
+                                                    int length,
+                                                    uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -2778,10 +2778,10 @@ static void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest,
     }
 }
 
-static void QT_FASTCALL rasterop_NotSourceXorDestination(uint *dest,
-                                                         const uint *src,
-                                                         int length,
-                                                         uint const_alpha)
+void QT_FASTCALL rasterop_NotSourceXorDestination(uint *dest,
+                                                  const uint *src,
+                                                  int length,
+                                                  uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -2797,8 +2797,8 @@ static void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length,
     qt_memfill(dest, ~color | 0xff000000, length);
 }
 
-static void QT_FASTCALL rasterop_NotSource(uint *dest, const uint *src,
-                                           int length, uint const_alpha)
+void QT_FASTCALL rasterop_NotSource(uint *dest, const uint *src,
+                                    int length, uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--)
@@ -2818,10 +2818,10 @@ static void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest,
     }
 }
 
-static void QT_FASTCALL rasterop_NotSourceAndDestination(uint *dest,
-                                                         const uint *src,
-                                                         int length,
-                                                         uint const_alpha)
+void QT_FASTCALL rasterop_NotSourceAndDestination(uint *dest,
+                                                  const uint *src,
+                                                  int length,
+                                                  uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -2842,10 +2842,10 @@ static void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest,
     }
 }
 
-static void QT_FASTCALL rasterop_SourceAndNotDestination(uint *dest,
-                                                         const uint *src,
-                                                         int length,
-                                                         uint const_alpha)
+void QT_FASTCALL rasterop_SourceAndNotDestination(uint *dest,
+                                                  const uint *src,
+                                                  int length,
+                                                  uint const_alpha)
 {
     Q_UNUSED(const_alpha);
     while (length--) {
@@ -7919,17 +7919,8 @@ void qInitDrawhelperAsm()
 
         functionForModeSolid = functionForModeSolidAsm;
     }
-    if (functionForModeAsm) {
-        const int destinationMode = QPainter::CompositionMode_Destination;
-        functionForModeAsm[destinationMode] = functionForMode_C[destinationMode];
-
-        // use the default qdrawhelper implementation for the
-        // extended composition modes
-        for (int mode = 12; mode < numCompositionFunctions; ++mode)
-            functionForModeAsm[mode] = functionForMode_C[mode];
-
+    if (functionForModeAsm)
         functionForMode = functionForModeAsm;
-    }
 
     qt_build_pow_tables();
 }
diff --git a/src/gui/painting/qdrawhelper_iwmmxt.cpp b/src/gui/painting/qdrawhelper_iwmmxt.cpp
index 80b2c04..d99045d 100644
--- a/src/gui/painting/qdrawhelper_iwmmxt.cpp
+++ b/src/gui/painting/qdrawhelper_iwmmxt.cpp
@@ -106,14 +106,35 @@ CompositionFunction qt_functionForMode_IWMMXT[] = {
     comp_func_DestinationOver<QIWMMXTIntrinsics>,
     comp_func_Clear<QIWMMXTIntrinsics>,
     comp_func_Source<QIWMMXTIntrinsics>,
-    0,
+    comp_func_Destination,
     comp_func_SourceIn<QIWMMXTIntrinsics>,
     comp_func_DestinationIn<QIWMMXTIntrinsics>,
     comp_func_SourceOut<QIWMMXTIntrinsics>,
     comp_func_DestinationOut<QIWMMXTIntrinsics>,
     comp_func_SourceAtop<QIWMMXTIntrinsics>,
     comp_func_DestinationAtop<QIWMMXTIntrinsics>,
-    comp_func_XOR<QIWMMXTIntrinsics>
+    comp_func_XOR<QIWMMXTIntrinsics>,
+    comp_func_Plus,
+    comp_func_Multiply,
+    comp_func_Screen,
+    comp_func_Overlay,
+    comp_func_Darken,
+    comp_func_Lighten,
+    comp_func_ColorDodge,
+    comp_func_ColorBurn,
+    comp_func_HardLight,
+    comp_func_SoftLight,
+    comp_func_Difference,
+    comp_func_Exclusion,
+    rasterop_SourceOrDestination,
+    rasterop_SourceAndDestination,
+    rasterop_SourceXorDestination,
+    rasterop_NotSourceAndNotDestination,
+    rasterop_NotSourceOrNotDestination,
+    rasterop_NotSourceXorDestination,
+    rasterop_NotSource,
+    rasterop_NotSourceAndDestination,
+    rasterop_SourceAndNotDestination
 };
 
 void qt_blend_color_argb_iwmmxt(int count, const QSpan *spans, void *userData)
diff --git a/src/gui/painting/qdrawhelper_mmx.cpp b/src/gui/painting/qdrawhelper_mmx.cpp
index d49c5a1..ba92554 100644
--- a/src/gui/painting/qdrawhelper_mmx.cpp
+++ b/src/gui/painting/qdrawhelper_mmx.cpp
@@ -77,7 +77,7 @@ CompositionFunction qt_functionForMode_MMX[numCompositionFunctions] = {
     comp_func_DestinationOver<QMMXIntrinsics>,
     comp_func_Clear<QMMXIntrinsics>,
     comp_func_Source<QMMXIntrinsics>,
-    0,
+    comp_func_Destination,
     comp_func_SourceIn<QMMXIntrinsics>,
     comp_func_DestinationIn<QMMXIntrinsics>,
     comp_func_SourceOut<QMMXIntrinsics>,
@@ -85,6 +85,27 @@ CompositionFunction qt_functionForMode_MMX[numCompositionFunctions] = {
     comp_func_SourceAtop<QMMXIntrinsics>,
     comp_func_DestinationAtop<QMMXIntrinsics>,
     comp_func_XOR<QMMXIntrinsics>,
+    comp_func_Plus,
+    comp_func_Multiply,
+    comp_func_Screen,
+    comp_func_Overlay,
+    comp_func_Darken,
+    comp_func_Lighten,
+    comp_func_ColorDodge,
+    comp_func_ColorBurn,
+    comp_func_HardLight,
+    comp_func_SoftLight,
+    comp_func_Difference,
+    comp_func_Exclusion,
+    rasterop_SourceOrDestination,
+    rasterop_SourceAndDestination,
+    rasterop_SourceXorDestination,
+    rasterop_NotSourceAndNotDestination,
+    rasterop_NotSourceOrNotDestination,
+    rasterop_NotSourceXorDestination,
+    rasterop_NotSource,
+    rasterop_NotSourceAndDestination,
+    rasterop_SourceAndNotDestination
 };
 
 void qt_blend_color_argb_mmx(int count, const QSpan *spans, void *userData)
diff --git a/src/gui/painting/qdrawhelper_mmx3dnow.cpp b/src/gui/painting/qdrawhelper_mmx3dnow.cpp
index 8bffaa7..b1e81fc 100644
--- a/src/gui/painting/qdrawhelper_mmx3dnow.cpp
+++ b/src/gui/painting/qdrawhelper_mmx3dnow.cpp
@@ -85,14 +85,35 @@ CompositionFunction qt_functionForMode_MMX3DNOW[numCompositionFunctions] = {
     comp_func_DestinationOver<QMMX3DNOWIntrinsics>,
     comp_func_Clear<QMMX3DNOWIntrinsics>,
     comp_func_Source<QMMX3DNOWIntrinsics>,
-    0,
+    comp_func_Destination,
     comp_func_SourceIn<QMMX3DNOWIntrinsics>,
     comp_func_DestinationIn<QMMX3DNOWIntrinsics>,
     comp_func_SourceOut<QMMX3DNOWIntrinsics>,
     comp_func_DestinationOut<QMMX3DNOWIntrinsics>,
     comp_func_SourceAtop<QMMX3DNOWIntrinsics>,
     comp_func_DestinationAtop<QMMX3DNOWIntrinsics>,
-    comp_func_XOR<QMMX3DNOWIntrinsics>
+    comp_func_XOR<QMMX3DNOWIntrinsics>,
+    comp_func_Plus,
+    comp_func_Multiply,
+    comp_func_Screen,
+    comp_func_Overlay,
+    comp_func_Darken,
+    comp_func_Lighten,
+    comp_func_ColorDodge,
+    comp_func_ColorBurn,
+    comp_func_HardLight,
+    comp_func_SoftLight,
+    comp_func_Difference,
+    comp_func_Exclusion,
+    rasterop_SourceOrDestination,
+    rasterop_SourceAndDestination,
+    rasterop_SourceXorDestination,
+    rasterop_NotSourceAndNotDestination,
+    rasterop_NotSourceOrNotDestination,
+    rasterop_NotSourceXorDestination,
+    rasterop_NotSource,
+    rasterop_NotSourceAndDestination,
+    rasterop_SourceAndNotDestination
 };
 
 void qt_blend_color_argb_mmx3dnow(int count, const QSpan *spans, void *userData)
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 97c78bb..eec6bf4 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -1945,6 +1945,41 @@ const uint qt_bayer_matrix[16][16] = {
     ((((argb >> 24) * alpha) >> 8) << 24) | (argb & 0x00ffffff)
 
 
+// prototypes of all the composition functions
+void QT_FASTCALL comp_func_SourceOver(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_DestinationOver(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Source(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint);
+void QT_FASTCALL comp_func_SourceIn(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_DestinationIn(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_SourceOut(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_DestinationOut(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_SourceAtop(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_DestinationAtop(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Plus(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Multiply(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Overlay(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Darken(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Lighten(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_ColorDodge(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_ColorBurn(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_HardLight(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_SoftLight(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Difference(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL comp_func_Exclusion(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_SourceOrDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_SourceAndDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_SourceXorDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_NotSourceXorDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_NotSource(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_NotSourceAndDestination(uint *dest, const uint *src, int length, uint const_alpha);
+void QT_FASTCALL rasterop_SourceAndNotDestination(uint *dest, const uint *src, int length, uint const_alpha);
+
 QT_END_NAMESPACE
 
 #endif // QDRAWHELPER_P_H
diff --git a/src/gui/painting/qdrawhelper_sse.cpp b/src/gui/painting/qdrawhelper_sse.cpp
index 58a7fdd..8b17c29 100644
--- a/src/gui/painting/qdrawhelper_sse.cpp
+++ b/src/gui/painting/qdrawhelper_sse.cpp
@@ -77,14 +77,35 @@ CompositionFunction qt_functionForMode_SSE[numCompositionFunctions] = {
     comp_func_DestinationOver<QSSEIntrinsics>,
     comp_func_Clear<QSSEIntrinsics>,
     comp_func_Source<QSSEIntrinsics>,
-    0,
+    comp_func_Destination,
     comp_func_SourceIn<QSSEIntrinsics>,
     comp_func_DestinationIn<QSSEIntrinsics>,
     comp_func_SourceOut<QSSEIntrinsics>,
     comp_func_DestinationOut<QSSEIntrinsics>,
     comp_func_SourceAtop<QSSEIntrinsics>,
     comp_func_DestinationAtop<QSSEIntrinsics>,
-    comp_func_XOR<QSSEIntrinsics>
+    comp_func_XOR<QSSEIntrinsics>,
+    comp_func_Plus,
+    comp_func_Multiply,
+    comp_func_Screen,
+    comp_func_Overlay,
+    comp_func_Darken,
+    comp_func_Lighten,
+    comp_func_ColorDodge,
+    comp_func_ColorBurn,
+    comp_func_HardLight,
+    comp_func_SoftLight,
+    comp_func_Difference,
+    comp_func_Exclusion,
+    rasterop_SourceOrDestination,
+    rasterop_SourceAndDestination,
+    rasterop_SourceXorDestination,
+    rasterop_NotSourceAndNotDestination,
+    rasterop_NotSourceOrNotDestination,
+    rasterop_NotSourceXorDestination,
+    rasterop_NotSource,
+    rasterop_NotSourceAndDestination,
+    rasterop_SourceAndNotDestination
 };
 
 void qt_blend_color_argb_sse(int count, const QSpan *spans, void *userData)
diff --git a/src/gui/painting/qdrawhelper_sse3dnow.cpp b/src/gui/painting/qdrawhelper_sse3dnow.cpp
index c58cf13..9ae0e07 100644
--- a/src/gui/painting/qdrawhelper_sse3dnow.cpp
+++ b/src/gui/painting/qdrawhelper_sse3dnow.cpp
@@ -85,14 +85,35 @@ CompositionFunction qt_functionForMode_SSE3DNOW[numCompositionFunctions] = {
     comp_func_DestinationOver<QSSE3DNOWIntrinsics>,
     comp_func_Clear<QSSE3DNOWIntrinsics>,
     comp_func_Source<QSSE3DNOWIntrinsics>,
-    0,
+    comp_func_Destination,
     comp_func_SourceIn<QSSE3DNOWIntrinsics>,
     comp_func_DestinationIn<QSSE3DNOWIntrinsics>,
     comp_func_SourceOut<QSSE3DNOWIntrinsics>,
     comp_func_DestinationOut<QSSE3DNOWIntrinsics>,
     comp_func_SourceAtop<QSSE3DNOWIntrinsics>,
     comp_func_DestinationAtop<QSSE3DNOWIntrinsics>,
-    comp_func_XOR<QSSE3DNOWIntrinsics>
+    comp_func_XOR<QSSE3DNOWIntrinsics>,
+    comp_func_Plus,
+    comp_func_Multiply,
+    comp_func_Screen,
+    comp_func_Overlay,
+    comp_func_Darken,
+    comp_func_Lighten,
+    comp_func_ColorDodge,
+    comp_func_ColorBurn,
+    comp_func_HardLight,
+    comp_func_SoftLight,
+    comp_func_Difference,
+    comp_func_Exclusion,
+    rasterop_SourceOrDestination,
+    rasterop_SourceAndDestination,
+    rasterop_SourceXorDestination,
+    rasterop_NotSourceAndNotDestination,
+    rasterop_NotSourceOrNotDestination,
+    rasterop_NotSourceXorDestination,
+    rasterop_NotSource,
+    rasterop_NotSourceAndDestination,
+    rasterop_SourceAndNotDestination
 };
 
 void qt_blend_color_argb_sse3dnow(int count, const QSpan *spans, void *userData)
-- 
cgit v0.12


From 34beae57ff8248e7666a4ce08a06eeff54e05e7a Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Mon, 26 Jul 2010 17:14:13 +0200
Subject: Implement the composition mode "Plus" with SSE2

Implement the composition function for CompositionMode_Plus with SSE2.

The macro MIX() can be replaced by a single instruction add-saturate,
which increase the speed a lot (13 times faster on the blend
benchmark).

Reviewed-by: Olivier Goffart
Reviewed-by: Andreas Kling
---
 src/gui/painting/qdrawhelper.cpp      |  8 ++---
 src/gui/painting/qdrawhelper_p.h      |  5 +++
 src/gui/painting/qdrawhelper_sse2.cpp | 66 +++++++++++++++++++++++++++++++++++
 tests/auto/qpainter/tst_qpainter.cpp  | 24 ++++++++++---
 4 files changed, 94 insertions(+), 9 deletions(-)

diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index a77c379..4ce2bee 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -1715,11 +1715,6 @@ void QT_FASTCALL comp_func_XOR(uint *dest, const uint *src, int length, uint con
     }
 }
 
-static const uint AMASK = 0xff000000;
-static const uint RMASK = 0x00ff0000;
-static const uint GMASK = 0x0000ff00;
-static const uint BMASK = 0x000000ff;
-
 struct QFullCoverage {
     inline void store(uint *dest, const uint src) const
     {
@@ -7775,6 +7770,7 @@ void qInitDrawhelperAsm()
 #ifdef QT_HAVE_MMX
     if (features & MMX) {
         functionForModeAsm = qt_functionForMode_MMX;
+
         functionForModeSolidAsm = qt_functionForModeSolid_MMX;
         qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_mmx;
 #ifdef QT_HAVE_3DNOW
@@ -7823,8 +7819,10 @@ void qInitDrawhelperAsm()
                                                   int length,
                                                   uint const_alpha);
             extern void QT_FASTCALL comp_func_solid_SourceOver_sse2(uint *destPixels, int length, uint color, uint const_alpha);
+            extern void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uint const_alpha);
 
             functionForModeAsm[0] = comp_func_SourceOver_sse2;
+            functionForModeAsm[QPainter::CompositionMode_Plus] = comp_func_Plus_sse2;
             functionForModeSolidAsm[0] = comp_func_solid_SourceOver_sse2;
 
             extern void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index eec6bf4..1a87127 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -91,6 +91,11 @@ QT_BEGIN_NAMESPACE
 #  define Q_STATIC_INLINE_FUNCTION static inline
 #endif
 
+static const uint AMASK = 0xff000000;
+static const uint RMASK = 0x00ff0000;
+static const uint GMASK = 0x0000ff00;
+static const uint BMASK = 0x000000ff;
+
 /*******************************************************************************
  * QSpan
  *
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 279f685..b4ef23e 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -164,6 +164,72 @@ void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixe
     }
 }
 
+inline int comp_func_Plus_one_pixel_const_alpha(uint d, const uint s, const uint const_alpha, const uint one_minus_const_alpha)
+{
+#define MIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
+    const int result = (MIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
+#undef MIX
+    return INTERPOLATE_PIXEL_255(result, const_alpha, d, one_minus_const_alpha);
+}
+
+inline int comp_func_Plus_one_pixel(uint d, const uint s)
+{
+#define MIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
+    const int result = (MIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
+#undef MIX
+    return result;
+}
+
+void QT_FASTCALL comp_func_Plus_sse2(uint *dst, const uint *src, int length, uint const_alpha)
+{
+    int x = 0;
+    const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;
+    const int prologLength = qMin(length, offsetToAlignOn16Bytes);
+
+    if (const_alpha == 255) {
+        // 1) Prologue: align destination on 16 bytes
+        for (; x < prologLength; ++x)
+            dst[x] = comp_func_Plus_one_pixel(dst[x], src[x]);
+
+        // 2) composition with SSE2
+        for (; x < length - 3; x += 4) {
+            const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]);
+
+            const __m128i result = _mm_adds_epu8(srcVector, dstVector);
+            _mm_store_si128((__m128i *)&dst[x], result);
+        }
+
+        // 3) Epilogue:
+        for (; x < length; ++x)
+            dst[x] = comp_func_Plus_one_pixel(dst[x], src[x]);
+    } else {
+        const int one_minus_const_alpha = 255 - const_alpha;
+        const __m128i constAlphaVector = _mm_set1_epi16(const_alpha);
+        const __m128i oneMinusConstAlpha =  _mm_set1_epi16(one_minus_const_alpha);
+
+        // 1) Prologue: align destination on 16 bytes
+        for (; x < prologLength; ++x)
+            dst[x] = comp_func_Plus_one_pixel_const_alpha(dst[x], src[x], const_alpha, one_minus_const_alpha);
+
+        const __m128i half = _mm_set1_epi16(0x80);
+        const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+        // 2) composition with SSE2
+        for (; x < length - 3; x += 4) {
+            const __m128i srcVector = _mm_loadu_si128((__m128i *)&src[x]);
+            const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]);
+
+            __m128i result = _mm_adds_epu8(srcVector, dstVector);
+            INTERPOLATE_PIXEL_255_SSE2(result, result, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half)
+            _mm_store_si128((__m128i *)&dst[x], result);
+        }
+
+        // 3) Epilogue:
+        for (; x < length; ++x)
+            dst[x] = comp_func_Plus_one_pixel_const_alpha(dst[x], src[x], const_alpha, one_minus_const_alpha);
+    }
+}
+
 void qt_memfill32_sse2(quint32 *dest, quint32 value, int count)
 {
     if (count < 7) {
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 27ee6e7..f358681 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -4176,14 +4176,18 @@ void tst_QPainter::inactivePainter()
     p.setWorldTransform(QTransform().scale(0.5, 0.5), true);
 }
 
-bool testCompositionMode(int src, int dst, int expected, QPainter::CompositionMode op)
+bool testCompositionMode(int src, int dst, int expected, QPainter::CompositionMode op, qreal opacity = 1.0)
 {
-    QImage actual(1, 1, QImage::Format_ARGB32_Premultiplied);
+    // The test image needs to be large enough to test SIMD code
+    const QSize imageSize(100, 100);
+
+    QImage actual(imageSize, QImage::Format_ARGB32_Premultiplied);
     actual.fill(QColor(dst, dst, dst).rgb());
 
     QPainter p(&actual);
     p.setCompositionMode(op);
-    p.fillRect(0, 0, 1, 1, QColor(src, src, src));
+    p.setOpacity(opacity);
+    p.fillRect(QRect(QPoint(), imageSize), QColor(src, src, src));
     p.end();
 
     if (qRed(actual.pixel(0, 0)) != expected) {
@@ -4191,7 +4195,9 @@ bool testCompositionMode(int src, int dst, int expected, QPainter::CompositionMo
                src, dst, qRed(actual.pixel(0, 0)), expected);
         return false;
     } else {
-        return true;
+        QImage refImage(imageSize, QImage::Format_ARGB32_Premultiplied);
+        refImage.fill(QColor(expected, expected, expected).rgb());
+        return actual == refImage;
     }
 }
 
@@ -4206,6 +4212,16 @@ void tst_QPainter::extendedBlendModes()
     QVERIFY(testCompositionMode(  0, 255, 255, QPainter::CompositionMode_Plus));
     QVERIFY(testCompositionMode(128, 128, 255, QPainter::CompositionMode_Plus));
 
+    QVERIFY(testCompositionMode(255, 255, 255, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(  0,   0,   0, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(127, 128, 165, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(127,   0,  37, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(  0, 127, 127, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(255,   0,  75, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(  0, 255, 255, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(128, 128, 166, QPainter::CompositionMode_Plus, 0.3));
+    QVERIFY(testCompositionMode(186, 200, 255, QPainter::CompositionMode_Plus, 0.3));
+
     QVERIFY(testCompositionMode(255, 255, 255, QPainter::CompositionMode_Multiply));
     QVERIFY(testCompositionMode(  0,   0,   0, QPainter::CompositionMode_Multiply));
     QVERIFY(testCompositionMode(127, 255, 127, QPainter::CompositionMode_Multiply));
-- 
cgit v0.12


From 47857453767a0ec2c7b75a555658dd166bd7d3d4 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Tue, 27 Jul 2010 10:23:46 +0200
Subject: QScriptValue::objectId(): do not assert if the value is not a cell

JSC::JSValue::asCell asserts if it is not a cell

Reviewed-by: Jedrzej Nowacki
---
 src/script/api/qscriptvalue_p.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h
index 853c6c8..8f286db 100644
--- a/src/script/api/qscriptvalue_p.h
+++ b/src/script/api/qscriptvalue_p.h
@@ -103,7 +103,7 @@ public:
 
     qint64 objectId()
     {
-        if ( (type == JavaScriptCore) && (engine) )
+        if ( (type == JavaScriptCore) && (engine) && jscValue.isCell() )
             return (qint64)jscValue.asCell();
         else
             return -1;
-- 
cgit v0.12


From 39097c5d652efd3eb0946e5a215d82573a46dbf9 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Tue, 27 Jul 2010 10:28:30 +0200
Subject: QScriptDeclarativeObject:  we need to save the current stack pointer.

in DeclarativeObjectDelegate::put, else we cannot get a proper
backtrace in the debugger.

Reviewed-by: Kent Hansen
---
 src/script/bridge/qscriptdeclarativeobject.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/script/bridge/qscriptdeclarativeobject.cpp b/src/script/bridge/qscriptdeclarativeobject.cpp
index 6e08b83..f330ac0 100644
--- a/src/script/bridge/qscriptdeclarativeobject.cpp
+++ b/src/script/bridge/qscriptdeclarativeobject.cpp
@@ -88,6 +88,7 @@ void DeclarativeObjectDelegate::put(QScriptObject* object, JSC::ExecState *exec,
                                     JSC::JSValue value, JSC::PutPropertySlot &slot)
 {
     QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
+    QScript::SaveFrameHelper saveFrame(engine, exec);
     QScriptDeclarativeClass::Identifier identifier = (void *)propertyName.ustring().rep();
 
     QScriptDeclarativeClassPrivate *p = QScriptDeclarativeClassPrivate::get(m_class);
@@ -144,7 +145,7 @@ JSC::JSValue DeclarativeObjectDelegate::call(JSC::ExecState *exec, JSC::JSObject
     QScriptDeclarativeClass *scriptClass = static_cast<DeclarativeObjectDelegate*>(delegate)->m_class;
     QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec);
 
-    JSC::ExecState *oldFrame = eng_p->currentFrame;
+    QScript::SaveFrameHelper saveFrame(eng_p, exec);
     eng_p->pushContext(exec, thisValue, args, callee);
     QScriptContext *ctxt = eng_p->contextForFrame(eng_p->currentFrame);
 
@@ -153,7 +154,6 @@ JSC::JSValue DeclarativeObjectDelegate::call(JSC::ExecState *exec, JSC::JSObject
         scriptClass->call(static_cast<DeclarativeObjectDelegate*>(delegate)->m_object, ctxt);
 
     eng_p->popContext();
-    eng_p->currentFrame = oldFrame;
     return (JSC::JSValue &)(result);
 }
 
-- 
cgit v0.12


From ab7c405ac2e528eb23b2c56ef02bd33c42bc3256 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Tue, 27 Jul 2010 10:31:21 +0200
Subject: QScriptEngineAgent: recompile all the function when installing a
 debugger.

Recompile all the function is necessary to ger the debug opcode that
notifies us when the position changes.

The change in CollectorHeapIterator.h is nessesary to get it work as
Debugger::recompileAllJSFunctions uses LiveObjectIterator,
LiveObjectIterator initialied m_cell to -1 and to ++(*this) in its
constructor.  But as m_cell is of type size_t (unsigned) then the
< comparison will always fail as it is an unsigned comparison.
This was already fixed upstream in r54672

Reviewed-by: Jedrzej Nowacki
---
 .../JavaScriptCore/runtime/CollectorHeapIterator.h | 10 ++---
 src/script/api/qscriptengine.cpp                   |  1 +
 src/script/api/qscriptengineagent.cpp              |  2 +
 .../qscriptengineagent/tst_qscriptengineagent.cpp  | 51 ++++++++++++++++++++++
 4 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h
index e4f2f91..4a38df9 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CollectorHeapIterator.h
@@ -97,14 +97,12 @@ namespace JSC {
 
     inline LiveObjectIterator& LiveObjectIterator::operator++()
     {
-        if (m_block < m_heap.nextBlock || m_cell < m_heap.nextCell) {
-            advance(HeapConstants::cellsPerBlock);
+        advance(HeapConstants::cellsPerBlock - 1);
+        if (m_block < m_heap.nextBlock || (m_block == m_heap.nextBlock && m_cell < m_heap.nextCell))
             return *this;
-        }
 
-        do {
-            advance(HeapConstants::cellsPerBlock);
-        } while (m_block < m_heap.usedBlocks && !m_heap.blocks[m_block]->marked.get(m_cell));
+        while (m_block < m_heap.usedBlocks && !m_heap.blocks[m_block]->marked.get(m_cell))
+            advance(HeapConstants::cellsPerBlock - 1);
         return *this;
     }
 
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 7bccffe..26673f4 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -4196,6 +4196,7 @@ void QScriptEngine::setAgent(QScriptEngineAgent *agent)
                  "cannot set agent belonging to different engine");
         return;
     }
+    QScript::APIShim shim(d);
     if (d->activeAgent)
         QScriptEngineAgentPrivate::get(d->activeAgent)->detach();
     d->activeAgent = agent;
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index 0b5828a..c3d1566 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -117,6 +117,8 @@ void QScriptEngineAgentPrivate::attach()
     if (engine->originalGlobalObject()->debugger())
         engine->originalGlobalObject()->setDebugger(0);
     JSC::Debugger::attach(engine->originalGlobalObject());
+    if (!QScriptEnginePrivate::get(engine)->isEvaluating())
+        JSC::Debugger::recompileAllJSFunctions(engine->globalData);
 }
 
 void QScriptEngineAgentPrivate::detach()
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index ed00b96..c30a636 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -97,6 +97,7 @@ private slots:
     void functionEntryAndExit_objectCall();
     void positionChange_1();
     void positionChange_2();
+    void positionChange_3();
     void exceptionThrowAndCatch();
     void eventOrder_assigment();
     void eventOrder_functionDefinition();
@@ -1625,6 +1626,56 @@ void tst_QScriptEngineAgent::positionChange_2()
     delete spy;
 }
 
+void tst_QScriptEngineAgent::positionChange_3()
+{
+    QScriptEngine eng;
+    eng.evaluate("function some_function1(a) {\n a++; \n return a + 12; } \n some_function1(42);", "function1.qs", 12);
+    QScriptValue some_function2 = eng.evaluate("(function (b) {\n b--; \n return b + 11; })", "function2.qs", 21);
+    some_function2.call(QScriptValue(), QScriptValueList() << 2 );
+
+    // Test that the agent work, even if installed after the function has been evaluated.
+    ScriptEngineSpy *spy = new ScriptEngineSpy(&eng, ~(ScriptEngineSpy::IgnorePositionChange));
+    {
+        spy->clear();
+        QScriptValue v = eng.evaluate("some_function1(15)");
+        QCOMPARE(v.toInt32(), (15+1+12));
+        QCOMPARE(spy->count(), 3);
+
+        // some_function1()
+        QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange);
+        QVERIFY(spy->at(0).scriptId != -1);
+        QCOMPARE(spy->at(0).lineNumber, 1);
+
+        // a++
+        QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
+        QVERIFY(spy->at(1).scriptId != spy->at(0).scriptId);
+        QCOMPARE(spy->at(1).lineNumber, 13);
+        // return a + 12
+        QCOMPARE(spy->at(2).type, ScriptEngineEvent::PositionChange);
+        QVERIFY(spy->at(2).scriptId == spy->at(1).scriptId);
+        QCOMPARE(spy->at(2).lineNumber, 14);
+    }
+
+    {
+        spy->clear();
+        QScriptValue v = some_function2.call(QScriptValue(), QScriptValueList() << 89 );
+        QCOMPARE(v.toInt32(), (89-1+11));
+        QCOMPARE(spy->count(), 2);
+
+        // b--
+        QCOMPARE(spy->at(0).type, ScriptEngineEvent::PositionChange);
+        QVERIFY(spy->at(0).scriptId != -1);
+        QCOMPARE(spy->at(0).lineNumber, 22);
+        // return b + 11
+        QCOMPARE(spy->at(1).type, ScriptEngineEvent::PositionChange);
+        QVERIFY(spy->at(1).scriptId == spy->at(0).scriptId);
+        QCOMPARE(spy->at(1).lineNumber, 23);
+    }
+
+    QVERIFY(!eng.hasUncaughtException());
+}
+
+
 void tst_QScriptEngineAgent::exceptionThrowAndCatch()
 {
     QScriptEngine eng;
-- 
cgit v0.12


From b932141c7d59eaee5ae72c914d7fc7078b0a3608 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Tue, 27 Jul 2010 12:52:13 +0200
Subject: Remove an useless assert from comp_func_SourceOver_sse2()

The assert can never be true since const_alpha is unsigned. That
line was triggering a warning on GCC.

Reviewed-by: Olivier Goffart
---
 src/gui/painting/qdrawhelper_sse2.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index b4ef23e..e090ae5 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -145,7 +145,6 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
 
 void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha)
 {
-    Q_ASSERT(const_alpha >= 0);
     Q_ASSERT(const_alpha < 256);
 
     const quint32 *src = (const quint32 *) srcPixels;
-- 
cgit v0.12


From 71df0ad5c02365e3baf8f6996d4b258f5da52a2f Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 27 Jul 2010 11:09:43 +0200
Subject: Fixed plugin build key for Symbian builds under Linux.

Task:     QTBUG-8962
RevBy:    Jason Barron
---
 configure | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index ffd38d0..7fc6aac 100755
--- a/configure
+++ b/configure
@@ -6929,6 +6929,8 @@ fi
 # turn off exceptions for the compilers that support it
 if [ "$PLATFORM_QWS" = "yes" ]; then
     COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
+elif [ "$XPLATFORM" != "$PLATFORM" ]; then
+    COMPILER=`echo $XPLATFORM | cut -f 2- -d-`
 else
     COMPILER=`echo $PLATFORM | cut -f 2- -d-`
 fi
@@ -7407,9 +7409,17 @@ rm -f .options
 BUILD_OPTIONS="$BUILD_CONFIG $BUILD_OPTIONS"
 # extract the operating system from the XPLATFORM
 TARGET_OPERATING_SYSTEM=`echo $XPLATFORM | cut -f 2- -d/ | cut -f -1 -d-`
+case "$XPLATFORM" in
+symbian*)
+    QT_BUILD_KEY_SYSTEM_PART="Symbian"
+    ;;
+*)
+    QT_BUILD_KEY_SYSTEM_PART="$CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER"
+    ;;
+esac
 
 # when cross-compiling, don't include build-host information (build key is target specific)
-QT_BUILD_KEY="$CFG_USER_BUILD_KEY $CFG_ARCH $TARGET_OPERATING_SYSTEM $COMPILER $BUILD_OPTIONS"
+QT_BUILD_KEY="$CFG_USER_BUILD_KEY $QT_BUILD_KEY_SYSTEM_PART $BUILD_OPTIONS"
 if [ -n "$QT_NAMESPACE" ]; then
     QT_BUILD_KEY="$QT_BUILD_KEY $QT_NAMESPACE"
 fi
-- 
cgit v0.12


From 4cd413970b18125885ce60d82a4ad06bce6395a5 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Tue, 27 Jul 2010 13:46:00 +0200
Subject: Make it possible again to build Qt without webkit

Remove the QT_CONFIG line from the qt_webkit_version.pri file in Qt,
because it is only meaningful for separate builds of WebKit.

(Real fix is in the import script that takes care of always
removing that line)

Task-number: QTBUG-12456
Discussed-with: axis
---
 mkspecs/modules/qt_webkit_version.pri | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mkspecs/modules/qt_webkit_version.pri b/mkspecs/modules/qt_webkit_version.pri
index d8cf06c..ffd192c 100644
--- a/mkspecs/modules/qt_webkit_version.pri
+++ b/mkspecs/modules/qt_webkit_version.pri
@@ -2,4 +2,3 @@ QT_WEBKIT_VERSION = 4.7.0
 QT_WEBKIT_MAJOR_VERSION = 4
 QT_WEBKIT_MINOR_VERSION = 7
 QT_WEBKIT_PATCH_VERSION = 0
-QT_CONFIG *= webkit
-- 
cgit v0.12


From d82d8d1fc90b4237e483fea9813ec084633f6f2d Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 27 Jul 2010 14:37:28 +0200
Subject: Fixed gcce linker error when linking against s60main built by armcc.

Task:     QTBUG-10680
RevBy:    Trust me
---
 src/s60main/s60main.pro | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
index 9ea3080..a273897 100644
--- a/src/s60main/s60main.pro
+++ b/src/s60main/s60main.pro
@@ -29,6 +29,7 @@ symbian {
     # Having MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA will cause s60main.lib be unlinkable
     # against GCCE apps, so remove it
     MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
+    linux-armcc:QMAKE_CXXFLAGS *= --export_all_vtbl
 } else {
     error("$$_FILE_ is intended only for Symbian!")
 }
-- 
cgit v0.12


From 7f9205aa572c60085c9e9f38749bb48e707fea95 Mon Sep 17 00:00:00 2001
From: Kevin Wright <kevin.wright@nokia.com>
Date: Tue, 27 Jul 2010 14:57:47 +0200
Subject: Adding missing image

---
 examples/touch/pinchzoom/images/cheese.jpg | Bin 0 -> 3029 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 examples/touch/pinchzoom/images/cheese.jpg

diff --git a/examples/touch/pinchzoom/images/cheese.jpg b/examples/touch/pinchzoom/images/cheese.jpg
new file mode 100644
index 0000000..dea5795
Binary files /dev/null and b/examples/touch/pinchzoom/images/cheese.jpg differ
-- 
cgit v0.12


From a62045401cc8f55c3175a2b33e8f43b356604f37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= <trond.kjernasen@nokia.com>
Date: Tue, 27 Jul 2010 15:16:15 +0200
Subject: Don't run the QGL test on systems that does not have GL support.

On a Mac that has no screens connected, it is possible to create
offscreen GL contexts, but not normal QGLWidgets. There are some
assumptions both in the tests and in the QGL module that this if you
can create one of them, you can create both.
The test now check if it can create a valid QGLWidget, if it can't
it will skip running all the QGL tests.

Task-number: QTBUG-12138
Reviewed-by: Prasanth
---
 tests/auto/qgl/tst_qgl.cpp | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 8ee494f..7fe461c 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -2252,5 +2252,30 @@ void tst_QGL::textureCleanup()
 #endif
 }
 
-QTEST_MAIN(tst_QGL)
+class tst_QGLDummy : public QObject
+{
+Q_OBJECT
+
+public:
+    tst_QGLDummy() {}
+
+private slots:
+    void qglSkipTests() {
+	QSKIP("QGL not supported on this system.", SkipAll);
+    }
+};
+
+int main(int argc, char **argv)
+{
+    QApplication app(argc, argv);
+    QTEST_DISABLE_KEYPAD_NAVIGATION \
+    QGLWidget glWidget;
+    if (!glWidget.isValid()) {
+	tst_QGLDummy tc;
+	return QTest::qExec(&tc, argc, argv);
+    }
+    tst_QGL tc;
+    return QTest::qExec(&tc, argc, argv);
+}
+
 #include "tst_qgl.moc"
-- 
cgit v0.12


From 61908af46700c7c1f2e59ce98daeadc2529fef1b Mon Sep 17 00:00:00 2001
From: Jason Barron <jason.barron@nokia.com>
Date: Tue, 27 Jul 2010 16:27:21 +0200
Subject: Fix signal emission of QDesktopWidget on Symbian.

QDesktopWidget on Symbian was not properly emitting the resized() and
the workAreaResized() signals. Qt was properly translating the system
event and sending the QResizeEvent to the widget, but the signal
emission is determined solely based on changes in the QVectors of
QRects outlining the screen dimensions. On Symbian, these vectors were
never being set and as a result the signals were never omitted.

The fix is to set the rects correctly in the init() function which is
called by the resizeEvent() handler. Also modify the accessor functions
to return the rectangles stored in the vector instead of querying for
them each time.

Task-number: QTBUG-11433
Reviewed-by: axis
Autotest: PASSES
---
 src/gui/kernel/qdesktopwidget_s60.cpp | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index e4d0bf3..a07f4a7 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -103,6 +103,10 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that)
 
     rects->resize(QDesktopWidgetPrivate::screenCount);
     workrects->resize(QDesktopWidgetPrivate::screenCount);
+
+    (*rects)[0].setRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
+    QRect wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+    (*workrects)[0].setRect(wr.x(), wr.y(), wr.width(), wr.height());
 }
 
 void QDesktopWidgetPrivate::cleanup()
@@ -146,17 +150,23 @@ QWidget *QDesktopWidget::screen(int /* screen */)
     return this;
 }
 
-const QRect QDesktopWidget::availableGeometry(int /* screen */) const
+const QRect QDesktopWidget::availableGeometry(int screen) const
 {
-    TRect clientRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
-    return qt_TRect2QRect(clientRect);
+    Q_D(const QDesktopWidget);
+    if (screen < 0 || screen >= d->screenCount)
+        screen = d->primaryScreen;
+
+    return d->workrects->at(screen);
 }
 
-const QRect QDesktopWidget::screenGeometry(int /* screen */) const
+const QRect QDesktopWidget::screenGeometry(int screen) const
 {
     Q_D(const QDesktopWidget);
-    return QRect(0, 0, S60->screenWidthInPixels, S60->screenHeightInPixels);
-    }
+    if (screen < 0 || screen >= d->screenCount)
+        screen = d->primaryScreen;
+
+    return d->rects->at(screen);
+}
 
 int QDesktopWidget::screenNumber(const QWidget * /* widget */) const
 {
-- 
cgit v0.12


From 34691d27d03abc0c8f940b4a0a3cda4cd308642e Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 26 Jul 2010 12:48:44 +1000
Subject: Cherry pick fix for MOBILITY-1194 from Qt Mobility.

2f582953ecfc53f217317f58e4fc75b5b51a1126
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 74 ++++++++++------------
 src/plugins/bearer/symbian/symbianengine.cpp       | 66 +++++++++++++++++--
 src/plugins/bearer/symbian/symbianengine.h         |  1 +
 .../qnetworksession/test/tst_qnetworksession.cpp   | 11 +++-
 tests/manual/bearerex/bearerex.cpp                 |  3 +-
 tests/manual/bearerex/bearerex.pro                 |  2 +-
 6 files changed, 104 insertions(+), 53 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index d6b4975..f7a52c2 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -146,12 +146,14 @@ void QNetworkSessionPrivateImpl::configurationRemoved(QNetworkConfigurationPriva
     }
 }
 
+// Function sets the state of the session to match the state
+// of the underlying interface (the configuration this session is based on)
 void QNetworkSessionPrivateImpl::syncStateWithInterface()
 {
     if (!publicConfig.isValid())
         return;
 
-    if (iFirstSync && publicConfig.isValid()) {
+    if (iFirstSync) {
         QObject::connect(engine, SIGNAL(configurationStateChanged(TUint32, TUint32, QNetworkSession::State)),
                          this, SLOT(configurationStateChanged(TUint32, TUint32, QNetworkSession::State)));
         // Listen to configuration removals, so that in case the configuration
@@ -162,46 +164,25 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
     // Start listening IAP state changes from QNetworkConfigurationManagerPrivate
     iHandleStateNotificationsFromManager = true;    
 
-    // Check open connections to see if there is already
-    // an open connection to selected IAP or SNAP
-    TUint count;
-    TRequestStatus status;
-    iConnectionMonitor.GetConnectionCount(count, status);
-    User::WaitForRequest(status);
-    if (status.Int() != KErrNone) {
-        return;
-    }
-
-    TUint numSubConnections;
-    TUint connectionId;
-    for (TUint i = 1; i <= count; i++) {
-        TInt ret = iConnectionMonitor.GetConnectionInfo(i, connectionId, numSubConnections);
-        if (ret == KErrNone) {
-            TUint apId;
-            iConnectionMonitor.GetUintAttribute(connectionId, 0, KIAPId, apId, status);
-            User::WaitForRequest(status);
-            if (status.Int() == KErrNone) {
-                TInt connectionStatus;
-                iConnectionMonitor.GetIntAttribute(connectionId, 0, KConnectionStatus, connectionStatus, status);
-                User::WaitForRequest(status);
-                if (connectionStatus == KLinkLayerOpen) {
-                    if (state != QNetworkSession::Closing) {
-                        if (newState(QNetworkSession::Connected, apId)) {
-                            return;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    if (state != QNetworkSession::Connected) {
-        if ((publicConfig.state() & QNetworkConfiguration::Discovered) ==
-            QNetworkConfiguration::Discovered) {
-            newState(QNetworkSession::Disconnected);
-        } else {
-            newState(QNetworkSession::NotAvailable);
-        }
+    // Check what is the state of the configuration this session is based on
+    // and set the session in appropriate state.
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+    qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+             << "syncStateWithInterface() state of publicConfig is: " << publicConfig.state();
+#endif
+    switch (publicConfig.state()) {
+    case QNetworkConfiguration::Active:
+        newState(QNetworkSession::Connected);
+        break;
+    case QNetworkConfiguration::Discovered:
+        newState(QNetworkSession::Disconnected);
+        break;
+    case QNetworkConfiguration::Defined:
+        newState(QNetworkSession::NotAvailable);
+        break;
+    case QNetworkConfiguration::Undefined:
+    default:
+        newState(QNetworkSession::Invalid);
     }
 }
 
@@ -253,7 +234,8 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
              << "currentInterface() requested, state: " << state
              << "publicConfig validity: " << publicConfig.isValid();
     if (activeInterface.isValid())
-        qDebug() << "interface is: " << activeInterface.humanReadableName();
+        qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+                 << "interface is: " << activeInterface.humanReadableName();
 #endif
 
     if (!publicConfig.isValid() || state != QNetworkSession::Connected) {
@@ -906,6 +888,14 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
     if (iapId == 0) {
         _LIT(KSetting, "IAP\\Id");
         iConnection.GetIntSetting(KSetting, iapId);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+        // Check if this is an Easy WLAN configuration. On Symbian^3 RConnection may report
+        // the used configuration as 'EasyWLAN' IAP ID if someone has just opened the configuration
+        // from WLAN Scan dialog, _and_ that connection is still up. We need to find the
+        // real matching configuration. Function alters the Easy WLAN ID to real IAP ID (only if
+        // easy WLAN):
+        engine->easyWlanTrueIapId(iapId);
+#endif
     }
 
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index d1160f7..99dc544 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -270,7 +270,7 @@ void SymbianEngine::updateConfigurationsL()
     QList<QString> knownConfigs = accessPointConfigurations.keys();
     QList<QString> knownSnapConfigs = snapConfigurations.keys();
 
-#ifdef SNAP_FUNCTIONALITY_AVAILABLE    
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
     // S60 version is >= Series60 3rd Edition Feature Pack 2
     TInt error = KErrNone;
     
@@ -311,7 +311,17 @@ void SymbianEngine::updateConfigurationsL()
     iCmManager.AllDestinationsL(destinations);
     for(int i = 0; i < destinations.Count(); i++) {
         RCmDestination destination;
-        destination = iCmManager.DestinationL(destinations[i]);
+
+        // Some destinatsions require ReadDeviceData -capability (MMS/WAP)
+        // The below function will leave in these cases. Don't. Proceed to
+        // next destination (if any).
+        TRAPD(error, destination = iCmManager.DestinationL(destinations[i]));
+        if (error == KErrPermissionDenied) {
+            continue;
+        } else {
+            User::LeaveIfError(error);
+        }
+
         CleanupClosePushL(destination);
         QString ident = QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX +
                         QString::number(qHash(destination.Id()));
@@ -319,12 +329,12 @@ void SymbianEngine::updateConfigurationsL()
             knownSnapConfigs.removeOne(ident);
         } else {
             SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
-    
+
             HBufC *pName = destination.NameLC();
             QT_TRYCATCH_LEAVING(cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()));
             CleanupStack::PopAndDestroy(pName);
             pName = NULL;
-    
+
             cpPriv->isValid = true;
             cpPriv->id = ident;
             cpPriv->numericId = destination.Id();
@@ -395,7 +405,6 @@ void SymbianEngine::updateConfigurationsL()
         CleanupStack::PopAndDestroy(&destination);
     }
     CleanupStack::PopAndDestroy(&destinations);
-    
 #else
     // S60 version is < Series60 3rd Edition Feature Pack 2
     CCommsDbTableView* pDbTView = ipCommsDB->OpenTableLC(TPtrC(IAP));
@@ -425,8 +434,9 @@ void SymbianEngine::updateConfigurationsL()
     }
     CleanupStack::PopAndDestroy(pDbTView);
 #endif
+
     QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
-    
+
     foreach (const QString &oldIface, knownConfigs) {
         //remove non existing IAP
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(oldIface);
@@ -692,6 +702,11 @@ void SymbianEngine::updateActiveAccessPoints()
             if (!ptr) {
                 // If IAP was not found, check if the update was about EasyWLAN
                 ptr = configurationFromEasyWlan(apId, connectionId);
+                // Change the ident correspondingly
+                if (ptr) {
+                    ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+                            QString::number(qHash(toSymbianConfig(ptr)->numericIdentifier()));
+                }
             }
 #endif
             if (ptr) {
@@ -1233,6 +1248,45 @@ QNetworkConfigurationPrivatePointer SymbianEngine::configurationFromEasyWlan(TUi
     }
     return QNetworkConfigurationPrivatePointer();
 }
+
+bool SymbianEngine::easyWlanTrueIapId(TUint32& trueIapId)
+{
+    // Check if this is easy wlan id in the first place
+    if (trueIapId != iCmManager.EasyWlanIdL())
+        return false;
+
+    // Loop through all connections that connection monitor is aware
+    // and check for IAPs based on easy WLAN
+    TRequestStatus status;
+    TUint connectionCount;
+    iConnectionMonitor.GetConnectionCount(connectionCount, status);
+    User::WaitForRequest(status);
+    TUint connectionId;
+    TUint subConnectionCount;
+    TUint apId;
+    if (status.Int() == KErrNone) {
+        for (TUint i = 1; i <= connectionCount; i++) {
+            iConnectionMonitor.GetConnectionInfo(i, connectionId, subConnectionCount);
+            iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount,
+                                                KIAPId, apId, status);
+            User::WaitForRequest(status);
+            if (apId == trueIapId) {
+                QNetworkConfigurationPrivatePointer ptr =
+                    configurationFromEasyWlan(apId, connectionId);
+                if (ptr) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+                    qDebug() << "QNCM easyWlanTrueIapId(), found true IAP ID: "
+                             << toSymbianConfig(ptr)->numericIdentifier();
+#endif
+                    trueIapId = toSymbianConfig(ptr)->numericIdentifier();
+                    return true;
+                }
+            }
+        }
+    }
+    return false;
+}
+
 #endif
 
 // Sessions may use this function to report configuration state changes,
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index cfddc29..ecd858d 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -208,6 +208,7 @@ private:
                                    QNetworkSession::State newState);
 #ifdef OCC_FUNCTIONALITY_AVAILABLE
     QNetworkConfigurationPrivatePointer configurationFromEasyWlan(TUint32 apId, TUint connectionId);
+    bool easyWlanTrueIapId(TUint32& trueIapId);
 #endif
 
 private: // Data
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index 24f6e52..3388cd5 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -88,7 +88,7 @@ private slots:
     void sessionStop();
 
     void roamingErrorCodes();
-    
+
     void sessionProperties_data();
     void sessionProperties();
 
@@ -918,6 +918,10 @@ void tst_QNetworkSession::sessionOpenCloseStop()
         session.waitForOpened();
 #endif        
 
+        // Wait until the configuration is uptodate as well, it may be signaled 'connected'
+        // bit later than the session
+        QTRY_VERIFY(configuration.state() == QNetworkConfiguration::Active);
+
         if (session.isOpen())
             QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty());
         if (!errorSpy.isEmpty()) {
@@ -1131,8 +1135,9 @@ void tst_QNetworkSession::sessionOpenCloseStop()
                         roamedSuccessfully = true;
                     } else if (state == QNetworkSession::Closing) {
                         QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
-                        QTRY_VERIFY(session.state() == QNetworkSession::Connected);
-                        roamedSuccessfully = true;
+                        QTRY_VERIFY(session.state() == QNetworkSession::Connected ||
+                                    session.state() == QNetworkSession::Disconnected);
+                        roamedSuccessfully = false;
                     } else if (state == QNetworkSession::Disconnected) {
                         QTRY_VERIFY(!errorSpy.isEmpty());
                         QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index 6f280db..2f90837 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -433,6 +433,7 @@ void SessionTab::opened()
             iapLineEdit->setText(config.name()+" ("+config.identifier()+")");
         }
     }
+    newState(m_NetworkSession->state()); // Update the "(open)"
 
     if (m_NetworkSession->configuration().type() == QNetworkConfiguration::UserChoice) {
         QVariant identifier = m_NetworkSession->sessionProperty("UserChoiceConfiguration");
@@ -523,7 +524,7 @@ void SessionTab::newState(QNetworkSession::State state)
 
     QString active;
     if (m_NetworkSession->isOpen()) {
-        active = " (O)";
+        active = " (open)";
     }
     stateLineEdit->setText(stateString(state)+active);
 }
diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro
index df39c85..397261d 100644
--- a/tests/manual/bearerex/bearerex.pro
+++ b/tests/manual/bearerex/bearerex.pro
@@ -25,4 +25,4 @@ SOURCES += bearerex.cpp \
            xqlistwidget.cpp \
     datatransferer.cpp
 
-symbian:TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
+symbian:TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData WriteDeviceData ReadDeviceData
-- 
cgit v0.12


From ce7ccc93275043a41648a8887525be92420c3acb Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 28 Jul 2010 11:55:28 +1000
Subject: Fix detection of OCC functionality.

---
 src/plugins/bearer/symbian/symbian_3/symbian_3.pro | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
index 25f18f2..ff0f11c 100644
--- a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
+++ b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
@@ -6,7 +6,7 @@ symbian {
         DEFINES += SNAP_FUNCTIONALITY_AVAILABLE
         LIBS += -lcmmanager
 
-        exists($$MW_LAYER_PUBLIC_EXPORT_PATH(extendedconnpref.h)) {
+        exists($$prependEpocroot($$MW_LAYER_PUBLIC_EXPORT_PATH(extendedconnpref.h))) {
             DEFINES += OCC_FUNCTIONALITY_AVAILABLE
             LIBS += -lextendedconnpref
         }
-- 
cgit v0.12


From 6ca74af0121f6038a20bca363deaf5c3e2d760f9 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 28 Jul 2010 10:40:05 +1000
Subject: Fix compilation error on Symbian^4.

The root cause is failing compilation test for SNAP when it shouldn't,
but it should still not result in compilation errors in code.
---
 src/plugins/bearer/symbian/qnetworksession_impl.cpp | 12 ++++++------
 src/plugins/bearer/symbian/qnetworksession_impl.h   |  2 +-
 src/plugins/bearer/symbian/symbianengine.cpp        | 10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index f7a52c2..225161d 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -364,7 +364,7 @@ void QNetworkSessionPrivateImpl::open()
             SymbianNetworkConfigurationPrivate *symbianConfig =
                 toSymbianConfig(privateConfiguration(publicConfig));
 
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
             // With One Click Connectivity (Symbian^3 onwards) it is possible
             // to connect silently, without any popups.
             TConnPrefList pref;
@@ -394,7 +394,7 @@ void QNetworkSessionPrivateImpl::open()
         SymbianNetworkConfigurationPrivate *symbianConfig =
             toSymbianConfig(privateConfiguration(publicConfig));
 
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
         // On Symbian^3 if service network is not reachable, it triggers a UI (aka EasyWLAN) where
         // user can create new IAPs. To detect this, we need to store the number of IAPs
         // there was before connection was started.
@@ -888,7 +888,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
     if (iapId == 0) {
         _LIT(KSetting, "IAP\\Id");
         iConnection.GetIntSetting(KSetting, iapId);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
         // Check if this is an Easy WLAN configuration. On Symbian^3 RConnection may report
         // the used configuration as 'EasyWLAN' IAP ID if someone has just opened the configuration
         // from WLAN Scan dialog, _and_ that connection is still up. We need to find the
@@ -934,7 +934,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
                 }
             }
         } else {
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
             // On Symbian^3 (only, not earlier or Symbian^4) if the SNAP was not reachable, it triggers
             // user choice type of activity (EasyWLAN). As a result, a new IAP may be created, and
             // hence if was not found yet. Therefore update configurations and see if there is something new.
@@ -972,7 +972,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
             qDebug() << "QNS this : " << QString::number((uint)this) << " - "
                     << "configuration was not found, returning invalid.";
 #endif
-#endif // OCC_FUNCTIONALITY_AVAILABLE
+#endif
             // Given IAP Id was not found from known IAPs array
             return QNetworkConfiguration();
         }
@@ -1305,7 +1305,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
                     }
                 }
             }
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
             // If the retVal is not true here, it means that the status update may apply to an IAP outside of
             // SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan.
             if (retVal == false && activeConfig.isValid() &&
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index 0754ace..73e6cab 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -64,7 +64,7 @@
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
     #include <comms-infras/cs_mobility_apiext.h>
 #endif
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
     #include <extendedconnpref.h>
 #endif
 
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 99dc544..664cb6e 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -698,7 +698,7 @@ void SymbianEngine::updateActiveAccessPoints()
             User::WaitForRequest(status);
             QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
             if (!ptr) {
                 // If IAP was not found, check if the update was about EasyWLAN
                 ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1059,7 +1059,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
 
             QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
             if (!ptr) {
                 // Check if status was regarding EasyWLAN
                 ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1084,7 +1084,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             User::WaitForRequest(status);
             QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
             if (!ptr) {
                 // Check for EasyWLAN
                 ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1192,7 +1192,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
         User::WaitForRequest(status);
         QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
         if (!ptr) {
             // If IAP was not found, check if the update was about EasyWLAN
             ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1213,7 +1213,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
     }
 }
 
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
 // Tries to derive configuration from EasyWLAN.
 // First checks if the interface brought up was EasyWLAN, then derives the real SSID,
 // and looks up configuration based on that one.
-- 
cgit v0.12


From a259bd2841b3ce7e34bb18990332bd497f97cdd0 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 28 Jul 2010 12:12:06 +1000
Subject: Cherry pick fix for MOBILITY-1194 from Qt Mobility.

f84bb604d745c512db8d53410c5fec835309f85e
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 22 +++++++
 src/plugins/bearer/symbian/qnetworksession_impl.h  |  3 +-
 src/plugins/bearer/symbian/symbianengine.cpp       | 67 ++++++++++++++--------
 3 files changed, 68 insertions(+), 24 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 225161d..1de4c0f 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -146,6 +146,23 @@ void QNetworkSessionPrivateImpl::configurationRemoved(QNetworkConfigurationPriva
     }
 }
 
+void QNetworkSessionPrivateImpl::configurationAdded(QNetworkConfigurationPrivatePointer config)
+{
+    Q_UNUSED(config);
+    // If session is based on service network, some other app may create new access points
+    // to the SNAP --> synchronize session's state with that of interface's.
+    if (!publicConfig.isValid() || publicConfig.type() != QNetworkConfiguration::ServiceNetwork)
+        return;
+
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+        qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+                 << "configurationAdded IAP: "
+                 << toSymbianConfig(privateConfiguration(config))->numericIdentifier();
+#endif
+
+        syncStateWithInterface();
+}
+
 // Function sets the state of the session to match the state
 // of the underlying interface (the configuration this session is based on)
 void QNetworkSessionPrivateImpl::syncStateWithInterface()
@@ -160,6 +177,11 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
         // this session is based on is removed, session knows to enter Invalid -state.
         QObject::connect(engine, SIGNAL(configurationRemoved(QNetworkConfigurationPrivatePointer)),
                          this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
+        // Connect to configuration additions, so that in case a configuration is added
+        // in a SNAP this session is based on, the session knows to synch its state with its
+        // interface.
+        QObject::connect(engine, SIGNAL(configurationAdded(QNetworkConfigurationPrivatePointer)),
+                         this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)));
     }
     // Start listening IAP state changes from QNetworkConfigurationManagerPrivate
     iHandleStateNotificationsFromManager = true;    
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index 73e6cab..aac9321 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -134,7 +134,8 @@ protected: // From CActive
 private Q_SLOTS:
     void configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState);
     void configurationRemoved(QNetworkConfigurationPrivatePointer config);
-    
+    void configurationAdded(QNetworkConfigurationPrivatePointer config);
+
 private:
     TUint iapClientCount(TUint aIAPId) const;
     quint64 transferredData(TUint dataType) const;
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 664cb6e..f87ea3c 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -291,14 +291,17 @@ void SymbianEngine::updateConfigurationsL()
             if (error == KErrNone) {
                 QNetworkConfigurationPrivatePointer ptr(cpPriv);
                 accessPointConfigurations.insert(ptr->id, ptr);
-
-                mutex.unlock();
-                // Emit configuration added. Connected slots may throw execptions
-                // which propagate here --> must be converted to leaves (standard
-                // std::exception would cause any TRAP trapping this function to terminate
-                // program).
-                QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
-                mutex.lock();
+                if (!iFirstUpdate) {
+                    // Emit configuration added. Connected slots may throw execptions
+                    // which propagate here --> must be converted to leaves (standard
+                    // std::exception would cause any TRAP trapping this function to terminate
+                    // program).
+                    QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+                    updateStatesToSnaps();
+                    mutex.unlock();
+                    QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+                    mutex.lock();
+                }
             }
         }
         CleanupStack::PopAndDestroy(&connectionMethod);
@@ -346,10 +349,13 @@ void SymbianEngine::updateConfigurationsL()
 
             QNetworkConfigurationPrivatePointer ptr(cpPriv);
             snapConfigurations.insert(ident, ptr);
-
-            mutex.unlock();
-            QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
-            mutex.lock();
+            if (!iFirstUpdate) {
+                QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+                updateStatesToSnaps();
+                mutex.unlock();
+                QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+                mutex.lock();
+            }
         }
 
         // Loop through all connection methods in this SNAP
@@ -362,19 +368,23 @@ void SymbianEngine::updateConfigurationsL()
             QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
             // Check that IAP can be found from accessPointConfigurations list
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
-            if (ptr) {
-                knownConfigs.removeOne(iface);
-            } else {
+            if (!ptr) {
                 SymbianNetworkConfigurationPrivate *cpPriv = NULL;
                 TRAP(error, cpPriv = configFromConnectionMethodL(connectionMethod));
                 if (error == KErrNone) {
                     ptr = QNetworkConfigurationPrivatePointer(cpPriv);
                     accessPointConfigurations.insert(ptr->id, ptr);
 
-                    mutex.unlock();
-                    QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
-                    mutex.lock();
+                    if (!iFirstUpdate) {
+                        QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+                        updateStatesToSnaps();
+                        mutex.unlock();
+                        QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+                        mutex.lock();
+                    }
                 }
+            } else {
+                knownConfigs.removeOne(iface);
             }
 
             if (ptr) {
@@ -397,6 +407,9 @@ void SymbianEngine::updateConfigurationsL()
             privSNAP->roamingSupported = privSNAP->serviceNetworkMembers.count() > 1;
 
             snapConfigLocker.unlock();
+
+            updateStatesToSnaps();
+
             mutex.unlock();
             QT_TRYCATCH_LEAVING(emit configurationChanged(privSNAP));
             mutex.lock();
@@ -422,10 +435,13 @@ void SymbianEngine::updateConfigurationsL()
             if (readNetworkConfigurationValuesFromCommsDb(apId, cpPriv)) {
                 QNetworkConfigurationPrivatePointer ptr(cpPriv);
                 accessPointConfigurations.insert(ident, ptr);
-
-                mutex.unlock();
-                QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
-                mutex.lock();
+                if (!iFirstUpdate) {
+                    QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+                    updateStatesToSnaps();
+                    mutex.unlock();
+                    QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+                    mutex.lock();
+                }
             } else {
                 delete cpPriv;
             }
@@ -478,6 +494,10 @@ void SymbianEngine::updateConfigurationsL()
     stopCommsDatabaseNotifications();
     TRAP_IGNORE(defaultConfig = defaultConfigurationL());
     startCommsDatabaseNotifications();
+
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+    updateStatesToSnaps();
+#endif
 }
 
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
@@ -711,7 +731,8 @@ void SymbianEngine::updateActiveAccessPoints()
 #endif
             if (ptr) {
                 iConnectionMonitor.GetIntAttribute(connectionId, subConnectionCount, KConnectionStatus, connectionStatus, status);
-                User::WaitForRequest(status);          
+                User::WaitForRequest(status);
+
                 if (connectionStatus == KLinkLayerOpen) {
                     online = true;
                     inactiveConfigs.removeOne(ident);
-- 
cgit v0.12


From 71ef5269c03d6230e6ebbf6f3c0b6f8836739ec3 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 28 Jul 2010 14:12:30 +1000
Subject: Cherry pick fix for QTMOBILITY-408 from Qt Mobility.

7f9a8ebcfe86d3df428707888c3ab5fcd10226a4
---
 src/plugins/bearer/icd/qnetworksession_impl.cpp | 59 +++++++++++--------------
 src/plugins/bearer/icd/qnetworksession_impl.h   |  8 +++-
 2 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index aeac620..e8e5183 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -235,7 +235,7 @@ void QNetworkSessionPrivateImpl::updateIdentifier(const QString &newId)
 }
 
 
-quint64 QNetworkSessionPrivateImpl::getStatistics(bool sent) const
+QNetworkSessionPrivateImpl::Statistics QNetworkSessionPrivateImpl::getStatistics() const
 {
     /* This could be also implemented by using the Maemo::Icd::statistics()
      * that gets the statistics data for a specific IAP. Change if
@@ -243,56 +243,51 @@ quint64 QNetworkSessionPrivateImpl::getStatistics(bool sent) const
      */
     Maemo::Icd icd;
     QList<Maemo::IcdStatisticsResult> stats_results;
-    quint64 counter_rx = 0, counter_tx = 0;
+    Statistics stats = { 0, 0, 0};
 
-    if (!icd.statistics(stats_results)) {
-	return 0;
-    }
+    if (!icd.statistics(stats_results))
+        return stats;
 
     foreach (const Maemo::IcdStatisticsResult &res, stats_results) {
-	if (res.params.network_attrs & ICD_NW_ATTR_IAPNAME) {
-	    /* network_id is the IAP UUID */
-	    if (QString(res.params.network_id.data()) == activeConfig.identifier()) {
-		counter_tx = res.bytes_sent;
-		counter_rx = res.bytes_received;
-	    }
-	} else {
-	    /* We probably will never get to this branch */
-        IcdNetworkConfigurationPrivate *icdConfig =
-            toIcdConfig(privateConfiguration(activeConfig));
+        if (res.params.network_attrs & ICD_NW_ATTR_IAPNAME) {
+            /* network_id is the IAP UUID */
+            if (QString(res.params.network_id.data()) == activeConfig.identifier()) {
+                stats.txData = res.bytes_sent;
+                stats.rxData = res.bytes_received;
+                stats.activeTime = res.time_active;
+            }
+        } else {
+            /* We probably will never get to this branch */
+            IcdNetworkConfigurationPrivate *icdConfig =
+                toIcdConfig(privateConfiguration(activeConfig));
 
-        icdConfig->mutex.lock();
-        if (res.params.network_id == icdConfig->network_id) {
-            counter_tx = res.bytes_sent;
-            counter_rx = res.bytes_received;
-	    }
-        icdConfig->mutex.unlock();
-	}
+            icdConfig->mutex.lock();
+            if (res.params.network_id == icdConfig->network_id) {
+                stats.txData = res.bytes_sent;
+                stats.rxData = res.bytes_received;
+                stats.activeTime = res.time_active;
+            }
+            icdConfig->mutex.unlock();
+        }
     }
 
-    if (sent)
-	return counter_tx;
-    else
-	return counter_rx;
+    return stats;
 }
 
 
 quint64 QNetworkSessionPrivateImpl::bytesWritten() const
 {
-    return getStatistics(true);
+    return getStatistics().txData;
 }
 
 quint64 QNetworkSessionPrivateImpl::bytesReceived() const
 {
-    return getStatistics(false);
+    return getStatistics().rxData;
 }
 
 quint64 QNetworkSessionPrivateImpl::activeTime() const
 {
-    if (startTime.isNull()) {
-        return 0;
-    }
-    return startTime.secsTo(QDateTime::currentDateTime());
+    return getStatistics().activeTime;
 }
 
 
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.h b/src/plugins/bearer/icd/qnetworksession_impl.h
index c43b1f0..390e508 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.h
+++ b/src/plugins/bearer/icd/qnetworksession_impl.h
@@ -170,6 +170,12 @@ private:
     QNetworkConfigurationManager manager;
     QIcdEngine *engine;
 
+    struct Statistics {
+        quint64 txData;
+        quint64 rxData;
+        quint64 activeTime;
+    };
+
     // The config set on QNetworkSession.
     QNetworkConfiguration config;
 
@@ -186,7 +192,7 @@ private:
     friend class IcdListener;
     void updateState(QNetworkSession::State);
     void updateIdentifier(const QString &newId);
-    quint64 getStatistics(bool sent) const;
+    Statistics getStatistics() const;
     void cleanupSession(void);
 
     void updateProxyInformation();
-- 
cgit v0.12


From 9814b2225b70d6b2f758e9dbe98f8e1662049b37 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 28 Jul 2010 14:23:16 +1000
Subject: Cherry pick fix for MOBILITY-1234 from Qt Mobility.

e51af0d74f8bb6ca6100d2338671d2d053bfed01
---
 src/plugins/bearer/symbian/symbianengine.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index f87ea3c..4bd6d2f 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -1197,6 +1197,8 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
                 QT_TRYCATCH_LEAVING(changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined));
             }
         }
+        // Something has in IAPs, update states to SNAPs
+        updateStatesToSnaps();
         }
         break;
 
-- 
cgit v0.12