本文整理汇总了Python中PySide.QtGui.QKeySequence方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QKeySequence方法的具体用法?Python QtGui.QKeySequence怎么用?Python QtGui.QKeySequence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QKeySequence方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: qui_menu
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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])
示例2: setupMenu
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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)
示例3: setupMenu
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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)
示例4: qui_menu
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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])
示例5: createActions
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
def createActions(self):
self.xrefAct = QtGui.QAction("Xref from/to...", self,
# shortcut=QtGui.QKeySequence("CTRL+B"),
statusTip="List the references where this element is used",
triggered=self.actionXref)
self.expandAct = QtGui.QAction("Expand...", self,
statusTip="Expand all the subtrees",
triggered=self.actionExpand)
self.collapseAct = QtGui.QAction("Collapse...", self,
statusTip="Collapse all the subtrees",
triggered=self.actionCollapse)
示例6: qui_atn
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
def qui_atn(self, ui_name, title, tip=None, icon=None, parent=None, key=None):
self.uiList[ui_name] = QtWidgets.QAction(title, self)
if icon!=None:
self.uiList[ui_name].setIcon(QtGui.QIcon(icon))
if tip !=None:
self.uiList[ui_name].setStatusTip(tip)
if key != None:
self.uiList[ui_name].setShortcut(QtGui.QKeySequence(key))
if parent !=None:
if isinstance(parent, (str, unicode)) and parent in self.uiList.keys():
self.uiList[parent].addAction(self.uiList[ui_name])
elif isinstance(parent, QtWidgets.QMenu):
parent.addAction(self.uiList[ui_name])
return ui_name
示例7: qui_key
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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 )
示例8: Establish_Connections
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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 ----
示例9: setupMenu
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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','user']:
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()
示例10: Establish_Connections
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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)
示例11: setupMenu
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QKeySequence [as 别名]
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()