Qt5: set main timer as QtPreciseTimer, prepare for use of native event filter under linux.

This commit is contained in:
Željan Rikalo 2022-11-17 15:26:41 +01:00
parent 5ddc38fa2a
commit b77d4fd672

View File

@ -280,10 +280,15 @@ begin
begin
FMainTimerID := -1;
ATimer := QTimer_Create(QCoreApplication_instance());
if (StyleName = 'gtk') or (StyleName = 'gtk+') then
QTimer_setInterval(ATimer, 1) {issue #31191}
QTimer_setTimerType(ATimer, QtPreciseTimer);
{$IFDEF HASX11}
if (StyleName = 'gtk2') or (StyleName = 'gtk') then
QTimer_setInterval(ATimer, 1)
else
QTimer_setInterval(ATimer, {$IFDEF QtCocoa}5{$ELSE} 0 {$ENDIF});
QTimer_setInterval(ATimer, 0);
{$ELSE}
QTimer_setInterval(ATimer, {$IFDEF QtCocoa}5{$ELSE}0{$ENDIF});
{$ENDIF}
QTimer_start(ATimer);
FMainTimerID := QTimer_timerId(ATimer);
QApplication_exec();