-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgraphicswidget.h
More file actions
executable file
·46 lines (31 loc) · 882 Bytes
/
graphicswidget.h
File metadata and controls
executable file
·46 lines (31 loc) · 882 Bytes
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
#ifndef GRAPHICSWIDGET_H
#define GRAPHICSWIDGET_H
#include <memory>
#include <QGLWidget>
#include <QStaticText>
#include <QImage>
class HexGrid;
class GridEntry;
class GraphicsWidget : public QGLWidget
{
Q_OBJECT
public:
explicit GraphicsWidget(QWidget *parent = 0);
void draw(HexGrid *grid);
QPoint pickCell(const QPointF &pos) const;
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
void drawDiagnosticText(QPainter &painter, int top,
const QString &labelText, const QString &valueText);
void drawControlText(QPainter &painter, int top,
const QString &labelText, const QString &valueText);
QTransform getCurrentTransform(void) const;
private:
QMap<QString, QStaticText> staticText;
QImage elements;
HexGrid *grid;
bool displayControls;
const static QPolygonF DISPLAY_HEXAGON;
};
#endif // GRAPHICSWIDGET_H