Solved QGraphicsPixmapItem VS QGraphicsItem with painted pixmap
-
Hey guys,
I'm trying to dispay an icon on a QGraphicsItem, The thing is I have a zoom feature and I would like to keep the quality of my icon while zooming.
I am using a .svg for vecotrial icons.
I have tried to use the QGraphicsPixmapItem so I could use the smoothTransformation.- didn't see a real difference
- too heavy
And I went for the classical way, directly drawing the pixmap in my QGraphicsItem
- Very good speed
- Bad quality while zooming
So none of the above seemed to work for me. Are there different ways of doing such things without cutting down the speed.
Thx ;)
-
Could you show some code?
My first idea would be to try QGraphicsSvgItem.
-
QGraphicsSvgItem seems to work perfectly, the only problem I have with this is I am using an online wrapper so my code works with Qt4 and Qt5 but QtSvg doesn't seem to be properly implemented in there.
So I had to manually import it from PySide2 to test.
Other than that, great solution ! Didn't know about QtSvg.
Thank you !
-
Actually the wrapper has been updated, So it's all good !