summaryrefslogtreecommitdiffstats
path: root/qt-ui/simplewidgets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r--qt-ui/simplewidgets.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index 79f12101d..fe9b8f592 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -305,6 +305,7 @@ DateWidget::DateWidget(QWidget *parent) : QWidget(parent),
{
setDate(QDate::currentDate());
setMinimumSize(QSize(64,64));
+ setFocusPolicy(Qt::StrongFocus);
calendarWidget->setWindowFlags(Qt::FramelessWindowHint);
connect(calendarWidget, SIGNAL(activated(QDate)), calendarWidget, SLOT(hide()));
@@ -352,6 +353,9 @@ void DateWidget::paintEvent(QPaintEvent *event)
painter.setBrush(Qt::black);
painter.setFont(font);
painter.drawText(QPoint(32 - metrics.width(day)/2, 45), day);
+
+ if(hasFocus())
+ painter.drawLine(0, 63, 63, 63);
}
void DateWidget::mousePressEvent(QMouseEvent *event)
@@ -360,3 +364,14 @@ void DateWidget::mousePressEvent(QMouseEvent *event)
calendarWidget->show();
}
+
+void DateWidget::focusInEvent(QFocusEvent *event)
+{
+ setFocus();
+ QWidget::focusInEvent(event);
+}
+
+void DateWidget::focusOutEvent(QFocusEvent *event)
+{
+ QWidget::focusOutEvent(event);
+} \ No newline at end of file