summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-14 16:53:47 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-14 16:53:47 (GMT)
commit30b415bf8644961d3e5b108b0b7c1b1abf07f685 (patch)
tree4a3d5c3f3428971544ad46a47f74d3b9e6a58bcc
parent4d2936ffd9291d27d57d056794b44f872a1e13ad (diff)
parentf8cf4296e2f1174610b8e095e9d0a496392fe70a (diff)
downloadQt-30b415bf8644961d3e5b108b0b7c1b1abf07f685.zip
Qt-30b415bf8644961d3e5b108b0b7c1b1abf07f685.tar.gz
Qt-30b415bf8644961d3e5b108b0b7c1b1abf07f685.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: QGraphicsWidget update issues with ItemHasNoContents + effect Fixed missing background for regular Qt applications with MeeGo system. Fix top-left corner of rounded rects in QPaintEngineEx
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp5
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/openvg/qpaintengine_vg.cpp2
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp1
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp29
5 files changed, 34 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 36a24db..921e121 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4984,14 +4984,15 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
return;
}
- bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents
- && !item->d_ptr->graphicsEffect;
+ bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents;
if (!hasNoContents) {
item->d_ptr->dirty = 1;
if (fullItemUpdate)
item->d_ptr->fullUpdatePending = 1;
else if (!item->d_ptr->fullUpdatePending)
item->d_ptr->needsRepaint |= rect;
+ } else if (item->d_ptr->graphicsEffect) {
+ invalidateChildren = true;
}
if (invalidateChildren) {
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 881bd6e..1e857e4 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -768,7 +768,7 @@ void QPaintEngineEx::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yR
x1, y2 - (1 - KAPPA) * yRadius,
x1, y2 - yRadius,
x1, y1 + yRadius, // LineTo
- x1, y1 + KAPPA * yRadius, // CurveTo
+ x1, y1 + (1 - KAPPA) * yRadius, // CurveTo
x1 + (1 - KAPPA) * xRadius, y1,
x1 + xRadius, y1
};
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 1b0c5e8..3c2fd3d 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -1008,7 +1008,7 @@ VGPath QVGPaintEnginePrivate::roundedRectPath(const QRectF &rect, qreal xRadius,
x1, y2 - (1 - KAPPA) * yRadius,
x1, y2 - yRadius,
x1, y1 + yRadius, // LineTo
- x1, y1 + KAPPA * yRadius, // CurveTo
+ x1, y1 + (1 - KAPPA) * yRadius, // CurveTo
x1 + (1 - KAPPA) * xRadius, y1,
x1 + xRadius, y1
};
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index e2c8425..2a64d49 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -73,7 +73,6 @@ QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const
{
QMeeGoGraphicsSystem::surfaceWasCreated = true;
QWindowSurface *surface = new QGLWindowSurface(widget);
- surface->window()->setAttribute(Qt::WA_NoSystemBackground);
return surface;
}
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
index fa6a5ec..e1bfb79 100644
--- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -76,6 +76,7 @@ private slots:
void dropShadowClipping();
void childrenVisibilityShouldInvalidateCache();
void prepareGeometryChangeInvalidateCache();
+ void itemHasNoContents();
};
void tst_QGraphicsEffect::initTestCase()
@@ -675,6 +676,34 @@ void tst_QGraphicsEffect::prepareGeometryChangeInvalidateCache()
QCOMPARE(item->nbPaint, 0);
}
+void tst_QGraphicsEffect::itemHasNoContents()
+{
+ QGraphicsRectItem *parent = new QGraphicsRectItem;
+ parent->setFlag(QGraphicsItem::ItemHasNoContents);
+
+ MyGraphicsItem *child = new MyGraphicsItem;
+ child->setParentItem(parent);
+ child->resize(200, 200);
+
+ QGraphicsScene scene;
+ scene.addItem(parent);
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(child->nbPaint, 1);
+
+ CustomEffect *effect = new CustomEffect;
+ parent->setGraphicsEffect(effect);
+ QTRY_COMPARE(effect->numRepaints, 1);
+
+ for (int i = 0; i < 3; ++i) {
+ effect->reset();
+ effect->update();
+ QTRY_COMPARE(effect->numRepaints, 1);
+ }
+}
+
QTEST_MAIN(tst_QGraphicsEffect)
#include "tst_qgraphicseffect.moc"