Python PySide2.QtGui.QKeySequence() Examples
The following are 30
code examples of PySide2.QtGui.QKeySequence().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PySide2.QtGui
, or try the search function
.
Example #1
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #2
Source File: universal_tool_template_0803.py From universal_tool_template.py with MIT License | 6 votes |
def setupMenu(self): self.quickMenu(['file_menu;&File','setting_menu;&Setting','help_menu;&Help']) cur_menu = self.uiList['setting_menu'] self.quickMenuAction('setParaA_atn','Set Parameter &A','A example of tip notice.','setParaA.png', cur_menu) self.uiList['setParaA_atn'].setShortcut(QtGui.QKeySequence("Ctrl+R")) cur_menu.addSeparator() if 'help_menu' in self.uiList.keys(): # for info review cur_menu = self.uiList['help_menu'] self.quickMenuAction('helpHostMode_atnNone','Host Mode - {}'.format(hostMode),'Host Running.','', cur_menu) self.quickMenuAction('helpPyMode_atnNone','Python Mode - {}'.format(pyMode),'Python Library Running.','', cur_menu) self.quickMenuAction('helpQtMode_atnNone','Qt Mode - {}'.format(qtModeList[qtMode]),'Qt Library Running.','', cur_menu) self.quickMenuAction('helpTemplate_atnNone','Universal Tool Teamplate - {}'.format(tpl_ver),'based on Univeral Tool Template v{0} by Shining Ying - https://github.com/shiningdesign/universal{1}tool{1}template.py'.format(tpl_ver,'_'),'', cur_menu) cur_menu.addSeparator() self.uiList['helpGuide_msg'] = self.help self.quickMenuAction('helpGuide_atnMsg','Usage Guide','How to Usge Guide.','helpGuide.png', cur_menu)
Example #3
Source File: UITranslator.py From universal_tool_template.py with MIT License | 6 votes |
def setupMenu(self): self.quickMenu(['file_menu;&File','setting_menu;&Setting','help_menu;&Help']) cur_menu = self.uiList['setting_menu'] self.quickMenuAction('setParaA_atn','Set Parameter &A','A example of tip notice.','setParaA.png', cur_menu) self.uiList['setParaA_atn'].setShortcut(QtGui.QKeySequence("Ctrl+R")) cur_menu.addSeparator() # for file menu cur_menu = self.uiList['file_menu'] self.quickMenuAction('newLang_atn','&Add New Language','Add a new translation.','newLang.png', cur_menu) self.quickMenuAction('resetLang_atn','&Reset Languages','Reset All.','resetLang.png', cur_menu) # for info review cur_menu = self.uiList['help_menu'] self.quickMenuAction('helpHostMode_atnNone','Host Mode - {}'.format(hostMode),'Host Running.','', cur_menu) self.quickMenuAction('helpPyMode_atnNone','Python Mode - {}'.format(pyMode),'Python Library Running.','', cur_menu) self.quickMenuAction('helpQtMode_atnNone','Qt Mode - {}'.format(qtModeList[qtMode]),'Qt Library Running.','', cur_menu) self.quickMenuAction('helpTemplate_atnNone','Universal Tool Teamplate - {}'.format(tpl_ver),'based on Univeral Tool Template v{} by Shining Ying - https://github.com/shiningdesign/universal_tool_template.py'.format(tpl_ver),'', cur_menu) cur_menu.addSeparator() self.uiList['helpGuide_msg'] = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file." self.quickMenuAction('helpGuide_atnMsg','Usage Guide','How to Usge Guide.','helpGuide.png', cur_menu)
Example #4
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #5
Source File: ClassName_1010.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #6
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #7
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #8
Source File: main_window.py From angr-management with BSD 2-Clause "Simplified" License | 6 votes |
def _init_shortcuts(self): """ Initialize shortcuts :return: None """ center_dockable_views = self.workspace.view_manager.get_center_views() for i in range(1, len(center_dockable_views)+1): QShortcut(QKeySequence('Ctrl+'+str(i)), self, center_dockable_views[i-1].raise_) # Raise the DisassemblyView after everything has initialized center_dockable_views[0].raise_() # # Plugins #
Example #9
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #10
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #11
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 6 votes |
def qui_menu(self, action_list_str, menu_str): # qui menu creation # syntax: self.qui_menu('right_menu_createFolder_atn;Create Folder,Ctrl+D | right_menu_openFolder_atn;Open Folder', 'right_menu') if menu_str not in self.uiList.keys(): self.uiList[menu_str] = QtWidgets.QMenu() create_opt_list = [ x.strip() for x in action_list_str.split('|') ] for each_creation in create_opt_list: ui_info = [ x.strip() for x in each_creation.split(';') ] atn_name = ui_info[0] atn_title = '' atn_hotkey = '' if len(ui_info) > 1: options = ui_info[1].split(',') atn_title = '' if len(options) < 1 else options[0] atn_hotkey = '' if len(options) < 2 else options[1] if atn_name != '': if atn_name == '_': self.uiList[menu_str].addSeparator() else: if atn_name not in self.uiList.keys(): self.uiList[atn_name] = QtWidgets.QAction(atn_title, self) if atn_hotkey != '': self.uiList[atn_name].setShortcut(QtGui.QKeySequence(atn_hotkey)) self.uiList[menu_str].addAction(self.uiList[atn_name])
Example #12
Source File: ShortCuts.py From PyAero with MIT License | 6 votes |
def addShortcut(self, shortcut, slotMethod, *args): """Add a shortcut to a slot (event handler) Args: shortcut (STRING): Something like 'ALT+m' slotMethod (STRING): Method of GuiSlots 'Slot' class Returns: object: QShortcut object """ # guislot converts to: # self.parent.slots.slotMethod() guislot = getattr(self.parent.slots, slotMethod) sc = QtWidgets.QShortcut(QtGui.QKeySequence(shortcut), self.parent) # connect shortcut to self.parent.slots(*args) sc.activated.connect(lambda: guislot(*args)) return
Example #13
Source File: tileGAN_client.py From tileGAN with GNU General Public License v3.0 | 6 votes |
def __init__(self, widget): QMainWindow.__init__(self) #self.setWindowFlags(QtCore.Qt.CustomizeWindowHint) self.setWindowTitle("TileGAN") app_icon = QtGui.QIcon() app_icon.addFile(iconFolder + '/icon_tilegan_16x16.png', QtCore.QSize(16, 16)) app_icon.addFile(iconFolder + '/icon_tilegan_24x24.png', QtCore.QSize(24, 24)) app_icon.addFile(iconFolder + '/icon_tilegan_32x32.png', QtCore.QSize(32, 32)) app_icon.addFile(iconFolder + '/icon_tilegan_48x48.png', QtCore.QSize(48, 48)) app_icon.addFile(iconFolder + '/icon_tilegan_64x64.png', QtCore.QSize(64, 64)) self.setWindowIcon(app_icon) ## Exit Action exit_action = QAction("Exit", self) exit_action.setShortcut(QtGui.QKeySequence("Ctrl+Q"))#) exit_action.triggered.connect(self.exit_app) # Window dimensions self.setCentralWidget(widget) geometry = app.desktop().availableGeometry(self) self.resize(int(geometry.height() * 0.85), int(geometry.height() * 0.75))
Example #14
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 5 votes |
def qui_key(self, key_name, key_combo, func): self.hotkey[key_name] = QtWidgets.QShortcut(QtGui.QKeySequence(key_combo), self) self.hotkey[key_name].activated.connect( func )
Example #15
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 5 votes |
def Establish_Connections(self): super(self.__class__,self).Establish_Connections() # custom ui response # shortcut connection self.hotkey = {} # self.hotkey['my_key'] = QtWidgets.QShortcut(QtGui.QKeySequence( "Ctrl+1" ), self) # self.hotkey['my_key'].activated.connect(self.my_key_func) # ---- user response list ----
Example #16
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 5 votes |
def Establish_Connections(self): super(self.__class__,self).Establish_Connections() # custom ui response # shortcut connection self.hotkey = {} # self.hotkey['my_key'] = QtWidgets.QShortcut(QtGui.QKeySequence( "Ctrl+1" ), self) # self.hotkey['my_key'].activated.connect(self.my_key_func) # ---- user response list ----
Example #17
Source File: universal_tool_template_0903.py From universal_tool_template.py with MIT License | 5 votes |
def setupMenu(self): self.quickMenu(['file_menu;&File','setting_menu;&Setting','help_menu;&Help']) cur_menu = self.uiList['setting_menu'] self.quickMenuAction('setParaA_atn','Set Parameter &A','A example of tip notice.','setParaA.png', cur_menu) self.uiList['setParaA_atn'].setShortcut(QtGui.QKeySequence("Ctrl+R")) cur_menu.addSeparator() super(self.__class__,self).setupMenu()
Example #18
Source File: file_menu.py From angr-management with BSD 2-Clause "Simplified" License | 5 votes |
def __init__(self, main_window): super(FileMenu, self).__init__("&File", parent=main_window) self.entries.extend([ MenuEntry('L&oad a new binary...', main_window.open_file_button, shortcut=QKeySequence(Qt.CTRL + Qt.Key_O)), MenuEntry('Loa&d a new docker target...', main_window.open_docker_button, shortcut=QKeySequence(Qt.SHIFT + (Qt.CTRL + Qt.Key_O))), MenuSeparator(), MenuEntry('&Load angr database...', main_window.load_database, shortcut=QKeySequence(Qt.CTRL + Qt.Key_L)), MenuEntry('&Save angr database...', main_window.save_database, shortcut=QKeySequence(Qt.CTRL + Qt.Key_S)), MenuEntry('S&ave angr database as...', main_window.save_database_as, shortcut=QKeySequence("Ctrl+Shift+S")), MenuSeparator(), MenuEntry('&Preferences...', main_window.preferences, shortcut=QKeySequence(Qt.CTRL + Qt.Key_P)), MenuSeparator(), MenuEntry('E&xit', main_window.quit), ])
Example #19
Source File: universal_tool_template_0904.py From universal_tool_template.py with MIT License | 5 votes |
def setupMenu(self): self.quickMenu(['file_menu;&File','setting_menu;&Setting','help_menu;&Help']) cur_menu = self.uiList['setting_menu'] self.quickMenuAction('setParaA_atn','Set Parameter &A','A example of tip notice.','setParaA.png', cur_menu) self.uiList['setParaA_atn'].setShortcut(QtGui.QKeySequence("Ctrl+R")) cur_menu.addSeparator() super(self.__class__,self).setupMenu()
Example #20
Source File: universal_tool_template_1000.py From universal_tool_template.py with MIT License | 5 votes |
def setupMenu(self): self.quickMenu('file_menu;&File | setting_menu;&Setting | help_menu;&Help') cur_menu = self.uiList['setting_menu'] for info in ['export', 'import']: title = info.title() self.quickMenuAction('{0}Config_atn'.format(info),'{0} Config (&{1})'.format(title,title[0]),'{0} Setting and Configuration.'.format(title),'{0}Config.png'.format(info), cur_menu) self.uiList['{0}Config_atn'.format(info)].setShortcut(QtGui.QKeySequence("Ctrl+{0}".format(title[0]))) cur_menu.addSeparator() super(self.__class__,self).setupMenu()
Example #21
Source File: universal_tool_template_1000.py From universal_tool_template.py with MIT License | 5 votes |
def Establish_Connections(self): super(self.__class__,self).Establish_Connections() # custom ui response # shortcut connection self.hotkey = {} # self.hotkey['my_key'] = QtWidgets.QShortcut(QtGui.QKeySequence( "Ctrl+1" ), self) # self.hotkey['my_key'].activated.connect(self.my_key_func) # ---- user response list ----
Example #22
Source File: universal_tool_template_v8.1.py From universal_tool_template.py with MIT License | 5 votes |
def setupMenu(self): self.quickMenu(['file_menu;&File','setting_menu;&Setting','help_menu;&Help']) cur_menu = self.uiList['setting_menu'] self.quickMenuAction('setParaA_atn','Set Parameter &A','A example of tip notice.','setParaA.png', cur_menu) self.uiList['setParaA_atn'].setShortcut(QtGui.QKeySequence("Ctrl+R")) cur_menu.addSeparator() # for info review cur_menu = self.uiList['help_menu'] self.quickMenuAction('helpHostMode_atnNone','Host Mode - {}'.format(hostMode),'Host Running.','', cur_menu) self.quickMenuAction('helpPyMode_atnNone','Python Mode - {}'.format(pyMode),'Python Library Running.','', cur_menu) self.quickMenuAction('helpQtMode_atnNone','Qt Mode - {}'.format(qtModeList[qtMode]),'Qt Library Running.','', cur_menu) self.quickMenuAction('helpTemplate_atnNone','Universal Tool Teamplate - {}'.format(tpl_ver),'based on Univeral Tool Template v{} by Shining Ying - https://github.com/shiningdesign/universal_tool_template.py'.format(tpl_ver),'', cur_menu) cur_menu.addSeparator() self.uiList['helpGuide_msg'] = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file." self.quickMenuAction('helpGuide_atnMsg','Usage Guide','How to Usge Guide.','helpGuide.png', cur_menu)
Example #23
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 5 votes |
def setupMenu(self): self.quickMenu('file_menu;&File | setting_menu;&Setting | help_menu;&Help') cur_menu = self.uiList['setting_menu'] for info in ['export', 'import']: title = info.title() self.quickMenuAction('{0}Config_atn'.format(info),'{0} Config (&{1})'.format(title,title[0]),'{0} Setting and Configuration.'.format(title),'{0}Config.png'.format(info), cur_menu) self.uiList['{0}Config_atn'.format(info)].setShortcut(QtGui.QKeySequence("Ctrl+{0}".format(title[0]))) cur_menu.addSeparator() super(self.__class__,self).setupMenu()
Example #24
Source File: analyze_menu.py From angr-management with BSD 2-Clause "Simplified" License | 5 votes |
def __init__(self, main_window): super().__init__("&Analyze", parent=main_window) self.entries.extend([ MenuEntry('&Decompile', main_window.decompile_current_function, shortcut=QKeySequence(Qt.Key_F5)), MenuEntry('&Interact', main_window.interact, shortcut=QKeySequence(Qt.Key_F6)),])
Example #25
Source File: view_menu.py From angr-management with BSD 2-Clause "Simplified" License | 5 votes |
def __init__(self, main_window): super(ViewMenu, self).__init__("&View", parent=main_window) self.entries.extend([ MenuEntry('Next Tab', main_window.workspace.view_manager.next_tab, shortcut=QKeySequence("Ctrl+Tab")), MenuEntry('Previous Tab', main_window.workspace.view_manager.previous_tab, shortcut=QKeySequence("Ctrl+Shift+Tab")), MenuSeparator(), MenuEntry('Split / Unsplit View', main_window.workspace.toggle_split, shortcut=QKeySequence("Ctrl+D")), ])
Example #26
Source File: help_menu.py From angr-management with BSD 2-Clause "Simplified" License | 5 votes |
def __init__(self, main_window): super().__init__("&Help", parent=main_window) self.entries.extend([ MenuEntry('&Documentation', main_window.open_doc_link, shortcut=QKeySequence(Qt.ALT + Qt.Key_H)), MenuSeparator(), MenuEntry('About angr...', main_window.open_about_dialog) ])
Example #27
Source File: qtutils.py From hotbox_designer with BSD 3-Clause Clear License | 5 votes |
def set_shortcut(keysequence, parent, method): shortcut = QtWidgets.QShortcut(QtGui.QKeySequence(keysequence), parent) shortcut.activated.connect(method)
Example #28
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 5 votes |
def qui_key(self, key_name, key_combo, func): self.hotkey[key_name] = QtWidgets.QShortcut(QtGui.QKeySequence(key_combo), self) self.hotkey[key_name].activated.connect( func )
Example #29
Source File: widgets.py From hotbox_designer with BSD 3-Clause Clear License | 5 votes |
def keyPressEvent(self, event): self.setText(QtGui.QKeySequence(event.key()).toString().lower()) self.textEdited.emit(self.text())
Example #30
Source File: BaseWindow.py From pyrdp with GNU General Public License v3.0 | 5 votes |
def __init__(self, options: Dict[str, object], parent: QWidget = None, maxTabCount = 250): super().__init__(parent) self.maxTabCount = maxTabCount self.setTabsClosable(True) self.tabCloseRequested.connect(self.onTabCloseRequest) self.log = logging.getLogger(LOGGER_NAMES.PLAYER) self.options = options self.closeTabShortcut = QShortcut(QKeySequence("Ctrl+W"), self, self.onCtrlW)