summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2020-02-21 00:22:37 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2020-02-22 01:15:20 +0100
commitc6fb366e05370af553af2130b370909ed4495cff (patch)
treecf406bde048449d5835693c1d7a3902947da4ea7
parent75c55e6cdbc1aca482ede3cdacd9fa18d5e0e449 (diff)
tdf#130499 Qt5 no qApp == main thread
If there is no QApplication, we can ignore the GUI thread. Change-Id: I0d2faf4799d493ad0b6074b40242c443d4bc43dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89241 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--vcl/qt5/Qt5Instance.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 1a0f10864e41..855f32d249af 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -400,7 +400,10 @@ void Qt5Instance::AddToRecentDocumentList(const OUString&, const OUString&, cons
OpenGLContext* Qt5Instance::CreateOpenGLContext() { return new Qt5OpenGLContext; }
-bool Qt5Instance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
+bool Qt5Instance::IsMainThread() const
+{
+ return !qApp || (qApp->thread() == QThread::currentThread());
+}
void Qt5Instance::TriggerUserEventProcessing()
{