My program produces runtime warnings when I type text into QGraphicsItem
s. The items are created like this:
QGraphicsTextItem* item = new QGraphicsTextItem(this)
item ->setTextInteractionFlags(Qt::TextEditorInteraction);
item ->setCacheMode(ItemCoordinateCache);
As soon as I start typing, the following warning is displayed:
QPainter::begin: Paint device returned engine 0, type: 2
This also results in more warnings like the following, all stating that the painter is not active:
QPainter::translate: Painter not active
QPainter::setClipRegion: Painter not active
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setWorldTransform: Painter not active
QPainter::end: Painter not active, aborted
If I however set the cache mode to NoCache
, everything is alright.
How do I fix this?