PDA

View Full Version : Problem with QDateEdit when spanning over month boundary



UweLo
2nd May 2007, 10:53
Hi,

I started working with Qt two weeks ago and I have a problem with QDateEdit for which I have not been able to find a solution. Probably it is just a misunderstanding on my side.

I initialize the QDateEdit widget as follows
QDate qdate = QDate::currentDate();
ui.dateEdit->setCurrentSection(QDateTimeEdit::DateSections_Mask );
ui.dateEdit->setDateRange(qdate.addDays(-5),qdate.addDays(5));
ui.dateEdit->setDate(qdate);

When the date range spans over two months the widget does not allow selecting any date outside the current month. The DisplayFormat is dd.MM.yyyy.

I thought that setting the CurrentSection to DateSections_Mask would fix the problem. But the highlight initially is still only on the date and even changing it to the month does not allow changing the month.

I would appreciate any help on this very much.