title: QPainter: Paint device returned engine 0
body: <p>My program produces runtime warnings when I type text into <code>QGraphicsItem</code>s. The items are created like this:</p>
  
  <pre><code>QGraphicsTextItem* item = new QGraphicsTextItem(this)
  item -&gt;setTextInteractionFlags(Qt::TextEditorInteraction);
  item -&gt;setCacheMode(ItemCoordinateCache);
  </code></pre>
  
  <p>As soon as I start typing, the following warning is displayed:</p>
  
  <pre><code>QPainter::begin: Paint device returned engine 0, type: 2 
  </code></pre>
  
  <p>This also results in more warnings like the following, all stating that the painter is not active:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>If I however set the cache mode to <code>NoCache</code>, everything is alright.</p>
  
  <p>How do I fix this?</p>