Use QEventLoop for wxEventLoop implementation in wxQt to fix several
issues with wxEventLoop, notably avoid "QApplication::exec is already
running" errors.

See https://github.com/wxWidgets/wxWidgets/pull/1165
This commit is contained in:
Vadim Zeitlin
2019-01-22 19:05:53 +01:00
2 changed files with 32 additions and 30 deletions

View File

@@ -9,6 +9,7 @@
#define _WX_QT_EVTLOOP_H_
class QTimer;
class QEventLoop;
class WXDLLIMPEXP_CORE wxQtEventLoopBase : public wxEventLoopBase
{
@@ -16,13 +17,15 @@ public:
wxQtEventLoopBase();
~wxQtEventLoopBase();
virtual int DoRun();
virtual void ScheduleExit(int rc = 0);
virtual bool Pending() const;
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual void DoYieldFor(long eventsToProcess);
virtual int DoRun() wxOVERRIDE;
virtual void ScheduleExit(int rc = 0) wxOVERRIDE;
virtual bool Pending() const wxOVERRIDE;
virtual bool Dispatch() wxOVERRIDE;
virtual int DispatchTimeout(unsigned long timeout) wxOVERRIDE;
virtual void WakeUp() wxOVERRIDE;
virtual void DoYieldFor(long eventsToProcess) wxOVERRIDE;
void ScheduleIdleCheck();
#if wxUSE_EVENTLOOP_SOURCE
virtual wxEventLoopSource *AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
@@ -30,6 +33,7 @@ public:
protected:
private:
QEventLoop *m_qtEventLoop;
QTimer *m_qtIdleTimer;
wxDECLARE_NO_COPY_CLASS(wxQtEventLoopBase);