-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBarcodeScanner.h
78 lines (60 loc) · 1.45 KB
/
BarcodeScanner.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//////////////////////////////////////////////////////////////////
//
// BarcodeScanner
// Scan and lookup barcodes
//
// Copyright (c) 2022, Relaxed Communications GmbH <[email protected]>
//
// This work is published under the GNU Public License
//
//////////////////////////////////////////////////////////////////
#pragma once
#include <QtWidgets/QDialog>
#include <QNetworkAccessManager>
#include <QTimer>
#include <glib.h>
#include <gst/gst.h>
using namespace std;
class QLabel;
class QPushButton;
class QComboBox;
class QCheckBox;
class QLineEdit;
class QSettings;
const QString VERSION = "0.2";
const unsigned FONT_SIZE = 10;
const unsigned POLL_TIMER = 100; // 100 ms
class BarcodeScanner : public QDialog
{
Q_OBJECT
public:
BarcodeScanner(QWidget *parent = Q_NULLPTR);
virtual ~BarcodeScanner();
protected:
void dispayErrorAndExit(const QString & msg);
void EANLookup(const QString & ean);
private slots:
void startClicked();
void stopClicked();
void aboutClicked();
void quitClicked();
void checkGstBus();
protected:
QSettings * settings;
QString last_symbol;
// QT UI
QComboBox* camera;
QLineEdit* eanSearchToken;
QLabel* errorMsg;
QPushButton* startButton;
QPushButton* stopButton;
QPushButton* aboutButton;
QPushButton* quitButton;
QLabel* productInfo;
QNetworkAccessManager network_manager;
QLabel* videoArea;
// GStreamer data
GstElement* pipeline;
GstBus* bus;
QTimer* gst_event_timer;
};