How to set a png scaled with label
-
wrote on 21 Nov 2019, 13:09 last edited by
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
-
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()));
-
@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()));
wrote on 21 Nov 2019, 13:14 last edited by@jsulm ui->label->setScaledContents(true);
ui->label->setPixmap(QPixmap::fromImage(wifi));I Got it finally Is It correct >?? -
@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.
-
@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.
wrote on 21 Nov 2019, 14:34 last edited by@jsulm Yes ..I understood ..Thanks a lot
-
Hi,
Depending on what you need, the scaledContent property might be of interest.
3/6