fix automatic update of dependency graph for Qt5

This commit is contained in:
wmayer
2018-01-15 23:54:31 +01:00
parent e404cadee6
commit 9a215440b8

View File

@@ -93,6 +93,8 @@ public:
// This is needed because embedding a QProcess into a QThread
// causes some problems with Qt5.
run();
// Can't use the finished() signal of QThread
emitFinished();
#else
start();
#endif
@@ -136,6 +138,7 @@ public:
Q_SIGNALS:
void svgFileRead(const QByteArray & data);
void error();
void emitFinished();
private:
QProcess dotProc, unflattenProc;
@@ -171,6 +174,9 @@ GraphvizView::GraphvizView(App::Document & _doc, QWidget* parent)
// Create worker thread
thread = new GraphvizWorker(this);
#if QT_VERSION >= 0x050000
connect(thread, SIGNAL(emitFinished()), this, SLOT(done()));
#endif
connect(thread, SIGNAL(finished()), this, SLOT(done()));
connect(thread, SIGNAL(error()), this, SLOT(error()));
connect(thread, SIGNAL(svgFileRead(const QByteArray &)), this, SLOT(svgFileRead(const QByteArray &)));
@@ -296,7 +302,7 @@ void GraphvizView::done()
if (nPending > 0) {
nPending = 0;
updateSvgItem(doc);
thread->start();
thread->startThread();
}
}