抗锯齿PNG在Qt中调整大小?

lan*_*ng2 3 python user-interface qt

在基于PyQt的GUI程序中,我在调整大小后将一些PNG文件绘制为QPixmap.所以这基本上是发生了什么:

bitmap = QPixmap( "foo.png" )
bitmap.scaleToHeight(38) # original is larger than this
scene.addItem(QGraphicsPixmapItem(bitmap)) # Add to graphics scene
Run Code Online (Sandbox Code Playgroud)

问题是:之后,位图相当丑陋.有没有办法以抗锯齿的方式做到这一点?

Pet*_*rin 7

请参阅文档.

bitmap = bitmap.scaledToHeight(38, Qt.SmoothTransformation)
Run Code Online (Sandbox Code Playgroud)