summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2020-02-21 00:22:37 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2020-02-22 10:04:27 +0100
commit3e1ae2e28718b7e9dda6a4a6e08dd4a512828858 (patch)
treef215b397aa059e28f0c692eefb5faba8c6693a01 /vcl
parentb15f6e3388eb031f2c57d21f0ea109f90e4e3c61 (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> (cherry picked from commit c6fb366e05370af553af2130b370909ed4495cff) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89141 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-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 eae41ad9a2bd..a040900fc7ee 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -397,7 +397,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()
{