When using a QGLWidget as a viewport for a QGraphicsView causes fonts to be insanely ugly. I am using a QGraphicsSimpleTextItem. Is there a way to make rendered text look as nice as it does when using the default viewport?
Secondly, to work around this I am trying to render the background png-image and text off-screen into a pixmap, then adding the pixmap to the scene that is displayed on the screen. The problem is I cannot make the background transparent. Here is essentially what I am doing:
- create a QGraphicsItemGroup
- Add a QPixmap (which is a png image containing transparent parts)
- Add a QGraphicsSimpleText item on top of the QPixmap
- Add the QGraphicsItemGroup to a new QGraphicsScene
- Create a QPixmap and a QPainter
- Call QGraphicsScene::render into the QPainter.
- Add the QPainter's QPixmap to the output scene that is displayed on the screen.
The rendered text looks good again however no matter what I try, the QGraphicsScene always fills in the transparent parts of the background png with a background color. Even when I set the background color of the scene to have a 0 alpha value, I still get a background color. I also tried adding another step and putting the scene into a viewport and using setAutoFillBackground to false which did not help either. Is there something I am missing here or maybe a better way to do this? I cannot have rendered text looking like we are back in the 80's.
[EDIT: list formatting, Volker]