LookAtClick.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 
5 #include <QWidget>
6 #include <QImage>
7 #include <QPoint>
8 
9 class LookAtClick : public QWidget
10 {
11  Q_OBJECT
12 public:
13  explicit LookAtClick(QWidget* parent = nullptr);
14  void drawBackground(QImage& image);
15  void process();
16 
17  QSize sizeHint() const override;
18 signals:
19  void clickedAt(const QPoint& point);
20 
21 
22 protected:
23  void mousePressEvent(QMouseEvent* event) override;
24  void paintEvent(QPaintEvent* event) override;
25  void mouseMoveEvent(QMouseEvent* event) override;
26  bool eventFilter(QObject* watched, QEvent* event) override;
27 public slots:
28 
29 private:
30  QPoint _lastPoint;
31  QPoint _center;
32 
33  QImage _backgroundImage;
34 };
35 
LookAtClick::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Definition: LookAtClick.cpp:47
LookAtClick
Definition: LookAtClick.h:9
LookAtClick::paintEvent
void paintEvent(QPaintEvent *event) override
Definition: LookAtClick.cpp:68
LookAtClick::clickedAt
void clickedAt(const QPoint &point)
LookAtClick::sizeHint
QSize sizeHint() const override
Definition: LookAtClick.cpp:32
LookAtClick::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
Definition: LookAtClick.cpp:63
LookAtClick::process
void process()
LookAtClick::eventFilter
bool eventFilter(QObject *watched, QEvent *event) override
Definition: LookAtClick.cpp:37
LookAtClick::LookAtClick
LookAtClick(QWidget *parent=nullptr)
Definition: LookAtClick.cpp:12
LookAtClick::drawBackground
void drawBackground(QImage &image)
Definition: LookAtClick.cpp:19