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

Phil Thompson phil at riverbankcomputing.com
Sat Jun 23 21:11:55 BST 2018


On 23 Jun 2018, at 4:07 pm, Florian Bruhin <me at the-compiler.org> wrote:
> 
> Hi,
> 
> I did just run my testsuite with PyQt 5.11, and it looks like connecting
> to the QAbstractItemModel::headerDataChanged signal fails (which causes
> anything using pytest-qt's modeltester[1] to fail):
> 
>>>> from PyQt5.QtGui import QStandardItemModel
>>>> model = QStandardItemModel()
>>>> model.headerDataChanged
>    <bound PYQT_SIGNAL headerDataChanged of QStandardItemModel object at 0x7f53e465e438>
>>>> model.headerDataChanged.connect(lambda: None)
>    QObject::connect: No such signal QStandardItemModel::headerDataChanged(Orientation,int,int)
>    Traceback (most recent call last):
>      File "<stdin>", line 1, in <module>
>    TypeError: connect() failed between (Qt::Orientation,int,int) and unislot()
> 
> The same thing also seems to happen with a @pyqtSlot-decorated slot in a
> QObject.
> 
> I've also tried somehow getting the correct overload via
> headerDataChanged[int, int, int] and [Qt.Orientation, int, int], without
> any luck.
> 
> Not sure yet whether it's only that signal, or whether it also affects
> other signals using enums or so... I've only seen it there so far.
> 
> [1] http://pytest-qt.readthedocs.io/en/latest/modeltester.html

There will be new releases tomorrow. Unfortunately its a regression in the SIP code generator that affects all the wheels.

Phil


More information about the PyQt mailing list