Results 1 to 2 of 2

Thread: QCalendarWidget show details on Mouse hovering onto that date...

  1. #1
    Join Date
    Sep 2013
    Posts
    40
    Thanks
    6
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QCalendarWidget show details on Mouse hovering onto that date...

    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
    Last edited by rohitkk; 10th March 2014 at 12:07.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QCalendarWidget show details on Mouse hovering onto that date...

    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,
    _

Similar Threads

  1. show build date in about box
    By glocker50 in forum Qt Programming
    Replies: 12
    Last Post: 3rd May 2015, 23:14
  2. Replies: 1
    Last Post: 19th April 2012, 10:49
  3. Replies: 1
    Last Post: 12th October 2010, 23:20
  4. Replies: 1
    Last Post: 24th April 2010, 16:31
  5. Mouse hovering or press event not working?
    By qtzcute in forum Newbie
    Replies: 11
    Last Post: 15th July 2009, 11:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.