summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-23 23:11:53 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-23 23:11:53 (GMT)
commit838e4cc024f4589322d5279acd96e3ca4d00e1f5 (patch)
tree8a5d4e50ac67e07d6116a504b39de8768ed5540e /src/gui
parent6801a97671f64ef30ab312b38d16abc964ad6ac5 (diff)
parente3999a4f91194b7508dbd1d3e6f595f729022ed7 (diff)
downloadQt-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/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp8
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/gui/itemviews/qtreeview.cpp12
-rw-r--r--src/gui/painting/qpainter.cpp2
-rw-r--r--src/gui/styles/qs60style_s60.cpp2
-rw-r--r--src/gui/text/qtextlayout.cpp14
-rw-r--r--src/gui/text/qtextlayout.h1
7 files changed, 30 insertions, 11 deletions
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 {