16 lines
435 B
C++
16 lines
435 B
C++
|
#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);
|
||
|
}
|
||
|
|