-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstonesocket.h
55 lines (42 loc) · 1.2 KB
/
stonesocket.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
#ifndef STONESOCKET_H
#define STONESOCKET_H
#include <QObject>
#include <QWidget>
#include <QtWidgets>
#include <QPair>
#include <QLabel>
#include <QGraphicsDropShadowEffect>
class StoneSocket : public QFrame
{
Q_OBJECT
public:
explicit StoneSocket(QWidget *parent = 0);
StoneSocket(int x, int y);
~StoneSocket();
QString static nextColor;
void setEmpty(bool empty);
bool isEmpty() const;
void setPosition(unsigned int x, unsigned int y) {_coord.first = x; _coord.second = y;}
void setPosition(QPair<unsigned int, unsigned int> &c) {_coord = c;}
void showStone();
void hideStone();
void setForegroundKolecko();
void setForeground(QString path);
void showForeground();
void hideForeground();
void mouseReleaseEvent ( QMouseEvent * event );
void mouseMoveEvent( QMouseEvent * event );
// static
void static setNextColor(QString next) {nextColor = next;}
QString static getNextColor() {return nextColor;}
signals:
void clickedOnPos(unsigned int x, unsigned int y);
public slots:
void setColor(QString color);
private:
QString color;
QPair<int, int> _coord;
bool empty;
QLabel *_foreground;
};
#endif // STONESOCKET_H