[PyQt] scribus: connecting a c++ signal with a pyqt5 slot

ale rimoldi ale.comp_06 at xox.ch
Wed Aug 5 21:39:39 BST 2015


hey

i come back with a question i've already asked a few months ago because
i still have not found an answer.

the issue is about porting the scribus scripter engine from pyqt4 to
pyqt5 and adapt it to the new way of handling signals and slots


http://scribus.net/websvn/filedetails.php?repname=Scribus&path=%2Ftrunk%2FScribus%2Fscribus%2Fplugins%2Fscripter%2Fpython%2Finit_scripter.py

has the following code

    def createMenu(mainWindow):
        Scripter.menu = ScripterMenu(mainWindow)

    Scripter.connect("createMenu(QMainWindow*)", createMenu)

the code used to work with pyqt4 and connects a createMenu signal
emitted by the c++ code and allows the ScripterMenu class to attach new
menu entries to the mainWindow object it gets from c++.

the interface between c++ and python is managed through libpython3.5
and pythonize.

my effort to port the scripter to python3 and pyqt5 is blocked in here

https://github.com/aoloe/scribus-plugin-scripter/blob/master/src/python/init_scripter.py#L94

the most common error i'm getting being

AttributeError: 'PyQt5.QtCore.pyqtSignal' object has no attribute
'connect'

... but the current code simply get's through without creating a
navigation entry....


does anybody have a hint what i can do?

have a nice evening
a.l.e


More information about the PyQt mailing list