本文整理汇总了Python中PM.PM_ToolButton.PM_ToolButton.setMenu方法的典型用法代码示例。如果您正苦于以下问题:Python PM_ToolButton.setMenu方法的具体用法?Python PM_ToolButton.setMenu怎么用?Python PM_ToolButton.setMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_ToolButton.PM_ToolButton
的用法示例。
在下文中一共展示了PM_ToolButton.setMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_DnaSequenceEditor
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setMenu [as 别名]
#.........这里部分代码省略.........
('PM_PushButton', self.replacePushButton, 11),
('PM_Label', self.warningSign, 12),
('PM_Label', self.phraseNotFoundLabel, 13),
('QSpacerItem', 5, 5, 14) ]
widgetRow = PM_WidgetRow(self,
title = '',
widgetList = widgetList,
label = "",
spanWidth = True )
def _loadTextEditWidget(self):
"""
Load the SequenceTexteditWidgets.
"""
self.sequenceTextEdit = \
PM_TextEdit( self,
label = " Sequence: ",
spanWidth = False,
permit_enter_keystroke = False)
self.sequenceTextEdit.setCursorWidth(2)
self.sequenceTextEdit.setWordWrapMode( QTextOption.WrapAnywhere )
self.sequenceTextEdit.setFixedHeight(20)
#The StrandSequence 'Mate' it is a read only etxtedit that shows
#the complementary strand sequence.
self.sequenceTextEdit_mate = \
PM_TextEdit(self,
label = "",
spanWidth = False,
permit_enter_keystroke = False
)
palette = getPalette(None,
QPalette.Base,
sequenceEditStrandMateBaseColor)
self.sequenceTextEdit_mate.setPalette(palette)
self.sequenceTextEdit_mate.setFixedHeight(20)
self.sequenceTextEdit_mate.setReadOnly(True)
self.sequenceTextEdit_mate.setWordWrapMode(QTextOption.WrapAnywhere)
#Important to make sure that the horizontal and vertical scrollbars
#for these text edits are never displayed.
for textEdit in (self.sequenceTextEdit, self.sequenceTextEdit_mate):
textEdit.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
textEdit.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
def _getFindLineEditStyleSheet(self):
"""
Return the style sheet for the findLineEdit. This sets the following
properties only:
- background-color
This style is set whenever the searchStrig can't be found (sets
a light red color background to the lineedit when this happens)
@return: The line edit style sheet.
@rtype: str
"""
styleSheet = \
"QLineEdit {\
background-color: rgb(255, 102, 102)\
}"
#Not used:
# background-color: rgb(217, 255, 216)\
return styleSheet
def _setFindOptionsToolButtonMenu(self):
"""
Sets the menu for the findOptionstoolbutton that appears a small
menu button next to the findLineEdit.
"""
self.findOptionsMenu = QMenu(self.findOptionsToolButton)
self.caseSensitiveFindAction = QAction(self.findOptionsToolButton)
self.caseSensitiveFindAction.setText('Match Case')
self.caseSensitiveFindAction.setCheckable(True)
self.caseSensitiveFindAction.setChecked(False)
self.findOptionsMenu.addAction(self.caseSensitiveFindAction)
self.findOptionsMenu.addSeparator()
self.findOptionsToolButton.setMenu(self.findOptionsMenu)
def _addToolTipText(self):
"""
What's Tool Tip text for widgets in this Property Manager.
"""
from ne1_ui.ToolTipText_for_PropertyManagers import ToolTip_SequenceEditor
ToolTip_SequenceEditor(self)
def _addWhatsThisText(self):
"""
What's This text for widgets in this Property Manager.
"""
from ne1_ui.WhatsThisText_for_PropertyManagers import whatsThis_SequenceEditor
whatsThis_SequenceEditor(self)
示例2: Ui_ProteinSequenceEditor
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setMenu [as 别名]
#.........这里部分代码省略.........
self.aaRulerTextEdit = \
PM_TextEdit( self,
label = "",
spanWidth = False,
permit_enter_keystroke = False)
palette = getPalette(None,
QPalette.Base,
pmGrpBoxColor)
self.aaRulerTextEdit.setPalette(palette)
self.aaRulerTextEdit.setWordWrapMode( QTextOption.WrapAnywhere )
self.aaRulerTextEdit.setFixedHeight(20)
self.aaRulerTextEdit.setReadOnly(True)
self.sequenceTextEdit = \
PM_TextEdit( self,
label = " Sequence: ",
spanWidth = False,
permit_enter_keystroke = False)
self.sequenceTextEdit.setCursorWidth(2)
self.sequenceTextEdit.setWordWrapMode( QTextOption.WrapAnywhere )
self.sequenceTextEdit.setFixedHeight(20)
self.secStrucTextEdit = \
PM_TextEdit( self,
label = " Secondary structure: ",
spanWidth = False,
permit_enter_keystroke = False)
palette = getPalette(None,
QPalette.Base,
sequenceEditStrandMateBaseColor)
self.secStrucTextEdit.setPalette(palette)
self.secStrucTextEdit.setWordWrapMode( QTextOption.WrapAnywhere )
self.secStrucTextEdit.setFixedHeight(20)
self.secStrucTextEdit.setReadOnly(True)
#Important to make sure that the horizontal and vertical scrollbars
#for these text edits are never displayed.
self.sequenceTextEdit.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.sequenceTextEdit.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.secStrucTextEdit.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.secStrucTextEdit.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.aaRulerTextEdit.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.aaRulerTextEdit.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
def _getFindLineEditStyleSheet(self):
"""
Return the style sheet for the findLineEdit. This sets the following
properties only:
- background-color
This style is set whenever the searchStrig can't be found (sets
a light red color background to the lineedit when this happens)
@return: The line edit style sheet.
@rtype: str
"""
styleSheet = \
"QLineEdit {\
background-color: rgb(255, 102, 102)\
}"
#Not used:
# background-color: rgb(217, 255, 216)\
return styleSheet
def _setFindOptionsToolButtonMenu(self):
"""
Sets the menu for the findOptionstoolbutton that appears a small
menu button next to the findLineEdit.
"""
self.findOptionsMenu = QMenu(self.findOptionsToolButton)
self.caseSensitiveFindAction = QAction(self.findOptionsToolButton)
self.caseSensitiveFindAction.setText('Match Case')
self.caseSensitiveFindAction.setCheckable(True)
self.caseSensitiveFindAction.setChecked(False)
self.findOptionsMenu.addAction(self.caseSensitiveFindAction)
self.findOptionsMenu.addSeparator()
self.findOptionsToolButton.setMenu(self.findOptionsMenu)
def _addToolTipText(self):
"""
What's Tool Tip text for widgets in this Property Manager.
"""
pass
def _addWhatsThisText(self):
"""
What's This text for widgets in this Property Manager.
"""
pass