File: test_qkeybindingedit.py

package info (click to toggle)
app-model 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 700 kB
  • sloc: python: 5,484; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 418 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
from qtpy.QtGui import QKeySequence

from app_model.backends.qt import QModelKeyBindingEdit
from app_model.types import KeyBinding, KeyCode, KeyMod


def test_qkeysequenceedit(qtbot) -> None:
    edit = QModelKeyBindingEdit()
    qtbot.addWidget(edit)
    assert edit.keyBinding() is None
    edit.setKeySequence(QKeySequence("Shift+A"))
    assert edit.keyBinding() == KeyBinding(parts=[KeyMod.Shift | KeyCode.KeyA])