[PyQt] pyqt AttributeError: 'QWebEngineSettings' object has no attribute 'setUnknownUrlSchemePolicy'

Florian Bruhin me at the-compiler.org
Sun Oct 28 10:03:56 GMT 2018


On Sun, Oct 28, 2018 at 11:55:55AM +0800, Zhao Lee wrote:
> pyqt AttributeError: 'QWebEngineSettings' object has no attribute 'setUnknownUrlSchemePolicy'
> however  http://doc.qt.io/qt-5/qwebenginesettings.html#setUnknownUrlSchemePolicy

Works fine here:

    >>> from PyQt5.QtWidgets import QApplication
    >>> from PyQt5.QtWebEngineWidgets import QWebEngineSettings
    >>> a = QApplication([])
    >>> s = QWebEngineSettings.defaultSettings()
    >>> s.setUnknownUrlSchemePolicy(QWebEngineSettings.DisallowUnknownUrlSchemes)
    >>>

Are you sure you're using Qt and PyQt 5.11 or newer?

Florian

-- 
https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181028/b2f8c98a/attachment.sig>


More information about the PyQt mailing list