2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2013-03-21 14:19:40 +00:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QPaintEvent>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
class MyWidget : public QWidget
|
|
|
|
{
|
|
|
|
public:
|
2013-03-14 23:42:15 +00:00
|
|
|
MyWidget() : QWidget()
|
|
|
|
{
|
2011-04-27 10:05:43 +00:00
|
|
|
setAttribute(Qt::WA_OpaquePaintEvent);
|
2013-03-14 23:42:15 +00:00
|
|
|
setAttribute(Qt::WA_StaticContents);
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
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();
|
2013-03-14 23:42:15 +00:00
|
|
|
}
|