Ralf Van Bogaert
unread,Apr 19, 2012, 3:57:15 AM4/19/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lqt-bi...@googlegroups.com
Hiya,
My app has a table that allows a user to insert dates. These can be edited using a QDateTimeEdit, with optional QCalendarPopup.
However to prevent being able to select dates that are already inserted, I need to paint these cells differently, by reimplementing the paintCell() method.
The following example marks all 11th days of the month in red;
local C=QCalendarWidget()
function C:paintCell(Painter,Rect,Date)
if Date:day()==11 then
Painter:fillRect(Rect,'red')
Painter:save()
Painter:setPen'white'
Painter:drawText(Rect,QString.number(Date:day()))
Painter:restore()
else
-- QCalendar:paintCell(Painter,Rect,Date)
end
end
However, the commented line in red is needed to paint all other cells normally,
but it crashes lqt with the message that the method is not available.
I have been trying some syntax variations but I can't find the correct one.
Can you help?
Regards
Ralf