Grid painting
This commit is contained in:
parent
a9c7952f5c
commit
e24837649c
3 changed files with 92 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define GRIDPREVIEW_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include "line.h"
|
||||
|
||||
class GridPreview : public QWidget
|
||||
|
|
@ -13,9 +14,12 @@ public:
|
|||
void addLine(Line &line);
|
||||
void removeLine(int index);
|
||||
QString toLuaTable();
|
||||
void paintEvent(QPaintEvent* event);
|
||||
QColor colorFromString(QString color);
|
||||
private:
|
||||
int width = 5, height = 5;
|
||||
QVector<Line> lines {};
|
||||
QMap<QString, QColor> colorMap;
|
||||
const QString tableTemplate = "return {\n width = %1,\n height = %2,\n lines = {\n%3\n }\n}";
|
||||
signals:
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue