diff options
Diffstat (limited to 'src')
79 files changed, 572 insertions, 240 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractvideooutput.cpp b/src/3rdparty/phonon/mmf/abstractvideooutput.cpp index 2d221ed..068118b 100644 --- a/src/3rdparty/phonon/mmf/abstractvideooutput.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideooutput.cpp @@ -161,24 +161,10 @@ void MMF::AbstractVideoOutput::dump() const { #ifndef QT_NO_DEBUG TRACE_CONTEXT(AbstractVideoOutput::dump, EVideoInternal); - QScopedPointer<ObjectDump::QVisitor> visitor(new ObjectDump::QVisitor); visitor->setPrefix("Phonon::MMF"); // to aid searchability of logs ObjectDump::addDefaultAnnotators(*visitor); - - if (QWidget *window = QApplication::activeWindow()) { - TRACE("Dumping from root window 0x%08x:", window); - ObjectDump::dumpTreeFromLeaf(*window, *visitor); - } - - TRACE("Dumping tree from leaf 0x%08x:", this); ObjectDump::dumpTreeFromLeaf(*this, *visitor); - - QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper); - dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs - ObjectDump::addDefaultAnnotators(*dumper); - TRACE_0("Dumping AbstractVideoOutput:"); - dumper->dumpObject(*this); #endif } diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index 122094e..d59e82a 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -65,6 +65,8 @@ MMF::VideoWidget::VideoWidget(QWidget *parent) TRACE_CONTEXT(VideoWidget::VideoWidget, EVideoApi); TRACE_ENTRY_0(); + parent->setProperty("_q_DummyWindowSurface", true); + TRACE_EXIT_0(); } diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 7afce5b..c2108ba 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1008,7 +1008,7 @@ HRESULT WINAPI QAxClientSite::TranslateAccelerator(LPMSG lpMsg, DWORD /*grfModif } } // ActiveQt based in-processes-servers will handle the event properly, so - // we dont need to send this key event to the host. + // we don't need to send this key event to the host. return S_OK; } diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp index ff21a9f..88f408e 100644 --- a/src/activeqt/shared/qaxtypes.cpp +++ b/src/activeqt/shared/qaxtypes.cpp @@ -547,7 +547,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type SAFEARRAY *array = 0; bool is2D = false; // If the first element in the array is a list the whole list is - // treated as a 2D array. The colum count is taken from the 1st element. + // treated as a 2D array. The column count is taken from the 1st element. if (count) { QVariantList col = list.at(0).toList(); int maxColumns = col.count(); diff --git a/src/corelib/arch/armv6/qatomic_generic_armv6.cpp b/src/corelib/arch/armv6/qatomic_generic_armv6.cpp index 39d966a..444d3d3 100644 --- a/src/corelib/arch/armv6/qatomic_generic_armv6.cpp +++ b/src/corelib/arch/armv6/qatomic_generic_armv6.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ** This file implements the generic atomics interface using ARMv6 assembly -** instructions. It is more efficent than the inline versions when Qt is +** instructions. It is more efficient than the inline versions when Qt is ** built for the THUMB instruction set, as the required instructions are ** only available in ARM state. ****************************************************************************/ diff --git a/src/corelib/arch/symbian/heap_hybrid.cpp b/src/corelib/arch/symbian/heap_hybrid.cpp index 91faaed..5d2b2b6 100644 --- a/src/corelib/arch/symbian/heap_hybrid.cpp +++ b/src/corelib/arch/symbian/heap_hybrid.cpp @@ -134,7 +134,7 @@ The constant can be changed at ROM build time using patchdata OBY keyword. @deprecated Patching this constant no longer has any effect. */ -#ifdef __X86GCC__ // For X86GCC we dont use the proper data import attribute +#ifdef __X86GCC__ // For X86GCC we don't use the proper data import attribute #undef IMPORT_D // since the constants are not really imported. GCC doesn't #define IMPORT_D // allow imports from self. #endif @@ -451,7 +451,7 @@ TInt RHybridHeap::ConstructLock(TUint32 aMode) void RHybridHeap::Init(TInt aBitmapSlab, TInt aPagePower) { - /*Moved code which does initilization */ + /*Moved code which does initialization */ iTop = (TUint8*)this + iMinLength; iBase = Ceiling(iBase, ECellAlignment); // Align iBase address @@ -874,7 +874,7 @@ available in the largest free block. Note that this function exists mainly for compatibility reasons. In a modern heap implementation such as that present in Symbian it is not appropriate to concern oneself with details such as the amount of free memory available on a -heap and its largeset free block, because the way that a modern heap implmentation +heap and its largeset free block, because the way that a modern heap implementation works is not simple. The amount of available virtual memory != physical memory and there are multiple allocation strategies used internally, which makes all memory usage figures "fuzzy" at best. @@ -1616,7 +1616,7 @@ void* RHybridHeap::DlMalloc(size_t bytes) void RHybridHeap::DlFree(void* mem) { /* - Consolidate freed chunks with preceeding or succeeding bordering + Consolidate freed chunks with preceding or succeeding bordering free chunks, if they exist, and then place in a bin. Intermixed with special cases for iTop, iDv, mmapped chunks, and usage errors. */ diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index f747bf7..031baa3 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -195,7 +195,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte // utf-8 bom composes into 0xfeff code point bool nonCharacter; if (!headerdone && uc == 0xfeff) { - // dont do anything, just skip the BOM + // don't do anything, just skip the BOM } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { // surrogate pair Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index d83f7ee..69e9219 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -695,7 +695,7 @@ bool QFSFileEnginePrivate::doStat() const } else if (fd == -1) { // ### actually covers two cases: d->fh and when the file is not open #if defined(Q_OS_SYMBIAN) - // Optimisation for Symbian where fileFlags() calls both doStat() and isSymlink(), but rarely on real links. + // Optimization for Symbian where fileFlags() calls both doStat() and isSymlink(), but rarely on real links. // When the filename is not a link, lstat will return the same info as stat, but this also removes // any need for a further call to lstat to check if the file is a link. need_lstat = false; diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h index 1dd51ea..8b77da5 100644 --- a/src/corelib/io/qiodevice_p.h +++ b/src/corelib/io/qiodevice_p.h @@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE #define QIODEVICE_BUFFERSIZE Q_INT64_C(16384) #endif -// This is QIODevice's read buffer, optimised for read(), isEmpty() and getChar() +// This is QIODevice's read buffer, optimized for read(), isEmpty() and getChar() class QIODevicePrivateLinearBuffer { public: diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index edd6d2b..53af822 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -3506,7 +3506,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) \threadsafe Registers a custom storage format. On success, returns a special - Format value that can then be passed to the QSettings constuctor. + Format value that can then be passed to the QSettings constructor. On failure, returns InvalidFormat. The \a extension is the file diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index b0c784e..fac0f45 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1812,7 +1812,7 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after) return *this; } else { QByteArray copy(after); - // ### optimise me + // ### optimize me remove(pos, len); return insert(pos, copy); } @@ -1853,7 +1853,7 @@ QByteArray &QByteArray::replace(int pos, int len, const char *after, int alen) } } -// ### optimise all other replace method, by offering +// ### optimize all other replace method, by offering // QByteArray::replace(const char *before, int blen, const char *after, int alen) /*! diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 4e9c1ad..0ea8c8d 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -560,7 +560,7 @@ void QDBusAbstractInterface::connectNotify(const char *signal) if (!d->isValid) return; - // we end up recursing here, so optimise away + // we end up recursing here, so optimize away if (qstrcmp(signal + 1, "destroyed(QObject*)") == 0) return; diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index 30f2cda..84d0349 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -172,7 +172,7 @@ template<typename T> inline T qdbus_cast(const QVariant &v return qvariant_cast<T>(v); } -// specialise for QVariant, allowing it to be used in place of QDBusVariant +// specialize for QVariant, allowing it to be used in place of QDBusVariant template<> inline QVariant qdbus_cast<QVariant>(const QDBusArgument &arg, QVariant *) { QDBusVariant item; diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 31588e7..a5d8ada 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -801,7 +801,7 @@ bool QDBusConnectionPrivate::activateCall(QObject* object, int flags, const QDBu ++cacheIt; if (cacheIt == slotCache.hash.constEnd() || cacheIt.key() != cacheKey) { - // not cached, analyse the meta object + // not cached, analyze the meta object const QMetaObject *mo = object->metaObject(); QByteArray memberName = msg.member().toUtf8(); diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp index 8b174a1..e620152 100644 --- a/src/dbus/qdbusmarshaller.cpp +++ b/src/dbus/qdbusmarshaller.cpp @@ -507,7 +507,7 @@ bool QDBusMarshaller::appendCrossMarshalling(QDBusDemarshaller *demarshaller) if (code == DBUS_TYPE_ARRAY) { int element = q_dbus_message_iter_get_element_type(&demarshaller->iterator); if (q_dbus_type_is_fixed(element)) { - // another optimisation: fixed size arrays + // another optimization: fixed size arrays // code is exactly like QDBusDemarshaller::toByteArray DBusMessageIter sub; q_dbus_message_iter_recurse(&demarshaller->iterator, &sub); diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index d838e37..10b2768 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -292,7 +292,7 @@ QDBusMessage QDBusMessagePrivate::makeLocal(const QDBusConnectionPrivate &conn, } // no complex types seen - // optimise by using the variant list itself + // optimize by using the variant list itself QDBusMessage retval; QDBusMessagePrivate *d = retval.d_ptr; d->arguments = asSent.d_ptr->arguments; @@ -452,7 +452,7 @@ QDBusMessage QDBusMessage::createReply(const QVariantList &arguments) const d_ptr->localReply = new QDBusMessage(reply); // keep an internal copy } - // the reply must have a msg or be a local-loop optimisation + // the reply must have a msg or be a local-loop optimization Q_ASSERT(reply.d_ptr->reply || reply.d_ptr->localMessage); return reply; } @@ -471,7 +471,7 @@ QDBusMessage QDBusMessage::createErrorReply(const QString name, const QString &m d_ptr->localReply = new QDBusMessage(reply); // keep an internal copy } - // the reply must have a msg or be a local-loop optimisation + // the reply must have a msg or be a local-loop optimization Q_ASSERT(reply.d_ptr->reply || reply.d_ptr->localMessage); return reply; } diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index cb377cb..821a227 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -242,7 +242,7 @@ bool QDBusMetaType::marshall(QDBusArgument &arg, int id, const void *data) QReadLocker locker(customTypesLock()); QVector<QDBusCustomTypeInfo> *ct = customTypes(); if (id >= ct->size()) - return false; // non-existant + return false; // non-existent const QDBusCustomTypeInfo &info = (*ct).at(id); if (!info.marshall) { @@ -271,7 +271,7 @@ bool QDBusMetaType::demarshall(const QDBusArgument &arg, int id, void *data) QReadLocker locker(customTypesLock()); QVector<QDBusCustomTypeInfo> *ct = customTypes(); if (id >= ct->size()) - return false; // non-existant + return false; // non-existent const QDBusCustomTypeInfo &info = (*ct).at(id); if (!info.demarshall) { diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index 61e561e..918a46c 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -85,7 +85,7 @@ namespace QDBusPendingReplyTypes { template<typename T1> inline int metaTypeFor(T1 * = 0) { return qMetaTypeId<T1>(); } - // specialise for QVariant, allowing it to be used in place of QDBusVariant + // specialize for QVariant, allowing it to be used in place of QDBusVariant template<> inline int metaTypeFor<QVariant>(QVariant *) { return qMetaTypeId<QDBusVariant>(); } diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index 2fcdc73..b7b0407 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -309,7 +309,7 @@ namespace QDBusUtil Returns true if \a connName is a valid unique connection name. Unique connection names start with a colon (":") and are followed by a list of dot-separated - components composed of ASCII letters, digits, the hypen or the underscore ("_") character. + components composed of ASCII letters, digits, the hyphen or the underscore ("_") character. */ bool isValidUniqueConnectionName(const QString &connName) { diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp index 26fb97f..c96ca0e 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp @@ -272,7 +272,7 @@ void QDeclarativeAnchorsPrivate::addDepend(QGraphicsObject *item) } else if(itemPrivate->isWidget) { Q_Q(QDeclarativeAnchors); QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); - QObject::connect(widget, SIGNAL(destroyed(QObject *)), q, SLOT(_q_widgetDestroyed(QObject *))); + QObject::connect(widget, SIGNAL(destroyed(QObject*)), q, SLOT(_q_widgetDestroyed(QObject*))); QObject::connect(widget, SIGNAL(geometryChanged()), q, SLOT(_q_widgetGeometryChanged())); } } @@ -289,7 +289,7 @@ void QDeclarativeAnchorsPrivate::remDepend(QGraphicsObject *item) } else if(itemPrivate->isWidget) { Q_Q(QDeclarativeAnchors); QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); - QObject::disconnect(widget, SIGNAL(destroyed(QObject *)), q, SLOT(_q_widgetDestroyed(QObject *))); + QObject::disconnect(widget, SIGNAL(destroyed(QObject*)), q, SLOT(_q_widgetDestroyed(QObject*))); QObject::disconnect(widget, SIGNAL(geometryChanged()), q, SLOT(_q_widgetGeometryChanged())); } } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index bbc03f3..6f38f63 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1217,7 +1217,7 @@ void QDeclarativeGridView::setModel(const QVariant &model) disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); - disconnect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); } d->clear(); @@ -1258,7 +1258,7 @@ void QDeclarativeGridView::setModel(const QVariant &model) connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); - connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); emit countChanged(); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index e29f285..38a4839 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1548,7 +1548,7 @@ void QDeclarativeListView::setModel(const QVariant &model) disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); disconnect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int))); disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); - disconnect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); } d->clear(); @@ -1595,7 +1595,7 @@ void QDeclarativeListView::setModel(const QVariant &model) connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); connect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int))); connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); - connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); emit countChanged(); } diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 1533d55..1b7dce0 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -335,7 +335,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() If the \e accepted property of the \l {MouseEvent}{mouse} parameter is set to false in the handler, the onPressed/onReleased/onClicked handlers will be called for the second - click; otherwise they are supressed. The accepted property defaults to true. + click; otherwise they are suppressed. The accepted property defaults to true. */ /*! diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 81c84f5..dc3d5ee 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -467,7 +467,7 @@ void QDeclarativePathView::setModel(const QVariant &model) disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); - disconnect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); for (int i=0; i<d->items.count(); i++){ QDeclarativeItem *p = d->items[i]; d->model->release(p); @@ -498,7 +498,7 @@ void QDeclarativePathView::setModel(const QVariant &model) connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); - connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); d->modelCount = d->model->count(); if (d->model->count()) d->offset = qmlMod(d->offset, qreal(d->model->count())); diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index cb64212..6f46c7b 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -202,7 +202,7 @@ void QDeclarativeRepeater::setModel(const QVariant &model) disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); /* - disconnect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + disconnect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); */ } @@ -230,7 +230,7 @@ void QDeclarativeRepeater::setModel(const QVariant &model) connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); /* - connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); + connect(d->model, SIGNAL(createdItem(int,QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); */ regenerate(); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 0903427..2348478 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -792,7 +792,7 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c) d->cursorComponent = c; if(!c){ //note that the components are owned by something else - disconnect(d->control, SIGNAL(cursorPositionChanged(int, int)), + disconnect(d->control, SIGNAL(cursorPositionChanged(int,int)), this, SLOT(moveCursor())); delete d->cursorItem; }else{ @@ -805,7 +805,7 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c) void QDeclarativeTextInputPrivate::startCreatingCursor() { Q_Q(QDeclarativeTextInput); - q->connect(control, SIGNAL(cursorPositionChanged(int, int)), + q->connect(control, SIGNAL(cursorPositionChanged(int,int)), q, SLOT(moveCursor())); if(cursorComponent->isReady()){ q->createCursor(); @@ -1446,7 +1446,7 @@ void QDeclarativeTextInputPrivate::init() q, SLOT(cursorPosChanged())); q->connect(control, SIGNAL(selectionChanged()), q, SLOT(selectionChanged())); - q->connect(control, SIGNAL(textChanged(const QString &)), + q->connect(control, SIGNAL(textChanged(QString)), q, SLOT(q_textChanged())); q->connect(control, SIGNAL(accepted()), q, SIGNAL(accepted())); diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index e569dd2..1f01a45 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -714,14 +714,14 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) this, SLOT(_q_itemsMoved(int,int,int))); d->m_listModelInterface = 0; } else if (d->m_abstractItemModel) { - QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsInserted(const QModelIndex &,int,int)), - this, SLOT(_q_rowsInserted(const QModelIndex &,int,int))); - QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsRemoved(const QModelIndex &,int,int)), - this, SLOT(_q_rowsRemoved(const QModelIndex &,int,int))); - QObject::disconnect(d->m_abstractItemModel, SIGNAL(dataChanged(const QModelIndex&,const QModelIndex&)), - this, SLOT(_q_dataChanged(const QModelIndex&,const QModelIndex&))); - QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), - this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); + QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(_q_rowsInserted(QModelIndex,int,int))); + QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(_q_rowsRemoved(QModelIndex,int,int))); + QObject::disconnect(d->m_abstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + this, SLOT(_q_dataChanged(QModelIndex,QModelIndex))); + QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), + this, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int))); QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); QObject::disconnect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged())); d->m_abstractItemModel = 0; @@ -762,14 +762,14 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) emit itemsInserted(0, d->m_listModelInterface->count()); return; } else if (object && (d->m_abstractItemModel = qobject_cast<QAbstractItemModel *>(object))) { - QObject::connect(d->m_abstractItemModel, SIGNAL(rowsInserted(const QModelIndex &,int,int)), - this, SLOT(_q_rowsInserted(const QModelIndex &,int,int))); - QObject::connect(d->m_abstractItemModel, SIGNAL(rowsRemoved(const QModelIndex &,int,int)), - this, SLOT(_q_rowsRemoved(const QModelIndex &,int,int))); - QObject::connect(d->m_abstractItemModel, SIGNAL(dataChanged(const QModelIndex&,const QModelIndex&)), - this, SLOT(_q_dataChanged(const QModelIndex&,const QModelIndex&))); - QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), - this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); + QObject::connect(d->m_abstractItemModel, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(_q_rowsInserted(QModelIndex,int,int))); + QObject::connect(d->m_abstractItemModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(_q_rowsRemoved(QModelIndex,int,int))); + QObject::connect(d->m_abstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + this, SLOT(_q_dataChanged(QModelIndex,QModelIndex))); + QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), + this, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int))); QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged())); d->m_metaDataCacheable = true; diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g index 1b66ba0..c84f0b3 100644 --- a/src/declarative/qml/parser/qdeclarativejs.g +++ b/src/declarative/qml/parser/qdeclarativejs.g @@ -1254,7 +1254,7 @@ case $rule_number: { else node = makeAstNode<AST::ObjectLiteral> (driver->nodePool()); node->lbraceToken = loc(1); - node->lbraceToken = loc(3); + node->rbraceToken = loc(3); sym(1).Node = node; } break; ./ @@ -1265,7 +1265,7 @@ case $rule_number: { AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); - node->lbraceToken = loc(4); + node->rbraceToken = loc(4); sym(1).Node = node; } break; ./ diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp index 8afb93d..28ef17d 100644 --- a/src/declarative/qml/parser/qdeclarativejsparser.cpp +++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp @@ -679,7 +679,7 @@ case 85: { else node = makeAstNode<AST::ObjectLiteral> (driver->nodePool()); node->lbraceToken = loc(1); - node->lbraceToken = loc(3); + node->rbraceToken = loc(3); sym(1).Node = node; } break; @@ -687,7 +687,7 @@ case 86: { AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); - node->lbraceToken = loc(4); + node->rbraceToken = loc(4); sym(1).Node = node; } break; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index c3fdf36..0c99ea8 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -878,7 +878,7 @@ void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContex created by calling QDeclarativeCompnent::create() or QDeclarativeComponent::beginCreate() which have CppOwnership by default. The ownership of these root-level objects is considered to - have been transfered to the C++ caller. + have been transferred to the C++ caller. Objects not-created by QML have CppOwnership by default. The exception to this is objects returned from a C++ method call. The diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h index e38580c..6305fbd 100644 --- a/src/declarative/util/qdeclarativeanimation_p_p.h +++ b/src/declarative/util/qdeclarativeanimation_p_p.h @@ -328,7 +328,7 @@ public: QDeclarativeBulkValueAnimator *va; - // for animations that dont use the QDeclarativeBulkValueAnimator + // for animations that don't use the QDeclarativeBulkValueAnimator QDeclarativeStateActions *actions; static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index d2f65ef..9fee257 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -220,15 +220,15 @@ void QDeclarativeFontLoader::setSource(const QUrl &url) fo->download(d->url, qmlEngine(this)->networkAccessManager()); d->status = Loading; emit statusChanged(); - QObject::connect(fo, SIGNAL(fontDownloaded(QString, QDeclarativeFontLoader::Status)), - this, SLOT(updateFontInfo(QString, QDeclarativeFontLoader::Status))); + QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)), + this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status))); } else { QDeclarativeFontObject *fo = d->fonts[d->url]; if (fo->id == -1) { d->status = Loading; emit statusChanged(); - QObject::connect(fo, SIGNAL(fontDownloaded(QString, QDeclarativeFontLoader::Status)), - this, SLOT(updateFontInfo(QString, QDeclarativeFontLoader::Status))); + QObject::connect(fo, SIGNAL(fontDownloaded(QString,QDeclarativeFontLoader::Status)), + this, SLOT(updateFontInfo(QString,QDeclarativeFontLoader::Status))); } else updateFontInfo(QFontDatabase::applicationFontFamilies(fo->id).at(0), Ready); diff --git a/src/gui/accessible/qaccessible_mac_p.h b/src/gui/accessible/qaccessible_mac_p.h index 4ee3a2d..e417cb6 100644 --- a/src/gui/accessible/qaccessible_mac_p.h +++ b/src/gui/accessible/qaccessible_mac_p.h @@ -122,7 +122,7 @@ private: QAccessibleInterfaceWrapper wrapper class. It has the same API as QAccessibleInterface, minus the child parameter - in the funcitons. + in the functions. */ class Q_AUTOTEST_EXPORT QAInterface : public QAccessible { @@ -432,7 +432,7 @@ public: /* QAccessibleHierarchyManager bridges the Mac and Qt accessibility hierarchies. There is a one-to-one relationship between QAElements on the Mac side - and QAInterfaces on the Qt side, and this class provies lookup funcitons + and QAInterfaces on the Qt side, and this class provides lookup functions that translates between these to items. The identity of a QAInterface is determined by its QAccessibleInterface and diff --git a/src/gui/embedded/qcopchannel_qws.cpp b/src/gui/embedded/qcopchannel_qws.cpp index 5786866..0d9d9d3 100644 --- a/src/gui/embedded/qcopchannel_qws.cpp +++ b/src/gui/embedded/qcopchannel_qws.cpp @@ -502,7 +502,7 @@ void QCopChannel::answer(QWSClient *cl, const QString& ch, bool known = qcopServerMap && qcopServerMap->contains(c) && !((*qcopServerMap)[c]).isEmpty(); // Yes, it's a typo, it's not user-visible, and we choose not to fix it for compatibility - QLatin1String ans = QLatin1String(known ? "known" : "unkown"); + QLatin1String ans = QLatin1String(known ? "known" : "unknown"); QWSServerPrivate::sendQCopEvent(cl, QLatin1String(""), ans, data, true); return; diff --git a/src/gui/embedded/qtransportauth_qws.cpp b/src/gui/embedded/qtransportauth_qws.cpp index 9a50702..90e90d1 100644 --- a/src/gui/embedded/qtransportauth_qws.cpp +++ b/src/gui/embedded/qtransportauth_qws.cpp @@ -445,7 +445,7 @@ QIODevice *QTransportAuth::passThroughByClient( QWSClient *client ) const /*! \internal Return a QIODevice pointer (to an internal QBuffer) which can be used - to receive data after authorisation on transport \a d. + to receive data after authorization on transport \a d. The return QIODevice will act as a pass-through. @@ -468,7 +468,7 @@ QAuthDevice *QTransportAuth::recvBuf( QTransportAuth::Data *data, QIODevice *iod /*! Return a QIODevice pointer (to an internal QBuffer) which can be used - to write data onto, for authorisation on transport \a d. + to write data onto, for authorization on transport \a d. The return QIODevice will act as a pass-through. diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 8480c19..1b7aa97 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -722,7 +722,7 @@ public: /*! Returns true if \a item1 is on top of \a item2. - The items dont need to be siblings. + The items don't need to be siblings. \internal */ @@ -776,7 +776,7 @@ inline bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem /*! Returns true if \a item2 is on top of \a item1. - The items dont need to be siblings. + The items don't need to be siblings. \internal */ diff --git a/src/gui/inputmethod/qinputcontextfactory.cpp b/src/gui/inputmethod/qinputcontextfactory.cpp index 865c1b2..afe5095 100644 --- a/src/gui/inputmethod/qinputcontextfactory.cpp +++ b/src/gui/inputmethod/qinputcontextfactory.cpp @@ -205,7 +205,7 @@ QStringList QInputContextFactory::keys() This function contains pure Symbian exception handling code for getting S60 language list. - Returned object ownership is transfered to caller. + Returned object ownership is transferred to caller. */ static CAknInputLanguageList* s60LangListL() { @@ -224,7 +224,7 @@ static CAknInputLanguageList* s60LangListL() \internal This function utility function return S60 language list. - Returned object ownership is transfered to caller. + Returned object ownership is transferred to caller. */ static CAknInputLanguageList* s60LangList() { diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp index e69cd65..e2a16b1 100644 --- a/src/gui/itemviews/qitemselectionmodel.cpp +++ b/src/gui/itemviews/qitemselectionmodel.cpp @@ -772,7 +772,7 @@ void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged() savedPersistentIndexes.clear(); savedPersistentCurrentIndexes.clear(); - // optimisation for when all indexes are selected + // optimization for when all indexes are selected // (only if there is lots of items (1000) because this is not entirely correct) if (ranges.isEmpty() && currentSelection.count() == 1) { QItemSelectionRange range = currentSelection.first(); diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index d8fb74c..a4cc5a3 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -3742,7 +3742,7 @@ int QApplication::x11ProcessEvent(XEvent* event) // toplevel reparented... QWidget *newparent = QWidget::find(event->xreparent.parent); if (! newparent || (newparent->windowType() == Qt::Desktop)) { - // we dont' know about the new parent (or we've been + // we don't know about the new parent (or we've been // reparented to root), perhaps a window manager // has been (re)started? reset the focus model to unknown X11->focus_model = QX11Data::FM_Unknown; diff --git a/src/gui/kernel/qclipboard_win.cpp b/src/gui/kernel/qclipboard_win.cpp index 63ca9e5..c2e29fd 100644 --- a/src/gui/kernel/qclipboard_win.cpp +++ b/src/gui/kernel/qclipboard_win.cpp @@ -141,7 +141,7 @@ public: clipBoardViewer = new QWidget(); clipBoardViewer->createWinId(); clipBoardViewer->setObjectName(QLatin1String("internal clipboard owner")); - // We dont need this internal widget to appear in QApplication::topLevelWidgets() + // We don't need this internal widget to appear in QApplication::topLevelWidgets() if (QWidgetPrivate::allWidgets) QWidgetPrivate::allWidgets->remove(clipBoardViewer); } diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 55548ef..62c861d 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -132,7 +132,7 @@ void setupOwner() requestor = new QWidget(0); requestor->createWinId(); requestor->setObjectName(QLatin1String("internal clipboard requestor")); - // We dont need this internal widgets to appear in QApplication::topLevelWidgets() + // We don't need this internal widgets to appear in QApplication::topLevelWidgets() if (QWidgetPrivate::allWidgets) { QWidgetPrivate::allWidgets->remove(owner); QWidgetPrivate::allWidgets->remove(requestor); @@ -769,7 +769,7 @@ QByteArray QX11Data::clipboardReadIncrementalProperty(Window win, Atom property, delete requestor; requestor = new QWidget(0); requestor->setObjectName(QLatin1String("internal clipboard requestor")); - // We dont need this internal widget to appear in QApplication::topLevelWidgets() + // We don't need this internal widget to appear in QApplication::topLevelWidgets() if (QWidgetPrivate::allWidgets) QWidgetPrivate::allWidgets->remove(requestor); diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp index 3dc6afc..300e5ca 100644 --- a/src/gui/kernel/qkeymapper_mac.cpp +++ b/src/gui/kernel/qkeymapper_mac.cpp @@ -749,7 +749,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e } return false; } - // Once we process the key down , we dont need to send the saved event again from + // Once we process the key down , we don't need to send the saved event again from // kEventTextInputUnicodeForKeyEvent, so clear it. if (currentContext && ekind == kEventRawKeyDown) { QMacInputContext *context = qobject_cast<QMacInputContext*>(currentContext); diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index fee1580..c81d75f 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -265,7 +265,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba, CFbsBitmap* nMask = softkeyAlpha.toSymbianCFbsBitmap(); CEikImage* myimage = new (ELeave) CEikImage; - myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered + myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transferred EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership cbaHasImage[position] = true; diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index 893ba2b..1821c3d 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -198,25 +198,22 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state, d->startPosition[0] = p1.screenPos(); d->startPosition[1] = p2.screenPos(); } - QLineF line(p1.screenPos(), p2.screenPos()); - QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos()); - QLineF tmp(line); - tmp.setLength(line.length() / 2.); - QPointF centerPoint = tmp.p2(); d->lastCenterPoint = d->centerPoint; - d->centerPoint = centerPoint; - d->changeFlags |= QPinchGesture::CenterPointChanged; + d->centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0; - const qreal scaleFactor = line.length() / lastLine.length(); + d->changeFlags |= QPinchGesture::CenterPointChanged; if (d->isNewSequence) { - d->lastScaleFactor = scaleFactor; + d->scaleFactor = 1.0; + d->lastScaleFactor = 1.0; } else { d->lastScaleFactor = d->scaleFactor; + QLineF line(p1.screenPos(), p2.screenPos()); + QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos()); + d->scaleFactor = line.length() / lastLine.length(); } - d->scaleFactor = scaleFactor; - d->totalScaleFactor = d->totalScaleFactor * scaleFactor; + d->totalScaleFactor = d->totalScaleFactor * d->scaleFactor; d->changeFlags |= QPinchGesture::ScaleFactorChanged; qreal angle = QLineF(p1.screenPos(), p2.screenPos()).angle(); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 9b44f15..e22ec55 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -236,6 +236,17 @@ void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w) } } +/*! + \internal + Recursively remove widget and all of its descendents. + */ +void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget) +{ + unregisterWidget(widget); + foreach (QObject *child, widget->children()) + if (QWidget *childWidget = qobject_cast<QWidget *>(child)) + unregisterWidgetSubtree(childWidget); +} QWidgetPrivate::QWidgetPrivate(int version) : QObjectPrivate(version) @@ -326,15 +337,27 @@ QWidgetPrivate::~QWidgetPrivate() #endif //QT_NO_GRAPHICSEFFECT } +class QDummyWindowSurface : public QWindowSurface +{ +public: + QDummyWindowSurface(QWidget *window) : QWindowSurface(window) {} + QPaintDevice *paintDevice() { return window(); } + void flush(QWidget *, const QRegion &, const QPoint &) {} +}; + QWindowSurface *QWidgetPrivate::createDefaultWindowSurface() { Q_Q(QWidget); QWindowSurface *surface; - if (QApplicationPrivate::graphicsSystem()) - surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); - else - surface = createDefaultWindowSurface_sys(); + if (q->property("_q_DummyWindowSurface").toBool()) { + surface = new QDummyWindowSurface(q); + } else { + if (QApplicationPrivate::graphicsSystem()) + surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); + else + surface = createDefaultWindowSurface_sys(); + } return surface; } @@ -10031,7 +10054,16 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) if (newParent && isAncestorOf(focusWidget())) focusWidget()->clearFocus(); + QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData(); + QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStore : 0; + d->setParent_sys(parent, f); + + QTLWExtra *topExtra = window()->d_func()->maybeTopData(); + QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStore : 0; + if (oldBsTracker && oldBsTracker != bsTracker) + oldBsTracker->unregisterWidgetSubtree(this); + if (desktopWidget) parent = 0; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 6c89659..ca1e3fc 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -122,6 +122,7 @@ public: void registerWidget(QWidget *w); void unregisterWidget(QWidget *w); + void unregisterWidgetSubtree(QWidget *w); inline QWidgetBackingStore* data() { diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 5df5e19..cf4bdf1 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -577,7 +577,7 @@ void QWidgetPrivate::hide_sys() QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId()); if (id) { - //Incorrect optimisation - for popup windows, Qt's focus is moved before + //Incorrect optimization - for popup windows, Qt's focus is moved before //hide_sys is called, resulting in the popup window keeping its elevated //position in the CONE control stack. //This can result in keyboard focus being in an invisible widget in some @@ -709,7 +709,8 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) // old_winid may not have received a 'not visible' visibility // changed event before being destroyed; make sure that it is // removed from the backing store's list of visible windows. - S60->controlVisibilityChanged(old_winid, false); + if (old_winid) + S60->controlVisibilityChanged(old_winid, false); setWinId(0); diff --git a/src/gui/painting/qdrawhelper_arm_simd.cpp b/src/gui/painting/qdrawhelper_arm_simd.cpp index 61dac5e..2a5f5e4 100644 --- a/src/gui/painting/qdrawhelper_arm_simd.cpp +++ b/src/gui/painting/qdrawhelper_arm_simd.cpp @@ -47,7 +47,26 @@ #ifdef QT_HAVE_ARM_SIMD #if defined(Q_OS_SYMBIAN) -#include <u32std.h> +#if !defined(__SWITCH_TO_ARM) +#ifdef __MARM_THUMB__ +#ifndef __ARMCC__ +#define __SWITCH_TO_ARM asm("push {r0} ");\ + asm("add r0, pc, #4 ");\ + asm("bx r0 ");\ + asm("nop ");\ + asm(".align 2 ");\ + asm(".code 32 ");\ + asm("ldr r0, [sp], #4 ") +#define __END_ARM asm(".code 16 ") +#else +#define __SWITCH_TO_ARM asm(".code 32 "); +#define __END_ARM +#endif // __ARMCC__ +#else +#define __SWITCH_TO_ARM +#define __END_ARM +#endif //__MARM_THUMB__ +#endif #endif #if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) diff --git a/src/gui/painting/qgraphicssystem_qws.cpp b/src/gui/painting/qgraphicssystem_qws.cpp index f5dab4b..03a0d11 100644 --- a/src/gui/painting/qgraphicssystem_qws.cpp +++ b/src/gui/painting/qgraphicssystem_qws.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE QPixmapData *QWSGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const { if (screen->pixmapDataFactory()) - return screen->pixmapDataFactory()->create(type); //### For 4.4 compatability + return screen->pixmapDataFactory()->create(type); //### For 4.4 compatibility else return new QRasterPixmapData(type); } diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp index 8580775..7383308 100644 --- a/src/gui/painting/qimagescale.cpp +++ b/src/gui/painting/qimagescale.cpp @@ -304,7 +304,7 @@ QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img, return(isi); } -/* FIXME: NEED to optimise ScaleAARGBA - currently its "ok" but needs work*/ +/* FIXME: NEED to optimize ScaleAARGBA - currently its "ok" but needs work*/ /* scale by area sampling */ static void qt_qimageScaleAARGBA(QImageScaleInfo *isi, unsigned int *dest, diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index c92d291..8f9d8ba 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1102,7 +1102,7 @@ void QRasterPaintEnginePrivate::updateMatrixData(QSpanData *spanData, const QBru Q_Q(QRasterPaintEngine); bool bilinear = q->state()->flags.bilinear; - if (b.d->transform.type() > QTransform::TxNone) { // FALCON: optimise + if (b.d->transform.type() > QTransform::TxNone) { // FALCON: optimize spanData->setupMatrix(b.transform() * m, bilinear); } else { if (m.type() <= QTransform::TxTranslate) { diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index bc4da28..acb20c1 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -201,7 +201,7 @@ private: Region rgn; void *xrectangles; #elif defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) - mutable RgnHandle unused; // Here for binary compatability reasons. ### Qt 5 remove. + mutable RgnHandle unused; // Here for binary compatibility reasons. ### Qt 5 remove. #endif #if defined(Q_WS_QWS) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) QRegionPrivate *qt_rgn; diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index a5e9c19..da29440 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -302,7 +302,7 @@ HWND QWindowsXPStylePrivate::winId(const QWidget *widget) limboWidget = new QWidget(0); limboWidget->createWinId(); limboWidget->setObjectName(QLatin1String("xp_limbo_widget")); - // We dont need this internal widget to appear in QApplication::topLevelWidgets() + // We don't need this internal widget to appear in QApplication::topLevelWidgets() if (QWidgetPrivate::allWidgets) QWidgetPrivate::allWidgets->remove(limboWidget); } diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index 9bf6cc8..ecc4690 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -2006,7 +2006,7 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) FcFontSet *set = FcConfigGetFonts(config, FcSetApplication); if (!set) { - FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existant"); + FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existent"); set = FcConfigGetFonts(config, FcSetApplication); // try again if (!set) return; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 571cf98..fc26eef 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -158,7 +158,7 @@ public: virtual QFixed emSquareSize() const { return ascent(); } - /* returns 0 as glyph index for non existant glyphs */ + /* returns 0 as glyph index for non existent glyphs */ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const = 0; /** diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 7609ee5..5f25752 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1209,7 +1209,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) QImage indexed(mask->width(), mask->height(), QImage::Format_Indexed8); - // ### This part is kinda pointless, but we'll crash later if we dont because some + // ### This part is kinda pointless, but we'll crash later if we don't because some // code paths expects there to be colortables for index8-bit... QVector<QRgb> colors(256); for (int i=0; i<256; ++i) diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp index e49f5b4..2283358 100644 --- a/src/gui/text/qfontsubset.cpp +++ b/src/gui/text/qfontsubset.cpp @@ -697,7 +697,7 @@ static QTtfTable generateHead(const qttf_head_table &head) // Bits 5-10: These should be set according to Apple's specification . However, they are not implemented in OpenType. // Bit 11: Font data is 'lossless,' as a result of having been compressed and decompressed with the Agfa MicroType Express engine. // Bit 12: Font converted (produce compatible metrics) -// Bit 13: Font optimised for ClearType +// Bit 13: Font optimized for ClearType // Bit 14: Reserved, set to 0 // Bit 15: Reserved, set to 0 << quint16(0) @@ -1008,7 +1008,7 @@ static void convertPath(const QPainterPath &path, QList<TTF_POINT> *points, QLis np.x = (i1_x + i2_x) >> 1; np.y = (i1_y + i2_y) >> 1; if (try_reduce) { - // see if we can optimise out the last onCurve point + // see if we can optimize out the last onCurve point int mx = (points->at(points->size() - 2).x + base[2].x) >> 1; int my = (points->at(points->size() - 2).y + base[2].y) >> 1; if (qAbs(mx - base[3].x) <= split_limit && qAbs(my = base[3].y) <= split_limit) diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 213db7e..0bdd20d 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -320,7 +320,7 @@ void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout) void QTextDocumentPrivate::insert_string(int pos, uint strPos, uint length, int format, QTextUndoCommand::Operation op) { - // ##### optimise when only appending to the fragment! + // ##### optimize when only appending to the fragment! Q_ASSERT(noBlockInString(text.mid(strPos, length))); split(pos); @@ -1446,7 +1446,7 @@ void QTextDocumentPrivate::clearFrame(QTextFrame *f) void QTextDocumentPrivate::scan_frames(int pos, int charsRemoved, int charsAdded) { - // ###### optimise + // ###### optimize Q_UNUSED(pos); Q_UNUSED(charsRemoved); Q_UNUSED(charsAdded); diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index f432b7e..f1278b9 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1615,7 +1615,7 @@ void QTextLine::setLineWidth(qreal width) if (line.length && line.textWidth <= line.width && line.from + line.length == eng->layoutData->string.length()) - // no need to do anything if the line is already layouted and the last one. This optimisation helps + // no need to do anything if the line is already layouted and the last one. This optimization helps // when using things in a single line layout. return; line.length = 0; diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index f38bae7..a8b39f4 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -722,7 +722,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb #else // Native UI-elements on Mac can scroll hundreds of lines at a time as // a result of acceleration. So keep the same behaviour in Qt, and - // dont restrict stepsToScroll to certain maximum (pageStep): + // don't restrict stepsToScroll to certain maximum (pageStep): stepsToScroll = int(offset_accumulated); #endif offset_accumulated -= int(offset_accumulated); diff --git a/src/multimedia/audio/qaudioengine.cpp b/src/multimedia/audio/qaudioengine.cpp index 7f1f5d3..c379aff 100644 --- a/src/multimedia/audio/qaudioengine.cpp +++ b/src/multimedia/audio/qaudioengine.cpp @@ -133,7 +133,7 @@ QT_BEGIN_NAMESPACE Uses the \a device as the QIODevice to transfer data. If \a device is null then the class creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle the data transfer. This QIODevice can be used to write() audio data directly. Passing a - QIODevice allows the data to be transfered without any extra code. + QIODevice allows the data to be transferred without any extra code. */ /*! @@ -247,7 +247,7 @@ QT_BEGIN_NAMESPACE Uses the \a device as the QIODevice to transfer data. If \a device is null then the class creates an internal QIODevice. Returns a pointer to the QIODevice being used to handle the data transfer. This QIODevice can be used to - read() audio data directly. Passing a QIODevice allows the data to be transfered + read() audio data directly. Passing a QIODevice allows the data to be transferred without any extra code. */ diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index 3676f64..6660c3f 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -201,7 +201,7 @@ QAudioInput::~QAudioInput() /*! Uses the \a device as the QIODevice to transfer data. - Passing a QIODevice allows the data to be transfered without any extra code. + Passing a QIODevice allows the data to be transferred without any extra code. All that is required is to open the QIODevice. If able to successfully get audio data from the systems audio device the diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp index cf3b79c..b71d48c 100644 --- a/src/multimedia/audio/qaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput.cpp @@ -199,7 +199,7 @@ QAudioFormat QAudioOutput::format() const /*! Uses the \a device as the QIODevice to transfer data. - Passing a QIODevice allows the data to be transfered without any extra code. + Passing a QIODevice allows the data to be transferred without any extra code. All that is required is to open the QIODevice. If able to successfully output audio data to the systems audio device the diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index cd224df..2910538 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -647,7 +647,7 @@ TInt CSymbianCertificateRetriever::ThreadEntryPoint(TAny* aParams) if (err) return err; else - return self->iSequenceError; // return any error that occured during the retrieval + return self->iSequenceError; // return any error that occurred during the retrieval } void CSymbianCertificateRetriever::ConstructL() diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 06b96ae..92cf108 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -457,7 +457,7 @@ public: AttributeOpacity }; - // There are optimisations we can do, depending on the brush transform: + // There are optimizations we can do, depending on the brush transform: // 1) May not have to apply perspective-correction // 2) Can use lower precision for matrix void optimiseForBrushTransform(QTransform::TransformationType transformType); diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 62eff6e..dbd295f 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2104,7 +2104,7 @@ void QGLContextPrivate::syncGlState() #undef ctx #ifdef QT_NO_EGL -void QGLContextPrivate::swapRegion(const QRegion *) +void QGLContextPrivate::swapRegion(const QRegion &) { Q_Q(QGLContext); q->swapBuffers(); diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index c79c4cd..27f7ad9 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -276,12 +276,12 @@ EGLSurface QGLContextPrivate::eglSurfaceForDevice() const return eglSurface; } -void QGLContextPrivate::swapRegion(const QRegion *region) +void QGLContextPrivate::swapRegion(const QRegion ®ion) { if (!valid || !eglContext) return; - eglContext->swapBuffersRegion2NOK(eglSurfaceForDevice(), region); + eglContext->swapBuffersRegion2NOK(eglSurfaceForDevice(), ®ion); } void QGLWidget::setMouseTracking(bool enable) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 6c494ee..f86c77f 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -343,7 +343,7 @@ public: void setVertexAttribArrayEnabled(int arrayIndex, bool enabled = true); void syncGlState(); // Makes sure the GL context's state is what we think it is - void swapRegion(const QRegion *region); + void swapRegion(const QRegion ®ion); #if defined(Q_WS_WIN) void updateFormatVersion(); diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 8157b2a..bbb98d0 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -194,7 +194,7 @@ public: widget = new QGLWidget(QGLFormat(QGL::SingleBuffer | QGL::NoDepthBuffer | QGL::NoStencilBuffer)); widget->resize(1, 1); - // We dont need this internal widget to appear in QApplication::topLevelWidgets() + // We don't need this internal widget to appear in QApplication::topLevelWidgets() if (QWidgetPrivate::allWidgets) QWidgetPrivate::allWidgets->remove(widget); initializing = false; @@ -275,6 +275,8 @@ struct QGLWindowSurfacePrivate QRegion paintedRegion; QSize size; + QSize textureSize; + QList<QImage> buffers; QGLWindowSurfaceGLPaintDevice glDevice; QGLWindowSurface* q_ptr; @@ -316,6 +318,7 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window) d_ptr->pb = 0; d_ptr->fbo = 0; d_ptr->ctx = 0; + d_ptr->tex_id = 0; #if defined (QT_OPENGL_ES_2) d_ptr->tried_fbo = true; d_ptr->tried_pb = true; @@ -433,7 +436,7 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, void QGLWindowSurface::beginPaint(const QRegion &) { - if (! context()) + if (!context()) return; int clearFlags = 0; @@ -457,13 +460,42 @@ void QGLWindowSurface::endPaint(const QRegion &rgn) d_ptr->buffers.clear(); } -void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &offset) +static void blitTexture(QGLContext *ctx, GLuint texture, const QSize &viewport, const QSize &texSize, const QRect &targetRect, const QRect &sourceRect) { - if (context() && widget != window()) { - qWarning("No native child widget support in GL window surface without FBOs or pixel buffers"); - return; - } + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_BLEND); + + glViewport(0, 0, viewport.width(), viewport.height()); + + QGLShaderProgram *blitProgram = + QGLEngineSharedShaders::shadersForContext(ctx)->blitProgram(); + blitProgram->bind(); + blitProgram->setUniformValue("imageTexture", 0 /*QT_IMAGE_TEXTURE_UNIT*/); + + // The shader manager's blit program does not multiply the + // vertices by the pmv matrix, so we need to do the effect + // of the orthographic projection here ourselves. + QRectF r; + qreal w = viewport.width(); + qreal h = viewport.height(); + r.setLeft((targetRect.left() / w) * 2.0f - 1.0f); + if (targetRect.right() == (viewport.width() - 1)) + r.setRight(1.0f); + else + r.setRight((targetRect.right() / w) * 2.0f - 1.0f); + r.setBottom((targetRect.top() / h) * 2.0f - 1.0f); + if (targetRect.bottom() == (viewport.height() - 1)) + r.setTop(1.0f); + else + r.setTop((targetRect.bottom() / w) * 2.0f - 1.0f); + + drawTexture(r, texture, texSize, sourceRect); +} + +void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &offset) +{ //### Find out why d_ptr->geometry_updated isn't always false. // flush() should not be called when d_ptr->geometry_updated is true. It assumes that either // d_ptr->fbo or d_ptr->pb is allocated and has the correct size. @@ -534,12 +566,29 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & } } #endif - if (hasPartialUpdateSupport() && - d_ptr->paintedRegion.boundingRect().width() * d_ptr->paintedRegion.boundingRect().height() < - geometry().width() * geometry().height() * 0.2) { - context()->d_func()->swapRegion(&d_ptr->paintedRegion); - } else - context()->swapBuffers(); + bool doingPartialUpdate = hasPartialUpdateSupport() && br.width() * br.height() < parent->geometry().width() * parent->geometry().height() * 0.2; + QGLContext *ctx = reinterpret_cast<QGLContext *>(parent->d_func()->extraData()->glContext); + if (widget != window()) { + if (initializeOffscreenTexture(window()->size())) + qWarning() << "QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss"; + glBindTexture(target, d_ptr->tex_id); + + const uint bottom = window()->height() - (br.y() + br.height()); + glCopyTexSubImage2D(target, 0, br.x(), bottom, br.x(), bottom, br.width(), br.height()); + + glBindTexture(target, 0); + + ctx->makeCurrent(); + if (doingPartialUpdate) + blitTexture(ctx, d_ptr->tex_id, parent->size(), window()->size(), rect, br); + else + blitTexture(ctx, d_ptr->tex_id, parent->size(), window()->size(), parent->rect(), parent->rect().translated(offset + wOffset)); + } + + if (doingPartialUpdate) + ctx->d_func()->swapRegion(br); + else + ctx->swapBuffers(); d_ptr->paintedRegion = QRegion(); } else { @@ -665,38 +714,10 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & else if (d_ptr->fbo) { Q_UNUSED(target); - GLuint texture = d_ptr->fbo->texture(); - - glDisable(GL_DEPTH_TEST); - if (d_ptr->fbo->isBound()) d_ptr->fbo->release(); - glViewport(0, 0, size.width(), size.height()); - - QGLShaderProgram *blitProgram = - QGLEngineSharedShaders::shadersForContext(ctx)->blitProgram(); - blitProgram->bind(); - blitProgram->setUniformValue("imageTexture", 0 /*QT_IMAGE_TEXTURE_UNIT*/); - - // The shader manager's blit program does not multiply the - // vertices by the pmv matrix, so we need to do the effect - // of the orthographic projection here ourselves. - QRectF r; - qreal w = size.width() ? size.width() : 1.0f; - qreal h = size.height() ? size.height() : 1.0f; - r.setLeft((rect.left() / w) * 2.0f - 1.0f); - if (rect.right() == (size.width() - 1)) - r.setRight(1.0f); - else - r.setRight((rect.right() / w) * 2.0f - 1.0f); - r.setBottom((rect.top() / h) * 2.0f - 1.0f); - if (rect.bottom() == (size.height() - 1)) - r.setTop(1.0f); - else - r.setTop((rect.bottom() / w) * 2.0f - 1.0f); - - drawTexture(r, texture, window()->size(), br); + blitTexture(ctx, d_ptr->fbo->texture(), size, window()->size(), rect, br); } #endif @@ -719,7 +740,6 @@ void QGLWindowSurface::updateGeometry() { return; d_ptr->geometry_updated = false; - QRect rect = geometry(); hijackWindow(window()); QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext); @@ -740,11 +760,8 @@ void QGLWindowSurface::updateGeometry() { if (d_ptr->ctx) { #ifndef QT_OPENGL_ES_2 - if (d_ptr->destructive_swap_buffers) { - glBindTexture(target, d_ptr->tex_id); - glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0); - glBindTexture(target, 0); - } + if (d_ptr->destructive_swap_buffers) + initializeOffscreenTexture(rect.size()); #endif return; } @@ -824,15 +841,8 @@ void QGLWindowSurface::updateGeometry() { ctx->makeCurrent(); #ifndef QT_OPENGL_ES_2 - if (d_ptr->destructive_swap_buffers) { - glGenTextures(1, &d_ptr->tex_id); - glBindTexture(target, d_ptr->tex_id); - glTexImage2D(target, 0, GL_RGBA, rect.width(), rect.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0); - - glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glBindTexture(target, 0); - } + if (d_ptr->destructive_swap_buffers) + initializeOffscreenTexture(rect.size()); #endif qDebug() << "QGLWindowSurface: Using plain widget as window surface" << this;; @@ -840,6 +850,23 @@ void QGLWindowSurface::updateGeometry() { d_ptr->ctx->d_ptr->internal_context = true; } +bool QGLWindowSurface::initializeOffscreenTexture(const QSize &size) +{ + if (size == d_ptr->textureSize) + return false; + + glGenTextures(1, &d_ptr->tex_id); + glBindTexture(GL_TEXTURE_2D, d_ptr->tex_id); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, size.width(), size.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, 0); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glBindTexture(GL_TEXTURE_2D, 0); + + d_ptr->textureSize = size; + return true; +} + bool QGLWindowSurface::scroll(const QRegion &area, int dx, int dy) { // this code randomly fails currently for unknown reasons diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h index ffc2e86..6906f35 100644 --- a/src/opengl/qwindowsurface_gl_p.h +++ b/src/opengl/qwindowsurface_gl_p.h @@ -107,6 +107,7 @@ private slots: private: void hijackWindow(QWidget *widget); + bool initializeOffscreenTexture(const QSize &size); QGLWindowSurfacePrivate *d_ptr; }; diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 7f81397..85723ce 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -760,7 +760,7 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/) { #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG qDebug() << "QNS this : " << QString::number((uint)this) << " - " - << "roaming Error() occured, isOpen is: " << isOpen; + << "roaming Error() occurred, isOpen is: " << isOpen; #endif if (isOpen) { isOpen = false; diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index ef273c1..b4dfc4d 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -976,7 +976,7 @@ void SymbianEngine::RunL() QMutexLocker locker(&mutex); if (iStatus != KErrCancel) { - // By default, start relistening notifications. Stop only if interesting event occured. + // By default, start relistening notifications. Stop only if interesting event occurred. iWaitingCommsDatabaseNotifications = true; RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int()); switch (event) { diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index bf6164d..f2ee6ae 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -1554,9 +1554,8 @@ void QDirectFBScreen::exposeRegion(QRegion r, int) : (DSBLIT_BLEND_ALPHACHANNEL|DSBLIT_BLEND_COLORALPHA); } } - if (!region.isEmpty()) { - solidFill(d_ptr->backgroundColor, region); - } + + solidFill(d_ptr->backgroundColor, region); while (idx > 0) { const PaintCommand &cmd = commands[--idx]; @@ -1629,29 +1628,34 @@ void QDirectFBScreen::solidFill(const QColor &color, const QRegion ®ion) Q_UNUSED(color); Q_UNUSED(region); #else + QDirectFBScreen::solidFill(d_ptr->primarySurface, color, region); +#endif +} + +static inline void clearRect(IDirectFBSurface *surface, const QColor &color, const QRect &rect) +{ + Q_ASSERT(surface); + const DFBRegion region = { rect.left(), rect.top(), rect.right(), rect.bottom() }; + // could just reinterpret_cast this to a DFBRegion + surface->SetClip(surface, ®ion); + surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha()); +} + +void QDirectFBScreen::solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion ®ion) +{ if (region.isEmpty()) return; - d_ptr->primarySurface->SetColor(d_ptr->primarySurface, - color.red(), color.green(), color.blue(), - color.alpha()); const int n = region.rectCount(); if (n == 1) { - const QRect r = region.boundingRect(); - d_ptr->primarySurface->FillRectangle(d_ptr->primarySurface, r.x(), r.y(), r.width(), r.height()); + clearRect(surface, color, region.boundingRect()); } else { const QVector<QRect> rects = region.rects(); - QVarLengthArray<DFBRectangle, 32> rectArray(n); for (int i=0; i<n; ++i) { - const QRect &r = rects.at(i); - rectArray[i].x = r.x(); - rectArray[i].y = r.y(); - rectArray[i].w = r.width(); - rectArray[i].h = r.height(); + clearRect(surface, color, rects.at(i)); } - d_ptr->primarySurface->FillRectangles(d_ptr->primarySurface, rectArray.constData(), n); } -#endif + surface->SetClip(surface, 0); } QImage::Format QDirectFBScreen::alphaPixmapFormat() const diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index c483020..1085423 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -159,6 +159,7 @@ public: void exposeRegion(QRegion r, int changing); void solidFill(const QColor &color, const QRegion ®ion); + static void solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion ®ion); void setMode(int width, int height, int depth); void blank(bool on); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 51969fc..2eeee24 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -380,11 +380,18 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, flushPending = false; } -void QDirectFBWindowSurface::beginPaint(const QRegion &) +void QDirectFBWindowSurface::beginPaint(const QRegion ®ion) { if (!engine) { engine = new QDirectFBPaintEngine(this); } + + if (dfbSurface) { + const QWidget *win = window(); + if (win && win->testAttribute(Qt::WA_NoSystemBackground)) { + QDirectFBScreen::solidFill(dfbSurface, Qt::transparent, region); + } + } flushPending = true; } diff --git a/src/plugins/graphicssystems/meego/dithering.cpp b/src/plugins/graphicssystems/meego/dithering.cpp new file mode 100644 index 0000000..ba6b99b --- /dev/null +++ b/src/plugins/graphicssystems/meego/dithering.cpp @@ -0,0 +1,267 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +// This is an implementation of the 32bit => 16bit Floyd-Steinberg dithering. +// The alghorithm used here is not the fastest possible but it's prolly fast enough: +// uses look-up tables, integer-only arthmetics and works in one pass on two lines +// at a time. It's a high-quality dithering using 1/8 diffusion precission. +// Two functions here to look at: +// +// * convertRGBA32_to_RGB565 +// * convertRGBA32_to_RGBA4444 +// +// Each channel (RGBA) is diffused independently and alpha is dithered too. + +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <math.h> + +// Gets a component (red = 1, green = 2...) from a RGBA data structure. +// data is unsigned char. stride is the number of bytes per line. +#define GET_RGBA_COMPONENT(data, x, y, stride, c) (data[(y * stride) + (x << 2) + c]) + +// Writes a new pixel with r, g, b to data in 565 16bit format. Data is a short. +#define PUT_565(data, x, y, width, r, g, b) (data[(y * width) + x] = (r << 11) | (g << 5) | b) + +// Writes a new pixel with r, g, b, a to data in 4444 RGBA 16bit format. Data is a short. +#define PUT_4444(data, x, y, width, r, g, b, a) (data[(y * width) + x] = (r << 12) | (g << 8) | (b << 4) | a) + +// Writes(ads) a new value to the diffusion accumulator. accumulator is a short. +// x, y is a position in the accumulation buffer. y can be 0 or 1 -- we operate on two lines at time. +#define ACCUMULATE(accumulator, x, y, width, v) if (x < width && x > 0) accumulator[(y * width) + x] += v + +// Clamps a value to be in 0..255 range. +#define CLAMP_256(v) if (v > 255) v = 255; if (v < 0) v = 0; + +// Converts incoming RGB32 (QImage::Format_RGB32) to RGB565. Returns the newly allocated data. +unsigned short* convertRGB32_to_RGB565(const unsigned char *in, int width, int height, int stride) +{ + // Will store output + unsigned short *out = (unsigned short *) malloc(width * height * 2); + + // Lookup tables for the 8bit => 6bit and 8bit => 5bit conversion + unsigned char lookup_8bit_to_5bit[256]; + short lookup_8bit_to_5bit_diff[256]; + unsigned char lookup_8bit_to_6bit[256]; + short lookup_8bit_to_6bit_diff[256]; + + // Macros for the conversion using the lookup table. + #define CONVERT_8BIT_TO_5BIT(v) (lookup_8bit_to_5bit[v]) + #define DIFF_8BIT_TO_5BIT(v) (lookup_8bit_to_5bit_diff[v]) + + #define CONVERT_8BIT_TO_6BIT(v) (lookup_8bit_to_6bit[v]) + #define DIFF_8BIT_TO_6BIT(v) (lookup_8bit_to_6bit_diff[v]) + + int i; + int x, y, c; // Pixel we're processing. c is component number (0, 1, 2 for r, b, b) + short component[3]; // Stores the new components (r, g, b) for pixel produced during conversion + short diff; // The difference between the converted value and the original one. To be accumulated. + short accumulator[3][width * 2]; // Three acumulators for r, g, b. Each accumulator is two lines. + + // Produce the conversion lookup tables. + for (i = 0; i < 256; i++) { + lookup_8bit_to_5bit[i] = round(i / 8.0); + if (lookup_8bit_to_5bit[i] > 31) + lookup_8bit_to_5bit[i] -= 1; + + // Before bitshifts: (i * 8) - (... * 8 * 8) + lookup_8bit_to_5bit_diff[i] = (i << 3) - (lookup_8bit_to_5bit[i] << 6); + + lookup_8bit_to_6bit[i] = round(i / 4.0); + if (lookup_8bit_to_6bit[i] > 63) + lookup_8bit_to_6bit[i] -= 1; + + // Before bitshifts: (i * 8) - (... * 4 * 8) + lookup_8bit_to_6bit_diff[i] = (i << 3) - (lookup_8bit_to_6bit[i] << 5); + } + + // Clear the accumulators + memset(accumulator[0], 0, width * 4); + memset(accumulator[1], 0, width * 4); + memset(accumulator[2], 0, width * 4); + + // For each line... + for (y = 0; y < height; y++) { + + // For each accumulator, move the second line (index 1) to replace the first line (index 0). + // Clear the second line (index 1) + memcpy(accumulator[0], accumulator[0] + width, width * 2); + memset(accumulator[0] + width, 0, width * 2); + + memcpy(accumulator[1], accumulator[1] + width, width * 2); + memset(accumulator[1] + width, 0, width * 2); + + memcpy(accumulator[2], accumulator[2] + width, width * 2); + memset(accumulator[2] + width, 0, width * 2); + + // For each column.... + for (x = 0; x < width; x++) { + + // For each component (r, g, b)... + for (c = 0; c < 3; c++) { + + // Get the 8bit value from the original image + component[c] = GET_RGBA_COMPONENT(in, x, y, stride, c); + + // Add the diffusion for this pixel we stored in the accumulator. + // >> 7 because the values in accumulator are stored * 128 + component[c] += accumulator[c][x] >> 7; + + // Make sure we're not over the boundaries. + CLAMP_256(component[c]); + + // For green component we use 6 bits. Otherwise 5 bits. + // Store the difference from converting 8bit => 6 bit and the orig pixel. + // Convert 8bit => 6(5) bit. + if (c == 1) { + diff = DIFF_8BIT_TO_6BIT(component[c]); + component[c] = CONVERT_8BIT_TO_6BIT(component[c]); + } else { + diff = DIFF_8BIT_TO_5BIT(component[c]); + component[c] = CONVERT_8BIT_TO_5BIT(component[c]); + } + + // Distribute the difference according to the matrix in the + // accumulation bufffer. + ACCUMULATE(accumulator[c], x + 1, 0, width, diff * 7); + ACCUMULATE(accumulator[c], x - 1, 1, width, diff * 3); + ACCUMULATE(accumulator[c], x, 1, width, diff * 5); + ACCUMULATE(accumulator[c], x + 1, 1, width, diff * 1); + } + + // Write the newly produced pixel + PUT_565(out, x, y, width, component[2], component[1], component[0]); + } + } + + return out; +} + +// Converts incoming RGBA32 (QImage::Format_ARGB32_Premultiplied) to RGB565. Returns the newly allocated data. +// This function is similar (yet different) to the _565 variant but it makes sense to duplicate it here for simplicity. +unsigned short* convertARGB32_to_RGBA4444(const unsigned char *in, int width, int height, int stride) +{ + // Will store output + unsigned short *out = (unsigned short *) malloc(width * height * 2); + + // Lookup tables for the 8bit => 4bit conversion + unsigned char lookup_8bit_to_4bit[256]; + short lookup_8bit_to_4bit_diff[256]; + + // Macros for the conversion using the lookup table. + #define CONVERT_8BIT_TO_4BIT(v) (lookup_8bit_to_4bit[v]) + #define DIFF_8BIT_TO_4BIT(v) (lookup_8bit_to_4bit_diff[v]) + + int i; + int x, y, c; // Pixel we're processing. c is component number (0, 1, 2, 3 for r, b, b, a) + short component[4]; // Stores the new components (r, g, b, a) for pixel produced during conversion + short diff; // The difference between the converted value and the original one. To be accumulated. + short accumulator[4][width * 2]; // Four acumulators for r, g, b, a. Each accumulator is two lines. + + // Produce the conversion lookup tables. + for (i = 0; i < 256; i++) { + lookup_8bit_to_4bit[i] = round(i / 16.0); + if (lookup_8bit_to_4bit[i] > 15) + lookup_8bit_to_4bit[i] -= 1; + + // Before bitshifts: (i * 8) - (... * 16 * 8) + lookup_8bit_to_4bit_diff[i] = (i << 3) - (lookup_8bit_to_4bit[i] << 7); + } + + // Clear the accumulators + memset(accumulator[0], 0, width * 4); + memset(accumulator[1], 0, width * 4); + memset(accumulator[2], 0, width * 4); + memset(accumulator[3], 0, width * 4); + + // For each line... + for (y = 0; y < height; y++) { + + // For each component (r, g, b, a)... + memcpy(accumulator[0], accumulator[0] + width, width * 2); + memset(accumulator[0] + width, 0, width * 2); + + memcpy(accumulator[1], accumulator[1] + width, width * 2); + memset(accumulator[1] + width, 0, width * 2); + + memcpy(accumulator[2], accumulator[2] + width, width * 2); + memset(accumulator[2] + width, 0, width * 2); + + memcpy(accumulator[3], accumulator[3] + width, width * 2); + memset(accumulator[3] + width, 0, width * 2); + + // For each column.... + for (x = 0; x < width; x++) { + + // For each component (r, g, b, a)... + for (c = 0; c < 4; c++) { + + // Get the 8bit value from the original image + component[c] = GET_RGBA_COMPONENT(in, x, y, stride, c); + + // Add the diffusion for this pixel we stored in the accumulator. + // >> 7 because the values in accumulator are stored * 128 + component[c] += accumulator[c][x] >> 7; + + // Make sure we're not over the boundaries. + CLAMP_256(component[c]); + + // Store the difference from converting 8bit => 4bit and the orig pixel. + // Convert 8bit => 4bit. + diff = DIFF_8BIT_TO_4BIT(component[c]); + component[c] = CONVERT_8BIT_TO_4BIT(component[c]); + + // Distribute the difference according to the matrix in the + // accumulation bufffer. + ACCUMULATE(accumulator[c], x + 1, 0, width, diff * 7); + ACCUMULATE(accumulator[c], x - 1, 1, width, diff * 3); + ACCUMULATE(accumulator[c], x, 1, width, diff * 5); + ACCUMULATE(accumulator[c], x + 1, 1, width, diff * 1); + } + + // Write the newly produced pixel + PUT_4444(out, x, y, width, component[0], component[1], component[2], component[3]); + } + } + + return out; +} diff --git a/src/plugins/graphicssystems/meego/meego.pro b/src/plugins/graphicssystems/meego/meego.pro index 0b157fa..0d3cce6 100644 --- a/src/plugins/graphicssystems/meego/meego.pro +++ b/src/plugins/graphicssystems/meego/meego.pro @@ -6,7 +6,7 @@ QT += gui opengl QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/graphicssystems HEADERS = qmeegographicssystem.h qmeegopixmapdata.h qmeegoextensions.h qmeegorasterpixmapdata.h qmeegolivepixmapdata.h -SOURCES = qmeegographicssystem.cpp qmeegographicssystem.h qmeegographicssystemplugin.h qmeegographicssystemplugin.cpp qmeegopixmapdata.h qmeegopixmapdata.cpp qmeegoextensions.h qmeegoextensions.cpp qmeegorasterpixmapdata.h qmeegorasterpixmapdata.cpp qmeegolivepixmapdata.cpp qmeegolivepixmapdata.h +SOURCES = qmeegographicssystem.cpp qmeegographicssystem.h qmeegographicssystemplugin.h qmeegographicssystemplugin.cpp qmeegopixmapdata.h qmeegopixmapdata.cpp qmeegoextensions.h qmeegoextensions.cpp qmeegorasterpixmapdata.h qmeegorasterpixmapdata.cpp qmeegolivepixmapdata.cpp qmeegolivepixmapdata.h dithering.cpp target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems INSTALLS += target diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp index 0899f2d..02a4273 100644 --- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp @@ -48,28 +48,14 @@ #include <private/qapplication_p.h> #include <private/qgraphicssystem_runtime_p.h> +// from dithering.cpp +extern unsigned short* convertRGB32_to_RGB565(const unsigned char *in, int width, int height, int stride); +extern unsigned short* convertARGB32_to_RGBA4444(const unsigned char *in, int width, int height, int stride); + static EGLint preserved_image_attribs[] = { EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE }; QHash <void*, QMeeGoImageInfo*> QMeeGoPixmapData::sharedImagesMap; -// This helper method converts (in place) a QImage::Format_ARGB4444_Premultiplied to -// GL-friendly Format_RGBA4444_Premultiplied. Just swaps the bits around really. -static void qARGBA4ToRGBA4(QImage *image) -{ - unsigned char *raw = static_cast <unsigned char *> (image->data_ptr()->data); - // FIXME image.bytesPerLine() is broken. Returns 512 for 128x128 image while it should - // return 256 - int bytesPerLine = image->width() * 2; - - for (int y = 0; y < image->height(); y++) { - for (int x = 0; x < image->width(); x++) { - unsigned short *target = (unsigned short *) (raw + (y * bytesPerLine + (x * 2))); - // FIXME Oh yeah, that's broken with endianness. - *target = (*target << 4) | (* target >> 12); - } - } -} - /* Public */ QMeeGoPixmapData::QMeeGoPixmapData() : QGLPixmapData(QPixmapData::PixmapType) @@ -160,12 +146,13 @@ Qt::HANDLE QMeeGoPixmapData::imageToEGLSharedImage(const QImage &image) glGenTextures(1, &textureId); glBindTexture(GL_TEXTURE_2D, textureId); if (image.hasAlphaChannel() && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels()) { - QImage convertedImage = image.convertToFormat(QImage::Format_ARGB4444_Premultiplied, Qt::DiffuseAlphaDither | Qt::DiffuseDither | Qt::PreferDither); - qARGBA4ToRGBA4(&convertedImage); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, convertedImage.bits()); + void *converted = convertARGB32_to_RGBA4444(image.bits(), image.width(), image.height(), image.bytesPerLine()); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, converted); + free(converted); } else { - QImage convertedImage = image.convertToFormat(QImage::Format_RGB16, Qt::DiffuseAlphaDither | Qt::DiffuseDither | Qt::PreferDither); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, convertedImage.bits()); + void *converted = convertRGB32_to_RGB565(image.bits(), image.width(), image.height(), image.bytesPerLine()); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, converted); + free(converted); } glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp index 64fd99c..3d753dc 100644 --- a/src/sql/kernel/qsqldriver.cpp +++ b/src/sql/kernel/qsqldriver.cpp @@ -396,7 +396,7 @@ QString QSqlDriver::escapeIdentifier(const QString &identifier, IdentifierType) \a identifier can either be a table name or field name, dependent on \a type. - \warning Because of binary compatability constraints, this function is not virtual. + \warning Because of binary compatibility constraints, this function is not virtual. If you want to provide your own implementation in your QSqlDriver subclass, reimplement the isIdentifierEscapedImplementation() slot in your subclass instead. The isIdentifierEscapedFunction() will dynamically detect the slot and call it. @@ -421,7 +421,7 @@ bool QSqlDriver::isIdentifierEscaped(const QString &identifier, IdentifierType t and trailing delimiter characters, \a identifier is returned without modification. - \warning Because of binary compatability constraints, this function is not virtual, + \warning Because of binary compatibility constraints, this function is not virtual, If you want to provide your own implementation in your QSqlDriver subclass, reimplement the stripDelimitersImplementation() slot in your subclass instead. The stripDelimiters() function will dynamically detect the slot and call it. @@ -871,7 +871,7 @@ QStringList QSqlDriver::subscribedToNotificationsImplementation() const \a identifier can either be a table name or field name, dependent on \a type. - Because of binary compatability constraints, isIdentifierEscaped() function + Because of binary compatibility constraints, isIdentifierEscaped() function (introduced in Qt 4.5) is not virtual. Instead, isIdentifierEscaped() will dynamically detect and call \e this slot. The default implementation assumes the escape/delimiter character is a double quote. Reimplement this @@ -896,7 +896,7 @@ bool QSqlDriver::isIdentifierEscapedImplementation(const QString &identifier, Id If \a identifier does not have leading and trailing delimiter characters, \a identifier is returned without modification. - Because of binary compatability constraints, the stripDelimiters() function + Because of binary compatibility constraints, the stripDelimiters() function (introduced in Qt 4.5) is not virtual. Instead, stripDelimiters() will dynamically detect and call \e this slot. It generally unnecessary to reimplement this slot. |