2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-09-14 02:03:34 +00:00
|
|
|
|
2023-01-30 13:32:42 +00:00
|
|
|
#ifndef WINDOW_H
|
|
|
|
#define WINDOW_H
|
|
|
|
|
2011-05-03 12:47:10 +00:00
|
|
|
#include <QWindow>
|
|
|
|
#include <QImage>
|
|
|
|
|
|
|
|
class Window : public QWindow
|
|
|
|
{
|
|
|
|
public:
|
2020-10-07 11:05:48 +00:00
|
|
|
Window(QWindow *parent = nullptr);
|
2011-07-21 11:50:28 +00:00
|
|
|
Window(QScreen *screen);
|
2011-05-03 12:47:10 +00:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 08:12:35 +00:00
|
|
|
void mousePressEvent(QMouseEvent *) override;
|
|
|
|
void mouseMoveEvent(QMouseEvent *) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *) override;
|
2011-05-03 12:47:10 +00:00
|
|
|
|
2016-06-15 08:12:35 +00:00
|
|
|
void keyPressEvent(QKeyEvent *) override;
|
2011-05-03 12:47:10 +00:00
|
|
|
|
2016-06-15 08:12:35 +00:00
|
|
|
void exposeEvent(QExposeEvent *) override;
|
|
|
|
void resizeEvent(QResizeEvent *) override;
|
2011-05-03 12:47:10 +00:00
|
|
|
|
2016-06-15 08:12:35 +00:00
|
|
|
void timerEvent(QTimerEvent *) override;
|
2011-07-21 11:50:28 +00:00
|
|
|
|
2011-05-03 12:47:10 +00:00
|
|
|
private:
|
|
|
|
void render();
|
2011-07-21 11:50:28 +00:00
|
|
|
void scheduleRender();
|
|
|
|
void initialize();
|
2011-05-03 12:47:10 +00:00
|
|
|
|
|
|
|
QString m_text;
|
|
|
|
QImage m_image;
|
|
|
|
QPoint m_lastPos;
|
|
|
|
int m_backgroundColorIndex;
|
2011-06-20 11:29:26 +00:00
|
|
|
QBackingStore *m_backingStore;
|
2011-07-21 11:50:28 +00:00
|
|
|
int m_renderTimer;
|
2011-05-03 12:47:10 +00:00
|
|
|
};
|
2023-01-30 13:32:42 +00:00
|
|
|
|
|
|
|
#endif // WINDOW_H
|