コード例 #1
0
    def setupUi(
        self, flip_shortcut: str, presentation_mode: bool, presentation_shortcut: str
    ):
        self.ui.flipShortcut.setKeySequence(QKeySequence(flip_shortcut))

        self.ui.presentationCheckBox.setChecked(presentation_mode)
        self.ui.presentationShortcut.setKeySequence(QKeySequence(presentation_shortcut))
コード例 #2
0
ファイル: settings.py プロジェクト: hgiesel/anki_search_bar
 def setupUi(
     self,
     open: str,
     open_browser: str,
     close: str,
     next: str,
     previous: str,
 ):
     self.ui.shortcutOpen.setKeySequence(QKeySequence(open))
     self.ui.shortcutOpenBrowser.setKeySequence(QKeySequence(open_browser))
     self.ui.shortcutClose.setKeySequence(QKeySequence(close))
     self.ui.shortcutNext.setKeySequence(QKeySequence(next))
     self.ui.shortcutPrevious.setKeySequence(QKeySequence(previous))
コード例 #3
0
    def setupUi(self, occlude_shortcut: str, occlude_accept_behavior: str,
                max_height: int) -> None:
        self.ui.occludeShortcut.setKeySequence(QKeySequence(occlude_shortcut))
        self.ui.occlusionAcceptBehavior.setCurrentIndex(
            behaviors.index(occlude_accept_behavior))
        self.ui.maxHeight.setValue(max_height)

        self.ui.versionInfo.setText(f"Closet {version}")
コード例 #4
0
ファイル: utils.py プロジェクト: hayreddin2019/YoudaoCollins
def addMenuItem(menuName, text, function, keys=None):
    action = QAction(text, mw)

    if keys:
        action.setShortcut(QKeySequence(keys))

    action.triggered.connect(function)

    if menuName == 'File':
        mw.form.menuCol.addAction(action)
    elif menuName == 'Edit':
        mw.form.menuEdit.addAction(action)
    elif menuName == 'Tools':
        mw.form.menuTools.addAction(action)
    elif menuName == 'Help':
        mw.form.menuHelp.addAction(action)
    else:
        addMenu(menuName)
        mw.customMenus[menuName].addAction(action)

    return action
コード例 #5
0
from aqt import mw, QAction, QKeySequence
from .mainwindow import MainWindow
from . import startmodule


def start():
    startmodule.start()


def debugStart():
    from . import debugreload
    debugreload.reloadAll(__name__)
    startmodule.start()


startAction = QAction("English word manager: start", mw)
startAction.setShortcut(QKeySequence('Ctrl+M'))
startAction.triggered.connect(debugStart)
mw.form.menuTools.addSeparator()
mw.form.menuTools.addAction(startAction)
コード例 #6
0
 def setupUi(self, toggle_field_shortcut: str, toggle_all_shortcut: str):
     self.ui.toggleFieldShortcut.setKeySequence(
         QKeySequence(toggle_field_shortcut))
     self.ui.toggleAllShortcut.setKeySequence(
         QKeySequence(toggle_all_shortcut))
コード例 #7
0
 def setupUi(self, toggle_mode_shortcut: str, toggle_zoom_shortcut: str):
     self.ui.toggleModeShortcut.setKeySequence(
         QKeySequence(toggle_mode_shortcut))
     self.ui.toggleZoomShortcut.setKeySequence(
         QKeySequence(toggle_zoom_shortcut))