[PyQt] how to use setDateTextFormat() using pyqt
ad3d
alhaddeshpande at gmail.com
Mon Jan 24 02:51:29 GMT 2011
hi guys
i am trying to color specific dates of QCalenderWidget using
setDateTextFormat() function.
i am using QDateEdit in the program n my piece of code is
self.dob_date = QtGui.QDateEdit(self.basic_grp)
self.dob_date.setGeometry(QtCore.QRect(89,110,100, 20))
self.dob_date.setCalenderPopup(True)
self.dob_date.setObjectName("dob_date")
#creating QDate as setDateTextFormat(QDate date, QTextCharFormat color)
date = 13
month = 01
year = 2011
item = QtCore.QDate(year,month,date)
#creating QTextCharFormat as setDateTextFormat(QDate date, QTextCharFormat
color)
kk = QtGui.QTextCharFormat()
kk.setForeground(QtGui.QColor('red'))
#creating calenderwidget for respective QDateEdit object
omg = self.dob_date.calenderWidget()
#using setDateTextFormat() to change color of QDate i.e. 13-01-2011 to "red"
omg.setDateTextFormat(item,kk)
This code is not giving any error but when i click on respective QDateEdit
to popup QCalenderWidget that date is in black color not in red..this code
is not changing color of the specified date...Can someone tell me where i am
going wrong????
Thanx in advance
--
View this message in context: http://old.nabble.com/how-to-use-setDateTextFormat%28%29-using-pyqt-tp30717999p30717999.html
Sent from the PyQt mailing list archive at Nabble.com.
More information about the PyQt
mailing list