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 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | class QPaintDeviceWindowPrivate; |
14 | class QPaintEvent; |
15 | |
16 | class Q_GUI_EXPORT QPaintDeviceWindow : public QWindow, public QPaintDevice |
17 | { |
18 | Q_OBJECT |
19 | Q_DECLARE_PRIVATE(QPaintDeviceWindow) |
20 | |
21 | public: |
22 | void update(const QRect &rect); |
23 | void update(const QRegion ®ion); |
24 | |
25 | using QWindow::width; |
26 | using QWindow::height; |
27 | using QWindow::devicePixelRatio; |
28 | |
29 | public Q_SLOTS: |
30 | void update(); |
31 | |
32 | protected: |
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 | |
41 | private: |
42 | QPaintEngine *paintEngine() const override; |
43 | Q_DISABLE_COPY(QPaintDeviceWindow) |
44 | }; |
45 | |
46 | QT_END_NAMESPACE |
47 | |
48 | #endif |
49 |