Learning PySide, I'm tweaking a text edit widget (QLineEdit) and trying to set the placeholder text using setPlaceHolderText as in the code snippet below (which I invoke from main
). Unfortunately, it is not working as I expected. The code runs, but the text box is blank, does not show the placeholder text. I am in Windows 7, Python 2.7 (working in iPython).
class MyTextEdit(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
self.textEditor=QtGui.QLineEdit(self)
self.textEditor.move(50,15)
self.textEditor.setPlaceholderText("Don't mind me.")
self.setGeometry(100, 100, 200, 50)
self.show()
Anyone understand what I'm doing wrong? I'm following examples from the following sites:
http://nullege.com/codes/search/PyQt4.QtGui.QLineEdit.setPlaceholderText
http://www.pythoncentral.io/pyside-pyqt-tutorial-interactive-widgets-and-layout-containers/
And don't see what I'm doing differently.