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

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


Am Samstag, 23. Juni 2018, 18:23:44 CEST schrieb Florian Bruhin:
> Hey,
> 
> On Sat, Jun 23, 2018 at 06:10:36PM +0200, Detlev Offenbach wrote:
> > QObject::connect: No such signal
> > Editor::marginClicked(int,int,KeyboardModifiers)

No, class Editor is derived from QsciScintilla and the signal is one of the 
QsciScintilla base class.

> 
> I assume Editor::marginClicked is a custom signal? How is it defined?
> 
> FWIW, as a workaround I added a definition of the headerDataChanged
> signal to my model subclasses, like so:
> 
>     class CompletionModel(QAbstractItemModel):
> 
>         if PYQT_VERSION == 0x050b00:
>             headerDataChanged = pyqtSignal(Qt.Orientation, int, int)
> 
>         def __init__(self, ...):
>             ...
> 
> I'm not sure what happens when the model actually gets emitted (from
> either Qt or PyQt), but at least that allows pytest-qt to connect to it
> again.
> 
> Florian

-- 
Detlev Offenbach
detlev at die-offenbachs.de




More information about the PyQt mailing list