summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-04-25 16:51:04 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-25 17:14:22 +0200
commit021808c670d7af8d1e398824e94d97d7ed2e412b (patch)
tree4d2e7b2636a0c4dbc6c5008b218d7f4a1348dd02
parent105b2312145e8868f5357d9e7ba78a9cddcfee64 (diff)
Fix recursion in qwidget gdiPainting test.
Change-Id: If4881dfecc6fc7cebcd3ed896846d34e35b3e3ae Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 7cda463eeb..ba2eb142c3 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -7769,13 +7769,13 @@ void tst_QWidget::moveRect()
#ifdef Q_OS_WIN
class GDIWidget : public QDialog
{
+ Q_OBJECT
public:
GDIWidget() { setAttribute(Qt::WA_PaintOnScreen); }
QPaintEngine *paintEngine() const { return 0; }
void paintEvent(QPaintEvent *) {
- qDebug() << __FUNCTION__;
QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface();
const HDC hdc = (HDC)ni->nativeResourceForWindow(QByteArrayLiteral("getDC"), windowHandle());
if (!hdc) {
@@ -7788,15 +7788,21 @@ public:
ni->nativeResourceForWindow(QByteArrayLiteral("releaseDC"), windowHandle());
- const QImage im = grab(QRect(QPoint(0, 0), size())).toImage();
- color = im.pixel(1, 1);
- QTimer::singleShot(0, this, SLOT(accept()));
+ QTimer::singleShot(0, this, SLOT(slotTimer()));
}
QSize sizeHint() const {
return QSize(400, 300);
}
+private slots:
+ void slotTimer() {
+ const QImage im = grab(QRect(QPoint(0, 0), size())).toImage();
+ color = im.pixel(1, 1);
+ accept();
+ }
+
+public:
QColor color;
};