src/platform/qt/TilePainter.h (view raw)
1/* Copyright (c) 2013-2016 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_TILE_PAINTER
7#define QGBA_TILE_PAINTER
8
9#include <QColor>
10#include <QWidget>
11#include <QVector>
12
13namespace QGBA {
14
15class TilePainter : public QWidget {
16Q_OBJECT
17
18public:
19 TilePainter(QWidget* parent = nullptr);
20
21public slots:
22 void setTile(int index, const uint16_t*);
23 void setTileCount(int tiles);
24
25signals:
26 void indexPressed(int index);
27
28protected:
29 void paintEvent(QPaintEvent*) override;
30 void mousePressEvent(QMouseEvent*) override;
31 void resizeEvent(QResizeEvent*) override;
32
33private:
34 QPixmap m_backing;
35};
36
37}
38
39#endif