I just completed the excercise for chapter 7 in which you create a form using Qt Designer and give it the functionality to search and replace some text. As usual I had to port it from PyQt4 to PyQt5. The signals gave me a little problem as they frequently can. In this case it was necessary to declare two custom signals which were used as you can see below. The stumbling block for me was that I didn’t provide for the found signal to pass in integer parameter.
# In porting this from PyQt4 I had to create two signals that # were created in-line in the original program like this: # form.connect(form, SIGNAL("found"), found) # form.connect(form, SIGNAL("notfound"), nomore) # This syntax is no longer possible with PyQt5 and the new style # signals. The signal must be declared as a class atribute and as # such must be declared as the first item in the class before any # method definition. The notfound signal doesn't take an argument so # none is given in the declaration. found returns the index of where # the text was found so it takes an integer argument which must be # declared like so: found = pyqtSignal(int) vs notfound = pyqtSignal() This is the form that is created