diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-09-18 11:25:05 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-09-19 09:44:36 +0200 |
commit | b7d1371910dad02c05bfd9ecd65a73de97871b9c (patch) | |
tree | 9bdcb3083f1c0df40505848bfe9930be2b7fb873 /vcl/qt5/Qt5Frame.cxx | |
parent | 56ac8214ab35387f8861044b62c79fae6d7ccac5 (diff) |
Qt5 minimal initial fix for Java UNO
This is just a minimal fix for Qt errors from JunitTest_svx_unoapi,
which was manipulating Qt5Timer and other timers, resulting in a
spew of timer error messages like:
QObject::killTimer: Timers cannot be stopped from another thread
QObject::startTimer: Timers cannot be started from another thread
QBasicTimer::start: QBasicTimer can only be used with threads started with QThread
Eventually all the QWidget manipulation in the Qt5Frame must be
redirected to the main thread, just like Qt5FilePicker already does.
Change-Id: I66054e6c90f99d27bd5818dcaa5876c515867f77
Reviewed-on: https://gerrit.libreoffice.org/60672
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5/Qt5Frame.cxx')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 3365ed4af3b8..b42ec5e08a0c 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -18,6 +18,7 @@ */ #include <Qt5Frame.hxx> +#include <Qt5Frame.moc> #include <Qt5Tools.hxx> #include <Qt5Instance.hxx> @@ -108,6 +109,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo) } else m_pQWidget = new Qt5Widget(*this, aWinFlags); + connect(this, SIGNAL(setVisibleSignal(bool)), SLOT(setVisible(bool))); if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG)) { @@ -301,6 +303,14 @@ void Qt5Frame::DrawMenuBar() { /* not needed */} void Qt5Frame::SetExtendedFrameStyle(SalExtStyle /*nExtStyle*/) { /* not needed */} +void Qt5Frame::setVisible(bool bVisible) +{ + if (m_pTopLevel) + m_pTopLevel->setVisible(bVisible); + else + m_pQWidget->setVisible(bVisible); +} + void Qt5Frame::Show(bool bVisible, bool /*bNoActivate*/) { assert(m_pQWidget); @@ -308,10 +318,7 @@ void Qt5Frame::Show(bool bVisible, bool /*bNoActivate*/) if (m_bDefaultSize) SetDefaultSize(); - if (m_pTopLevel) - m_pTopLevel->setVisible(bVisible); - else - m_pQWidget->setVisible(bVisible); + Q_EMIT setVisibleSignal(bVisible); } void Qt5Frame::SetMinClientSize(long nWidth, long nHeight) |