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的控件就没有铺满窗口……