summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-17 17:07:55 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-17 17:07:55 (GMT)
commit4f33dbd5361c0875f39518b762a764478f04dd30 (patch)
tree0ac6715405dba0e08cefa5a3d07241fe01a93445 /src
parent502f0e852b7e4ef00162246568d7cb7e2dfcae58 (diff)
parentfa373ee165b32b712690656a5f69f862292a2c1e (diff)
downloadQt-4f33dbd5361c0875f39518b762a764478f04dd30.zip
Qt-4f33dbd5361c0875f39518b762a764478f04dd30.tar.gz
Qt-4f33dbd5361c0875f39518b762a764478f04dd30.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Export qt_directfb_.* functions in plugin as well Added autotest for QPixmap::size() with null pixmaps. Update Symbian def files. QGraphicsItem::childrenBoundingRect behavior breaks QGraphicsEffect::sourceBoundingRect(). Wrong bounding rect returned by QGraphicsEffect::boundingRect(). Compile on Mac Ensure building of WebKit and QtConcurrent are disabled with SunCC.
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp43
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h16
-rw-r--r--src/gui/kernel/qwidget_mac.mm3
-rw-r--r--src/plugins/gfxdrivers/directfb/directfb.pro2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp2
-rw-r--r--src/s60installs/eabi/QtGuiu.def4
7 files changed, 35 insertions, 37 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2600d06..b404692 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1272,37 +1272,40 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
Returns the bounding rect of this item's children (excluding itself).
*/
-void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, bool doClip)
+void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
{
Q_Q(QGraphicsItem);
QRectF childrenRect;
QRectF *result = rect;
rect = &childrenRect;
+ const bool setTopMostEffectItem = !topMostEffectItem;
for (int i = 0; i < children.size(); ++i) {
QGraphicsItem *child = children.at(i);
QGraphicsItemPrivate *childd = child->d_ptr.data();
+ if (setTopMostEffectItem)
+ topMostEffectItem = child;
bool hasPos = !childd->pos.isNull();
if (hasPos || childd->transformData) {
// COMBINE
QTransform matrix = childd->transformToParent();
if (x)
matrix *= *x;
- *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect());
+ *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
if (!childd->children.isEmpty())
- childd->childrenBoundingRectHelper(&matrix, rect);
+ childd->childrenBoundingRectHelper(&matrix, rect, topMostEffectItem);
} else {
if (x)
- *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect());
+ *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
else
- *rect |= child->d_ptr->effectiveBoundingRect();
+ *rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);
if (!childd->children.isEmpty())
- childd->childrenBoundingRectHelper(x, rect);
+ childd->childrenBoundingRectHelper(x, rect, topMostEffectItem);
}
}
- if (doClip && (flags & QGraphicsItem::ItemClipsChildrenToShape)){
+ if (flags & QGraphicsItem::ItemClipsChildrenToShape){
if (x)
*rect &= x->mapRect(q->boundingRect());
else
@@ -1870,6 +1873,10 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
// Item children clipping changes. Propagate the ancestor flag to
// all children.
d_ptr->updateAncestorFlag(ItemClipsChildrenToShape);
+ // The childrenBoundingRect is clipped to the boundingRect in case of ItemClipsChildrenToShape,
+ // which means we have to invalidate the cached childrenBoundingRect whenever this flag changes.
+ d_ptr->dirtyChildrenBoundingRect = 1;
+ d_ptr->markParentDirty(true);
}
if ((flags & ItemIgnoresTransformations) != (oldFlags & ItemIgnoresTransformations)) {
@@ -2800,6 +2807,8 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const
Q_Q(const QGraphicsItem);
QGraphicsEffect *effect = graphicsEffect;
if (scene && effect && effect->isEnabled()) {
+ if (scene->d_func()->views.isEmpty())
+ return effect->boundingRectFor(rect);
QRectF sceneRect = q->mapRectToScene(rect);
QRectF sceneEffectRect;
foreach (QGraphicsView *view, scene->views()) {
@@ -2823,12 +2832,12 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const
\sa boundingRect()
*/
-QRectF QGraphicsItemPrivate::effectiveBoundingRect() const
+QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const
{
#ifndef QT_NO_GRAPHICSEFFECT
Q_Q(const QGraphicsItem);
QRectF brect = effectiveBoundingRect(q_ptr->boundingRect());
- if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
+ if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren || topMostEffectItem == q)
return brect;
const QGraphicsItem *effectParent = parent;
@@ -2839,8 +2848,10 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect() const
const QRectF effectRectInParentSpace = effectParent->d_ptr->effectiveBoundingRect(brectInParentSpace);
brect = effectParent->mapRectToItem(q, effectRectInParentSpace);
}
- if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
+ if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
+ || topMostEffectItem == effectParent) {
return brect;
+ }
effectParent = effectParent->d_ptr->parent;
}
@@ -4715,7 +4726,7 @@ QRectF QGraphicsItem::childrenBoundingRect() const
return d_ptr->childrenBoundingRect;
d_ptr->childrenBoundingRect = QRectF();
- d_ptr->childrenBoundingRectHelper(0, &d_ptr->childrenBoundingRect);
+ d_ptr->childrenBoundingRectHelper(0, &d_ptr->childrenBoundingRect, 0);
d_ptr->dirtyChildrenBoundingRect = 0;
return d_ptr->childrenBoundingRect;
}
@@ -11168,14 +11179,8 @@ QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem syste
}
QRectF rect = item->boundingRect();
- if (!item->d_ptr->children.isEmpty()) {
- if (dirtyChildrenBoundingRect) {
- childrenBoundingRect = QRectF();
- item->d_ptr->childrenBoundingRectHelper(0, &childrenBoundingRect, true);
- dirtyChildrenBoundingRect = false;
- }
- rect |= childrenBoundingRect;
- }
+ if (!item->d_ptr->children.isEmpty())
+ rect |= item->childrenBoundingRect();
if (deviceCoordinates) {
Q_ASSERT(info->painter);
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index cce9439..77e4054 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -300,10 +300,10 @@ public:
QDeclarativeListProperty<QGraphicsObject> childrenList();
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
const QVariant *thisPointerVariant);
- void childrenBoundingRectHelper(QTransform *x, QRectF *rect, bool doClip = true);
+ void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem);
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
const QRegion &exposedRegion, bool allItems = false) const;
- QRectF effectiveBoundingRect() const;
+ QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem = 0) const;
QRectF sceneEffectiveBoundingRect() const;
QRectF effectiveBoundingRect(const QRectF &rect) const;
@@ -661,7 +661,7 @@ class QGraphicsItemEffectSourcePrivate : public QGraphicsEffectSourcePrivate
{
public:
QGraphicsItemEffectSourcePrivate(QGraphicsItem *i)
- : QGraphicsEffectSourcePrivate(), dirtyChildrenBoundingRect(true), item(i), info(0)
+ : QGraphicsEffectSourcePrivate(), item(i), info(0)
{}
inline void detach()
@@ -712,9 +712,6 @@ public:
QGraphicsEffect::PixmapPadMode mode) const;
QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const;
- mutable bool dirtyChildrenBoundingRect;
- mutable QRectF childrenBoundingRect;
-
QGraphicsItem *item;
QGraphicsItemPaintInfo *info;
QTransform lastEffectTransform;
@@ -872,12 +869,9 @@ inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
#ifndef QT_NO_GRAPHICSEFFECT
if (parentp->graphicsEffect) {
if (updateBoundingRect) {
- QGraphicsItemEffectSourcePrivate *sourcep =
- static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
- ->source->d_func());
- parentp->dirtyChildrenBoundingRect = 1;
+ static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
+ ->source->d_func())->invalidateCache();
parentp->notifyInvalidated = 1;
- sourcep->invalidateCache();
}
if (parentp->scene && parentp->graphicsEffect->isEnabled()) {
parentp->dirty = 1;
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 159c45d..1e2aa9f 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -114,6 +114,9 @@
QT_BEGIN_NAMESPACE
+// qmainwindow.cpp
+extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
+
#define XCOORD_MAX 16383
#define WRECT_MAX 8191
diff --git a/src/plugins/gfxdrivers/directfb/directfb.pro b/src/plugins/gfxdrivers/directfb/directfb.pro
index 0706f01..d397050 100644
--- a/src/plugins/gfxdrivers/directfb/directfb.pro
+++ b/src/plugins/gfxdrivers/directfb/directfb.pro
@@ -11,5 +11,5 @@ SOURCES += qdirectfbscreenplugin.cpp
QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB
LIBS += $$QT_LIBS_DIRECTFB
-DEFINES += $$QT_DEFINES_DIRECTFB QT_DIRECTFB_PLUGIN
+DEFINES += $$QT_DEFINES_DIRECTFB
contains(gfx-plugins, directfb):DEFINES += QT_QWS_DIRECTFB
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index f704432..c0d96d7 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -585,7 +585,6 @@ void QDirectFBPixmapData::invalidate()
imageFormat = QImage::Format_Invalid;
}
-#ifndef QT_DIRECTFB_PLUGIN
Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_pixmap(const QPixmap &pixmap)
{
const QPixmapData *data = pixmap.pixmapData();
@@ -594,7 +593,6 @@ Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_pixmap(const QPixmap &pix
const QDirectFBPixmapData *dfbData = static_cast<const QDirectFBPixmapData*>(data);
return dfbData->directFBSurface();
}
-#endif
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index cffd4e3..bf6164d 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -1790,7 +1790,6 @@ IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, co
}
#endif
-#ifndef QT_DIRECTFB_PLUGIN
Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_widget(const QWidget *widget, QRect *rect)
{
return QDirectFBScreen::instance() ? QDirectFBScreen::instance()->surfaceForWidget(widget, rect) : 0;
@@ -1808,7 +1807,6 @@ Q_GUI_EXPORT IDirectFBWindow *qt_directfb_window_for_widget(const QWidget *widge
}
#endif
-#endif
QT_END_NAMESPACE
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 6696beb..47e893b 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -9389,7 +9389,7 @@ EXPORTS
_ZNK20QGraphicsItemPrivate19genericMapFromSceneERK7QPointFPK7QWidget @ 9388 NONAME
_ZNK20QGraphicsItemPrivate19maybeExtraItemCacheEv @ 9389 NONAME
_ZNK20QGraphicsItemPrivate20discardUpdateRequestEbbbb @ 9390 NONAME ABSENT
- _ZNK20QGraphicsItemPrivate21effectiveBoundingRectEv @ 9391 NONAME
+ _ZNK20QGraphicsItemPrivate21effectiveBoundingRectEv @ 9391 NONAME ABSENT
_ZNK20QGraphicsItemPrivate22inputMethodQueryHelperEN2Qt16InputMethodQueryE @ 9392 NONAME
_ZNK20QGraphicsItemPrivate24combineTransformToParentEP10QTransformPKS0_ @ 9393 NONAME
_ZNK20QGraphicsItemPrivate26combineTransformFromParentEP10QTransformPKS0_ @ 9394 NONAME
@@ -12092,6 +12092,6 @@ EXPORTS
_ZN11QFontEngine16lastRightBearingERK12QGlyphLayoutb @ 12091 NONAME
_ZN18QTapAndHoldGesture10setTimeoutEi @ 12092 NONAME
_ZN18QTapAndHoldGesture7timeoutEv @ 12093 NONAME
- _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12094 NONAME
+ _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFb @ 12094 NONAME ABSENT
_ZN20QGraphicsItemPrivate14children_clearEP24QDeclarativeListPropertyI15QGraphicsObjectE @ 12095 NONAME