-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathimagewidget.h
More file actions
106 lines (87 loc) · 2.49 KB
/
imagewidget.h
File metadata and controls
106 lines (87 loc) · 2.49 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H
#include <QWidget>
#include <QLabel>
#include <QPixmap>
#include <QSize>
#include "targetlistwindow.h"
#include <QMouseEvent>
#include <QTabWidget>
#include <QThread>
#include "lifesupport.h"
class MainWindow;
namespace Ui {
class ImageWidget;
}
class ImageWidget : public QWidget
{
Q_OBJECT
public:
// LOADER THREAD
class ImageLoader : public QThread
{
public:
explicit ImageLoader(ImageWidget *imageWidget, QString filePath)
: imageWidget(imageWidget), filePath(filePath) {}
static int numLoaders;
void run();
private:
ImageWidget *imageWidget;
QString filePath;
};
explicit ImageWidget(LifeSupport* dataPackage, MainWindow *parent, bool initTargetList = true);
ImageWidget(ImageWidget &toCopy);
// Setters
void setTitle(QString name);
void setImage(QString imagePath);
void setImage(QPixmap &resizedImage);
void setFolderPath(QString folderPath) ;
void setFilePath(QString filePath) ;
void setImagePath(QString imagePath);
void setTabWidget(QTabWidget* tabWidget ) ;
void setNumTargets(int numTargets);
void setSeen(bool seen);
void setLatLon(const LatLon &latlon);
void setTargetData(const QList<TargetData> &targetData);
// Getters
QString getTitle() const;
QString getImagePath() const;
QPixmap& getImage();
QString getFolderPath() const;
QString getFilePath() const;
TargetListWindow* getTargetList();
int getNumTargets() const;
bool isInitialized() const;
bool getSeen() const;
QList<TargetData>& getTargetData();
LatLon getLatLon() const;
TargetData &getTarget(const QString &targetName);
void deleteTargetListWindow();
void changeTargetListWindow(TargetListWindow* targetList, bool alreadyInitialized = true);
void setImagePathString(QString imagePath);
void finishLoading();
friend class ImageLoader;
~ImageWidget();
protected:
void mouseDoubleClickEvent(QMouseEvent *event);
QString title;
int numTargets;
QString filePath ;
QString imagePath;
QString folderPath;
QPixmap image;
TargetListWindow *targetList;
bool targetListInitialized;
bool seen;
ImageLoader* loader;
bool loadingFinished;
QList<TargetData> targetData;
LatLon latlon;
private slots:
void on_pinButton_clicked();
private:
LifeSupport* dataPackage ;
Ui::ImageWidget *ui;
MainWindow* mainWindow ;
};
#endif // IMAGEWIDGET_H