chatdialog: Fix issue of creating QObjects in different thread.
Change-Id: I2f0dc2006cc330cd9d4fc5973eb475d841103b59
diff --git a/src/digesttreescene.cpp b/src/digesttreescene.cpp
index c2aa865..d692d4e 100644
--- a/src/digesttreescene.cpp
+++ b/src/digesttreescene.cpp
@@ -25,8 +25,10 @@
//DisplayUserPtr DisplayUserNullPtr;
-DigestTreeScene::DigestTreeScene(QWidget *parent)
+DigestTreeScene::DigestTreeScene(ndn::shared_ptr<boost::asio::io_service> ioService,
+ QWidget *parent)
: QGraphicsScene(parent)
+ , m_scheduler(*ioService)
{
previouslyUpdatedUser = DisplayUserNullPtr;
}
@@ -58,7 +60,7 @@
if (rePlot)
{
plot(digest);
- QTimer::singleShot(2100, this, SLOT(emitReplot()));
+ m_scheduler.scheduleEvent(ndn::time::milliseconds(600), ndn::bind(&DigestTreeScene::emitReplot, this));
}
else
{