2010-10-17 141 views
0

我有一個QLineEdit,我想設置一個佔位符文本。當我打電話setPlaceholderText(string)我得到一個AttributeError,但:PyQt4:AttributeError:'QLineEdit'對象沒有屬性'setPlaceholderText'

>>> from PyQt4 import QtCore 
>>> QtCore.PYQT_VERSION_STR 
'4.7.4' 
>>> QtCore.QT_VERSION_STR 
'4.7.0' 

,並從QAssistant:

This property holds the line edit's placeholder text.
...
This property was introduced in Qt 4.7.

回答

3

我猜想,雖然庫非常近,綁定是根本就不是那麼最新。

您可能想查看PySide - 與PyQt相比,諾基亞項目(IMO)的許可問題更少。

+0

謝謝!現在我嘗試PySide! – rubik 2010-10-17 11:37:33

+0

好吧,PySide的作品!再次感謝你。 – rubik 2010-10-17 18:00:10