QPixmap QPixmap::scaledToWidth(int width, Qt::TransformationMode mode = Qt::FastTransformation) const
Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved.
If width is 0 or negative, a null pixmap is returned.
你應該對QPixmap做下縮放吧,該函數有方法scaledToWidth和scaledToHeight
縮放圖片後再進行繪製
你這裡的
QPainter painter(this)
中的this
是你wuziqi
這個視窗嗎?你的那個qipan的控制就沒有鋪滿視窗…