void ChatScene::setWidth(qreal width) {
if(width == _sceneRect.width())
return;
+ layout(width);
+}
+void ChatScene::layout(qreal width) {
// clock_t startT = clock();
+ if(width < 0)
+ width = _sceneRect.width();
+
// disabling the index while doing this complex updates is about
// 2 to 10 times faster!
//setItemIndexMethod(QGraphicsScene::NoIndex);