2023-04-18 14:14:46 +08:00
|
|
|
#include "eleimg.h"
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QPainter>
|
|
|
|
|
|
|
|
EleImg::EleImg(QString path, QWidget *parent) : QWidget{parent} {
|
|
|
|
img.load(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
void EleImg::paintEvent(QPaintEvent *){
|
|
|
|
QPainter painter(this);
|
|
|
|
painter.setRenderHints(QPainter::Antialiasing|QPainter::SmoothPixmapTransform);
|
|
|
|
if(! img.isNull()) painter.drawPixmap(0, 0, width(), height(), img);
|
|
|
|
}
|
|
|
|
|