PDA

View Full Version : How to link A label with CalendarWidget



Rakesh_Kumar
29th October 2008, 03:39
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

aamer4yu
29th October 2008, 07:07
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) :)

lyuts
29th October 2008, 10:49
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.