-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRTLSDisplayApplication.h
More file actions
executable file
·88 lines (71 loc) · 2.84 KB
/
RTLSDisplayApplication.h
File metadata and controls
executable file
·88 lines (71 loc) · 2.84 KB
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
79
80
81
82
83
84
85
86
87
88
// -------------------------------------------------------------------------------------------------------------------
//
// File: RTLSDisplayApplication.h
//
// Copyright 2016 (c) Decawave Ltd, Dublin, Ireland.
//
// All rights reserved.
//
// Author:
//
// -------------------------------------------------------------------------------------------------------------------
#ifndef RTLSDISPLAYAPPLICATION_H
#define RTLSDISPLAYAPPLICATION_H
#include <QApplication>
#include <QAbstractItemView>
#include <qthread.h>
class QItemSelectionModel;
class ViewSettings;
class MainWindow;
class SerialConnection;
class GraphicsWidget;
class GraphicsView;
class RTLSClient;
/**
* The RTLSDisplayApplication class is a singleton class which handles the application.
*
* It allows getting pointers to global objects within the application.
* These pointers should not be used during initial initialization (in constructors), as it is niot guaranteed that they have bben allocated and initialized yet.\n
* Instead, any setup which requires these pointers should be split in another function.\n
* connectReady() may be used to run that specific function once all the resources are allocated.
* The slot passed as the second argument will either run immediately if setup is already done, or connected to a signal that will be emitted once initialization is complete.
* @code
* RTLSDisplayApplication::connectReady(this, "onReady()");
* @endcode
*
*/
class RTLSDisplayApplication : public QApplication //, virtual public QThread
{
Q_OBJECT
public:
explicit RTLSDisplayApplication(int &argc, char ** argv);
virtual ~RTLSDisplayApplication();
static RTLSDisplayApplication *instance();
static ViewSettings *viewSettings();
static SerialConnection *serialConnection();
static RTLSClient *client();
static MainWindow *mainWindow();
static GraphicsWidget *graphicsWidget();
static GraphicsView *graphicsView();
/**
* Call \a member of \a receiver once initialization is complete.
* The function is either called reight away if initialization is already done, or connected to the ready() signal.
* The method must be registered within Qt's meta object system, using Q_INVOKABLE, or declaring it as a slot.
*/
static void connectReady(QObject *receiver, const char *member, Qt::ConnectionType type = Qt::AutoConnection);
signals:
/**
* Emitted when the inizialization is complete.
* Because this signal is only emitted once at application startup, the connectReady() should be used instead.
*/
void ready();
public slots:
protected:
private:
ViewSettings *_viewSettings;
SerialConnection *_serialConnection;
RTLSClient *_client;
MainWindow *_mainWindow;
bool _ready;
};
#endif // RTLSDISPLAYAPPLICATION_H