PDA

View Full Version : Please help me to check this simple project,thanks!



rainspider
5th December 2009, 15:28
In this project,I want to connect a QLineEdit's doubleclick to a QCalendarWidget's modal-show[a mainwindow's method name of selectdate] .but i can't find this signal,so i connect it to a button's click occasional .has any better methods?
When i launch the app, the Calendar can show currently.next,i want connect the Calendar's
double click to change LineEdit's text and close it[a mainwindow's method name of setlineeditdate],but it don't work,why?
Thanks !:p

spirit
7th December 2009, 07:39
you can install event filter on your calendar widget and catch double-click or you can sub-class QCalendarWidget and reimplement mouseDoubleClickEvent.

spirit
7th December 2009, 08:17
btw, fix you connection, it should look like


...
connect(calendar,SIGNAL(activated(const QDate&)),this,SLOT(setlineeditdate(const QDate&)));
...