pyqtSignal() connects bool object instead of str
<p>Let's say I have this snippet of code:</p>

<pre><code>from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QDialog
from PyQt5.QtCore import pyqtSignal
from ui_helloworld import Ui_MainWindow
from ui_hellodialog import Ui_Hi
from sys import argv
from sys import exit


class MainWindow(QMainWindow):

    update = pyqtSignal(str)

    def __init__(self):

        super(MainWindow, self).__init__()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.h = HelloDialog()

        self.ui.pushButton.clicked.connect(self.update_label)
        self.ui.doIt.clicked.connect(self.h.update_label)

    def update_label(self):
        self.h.show()

    def update_label_hello(self, msg):

        self.update.emit(msg)


class HelloDialog(QDialog):

    def __init__(self):

        super(HelloDialog, self).__init__()
        self.ui = Ui_Hi()
        self.ui.setupUi(self)

    def update_label(self, msg):

        print msg

        # Crashes the program:
        # TypeError: setText(self, str): argument 1 has unexpected type 'bool'
        # &gt;&gt; self.ui.label.setText(msg)


        self.ui.label.setText("Hello world!")


def main():

    app = QApplication(argv)

    window = MainWindow()
    window.show()

    exit(app.exec_())


if __name__=="__main__":
    main()
</code></pre>

<p>It's fairly simple. It's 2 windows, one is a QMainWindow and the other is a QDialog. The MainWindow has 2 buttons, pushButton and doIt:</p>

<ul>
<li><code>pushButton</code> opens the <code>HelloDialog</code></li>
<li><code>doIt</code> emit the <code>update</code> signal</li>
</ul>

<p>The problem is, that the slot in <code>HelloDialog</code> Is receiving a boolean from the <code>update</code> signal in <code>MainWindow</code>, but I declared it as a str object.</p>

<p>Why does the the <code>update_label</code> slot receive a <code>bool</code> and not a <code>str</code> object? </p>

<pre><code>localhost :: Documents/Python/qt Â» python main.py 

{ push `doIt` object }

False
</code></pre>

<p>The <code>Ui_MainWidow</code> and <code>Ui_Hi</code> classes are <code>pyuic5</code> generated.</p>

<p>I did not need to connect to <code>self.h.update_label</code> directly. I had to connect to the method inside MainWindow called <code>update_label_hello</code> to <code>doIt</code>, and then connect the <code>pyqtSignal</code> to the slot in <code>HelloDialog</code></p>

<p>So, the final result is this:</p>

<p>init of <code>MainWindow</code>:</p>

<pre><code>def __init__(self):

    super(MainWindow, self).__init__()

    self.ui = Ui_MainWindow()
    self.ui.setupUi(self)
    self.h = HelloDialog()

    self.ui.pushButton.clicked.connect(self.update_label_)
    self.ui.doIt.clicked.connect(self.update_label_hello)

    self.update.connect(self.h.update_label)
</code></pre>

python qt pyqt5