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

Detlev Offenbach detlev at die-offenbachs.de
Sat Jun 23 17:10:36 BST 2018


I am observing a similar issue. I am getting 

QObject::connect: No such signal 

The method/slot to is defined with

    @pyqtSlot(int, int, Qt.KeyboardModifiers)
    def __marginClicked(self, margin, line, modifiers):

The same error message is given, if the @pyqtSlot line is absent.

How can I overcome this issue because it means, that eric is not usable with 
PyQt 5.11.


Am Samstag, 23. Juni 2018, 17:07:56 CEST schrieb Florian Bruhin:
> 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
> Florian

Detlev Offenbach
detlev at die-offenbachs.de

More information about the PyQt mailing list