Results 1 to 2 of 2

Thread: How to capture right clicked dates in a QCalendarWidget?

  1. #1
    Join Date
    Jul 2007
    Location
    Cluj Napoca, Romania
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to capture right clicked dates in a QCalendarWidget?

    I want to paint all right clicked cells with a different color in a QCalendarWidget. I have done the code for the painting, I can detect right clicks by reimplementing contextMenuEvent but it only gives me a QPoint with relative coordinates in the widget. I want to select the right clicked date.

    So, the question is how do I get the corresponding dates in the calendar from the coordinates of the right clicked cells.

    I have tried capturing the clicked(QDate) signal since the docs say:

    void QCalendarWidget::clicked ( const QDate & date ) [signal]
    This signal is emitted when a mouse button is clicked. The date the mouse was clicked on is specified by date. The signal is only emitted when clicked on a valid date, e.g., dates are not outside the minimumDate() and maximumDate(). If the selection mode is NoSelection, this signal will not be emitted.
    Technically it should capture right clicks too, but it doesn't. I don't know why. Any ideas ?

    Thanks.
    May the source be with you!

  2. #2
    Join Date
    Jul 2007
    Location
    Cluj Napoca, Romania
    Posts
    15
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to capture right clicked dates in a QCalendarWidget?

    ****bump****
    May the source be with you!

Similar Threads

  1. Adding 2 Dates
    By bwindorski in forum Newbie
    Replies: 2
    Last Post: 5th December 2009, 06:15
  2. Replies: 3
    Last Post: 5th July 2009, 17:22
  3. How can I add a QCalendarWidget to a QToolBar?
    By cydside in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2009, 23:06
  4. about QCalendarWidget
    By nifei in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2009, 09:17
  5. Replies: 2
    Last Post: 19th April 2006, 19:11

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.