done with GUI
diff --git a/demo/chatdialog.cpp b/demo/chatdialog.cpp
index b7edf20..6fd93df 100644
--- a/demo/chatdialog.cpp
+++ b/demo/chatdialog.cpp
@@ -17,6 +17,8 @@
DigestTreeScene *scene = new DigestTreeScene();
treeViewer->setScene(scene);
+ QRectF rect = scene->itemsBoundingRect();
+ scene->setSceneRect(rect);
//scene->plot();
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
@@ -144,3 +146,21 @@
updateLabels();
}
}
+
+void
+ChatDialog::resizeEvent(QResizeEvent *e)
+{
+ fitView();
+}
+
+void
+ChatDialog::showEvent(QShowEvent *e)
+{
+ fitView();
+}
+
+void
+ChatDialog::fitView()
+{
+ treeViewer->fitInView(treeViewer->scene()->itemsBoundingRect(), Qt::KeepAspectRatio);
+}