Use qtutils.version_check to check for signal availability

With Qt 5.12 but an older PyQt, it looks like the attributes are available, but
connecting fails with:

    TypeError: C++ type 'QWebEngineClientCertificateSelection' is not supported
    as a signal argument type

Let's ensure we require both a new Qt and PyQt instead.
This commit is contained in:
Florian Bruhin 2019-02-17 17:29:27 +01:00
parent 64f7692d74
commit d97a186992

View File

@ -1505,13 +1505,11 @@ class WebEngineTab(browsertab.AbstractTab):
self._on_proxy_authentication_required)
page.contentsSizeChanged.connect(self.contents_size_changed)
page.navigation_request.connect(self._on_navigation_request)
try:
if qtutils.version_check('5.12'):
page.printRequested.connect(self._on_print_requested)
page.selectClientCertificate.connect(
self._on_select_client_certificate)
except AttributeError:
# Added in Qt 5.12
pass
view.titleChanged.connect(self.title_changed)
view.urlChanged.connect(self._on_url_changed)