summaryrefslogtreecommitdiffstats
path: root/tests/manual/repaint/task141091/main.cpp
blob: 2fceea0148ee86996c2d23034ce85828e5f728e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include <QApplication>
#include <QMainWindow>
#include <QPaintEvent>
#include <QDebug>

class MyWidget : public QWidget
{
public:
    MyWidget() : QWidget()
    {
        setAttribute(Qt::WA_OpaquePaintEvent);
        setAttribute(Qt::WA_StaticContents);
    }

protected:
    void paintEvent(QPaintEvent *e) { qDebug() << e->rect(); }
};

int main(int argc, char **argv)
{
    QApplication a(argc, argv);
    MyWidget w;
    w.show();
    return a.exec();
}