[PyQt] Which used a rather good tool to wrap Qt for Python , PySide or PyQt ?

iMath 2281570025 at qq.com
Fri Jan 16 12:49:45 GMT 2015


the PySide code here prompts "TypeError: 'str' object is not callable" while it is working,but  ‍When changed to PyQt code, it works well.‍


The reason why this happen is because you cannot ‍self.text = None in PySide,‍


It seems naming-clash error happened in PySide while not in PyQt , so Which used a rather good tool to wrap Qt for Python , PySide or PyQt ? ‍




from PySide import QtGui, QtCore




class MyProgressBar(QtGui.QProgressBar):


    def __init__(self):
        super().__init__()
        self.setRange(0, 0)
        self.setAlignment(QtCore.Qt.AlignCenter)
        self.text = None


    # def setText(self, text):
    #     self.text = text


    # def text(self):
    #     return self.text


app = QtGui.QApplication([])


p = MyProgressBar()
# p.setText('finding resource...')
p.show()


app.exec_()‍
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150116/5e53b31a/attachment.html>


More information about the PyQt mailing list