-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdroparea.h
More file actions
62 lines (45 loc) · 1.24 KB
/
Copy pathdroparea.h
File metadata and controls
62 lines (45 loc) · 1.24 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
#ifndef DROPAREA_H
#define DROPAREA_H
#include "process.h"
#include "program.h"
#include <QTableWidget>
#include <QProcess>
class MainWindow;
class QMimeData;
class DropArea : public QTableWidget {
Q_OBJECT
public:
DropArea(QWidget *parent = 0);
~DropArea() {
for(int i = 0; i < progs.size(); i++)
delete(progs[i]);
progs.clear();
for(int i = 0; i < procs.size(); i++)
delete(procs[i]);
procs.clear();
}
void addProgram(Program* prog) {
progs.push_back(prog);
}
void startProg(Program* p, QString file, QString path);
public slots:
void clear();
void launch();
void error(QProcess::ProcessError error);
void started();
void finished(int, QProcess::ExitStatus);
signals:
void changed(const QMimeData *mimeData = 0);
protected:
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
private:
MainWindow *parent;
QTableWidget *table;
QStringList listFile;
QVector<Program*> progs;
QVector<Process*> procs;
};
#endif // DROPAREA_H