PDA

View Full Version : QCalendarWidget show details on Mouse hovering onto that date...



rohitkk
10th March 2014, 11:32
Hi ,
I am writing a program with QCalendarWidget such that some dates in QCalendarWidget should be turned to red (As holiday present in my db) but I also have to display the details on hovering to those dates(i.e. My holiday dates present in db) in QCalendarWidget ,so far i am able to display(using QToolTip::showText()) by checking QCalendarWidget.selectedDate() & now I want to get the date by hovering onto the holiday dates in QCalendarWidget.
Can anyone pls help on displaying the details on QCalendarWidget mouse hover .....
Thanks in Advance...

Regards,
Rohit Kashyap

anda_skoa
10th March 2014, 13:25
Rought idea:

derive your own calendar widget subclass. Overwrit paintCell() such that you store each cell's rectangle together with the associated date.
Overwrite event() and check for the tool tip event. Use the contained position to find the respective cell rect and its associated date.

Your paintCell method can obviously also change the painter's color when it is painting one of your special dates.

Cheers,
_