macOS: Reflect platform settings for double click and key repeat intervals

The KeyboardAutoRepeatRate is unfortunately exposed in QStyleHints as
an int, so any rate below 1 event per second will not be reflected
accurately.

Change-Id: I506762545a1838cf007320e73827def006f5f0c2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ff4e624cd6b4320314ea93d142c707732cb01d4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2022-09-28 21:18:01 +02:00 committed by Qt Cherry-pick Bot
parent fc146be897
commit d28acffdc0

View File

@ -452,6 +452,12 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const
return !NSScreen.screensHaveSeparateSpaces;
case QPlatformTheme::ShowDirectoriesFirst:
return false;
case QPlatformTheme::MouseDoubleClickInterval:
return NSEvent.doubleClickInterval * 1000;
case QPlatformTheme::KeyboardInputInterval:
return NSEvent.keyRepeatDelay * 1000;
case QPlatformTheme::KeyboardAutoRepeatRate:
return 1.0 / NSEvent.keyRepeatInterval;
default:
break;
}