Some shortcuts not propagating
Matic Kukovec
kukovecmatic at hotmail.com
Wed Dec 8 14:24:39 GMT 2021
Hey Thomas,
QsciScintilla.standardCommands().clearKeys()
That's it! Thanks for the suggestion!
The above code clears all shortcuts and makes the QMainWindow shortcut work!
Why does that work, but QSciScintilla.SendScintilla(QsciScintillaBase.SCI_CLEARALLCMDKEYS) does not?
Regards
________________________________
From: Thomas Lübking <thomas.luebking at gmail.com>
Sent: Wednesday, December 8, 2021 3:05 PM
To: Matic Kukovec <kukovecmatic at hotmail.com>
Cc: QScintilla <qscintilla at riverbankcomputing.com>
Subject: Re: Some shortcuts not propagating
Am Wed, Dec 08, 2021 at 10:08:22AM +0000 schrieb Matic Kukovec:
>(The QScintilla widget does NOT have that key shortcut bound to anything), the QScintilla editor
>just adds '/' characters. But when focusing with the mouse on any other widget, the shortcut works!
I'd be not so sure about that assertion:
Ctrl+\ defaults to "Move right one word part"
Ctrl++ to "Zoom in"
And Ctrl+- to "Zoom out"
Try eg.
if (QsciCommand *cmd = doc->standardCommands()->boundTo(Qt::CTRL + Qt::Key_Plus))
cmd->setKey(0); // doc is QsciScintilla*
to steal it.
(I do that in sqriptor to override a bunch of shortcuts)
That aside there's QAction::setShortcutContext();
Cheers,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20211208/734367e2/attachment.htm>
More information about the QScintilla
mailing list