diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-03-23 23:11:53 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-03-23 23:11:53 (GMT) |
commit | 838e4cc024f4589322d5279acd96e3ca4d00e1f5 (patch) | |
tree | 8a5d4e50ac67e07d6116a504b39de8768ed5540e /src | |
parent | 6801a97671f64ef30ab312b38d16abc964ad6ac5 (diff) | |
parent | e3999a4f91194b7508dbd1d3e6f595f729022ed7 (diff) | |
download | Qt-838e4cc024f4589322d5279acd96e3ca4d00e1f5.zip Qt-838e4cc024f4589322d5279acd96e3ca4d00e1f5.tar.gz Qt-838e4cc024f4589322d5279acd96e3ca4d00e1f5.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts:
tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h | 4 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h | 4 | ||||
-rw-r--r-- | src/corelib/animation/qsequentialanimationgroup.cpp | 7 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 63 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 8 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 12 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 14 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.h | 1 | ||||
-rw-r--r-- | src/qt3support/network/q3socketdevice_win.cpp | 1 |
12 files changed, 67 insertions, 53 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h index 5fb7fe3..5b655e8 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h @@ -75,7 +75,7 @@ #include <libkern/OSAtomic.h> #elif OS(ANDROID) #include <cutils/atomic.h> -#elif COMPILER(GCC) && !PLATFORM(SYMBIAN) +#elif COMPILER(GCC) && !defined(__SYMBIAN32__) #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) #include <ext/atomicity.h> #else @@ -239,7 +239,7 @@ inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Bar inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } inline int atomicDecrement(int volatile* addend) { return android_atomic_dec(addend); } -#elif COMPILER(GCC) && !PLATFORM(SPARC64) && !PLATFORM(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc +#elif COMPILER(GCC) && !PLATFORM(SPARC64) && !defined(__SYMBIAN32__) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h index 52a24f6..3e25c95 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h @@ -73,7 +73,7 @@ #include <windows.h> #elif PLATFORM(DARWIN) #include <libkern/OSAtomic.h> -#elif COMPILER(GCC) && !PLATFORM(SYMBIAN) +#elif COMPILER(GCC) && !defined(__SYMBIAN32__) #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) #include <ext/atomicity.h> #else @@ -232,7 +232,7 @@ inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(r inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); } inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(addend)); } -#elif COMPILER(GCC) && !PLATFORM(SPARC64) && !PLATFORM(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc +#elif COMPILER(GCC) && !PLATFORM(SPARC64) && !defined(__SYMBIAN32__) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp index 7617c1f..5ca30e6 100644 --- a/src/corelib/animation/qsequentialanimationgroup.cpp +++ b/src/corelib/animation/qsequentialanimationgroup.cpp @@ -464,12 +464,7 @@ void QSequentialAnimationGroupPrivate::setCurrentAnimation(int index, bool inter void QSequentialAnimationGroupPrivate::activateCurrentAnimation(bool intermediate) { - Q_Q(QSequentialAnimationGroup); - - if (!currentAnimation) - return; - - if (state == QSequentialAnimationGroup::Stopped) + if (!currentAnimation || state == QSequentialAnimationGroup::Stopped) return; currentAnimation->stop(); diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 312c4b2..4ad78fd 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -483,38 +483,37 @@ int QMetaObject::classInfoCount() const } /** \internal -* helper class for indexOf{Method,Slot,Signal}, returns the relative index of the method within +* helper function for indexOf{Method,Slot,Signal}, returns the relative index of the method within * the baseObject * \a MethodType might be MethodSignal or MethodSlot, or 0 to match everything. +* \a normalizeStringData set to true if we should do a second pass for old moc generated files normalizing all the symbols. */ template<int MethodType> static inline int indexOfMethodRelative(const QMetaObject **baseObject, const char *method, bool normalizeStringData) { - const QMetaObject *m; - for (m = *baseObject; m; m = *baseObject = m->d.superdata) { - const QMetaObject *const m = *baseObject; + for (const QMetaObject *m = *baseObject; m; m = m->d.superdata) { int i = (MethodType == MethodSignal && priv(m->d.data)->revision >= 4) ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); - if (i < 0) - continue; - const int end = (MethodType == MethodSlot && priv(m->d.data)->revision >= 4) ? (priv(m->d.data)->signalCount) : 0; if (!normalizeStringData) { for (; i >= end; --i) { - if ((MethodType == 0 || (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) - && strcmp(method, m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) + const char *stringdata = m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5*i]; + if (method[0] == stringdata[0] && strcmp(method + 1, stringdata + 1) == 0) { + *baseObject = m; return i; + } } } else if (priv(m->d.data)->revision < 5) { - const char *stringdata = (m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5 * i]); - const QByteArray normalizedSignature = QMetaObject::normalizedSignature(stringdata); for (; i >= end; --i) { - if ((MethodType == 0|| (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) - && normalizedSignature == method) + const char *stringdata = (m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5 * i]); + const QByteArray normalizedSignature = QMetaObject::normalizedSignature(stringdata); + if (normalizedSignature == method) { + *baseObject = m; return i; + } } } } @@ -537,8 +536,8 @@ int QMetaObject::indexOfConstructor(const char *constructor) const if (priv(d.data)->revision < 2) return -1; for (int i = priv(d.data)->constructorCount-1; i >= 0; --i) { - if (strcmp(constructor, d.stringdata - + d.data[priv(d.data)->constructorData + 5*i]) == 0) { + const char *data = d.stringdata + d.data[priv(d.data)->constructorData + 5*i]; + if (data[0] == constructor[0] && strcmp(constructor + 1, data + 1) == 0) { return i; } } @@ -682,18 +681,19 @@ static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, co */ int QMetaObject::indexOfEnumerator(const char *name) const { - int i = -1; const QMetaObject *m = this; - while (m && i < 0) { - for (i = priv(m->d.data)->enumeratorCount-1; i >= 0; --i) - if (strcmp(name, m->d.stringdata - + m->d.data[priv(m->d.data)->enumeratorData + 4*i]) == 0) { + while (m) { + const QMetaObjectPrivate *d = priv(m->d.data); + for (int i = d->enumeratorCount - 1; i >= 0; --i) { + const char *prop = m->d.stringdata + m->d.data[d->enumeratorData + 4*i]; + if (name[0] == prop[0] && strcmp(name + 1, prop + 1) == 0) { i += m->enumeratorOffset(); - break; + return i; } + } m = m->d.superdata; } - return i; + return -1; } /*! @@ -704,26 +704,27 @@ int QMetaObject::indexOfEnumerator(const char *name) const */ int QMetaObject::indexOfProperty(const char *name) const { - int i = -1; const QMetaObject *m = this; - while (m && i < 0) { - for (i = priv(m->d.data)->propertyCount-1; i >= 0; --i) - if (strcmp(name, m->d.stringdata - + m->d.data[priv(m->d.data)->propertyData + 3*i]) == 0) { + while (m) { + const QMetaObjectPrivate *d = priv(m->d.data); + for (int i = d->propertyCount-1; i >= 0; --i) { + const char *prop = m->d.stringdata + m->d.data[d->propertyData + 3*i]; + if (name[0] == prop[0] && strcmp(name + 1, prop + 1) == 0) { i += m->propertyOffset(); - break; + return i; } + } m = m->d.superdata; } - if (i == -1 && priv(this->d.data)->revision >= 3 && (priv(this->d.data)->flags & DynamicMetaObject)){ + if (priv(this->d.data)->revision >= 3 && (priv(this->d.data)->flags & DynamicMetaObject)) { QAbstractDynamicMetaObject *me = const_cast<QAbstractDynamicMetaObject *>(static_cast<const QAbstractDynamicMetaObject *>(this)); - i = me->createProperty(name, 0); + return me->createProperty(name, 0); } - return i; + return -1; } /*! diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3c255ef..948ff28 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3482,7 +3482,7 @@ void QGraphicsItem::setX(qreal x) if (qIsNaN(x)) return; - d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y())); + setPos(QPointF(x, d_ptr->pos.y())); } /*! @@ -3509,7 +3509,7 @@ void QGraphicsItem::setY(qreal y) if (qIsNaN(y)) return; - d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y)); + setPos(QPointF(d_ptr->pos.x(), y)); } /*! @@ -3577,7 +3577,7 @@ void QGraphicsItem::setPos(const QPointF &pos) return; // Update and repositition. - if (!(d_ptr->flags & ItemSendsGeometryChanges)) { + if (!(d_ptr->flags & ItemSendsGeometryChanges) && !(d_ptr->flags & ItemSendsScenePositionChanges)) { d_ptr->setPosHelper(pos); return; } @@ -10936,7 +10936,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP // Item coordinates with info. QTransform newEffectTransform = info->transformPtr->inverted(); newEffectTransform *= effectTransform; - scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, info->exposedRegion, + scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0, info->widget, info->opacity, &newEffectTransform, info->wasDirtySceneTransform, info->drawItem); } diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index bcdc7d3..29a4be8 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4721,7 +4721,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (item->d_ptr->graphicsEffect && item->d_ptr->graphicsEffect->isEnabled()) { ENSURE_TRANSFORM_PTR; QGraphicsItemPaintInfo info(viewTransform, transformPtr, effectTransform, exposedRegion, widget, &styleOptionTmp, - painter, opacity, wasDirtyParentSceneTransform, drawItem); + painter, opacity, wasDirtyParentSceneTransform, itemHasContents && !itemIsFullyTransparent); QGraphicsEffectSource *source = item->d_ptr->graphicsEffect->d_func()->source; QGraphicsItemEffectSourcePrivate *sourced = static_cast<QGraphicsItemEffectSourcePrivate *> (source->d_func()); diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 61ad79d..4636c50 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -674,15 +674,19 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto // refresh the height cache here; we don't really lose anything by getting the size hint, // since QAbstractItemView::dataChanged() will get the visualRect for the items anyway - int topViewIndex = d->viewIndex(topLeft); - if (topViewIndex == 0) - d->defaultItemHeight = indexRowSizeHint(topLeft); bool sizeChanged = false; + int topViewIndex = d->viewIndex(topLeft); + if (topViewIndex == 0) { + int newDefaultItemHeight = indexRowSizeHint(topLeft); + sizeChanged = d->defaultItemHeight != newDefaultItemHeight; + d->defaultItemHeight = newDefaultItemHeight; + } + if (topViewIndex != -1) { if (topLeft.row() == bottomRight.row()) { int oldHeight = d->itemHeight(topViewIndex); d->invalidateHeightCache(topViewIndex); - sizeChanged = (oldHeight != d->itemHeight(topViewIndex)); + sizeChanged |= (oldHeight != d->itemHeight(topViewIndex)); if (topLeft.column() == 0) d->viewItems[topViewIndex].hasChildren = d->hasVisibleChildren(topLeft); } else { diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index db4ace4..1c528fe 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7999,7 +7999,7 @@ start_lengthVariant: for (int i = 0; i < textLayout.lineCount(); i++) { QTextLine line = textLayout.lineAt(i); - qreal advance = textLayout.engine()->lines[i].textAdvance.toReal(); + qreal advance = line.horizontalAdvance(); if (tf & Qt::AlignRight) xoff = r.width() - advance; else if (tf & Qt::AlignHCenter) diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 6138e85..4a279a7 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -63,7 +63,7 @@ #include <AknUtils.h> #include <aknnavi.h> #include <gulicon.h> -#include <AknBitmapAnimation.h> +#include <aknbitmapanimation.h> #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 766053c..2fc5d1a 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1570,6 +1570,20 @@ qreal QTextLine::naturalTextWidth() const return eng->lines[i].textWidth.toReal(); } +/*! \since 4.7 + Returns the horizontal advance of the text. The advance of the text + is the distance from its position to the next position at which + text would naturally be drawn. + + By adding the advance to the position of the text line and using this + as the position of a second text line, you will be able to position + the two lines side-by-side without gaps in-between. +*/ +qreal QTextLine::horizontalAdvance() const +{ + return eng->lines[i].textAdvance.toReal(); +} + /*! Lays out the line with the given \a width. The line is filled from its starting position with as many characters as will fit into diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h index edae7de..8c93ed6 100644 --- a/src/gui/text/qtextlayout.h +++ b/src/gui/text/qtextlayout.h @@ -202,6 +202,7 @@ public: bool leadingIncluded() const; qreal naturalTextWidth() const; + qreal horizontalAdvance() const; QRectF naturalTextRect() const; enum Edge { diff --git a/src/qt3support/network/q3socketdevice_win.cpp b/src/qt3support/network/q3socketdevice_win.cpp index 528b50a..1354cfa 100644 --- a/src/qt3support/network/q3socketdevice_win.cpp +++ b/src/qt3support/network/q3socketdevice_win.cpp @@ -47,7 +47,6 @@ #include <string.h> -# include <qt_windows.h> #if defined (QT_NO_IPV6) # include <winsock.h> #else |