-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrenderarea.h
61 lines (47 loc) · 1.25 KB
/
renderarea.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
#ifndef RENDERAREA_H
#define RENDERAREA_H
#include <vector>
#include <QWidget>
#include <QBrush>
#include <QPen>
struct Graph;
class RenderArea : public QWidget
{
Q_OBJECT
public:
explicit RenderArea(QWidget *parent = nullptr);
enum Layout { FR, KK };
QSize minimumSizeHint() const override;
QSize sizeHint() const override;
void paintGraph(QPainter *painter);
void setColor(int index, QColor color);
void setPen(const QPen &pen);
QPen pen() const;
void setMainColor(const QColor &newMainColor);
QColor mainColor() const;
void setCircleSize(int size);
int circleSize() const;
void setFontSize(int size);
int fontSize() const;
void setAntialiased(bool antialiased);
bool antialiased() const;
Layout layout() const;
void setLayout(const Layout &newLayout);
bool displayText() const;
void setDisplayText(bool display);
public slots:
void setGraph(struct Graph *graph);
protected:
void paintEvent(QPaintEvent *event) override;
private:
std::vector<QColor> vertexColors;
struct Graph *graph;
Layout _layout;
QColor _main_color;
QPen _pen;
int _circle_size;
int _font_size;
bool _antialiased;
bool _display_text;
};
#endif // RENDERAREA_H