mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 12:02:48 +02:00
Qt5: reduce CPU usage with native event loop on mswindows
This commit is contained in:
parent
8d29480359
commit
e8348c050d
@ -287,7 +287,7 @@ begin
|
|||||||
else
|
else
|
||||||
QTimer_setInterval(ATimer, 0);
|
QTimer_setInterval(ATimer, 0);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
QTimer_setInterval(ATimer, {$IFDEF QtCocoa}5{$ELSE}0{$ENDIF});
|
QTimer_setInterval(ATimer, {$IFDEF QtCocoa}5{$ELSE}1{$ENDIF});
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
QTimer_start(ATimer);
|
QTimer_start(ATimer);
|
||||||
FMainTimerID := QTimer_timerId(ATimer);
|
FMainTimerID := QTimer_timerId(ATimer);
|
||||||
@ -314,7 +314,7 @@ begin
|
|||||||
{we cannot call directly processEvents() with this flag
|
{we cannot call directly processEvents() with this flag
|
||||||
since it produces AV's sometimes, so better check is there
|
since it produces AV's sometimes, so better check is there
|
||||||
any pending event.}
|
any pending event.}
|
||||||
{$IF DEFINED(QtUseNativeEventLoop) AND DEFINED(QtCocoa)}
|
{$IF DEFINED(QtUseNativeEventLoop) AND NOT DEFINED(HASX11)}
|
||||||
if not QCoreApplication_hasPendingEvents() then
|
if not QCoreApplication_hasPendingEvents() then
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
QCoreApplication_processEvents(QEventLoopWaitForMoreEvents);
|
QCoreApplication_processEvents(QEventLoopWaitForMoreEvents);
|
||||||
|
Loading…
Reference in New Issue
Block a user