stop script editor from eating undo/redo shortcuts (Fixes #2506)

c++11
Marc Zinnschlag 10 years ago
parent 27000fb36b
commit 60a835c16d

@ -25,6 +25,19 @@ CSVWorld::ScriptEdit::ChangeLock::~ChangeLock()
--mEdit.mChangeLocked; --mEdit.mChangeLocked;
} }
bool CSVWorld::ScriptEdit::event (QEvent *event)
{
// ignore undo and redo shortcuts
if (event->type()==QEvent::ShortcutOverride)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *> (event);
if (keyEvent->matches (QKeySequence::Undo) || keyEvent->matches (QKeySequence::Redo))
return true;
}
return QPlainTextEdit::event (event);
}
CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode, CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode,
QWidget* parent) QWidget* parent)

@ -53,6 +53,10 @@ namespace CSVWorld
QFont mDefaultFont; QFont mDefaultFont;
QFont mMonoFont; QFont mMonoFont;
protected:
bool event (QEvent *event);
public: public:
ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode, ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode,

Loading…
Cancel
Save