| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#include <QWindow> |
| 5 |
#include <QImage> |
| 6 |
|
| 7 |
class Window : public QWindow |
| 8 |
{ |
| 9 |
public: |
| 10 |
Window(QWindow *parent = nullptr); |
| 11 |
Window(QScreen *screen); |
| 12 |
|
| 13 |
protected: |
| 14 |
void mousePressEvent(QMouseEvent *); |
| 15 |
void mouseMoveEvent(QMouseEvent *); |
| 16 |
void mouseReleaseEvent(QMouseEvent *); |
| 17 |
void wheelEvent(QWheelEvent *event); |
| 18 |
|
| 19 |
void keyPressEvent(QKeyEvent *); |
| 20 |
|
| 21 |
void exposeEvent(QExposeEvent *); |
| 22 |
void resizeEvent(QResizeEvent *); |
| 23 |
|
| 24 |
void timerEvent(QTimerEvent *); |
| 25 |
|
| 26 |
private: |
| 27 |
void render(); |
| 28 |
void scheduleRender(); |
| 29 |
void initialize(); |
| 30 |
|
| 31 |
QString m_text; |
| 32 |
QImage m_image; |
| 33 |
QPoint m_lastPos; |
| 34 |
int m_backgroundColorIndex; |
| 35 |
QBackingStore *m_backingStore; |
| 36 |
int m_renderTimer; |
| 37 |
QPoint scrollOffset; |
| 38 |
}; |