Calendar Widget: make it modal

Also fix the setWindowFlags calls - those are not incremental, so you need
to call the method once and combine the flags.

I would also like ESC to close the calendar widget, but haven't figured
out how to do that...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-28 08:57:47 -07:00
parent 3179e0f722
commit 413c276258

View file

@ -297,8 +297,8 @@ DateWidget::DateWidget(QWidget *parent) : QWidget(parent),
setDate(QDate::currentDate());
setMinimumSize(QSize(80,64));
setFocusPolicy(Qt::StrongFocus);
calendarWidget->setWindowFlags(Qt::FramelessWindowHint);
calendarWidget->setWindowFlags(Qt::WindowStaysOnTopHint);
calendarWidget->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
calendarWidget->setWindowModality(Qt::ApplicationModal);
calendarWidget->setFirstDayOfWeek(getLocale().firstDayOfWeek());
calendarWidget->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);