PyQt5 v5.15.10, PyQt6 v6.5.3, SIP v6.7.12 Available

Florian Bruhin me at the-compiler.org
Tue Oct 10 13:24:28 BST 2023


Hey,

> >
> >
> > PyQt6 v6.5.3
> > PyQt6-sip v13.6.0
> > PyQt6-Qt6 v6.5.3
> >
> >
> In a Qt6 class derived from QTableView, with the slot selectionChanged,
> under Python 3.11 (Windows), I'm getting the following error:
> 
> AttributeError: 'QItemSelection' object has no attribute 'length'
> 
> Again on Windows Qt6, in a class derived from QAbstractTableModel, when
> emitting the signal headerDataChanged, I'm getting the following error
> (with class name DeduplicateModel):
> AttributeError: 'DeduplicateModel' does not have a signal with the
> signature headerDataChanged(Qt::Orientation, int, int)
> 
> The code works using PySide6. It's possible I may not have decorated every
> slot in the application, if that matters?

For what it's worth, I saw something similar pop up in my bleeding edge
Arch Linux CI environment with:

python-pyqt6 6.5.2-1 (!)
qt6-base 6.6.0rc-1

where:

    class FakeProcess(QProcess):

        def __init__(self, parent: QObject = None) -> None:
            super().__init__(parent)
            # replacing some things with mocks, but not touching
            # self.finished

and:

    proc.finished.emit(0, QProcess.ExitStatus.NormalExit)

results in:

    AttributeError: 'FakeProcess' does not have a signal with the signature finished(int, QProcess::ExitStatus)

despite it clearly inheriting this from QProcess, and that working fine
in earlier Qt/PyQt versions.

Unfortunately so far I haven't been able to reproduce locally so far,
so I don't have a minimal reproducer.

Damon, could you maybe check if this errors out for you too?

    from PyQt6.QtCore import QProcess
    class Process(QProcess): pass
    proc = Process()
    proc.finished.emit(0, QProcess.ExitStatus.NormalExit)

(and if not, maybe something with a boilerplate __init__ like above?)

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20231010/857b03a6/attachment.sig>


More information about the PyQt mailing list