This is a *huge* performance improvement. Instead of using the
QTextDocument already attached to the QGraphicsTextItem, we create a
new QTextDocument and fill it. Only at the end of populateWidget() we
attach it to the QGraphicsTextItem. This way it will only be layouted
once and not per insert (three times per instruction).