-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera_view.h
More file actions
48 lines (36 loc) · 971 Bytes
/
Copy pathcamera_view.h
File metadata and controls
48 lines (36 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef CAMERA_VIEW_H
#define CAMERA_VIEW_H
#include <QLabel>
#include <QImage>
#include <QTimer>
#include <QWidget>
#include <QElapsedTimer>
#include <QDebug>
#include <QMouseEvent>
#include <QPainter>
#include <QMessageBox>
#include <QStackedLayout>
// 摄像头显示视图
class CameraView : public QLabel
{
Q_OBJECT
public:
explicit CameraView(int index, QWidget *parent = nullptr);
void setInfoText(const QString &text);
void setFullscreen(bool fullscreen);
bool isFullScreen() const { return isFullscreen; }
protected:
void mousePressEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
bool eventFilter(QObject *obj, QEvent *event) override;
signals:
void clicked(int index);
private:
int cameraIndex;
bool isFullscreen;
QString infoText;
QWidget *fullscreenWindow = nullptr;
QWidget *originalParent = nullptr;
QRect originalGeometry;
};
#endif // CAMERA_VIEW_H