Solved How to set a png scaled with label
-
QPixmap wifi(":/wifi-icon-6.png");
ui->label->setPixmap(wifi);
ui->label->show();
ui->wifi->setScaledSize(ui->label->size());// This one leads to ErrorSay me some suggestions to set up this scaling
-
@sankarapandiyan Please read documentation - there is no setScaledSize method.
https://doc.qt.io/qt-5/qpixmap.html#scaledQPixmap wifi(":/wifi-icon-6.png"); ui->label->show(); ui->label->setPixmap(wifi.scaled(ui->label->size()));
-
@jsulm ui->label->setScaledContents(true);
ui->label->setPixmap(QPixmap::fromImage(wifi));I Got it finally Is It correct >?? -
@sankarapandiyan said in How to set a png scaled with label:
I Got it finally Is It correct
Looks like it is. But now you do not scale.
-
@jsulm Yes ..I understood ..Thanks a lot
-
Hi,
Depending on what you need, the scaledContent property might be of interest.