Qt4 compatibility

This commit is contained in:
Matthias Koefferlein 2021-03-15 18:23:34 +01:00
parent d9686c1f77
commit 3bd63e4b80
1 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ LogFile::add (LogFileEntry::mode_type mode, const std::string &msg, bool continu
++m_generation_id; ++m_generation_id;
if (QThread::currentThread ()->eventDispatcher () && (tl::Clock::current () - m_last_yield).seconds () > 0.1) { if (lay::ApplicationBase::instance ()->qapp_gui () && QThread::currentThread () == lay::ApplicationBase::instance ()->qapp_gui ()->thread () && (tl::Clock::current () - m_last_yield).seconds () > 0.1) {
m_last_yield = tl::Clock::current (); m_last_yield = tl::Clock::current ();
can_yield = true; can_yield = true;
} }
@ -255,7 +255,7 @@ LogFile::add (LogFileEntry::mode_type mode, const std::string &msg, bool continu
// use this opportunity to process events // use this opportunity to process events
if (can_yield) { if (can_yield) {
QThread::currentThread ()->eventDispatcher ()->processEvents (QEventLoop::AllEvents); lay::ApplicationBase::instance ()->process_events (QEventLoop::AllEvents);
} }
} }