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 QSHAPEDPIXMAPDNDWINDOW_H |
5 | #define QSHAPEDPIXMAPDNDWINDOW_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtGui/private/qtguiglobal_p.h> |
19 | #include <QtGui/QRasterWindow> |
20 | #include <QtGui/QPixmap> |
21 | |
22 | QT_REQUIRE_CONFIG(draganddrop); |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class QShapedPixmapWindow : public QRasterWindow |
27 | { |
28 | Q_OBJECT |
29 | public: |
30 | explicit QShapedPixmapWindow(QScreen *screen = nullptr); |
31 | ~QShapedPixmapWindow(); |
32 | |
33 | void setUseCompositing(bool on) { m_useCompositing = on; } |
34 | void setPixmap(const QPixmap &pixmap); |
35 | void setHotspot(const QPoint &hotspot); |
36 | |
37 | void updateGeometry(const QPoint &pos); |
38 | |
39 | protected: |
40 | void paintEvent(QPaintEvent *) override; |
41 | |
42 | private: |
43 | QPixmap m_pixmap; |
44 | QPoint m_hotSpot; |
45 | bool m_useCompositing; |
46 | }; |
47 | |
48 | QT_END_NAMESPACE |
49 | |
50 | #endif // QSHAPEDPIXMAPDNDWINDOW_H |
51 | |