AttributeError: 'MainWindow' object has no attribute 'onWindowTitleChange'

While running your example, I get the error:
AttributeError: ‘MainWindow’ object has no attribute ‘onWindowTitleChange’

I had the same problem, it seems that this signal is no longer available in the Qt QMainWindow class.

The onWindowTitleChange is a custom-defined slot (see the bottom of the example file) which you need to add yourself. The signal windowTitleChange is connected to this.

# SLOT: This accepts a string, e.g. the window title, and prints it
def onWindowTitleChange(self, s):
1 Like

Thanks, that makes sense.

I got the same error but my mistake was that I had copy/pasted the slots into the same indent level as the class MainWindow instead of the indent level of the def __init__. It worked once I moved them over.