我正在尝试使用QBrush.setTexture()
更新QGraphicsRectItem
并带有.png背景。但我无法设置确切的大小以适应QGraphicsRectItem
和QPixMap
。如何在QGraphicsRectItem上用QPixmap调用QBrush.setTexture()?
brush->setTexture((QPixmap(":/images/h_shutdown.png"))
.scaled(70,30,Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
但是,.png总是从中心交叉堆叠延伸。
你有什么建议吗?
QGrahpicsRectItem with backround png