Results 1 to 3 of 3

Thread: How to link A label with CalendarWidget

  1. #1
    Join Date
    Sep 2008
    Posts
    32
    Thanks
    7

    Smile How to link A label with CalendarWidget

    Hi,

    I need to connect a CalenderWidget to a label. i.e. Whenever I click on the label the calenderWidget should appear and after selecting the date the calender should disappear.
    Could anyone please let me know how to achieve this. It should work in the similar way how it works when we make calender popup as true for QDateTimeEdit.

    Thanks and Regards
    Rakesh

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to link A label with CalendarWidget

    You can subclass QLabel and implement calendar popup on mousepress...

    Psstt : You can also use a QPushButton and set its flat property true (QPushButton::setFlat)

  3. The following user says thank you to aamer4yu for this useful post:

    Rakesh_Kumar (3rd November 2008)

  4. #3
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to link A label with CalendarWidget

    I think it would be better if you use QDateEdit and QCalendarWidget. Subclass QDateEdit so that your DateEdit will show QCalendarWidget when DateEdit is clicked.
    I'm a rebel in the S.D.G.

  5. The following user says thank you to lyuts for this useful post:

    Rakesh_Kumar (3rd November 2008)

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.