added shortcut for closing subviews (Fixes #2558)

c++11
Marc Zinnschlag 10 years ago
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…
Cancel
Save