mirror of
https://github.com/vanilla-wiiu/vanilla.git
synced 2025-01-22 08:11:47 -05:00
40 lines
No EOL
898 B
C++
40 lines
No EOL
898 B
C++
#ifndef VIEWER_H
|
|
#define VIEWER_H
|
|
|
|
#include <QOpenGLWidget>
|
|
|
|
class Viewer : public QOpenGLWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
Viewer(QWidget *parent = nullptr);
|
|
|
|
const QImage &image() const { return m_image; }
|
|
|
|
public slots:
|
|
void setImage(const QImage &image);
|
|
|
|
signals:
|
|
void requestExitFullScreen();
|
|
void touch(int x, int y);
|
|
void keyPressed(Qt::Key key);
|
|
void keyReleased(Qt::Key key);
|
|
|
|
protected:
|
|
virtual void paintGL() override;
|
|
virtual void keyPressEvent(QKeyEvent *key) override;
|
|
virtual void keyReleaseEvent(QKeyEvent *key) override;
|
|
virtual void mousePressEvent(QMouseEvent *ev) override;
|
|
virtual void mouseMoveEvent(QMouseEvent *ev) override;
|
|
virtual void mouseReleaseEvent(QMouseEvent *ev) override;
|
|
|
|
private:
|
|
QTransform generateTransform();
|
|
|
|
void emitTouchSignal(const QPointF &position);
|
|
|
|
QImage m_image;
|
|
|
|
};
|
|
|
|
#endif // VIEWER_H
|