PyQt4:属性错误:“QLineEdit”对象没有属性“setPlaceholderText”
我有一个 QLineEdit,我想设置一个占位符文本。当我调用 setPlaceholderText(string) 时,我收到 AttributeError,但是:
>>> from PyQt4 import QtCore
>>> QtCore.PYQT_VERSION_STR
'4.7.4'
>>> QtCore.QT_VERSION_STR
'4.7.0'
并且来自 QAssistant:
该属性保存行编辑的 占位符文本。
...
该属性是在 Qt 4.7 中引入的。
I have a QLineEdit, and I want to set a placeholder text. When I call setPlaceholderText(string)
I get an AttributeError, but:
>>> from PyQt4 import QtCore
>>> QtCore.PYQT_VERSION_STR
'4.7.4'
>>> QtCore.QT_VERSION_STR
'4.7.0'
and from the QAssistant:
This property holds the line edit's
placeholder text.
...
This property was introduced in Qt 4.7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜想虽然这些库是最近的,但绑定根本不是最新的。
您可能想查看 PySide - 一个诺基亚项目,其许可证问题(在我看来)比 PyQt 少。
I would guess that although the libraries are very recent, the bindings are simply not that up to date.
You might want to check out PySide - a Nokia project with (IMO) fewer license issues than PyQt.