diff options
Diffstat (limited to 'vcl/qt5/Qt5Menu.cxx')
-rw-r--r-- | vcl/qt5/Qt5Menu.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 49de2c0305a7..4fdebe00f226 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -12,6 +12,7 @@ #include <Qt5Bitmap.hxx> #include <Qt5Menu.hxx> #include <Qt5Menu.moc> +#include <Qt5Instance.hxx> #include <QtWidgets/QtWidgets> @@ -390,10 +391,12 @@ void Qt5Menu::SetSubMenu(SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned void Qt5Menu::SetFrame(const SalFrame* pFrame) { - if (qApp->thread() != QThread::currentThread()) + auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance)); + assert(pSalInst); + if (!pSalInst->IsMainThread()) { - SolarMutexReleaser aReleaser; - return Q_EMIT setFrameSignal(pFrame); + pSalInst->RunInMainThread([this, pFrame]() { SetFrame(pFrame); }); + return; } SolarMutexGuard aGuard; |