1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPAINTDEVICEWINDOW_H
5#define QPAINTDEVICEWINDOW_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtGui/QWindow>
9#include <QtGui/QPaintDevice>
10
11QT_BEGIN_NAMESPACE
12
13class QPaintDeviceWindowPrivate;
14class QPaintEvent;
15
16class Q_GUI_EXPORT QPaintDeviceWindow : public QWindow, public QPaintDevice
17{
18 Q_OBJECT
19 Q_DECLARE_PRIVATE(QPaintDeviceWindow)
20
21public:
22 void update(const QRect &rect);
23 void update(const QRegion &region);
24
25 using QWindow::width;
26 using QWindow::height;
27 using QWindow::devicePixelRatio;
28
29public Q_SLOTS:
30 void update();
31
32protected:
33 void exposeEvent(QExposeEvent *) override;
34 void paintEvent(QPaintEvent *event) override;
35
36 int metric(PaintDeviceMetric metric) const override;
37 bool event(QEvent *event) override;
38
39 QPaintDeviceWindow(QPaintDeviceWindowPrivate &dd, QWindow *parent);
40
41private:
42 QPaintEngine *paintEngine() const override;
43 Q_DISABLE_COPY(QPaintDeviceWindow)
44};
45
46QT_END_NAMESPACE
47
48#endif
49

source code of qtbase/src/gui/kernel/qpaintdevicewindow.h