-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagviewrectitem.h
84 lines (55 loc) · 2.04 KB
/
agviewrectitem.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
#ifndef AGViewRectItem_H
#define AGViewRectItem_H
//#include "agcliprectitem.h"
#include "agprocessthread.h"
#include <QObject>
#include <QGraphicsRectItem>
#include <QDebug>
#include <QKeyEvent>
#include <QGraphicsSceneMouseEvent>
#include <QFileInfo>
#include <QGraphicsView>
#include <QMenu>
#include <QApplication> //to use qApp (icon)
class AGViewRectItem: public QObject, public QGraphicsRectItem
{
Q_OBJECT
public:
AGViewRectItem(QGraphicsItem *parent = nullptr, QFileInfo fileInfo = QFileInfo());
QString mediaType;
QString itemType;
QFileInfo fileInfo;
AGViewRectItem *parentRectItem;
QGraphicsPixmapItem *pictureItem = nullptr;
QString itemToString();
int duration;
void updateToolTip();
qreal mediaDefaultHeight = 300 * 9.0 / 16.0;
QList<AGProcessAndThread *> processes;
QGraphicsTextItem *subLogItem = nullptr;
// QGraphicsRectItem *progressRectItem = nullptr;
QGraphicsProxyWidget *progressSliderProxy = nullptr;
void onItemRightClicked(QPoint pos);
bool containsVideo;
bool containsAudio;
bool containsImage;
void processAction(QString action);
void newProgressItem();
void newSubLogItem();
virtual void setTextItem(QTime time, QTime totalTime);
QString lastOutputString;
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
QMenu *fileContextMenu = nullptr;
void recursiveFileRenameCopyIfExists(QString folderName, QString fileName);
signals:
// void agItemChanged(AGViewRectItem *clipItem);
void hoverPositionChanged(QGraphicsRectItem *rectItem, double position);
void showInStatusBar(QString message, int timeout);
private slots:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
protected slots:
void onProcessOutput(QTime time, QTime totalTime, QString event, QString outputString);
};
#endif // AGViewRectItem_H