mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Added keyboard navigation to the calendar date picker.
Wee. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a7240cd83f
commit
ef6c410574
2 changed files with 15 additions and 1 deletions
|
@ -375,3 +375,16 @@ void DateWidget::focusOutEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::focusOutEvent(event);
|
QWidget::focusOutEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DateWidget::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if ( event->key() == Qt::Key_Return ||
|
||||||
|
event->key() == Qt::Key_Enter ||
|
||||||
|
event->key() == Qt::Key_Space){
|
||||||
|
calendarWidget->move(mapToGlobal(QPoint(0,64)));
|
||||||
|
calendarWidget->show();
|
||||||
|
event->setAccepted(true);
|
||||||
|
}else{
|
||||||
|
QWidget::keyPressEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -102,6 +102,7 @@ protected:
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
void focusInEvent(QFocusEvent *);
|
void focusInEvent(QFocusEvent *);
|
||||||
void focusOutEvent(QFocusEvent *);
|
void focusOutEvent(QFocusEvent *);
|
||||||
|
void keyPressEvent(QKeyEvent *);
|
||||||
signals:
|
signals:
|
||||||
void dateChanged(const QDate& date);
|
void dateChanged(const QDate& date);
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue