#pragma once #include #include "global.h" struct SVG_Image_Render { SVG_Image_Render& set_path(const QString& path) { this->_path = path; return *this; } SVG_Image_Render& set_color(const QColor& color) { this->_color = color; return *this; } SVG_Image_Render& create(); void render(QPainter* painter); void render(QPainter* painter, const QRectF& rect); void render(QPainter* painter, const QRectF& rect, const QColor& color); QImage to_image(QSize size, const QColor& c); QPixmap to_pixmap(QSize size, const QColor& c); const QColor& get_color() { return _color; }; protected: QString _path; QColor _color = QColor(Qt::red); QDomDocument doc; QByteArray change_color(const QColor& color); };