src/platform/qt/MessagePainter.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef QGBA_MESSAGE_PAINTER
7#define QGBA_MESSAGE_PAINTER
8
9#include <QObject>
10#include <QStaticText>
11#include <QTimer>
12
13namespace QGBA {
14
15class MessagePainter : public QObject {
16Q_OBJECT
17
18public:
19 MessagePainter(QObject* parent = nullptr);
20
21 void resize(const QSize& size, bool lockAspectRatio);
22 void paint(QPainter* painter);
23
24public slots:
25 void showMessage(const QString& message);
26 void clearMessage();
27
28private:
29 QStaticText m_message;
30 QTimer m_messageTimer;
31 QTransform m_world;
32 QFont m_messageFont;
33};
34
35}
36
37#endif