summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-06-03 14:00:56 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-06-03 14:01:19 +0200
commita9910abac9b3c9cf5aa532ca9d3e62e6cae0b839 (patch)
tree2ae72069898936752d8aeda2f329ec8b0f789b8d /tests/auto/qwidget/tst_qwidget.cpp
parent5f4faba583ce674131df163187bd3be03cf411f8 (diff)
Remove tst_QWidget::painterRedirection().
We've removed support for painter redirection, QWidget::render() should be used instead.
Diffstat (limited to 'tests/auto/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index a795e89762..5b5a3e9b51 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -318,7 +318,6 @@ private slots:
void updateGeometry();
void updateGeometry_data();
void sendUpdateRequestImmediately();
- void painterRedirection();
void doubleRepaint();
#ifndef Q_WS_MAC
void resizeInPaintEvent();
@@ -7799,64 +7798,6 @@ void tst_QWidget::sendUpdateRequestImmediately()
QCOMPARE(updateWidget.numUpdateRequestEvents, 1);
}
-class RedirectedWidget : public QWidget
-{
-protected:
- void paintEvent(QPaintEvent *)
- {
- // Verify that the widget has a redirection set. The widget is redirected to
- // the backing store on all platforms using it; otherwise to itself if the wrect
- // does not start in (0, 0) or it has a mask set.
- QPaintDevice *oldRedirection = QPainter::redirected(this);
-#ifndef Q_WS_MAC
- QVERIFY(oldRedirection);
-#endif
-
- QImage image(size(), QImage::Format_RGB32);
- image.fill(Qt::blue);
-
- {
- QPainter painter(this);
- QCOMPARE(painter.device(), static_cast<QPaintDevice *>(this));
- }
-
- QPainter::setRedirected(this, &image);
- QCOMPARE(QPainter::redirected(this), static_cast<QPaintDevice *>(&image));
-
- QPainter painter(this);
- painter.fillRect(rect(), Qt::red);
-
- QPainter::restoreRedirected(this);
- QCOMPARE(QPainter::redirected(this), oldRedirection);
-
- for (int i = 0; i < image.height(); ++i)
- for (int j = 0; j < image.width(); ++j)
- QCOMPARE(image.pixel(j, i), QColor(Qt::red).rgb());
- }
-
-};
-
-// Test to make sure we're compatible in the particular case where QPainter::setRedirected
-// actually works. It has been broken for all other cases since Qt 4.1.4 (backing store).
-// QWidget::render is the modern and more powerful way of doing the same.
-void tst_QWidget::painterRedirection()
-{
- RedirectedWidget widget;
- // Set FramelessWindowHint and mask to trigger internal painter redirection on the Mac.
- widget.setWindowFlags(widget.windowFlags() | Qt::FramelessWindowHint);
- widget.setMask(QRect(10, 10, 50, 50));
- widget.setFixedSize(100, 200);
- widget.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&widget);
-#endif
- QPixmap pixmap(widget.size());
- QPainter::setRedirected(&widget, &pixmap, QPoint());
- widget.repaint();
- QCOMPARE(QPainter::redirected(&widget), static_cast<QPaintDevice *>(&pixmap));
-}
-
-
void tst_QWidget::doubleRepaint()
{
#ifdef Q_OS_IRIX