display.cpp 414 B
#include "display.h"
Display::Display() {}
void Display::setImage(QLabel* label, const QString& imagePath) {
QPixmap pixmap = loadPixmap(imagePath);
if (!pixmap.isNull()) {
int w = label->width();
int h = label->height();
label->setPixmap(pixmap.scaled(w, h, Qt::KeepAspectRatio));
}
}
QPixmap Display::loadPixmap(const QString& imagePath) {
return QPixmap(imagePath);
}