[PyQt] PyQt 5.11: Connecting to QAbstractItemModel::headerDataChanged fails

Florian Bruhin me at the-compiler.org
Sun Jun 24 08:21:02 BST 2018


On Sat, Jun 23, 2018 at 09:11:55PM +0100, Phil Thompson wrote:
> There will be new releases tomorrow. Unfortunately its a regression in the SIP code generator that affects all the wheels.

I've just tried 5.11.1 as I saw it on PyPI, but unfortunately, it seems
worse.

Connecting to QObject::destroyed seems to fail:

  >>> from PyQt5.QtCore import QObject
  >>> obj = QObject()
  >>> obj.destroyed.connect(lambda: None)
  QObject::connect: No such signal QObject::destroyed(*)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: connect() failed between (QObject*) and unislot()

Connecting to QAbstractItemModel::layoutAboutToBeChanged and
QAbstractItemModel::layoutChanged:

  >>> from PyQt5.QtGui import QStandardItemModel
  >>> model = QStandardItemModel()
  >>> model.layoutAboutToBeChanged.connect(lambda: None)
  QObject::connect: No such signal QStandardItemModel::layoutAboutToBeChanged(QList<QPersistentModelIndex>,LayoutChangeHint)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: connect() failed between (QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint) and unislot()

Connecting to QWebEnginePage::featurePermissionRequested:

  >>> from PyQt5.QtWidgets import QApplication
  >>> from PyQt5.QtWebEngineWidgets import QWebEnginePage
  >>> app = QApplication([])
  >>> page = QWebEnginePage()
  >>> page.featurePermissionRequested.connect(lambda: None)
  QObject::connect: No such signal QWebEnginePage::featurePermissionRequested(QUrl,Feature)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: connect() failed between (QUrl,QWebEnginePage::Feature) and unislot()

Connecting to QProcess::error:

  >>> from PyQt5.QtCore import QProcess
  >>> proc = QProcess()
  >>> proc.error.connect(lambda: None)
  QObject::connect: No such signal QProcess::error(ProcessError)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: connect() failed between (QProcess::ProcessError) and unislot()

Connecting to QLocalSocket::error:

  >>> from PyQt5.QtNetwork import QLocalSocket
  >>> socket = QLocalSocket()
  >>> socket.error.connect(lambda: None)
  QObject::connect: No such signal QLocalSocket::error(LocalSocketError)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: connect() failed between (QLocalSocket::LocalSocketError) and unislot()

Trying to *emit* QNetworkReply::error:

  >>> from PyQt5.QtNetwork import QNetworkReply
  >>> class ErrorNetworkReply(QNetworkReply):
  ...   def __init__(self, *args):
  ...     super().__init__(*args)
  ...     self.error.emit(QNetworkReply.TimeoutError)
  ... 
  >>> reply = ErrorNetworkReply()
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "<stdin>", line 4, in __init__
  AttributeError: 'ErrorNetworkReply' does not have a signal with the signature error(NetworkError)

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/20180624/7e6d62eb/attachment.sig>


More information about the PyQt mailing list