HI everyone,
I'm new here and in programming Qt and I have a problem, so I hope you could explain it to me.
Thank you very much.
I have an image, represented by a pixmap, fit in a label in my mainwindow.
I want to scale it but when I scale ithe pixmap, the label doesn't change, so I have two different situations:
1) the label is the same but the pixmap inside it is scaled (so you can see only a part of the image)
2) the label is the same and also the pixmap inside it
In this code I have the second situation. Can you resolve this problem?
void Interfaccia::zoomMappa()
{
ui->labelMap->setPixmap(mappa);
ui->labelMap->setScaledContents(true);
mappa.scaled(10,10,Qt::IgnoreAspectRatio);
}
void Interfaccia::zoomMappa()
{
QPixmap mappa("DefaultMap.png");
ui->labelMap->setPixmap(mappa);
ui->labelMap->setScaledContents(true);
mappa.scaled(10,10,Qt::IgnoreAspectRatio);
}
To copy to clipboard, switch view to plain text mode
Bookmarks