summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp3
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp72
2 files changed, 0 insertions, 75 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 27fd09e..3ef311c 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3275,13 +3275,10 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
// Determine the exposed region
d->exposedRegion = event->region();
- if (d->exposedRegion.isEmpty())
- d->exposedRegion = viewport()->rect();
QRectF exposedSceneRect = mapToScene(d->exposedRegion.boundingRect()).boundingRect();
// Set up the painter
QPainter painter(viewport());
- painter.setClipRect(event->rect(), Qt::IntersectClip);
#ifndef QT_NO_RUBBERBAND
if (d->rubberBanding && !d->rubberBandRect.isEmpty())
painter.save();
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 9c6aa39..f07453c 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -217,7 +217,6 @@ private slots:
void update();
void inputMethodSensitivity();
void inputContextReset();
- void defaultClipIntersectToView();
// task specific tests below me
void task172231_untransformableItems();
@@ -3693,77 +3692,6 @@ void tst_QGraphicsView::inputContextReset()
QCOMPARE(inputContext.resets, 0);
}
-class ViewClipTester : public QGraphicsView
-{
-public:
- ViewClipTester(QGraphicsScene *scene = 0)
- : QGraphicsView(scene)
- { }
- QRegion clipRegion;
-
-protected:
- void drawBackground(QPainter *painter, const QRectF &rect)
- {
- clipRegion = painter->clipRegion();
- }
-};
-
-class ItemClipTester : public QGraphicsRectItem
-{
-public:
- ItemClipTester() : QGraphicsRectItem(0, 0, 20, 20)
- {
- setBrush(Qt::blue);
- }
- QRegion clipRegion;
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
- {
- clipRegion = painter->clipRegion();
- QGraphicsRectItem::paint(painter, option, widget);
- }
-};
-
-void tst_QGraphicsView::defaultClipIntersectToView()
-{
- QGraphicsScene scene;
- ItemClipTester *tester = new ItemClipTester;
- scene.addItem(tester);
-
- ViewClipTester view(&scene);
- view.setAlignment(Qt::AlignTop | Qt::AlignLeft);
- view.setFrameStyle(0);
- view.resize(200, 200);
- view.show();
- QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
-
- QRect viewRect(0, 0, 200, 200);
- QCOMPARE(view.clipRegion, QRegion(viewRect));
- QCOMPARE(tester->clipRegion, QRegion(viewRect));
-
- view.viewport()->update(0, 0, 5, 5);
- view.viewport()->update(10, 10, 5, 5);
- qApp->processEvents();
- viewRect = QRect(0, 0, 15, 15);
- QCOMPARE(view.clipRegion, QRegion(viewRect));
- QCOMPARE(tester->clipRegion, QRegion(viewRect));
-
- view.scale(2, 2);
- qApp->processEvents();
-
- viewRect.moveTop(-viewRect.height());
- viewRect = QRect(0, 0, 100, 100);
- QCOMPARE(view.clipRegion, QRegion(viewRect));
- QCOMPARE(tester->clipRegion, QRegion(viewRect));
-
- view.viewport()->update(0, 0, 5, 5);
- view.viewport()->update(10, 10, 5, 5);
- qApp->processEvents();
- viewRect = QRect(0, 0, 8, 8);
- QCOMPARE(view.clipRegion, QRegion(viewRect));
- QCOMPARE(tester->clipRegion, QRegion(viewRect));
-}
-
void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged()
{
QGraphicsView view;