I build a QLineEdit Widget and a QButton Widget. I want to reference the entered text in QLineEdit from a function my code as follows
Code: Select all
class MainWindow(QtGui.QWidget):
def __init__(self, parent=None):
......
colorEdit = QtGui.QLineEdit()
......
self.connect(colorEdit, QtCore.SIGNAL("returnPressed()"), self.newMovie)
......
def newMovie(self):
# This is where it goes wrong with attribute errors
mycolor = self.colorEdit.text()
......
AttributeError: 'MainWindow' object has no attribute 'colorEdit'