Let me guess: are you trying to scale the pixmap so that it is as high as the standart label?
Try this:
// Create an empty label
//Load the pixmap
//Create the instance of the default application font
//Create font metrics of the font
//Scale the pixmap to the height of the font
mypix = mypix.scaledToHeight(metrics.height());
//Set the result to the label
mylabel->setPixmap(mypix);
// Create an empty label
QLabel *mylabel = new QLabel;
//Load the pixmap
QPixmap mypix("query.png");
//Create the instance of the default application font
QFont font;
//Create font metrics of the font
QFontMetrics metrics(font);
//Scale the pixmap to the height of the font
mypix = mypix.scaledToHeight(metrics.height());
//Set the result to the label
mylabel->setPixmap(mypix);
To copy to clipboard, switch view to plain text mode
P.S.: Please, next time use the [code] and [/code] tags to make your QT code readable.
Bookmarks