D
dmbkiwi
I'm trying to write a simple dialog with PyQt. Ive got this code as
one of the slots:
def setFixed(self):
if len(str(self.fixed_label.displayText())) == 0:
QMessageBox.critical(self, "Label Missing", "You must enter
a label.")
else:
print str(self.fixed_date_month.currentText())
print str(self.fixed_date_day.currentText())
day_text = str(self.fixed_date_day.curentText()) + ' ' +
str(self.fixed_date_month.currentText())
self.date_list.insertItem(date_text)
self.label_list.insertItem(str(self.fixed_label.displayText()))
When run, the output is:
January
1
Traceback (most recent call last):
File "/home/matt/karamba/date_calc/date_config.py", line 285, in
setFixed
day_text = str(self.fixed_date_day.curentText()) + ' ' +
str(self.fixed_date_month.currentText())
AttributeError: curentText
How can it print .currentText(), but then throw an AttributeError when
I try an put them in a variable?
Any help appreciated.
Cheers
Matt
one of the slots:
def setFixed(self):
if len(str(self.fixed_label.displayText())) == 0:
QMessageBox.critical(self, "Label Missing", "You must enter
a label.")
else:
print str(self.fixed_date_month.currentText())
print str(self.fixed_date_day.currentText())
day_text = str(self.fixed_date_day.curentText()) + ' ' +
str(self.fixed_date_month.currentText())
self.date_list.insertItem(date_text)
self.label_list.insertItem(str(self.fixed_label.displayText()))
When run, the output is:
January
1
Traceback (most recent call last):
File "/home/matt/karamba/date_calc/date_config.py", line 285, in
setFixed
day_text = str(self.fixed_date_day.curentText()) + ' ' +
str(self.fixed_date_month.currentText())
AttributeError: curentText
How can it print .currentText(), but then throw an AttributeError when
I try an put them in a variable?
Any help appreciated.
Cheers
Matt