The root cause of the problem here is you cannot self.text = None,not
setText("").
------------------ 原始邮件 ------------------
发件人: "Kenneth Martin";<mar...@granitesemi.com>;
发送时间: 2015年1月19日(星期一) 凌晨5:21
收件人: "iMath"<2281570...@qq.com>;
主题: Re: [PySide] Which used a rather good tool to wrap Qt for Python, PySide or
PyQt ?
I think PySide does accept .setText("") instead of
.setText(None)
On 15-01-17 08:37 PM, iMath wrote:
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_()
_______________________________________________ PySide mailing list
PySide@qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside
_______________________________________________
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside