diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-03-24 17:07:29 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-04-04 08:46:12 +0200 |
commit | 7e7bcce2d992c6fd53fdc4d9eb40f21c951d5347 (patch) | |
tree | be52dbc136cd0e88a89dfe4487f8ee09d142bfa1 /src/qt/guiutil.cpp | |
parent | 55f69a47002a1fc5bdf4e0c345e61ec955fa664b (diff) |
Code deduplication: make function in GUIUtil to get connection type to call object slot in GUI thread
with invokeMethod.
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index ac69bd07e9..ad530a78e4 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -17,6 +17,7 @@ #include <QClipboard> #include <QFileDialog> #include <QDesktopServices> +#include <QThread> QString GUIUtil::dateTimeStr(qint64 nTime) { @@ -184,3 +185,14 @@ QString GUIUtil::getSaveFileName(QWidget *parent, const QString &caption, return result; } +Qt::ConnectionType GUIUtil::blockingGUIThreadConnection() +{ + if(QThread::currentThread() != QCoreApplication::instance()->thread()) + { + return Qt::BlockingQueuedConnection; + } + else + { + return Qt::DirectConnection; + } +} |