From 3eac528716411b9e44b1e37d27543839672dce31 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 9 Jan 2015 15:43:03 +0100 Subject: [PATCH] Switch Qt style to Fusion on OS X on Qt 5.4. Fixes #462. See #459. Upstream bugs: https://bugreports.qt.io/browse/QTBUG-42948 https://bugreports.qt.io/browse/QTBUG-43070 --- qutebrowser/browser/webview.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index 6472694ed..45ec990e1 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -19,11 +19,12 @@ """The main browser widgets.""" +import sys import itertools import functools from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QTimer, QUrl -from PyQt5.QtWidgets import QApplication +from PyQt5.QtWidgets import QApplication, QStyleFactory from PyQt5.QtWebKit import QWebSettings from PyQt5.QtWebKitWidgets import QWebView, QWebPage @@ -85,6 +86,10 @@ class WebView(QWebView): def __init__(self, win_id, parent=None): super().__init__(parent) + if sys.platform == 'darwin' and qtutils.version_check('5.4'): + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-42948 + # See https://github.com/The-Compiler/qutebrowser/issues/462 + self.setStyle(QStyleFactory.create('Fusion')) self._win_id = win_id self.load_status = LoadStatus.none self._check_insertmode = False