Glue class that maps plActions to QActions. QActions are only created if the plAction is actually mapped somewhere. Document and Global actions are manually executed and don't solely rely on Qt's ShortcutContext setting to prevent ambiguous action shortcuts.
More...
#include <QtProxy.moc.h>
|
virtual void | Update ()=0 |
|
virtual void | SetAction (plAction *pAction) |
|
plAction * | GetAction () |
|
|
| PL_MAKE_SUBSYSTEM_STARTUP_FRIEND (GuiFoundation, QtProxies) |
|
Glue class that maps plActions to QActions. QActions are only created if the plAction is actually mapped somewhere. Document and Global actions are manually executed and don't solely rely on Qt's ShortcutContext setting to prevent ambiguous action shortcuts.
◆ TriggerDocumentAction()
bool plQtProxy::TriggerDocumentAction |
( |
plDocument * | pDocument, |
|
|
QKeyEvent * | pEvent, |
|
|
bool | bTestOnly ) |
|
static |
Converts the QKeyEvent into a shortcut and tries to find a matching action in the document and global action list.
Document actions are not mapped as ShortcutContext::WindowShortcut because docking allows for multiple documents to be mapped into the same window. Instead, ShortcutContext::WidgetWithChildrenShortcut is used to prevent ambiguous action shortcuts and the actions are executed manually via filtering QEvent::ShortcutOverride at the dock widget level. The function always has to be called two times: A: QEvent::ShortcutOverride: Only check with bTestOnly = true that we want to override the shortcut. This will instruct Qt to send the event as a regular key press event to the widget that accepted the override. B: QEvent::keyPressEvent: Execute the actual action with bTestOnly = false;
- Parameters
-
pDocument | The document for which matching actions should be searched for. If null, only global actions are searched. |
pEvent | The key event that should be converted into a shortcut. |
bTestOnly | Accept the event and return true but don't execute the action. Use this inside QEvent::ShortcutOverride. |
- Returns
- Whether the key event was consumed and an action executed.
The documentation for this class was generated from the following files:
- Code/Tools/Libs/GuiFoundation/ActionViews/QtProxy.moc.h
- Code/Tools/Libs/GuiFoundation/ActionViews/Implementation/QtProxy.cpp