Skip to content

feat(dialog_sdk): add keyboard shortcut support for QPushButton#33

Merged
pabloinigoblasco merged 1 commit into
developmentfrom
feat/dialog-button-shortcuts
Apr 6, 2026
Merged

feat(dialog_sdk): add keyboard shortcut support for QPushButton#33
pabloinigoblasco merged 1 commit into
developmentfrom
feat/dialog-button-shortcuts

Conversation

@pabloinigoblasco
Copy link
Copy Markdown
Collaborator

@pabloinigoblasco pabloinigoblasco commented Apr 6, 2026

Summary

Add WidgetData::setShortcut() so plugins can declaratively bind keyboard shortcuts to buttons. The host materializes them as QShortcut objects that trigger click() synchronously through the normal event pipeline.

New API surface:

  • WidgetData::setShortcut(name, key_sequence) — declare a shortcut for a button
  • WidgetDataView::shortcut(name) — read shortcut from widget data
  • installButtonShortcuts(root, view) — host-side helper to create QShortcut objects

Use Case

This enables plugins to provide keyboard shortcuts for common actions without Qt dependencies. For example, a file loader dialog could bind Ctrl+A to "Select All" and Ctrl+Shift+A to "Deselect All".

Test Plan

  • Verify shortcuts trigger button click events
  • Verify shortcuts work in injected parser dialogs
  • Verify no conflicts with existing Qt shortcuts

Add WidgetData::setShortcut() so plugins can declaratively bind keyboard
shortcuts to buttons. The host materializes them as QShortcut objects
that trigger click() synchronously through the normal event pipeline.

New API surface:
- WidgetData::setShortcut(name, key_sequence)
- WidgetDataView::shortcut(name)
- installButtonShortcuts(root, view) in widget_binding
@pabloinigoblasco pabloinigoblasco merged commit 67e4446 into development Apr 6, 2026
2 checks passed
@pabloinigoblasco pabloinigoblasco deleted the feat/dialog-button-shortcuts branch May 4, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant