引用楼主geniusroger于2010-02-12 11:47发表的 QPixmap对象的大小设置 :
我想利用QPixmap类在一个label实例上显示硬盘上的图片。
    QPixmap pixmap;
    pixmap.load(fileName);
    update();
ui->iconLabel->resize(pixmap.size); //adjust the size of the label
ui->iconLabel->setScaledContents(true);//! the pixmap's size change along with the label
    ui->iconLabel->setPixmap(pixmap);
....... 
