-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardDealer.h
More file actions
69 lines (63 loc) · 1.55 KB
/
Copy pathCardDealer.h
File metadata and controls
69 lines (63 loc) · 1.55 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
#ifndef CARDDEALER_H
#define CARDDEALER_H
#include <QObject>
#include <QFrame>
#include <QParallelAnimationGroup>
#include <QPropertyAnimation>
#include <QTransform>
#include <QPaintEvent>
#include <QResizeEvent>
#include <QList>
#include <QTimeLine>
#include <QPixmap>
#include "PixmapLabel.h"
class CardDealer;
class MovedCard : public QLabel
{
Q_OBJECT
friend class CardDealer;
public:
MovedCard(QWidget* parent, bool direction = true);
virtual ~MovedCard();
void setRoute(QPoint p1, QPoint p2);
void setRotation(qreal ang1, qreal ang2);
void setSize(qreal sx, qreal sy);
private:
QPropertyAnimation animrot;
QPropertyAnimation animpos;
QPropertyAnimation animsize;
QParallelAnimationGroup group;
bool rotOn;
bool posOn;
bool sizeOn;
};
typedef QList<MovedCard*> CardList;
typedef QList<MovedCard*>::iterator itCardList;
class CardDealer : public QWidget
{
Q_OBJECT
public:
explicit CardDealer(QWidget* parent);
~CardDealer();
void append(const PixmapLabel& label, bool clearTable = true);
void setDuration(int msec);
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
private:
QTimeLine* timeline;
CardList cardlist;
int duration;
QPoint bottomRightCorner;
QPoint bottomLeftCorner;
// qreal timeval;
signals:
void startMove();
void finished();
private slots:
void endMove();
void timeChanged();
public slots:
void start();
};
#endif // CARDDEALER_H