mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 01:49:41 +00:00
stop script editor from eating undo/redo shortcuts (Fixes #2506)
This commit is contained in:
parent
27000fb36b
commit
60a835c16d
2 changed files with 17 additions and 0 deletions
|
@ -25,6 +25,19 @@ CSVWorld::ScriptEdit::ChangeLock::~ChangeLock()
|
|||
--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,
|
||||
QWidget* parent)
|
||||
|
|
|
@ -53,6 +53,10 @@ namespace CSVWorld
|
|||
QFont mDefaultFont;
|
||||
QFont mMonoFont;
|
||||
|
||||
protected:
|
||||
|
||||
bool event (QEvent *event);
|
||||
|
||||
public:
|
||||
|
||||
ScriptEdit (const CSMDoc::Document& document, ScriptHighlighter::Mode mode,
|
||||
|
|
Loading…
Reference in a new issue