qt/LedOK/player/eleimg.cpp

16 lines
435 B
C++
Raw Normal View History

2022-01-20 10:08:17 +08:00
#include "eleimg.h"
#include <QJsonObject>
#include <QPainter>
EleImg::EleImg(QString path, QWidget *parent) : QWidget{parent} {
img.load(path);
qDebug()<< " EleImg isVisible()" << isVisible();
}
void EleImg::paintEvent(QPaintEvent *){
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing|QPainter::SmoothPixmapTransform);
if(! img.isNull()) painter.drawPixmap(0, 0, width(), height(), img);
}