mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 15:39:02 +00:00
added shortcut for closing subviews (Fixes #2558)
This commit is contained in:
parent
93c3bb3716
commit
7b207a7954
@ -2,6 +2,24 @@
|
||||
|
||||
#include "view.hpp"
|
||||
|
||||
#include <QShortcut>
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
bool CSVDoc::SubView::event (QEvent *event)
|
||||
{
|
||||
if (event->type()==QEvent::ShortcutOverride)
|
||||
{
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent *> (event);
|
||||
|
||||
if (keyEvent->key()==Qt::Key_W && keyEvent->modifiers()==(Qt::ShiftModifier | Qt::ControlModifier))
|
||||
emit closeRequest();
|
||||
return true;
|
||||
}
|
||||
|
||||
return QDockWidget::event (event);
|
||||
}
|
||||
|
||||
CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id)
|
||||
: mUniversalId (id)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ namespace CSVDoc
|
||||
|
||||
void setUniversalId(const CSMWorld::UniversalId& id);
|
||||
|
||||
bool event (QEvent *event);
|
||||
|
||||
public:
|
||||
|
||||
SubView (const CSMWorld::UniversalId& id);
|
||||
|
Loading…
Reference in New Issue
Block a user