我之前的理解是 PySide 不需要 QString。然而,我发现 PySide(我使用 v1.2.1 和 Python v2.7.5)似乎对此不一致,具体取决于我如何连接信号和插槽:
# This Way of wiring up signals and slots requires str
le = QLineEdit()
slotOnChanged = self.onChanged
le.textChanged[str].connect(slotOnChanged)
# But this Way requires QString
le = QLineEdit()
signalTextChanged = SIGNAL("textChanged(QString)")
slotOnChanged = self.onChanged
le.connect(signalTextChanged, slotOnChanged)