1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

return/enter activate the selected button

This commit is contained in:
Marc Zinnschlag 2014-07-10 11:32:20 +02:00
parent 50ee815dd8
commit 365b721878
2 changed files with 13 additions and 0 deletions

View file

@ -12,6 +12,17 @@ void CSVWidget::PushButton::keyPressEvent (QKeyEvent *event)
QPushButton::keyPressEvent (event);
}
void CSVWidget::PushButton::keyReleaseEvent (QKeyEvent *event)
{
if (event->key()==Qt::Key_Return || event->key()==Qt::Key_Enter)
{
mKeepOpen = event->modifiers() & Qt::ShiftModifier;
emit clicked();
}
QPushButton::keyReleaseEvent (event);
}
void CSVWidget::PushButton::mouseReleaseEvent (QMouseEvent *event)
{
mKeepOpen = event->button()==Qt::LeftButton && (event->modifiers() & Qt::ShiftModifier);

View file

@ -15,6 +15,8 @@ namespace CSVWidget
virtual void keyPressEvent (QKeyEvent *event);
virtual void keyReleaseEvent (QKeyEvent *event);
virtual void mouseReleaseEvent (QMouseEvent *event);
public: