qt/LedOK/player/eleimg.cpp
2022-08-25 18:37:24 +08:00

15 lines
381 B
C++

#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);
}