-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtargetlistwindow.h
90 lines (73 loc) · 1.96 KB
/
targetlistwindow.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
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef TARGETLISTWINDOW_H
#define TARGETLISTWINDOW_H
#include <QDialog>
#include "targetmaker.h"
#include "targetwindow.h"
#include "targetlist.h"
#include <QSettings>
#include <QPainter>
#include <QPixmap>
#include <QColor>
#include <QThread>
#include "lifesupport.h"
// LOADER THREAD
class Loader : public QThread
{
public:
explicit Loader(TargetList *targetList, QString folderPath, QString filePath)
{
this->targetList = targetList;
this->folderPath = folderPath;
this->filePath = filePath;
}
void run();
private:
TargetList *targetList;
QString folderPath, filePath;
};
namespace Ui {
class TargetListWindow;
class CustomLabel;
}
class TargetListWindow : public QDialog
{
Q_OBJECT
public:
explicit TargetListWindow(LifeSupport* dataPackage, QWidget *parent = 0);
Ui::TargetListWindow *ui ;
~TargetListWindow();
void setMainPic (QString imagePath) ;
void loadTargets (QString folderPath, QString filePath) ;
//QString selected();
void changeDesc(QString desc) ;
private slots:
void on_newItem_clicked();
void on_edit_clicked();
void on_deleteButton_clicked();
void on_upButton_clicked();
void on_downButton_clicked();
void sort(int col);
void on_targetListTable_doubleClicked(const QModelIndex &index);
void on_targetListTable_clicked(const QModelIndex &index);
private:
//TargetMaker *targetMaker;
TargetMaker *targetEditor;
Loader *loader;
QPixmap mainpic ;
int mainPicWidth, mainPicHeight;
QSettings *resultFile;
TargetList *targetList;
int colCount;
LifeSupport* data;
};
class CustomLabel : public QLabel
{
Q_OBJECT
signals:
void mousePressed(const QPoint& );
public:
CustomLabel( QWidget* parent=0, Qt::WindowFlags f =0 );
CustomLabel( const QString& text, QWidget* parent = 0, Qt::WindowFlags f = 0);
void mousePressedEvent( QMouseEvent* ev);
};
#endif // TARGETLISTWINDOW_H