blob: 0a2acccccfbb7938cbe79e471e32f805dd455b8b (
plain)
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
|
#ifndef PAINTER_H
#define PAINTER_H
#include "diagram/statement.h"
#include "diagram/structogram.h"
#include <QWidget>
#include <QFont>
#include <QFontMetrics>
#include <QPaintEvent>
#include <QPainter>
#include <QRect>
class Painter : public QWidget
{
Q_OBJECT
public:
explicit Painter(QWidget *parent = 0);
~Painter();
void structogram(samb::Structogram **structogram) { _structogram = structogram; }
const samb::Structogram structogram() const { return **_structogram; }
protected:
void paintEvent(QPaintEvent *event);
private:
samb::Structogram **_structogram = nullptr;
QFont _font;
QFontMetrics _fontMetrics;
int _margin = 10;
void drawStatement(QPainter &qp, samb::Statement &statement, const QRect &rect);
};
#endif // PAINTER_H
|