Turn off FocusOnNavigationEnabled on Qt 5.9

This way we get the same behavior with Qt 5.9 and 5.10 at least, leaving only
5.7 if we pretend that 5.8 never existed.
This commit is contained in:
Florian Bruhin 2018-06-11 20:28:00 +02:00
parent e7659cea63
commit d42934af08

View File

@ -187,8 +187,17 @@ class ProfileSetter:
"""Initialize settings on the given profile."""
self.set_http_headers()
self.set_http_cache_size()
self._profile.settings().setAttribute(
settings = self._profile.settings()
settings.setAttribute(
QWebEngineSettings.FullScreenSupportEnabled, True)
try:
settings.setAttribute(
QWebEngineSettings.FocusOnNavigationEnabled, False)
except AttributeError:
# Added in Qt 5.8
pass
if qtutils.version_check('5.8'):
self.set_dictionary_language()