pineapple-pictures/graphicsview.h

30 lines
802 B
C
Raw Normal View History

2019-09-28 01:18:08 +08:00
#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H
#include <QGraphicsView>
2019-09-29 15:52:35 +08:00
class GraphicsScene;
2019-09-28 01:18:08 +08:00
class GraphicsView : public QGraphicsView
{
public:
GraphicsView(QWidget *parent = nullptr);
2019-09-29 15:52:35 +08:00
void showImage(const QPixmap &pixmap);
void showText(const QString &text);
GraphicsScene * scene() const;
void setScene(GraphicsScene *scene);
2019-09-28 01:18:08 +08:00
private:
void mousePressEvent(QMouseEvent * event) override;
void mouseMoveEvent(QMouseEvent * event) override;
void mouseReleaseEvent(QMouseEvent * event) override;
void wheelEvent(QWheelEvent *event) override;
2019-09-29 15:52:35 +08:00
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dropEvent(QDropEvent *event) override;
2019-09-28 01:18:08 +08:00
};
#endif // GRAPHICSVIEW_H