本文整理汇总了Python中PM.PM_ToolButton.PM_ToolButton.setChecked方法的典型用法代码示例。如果您正苦于以下问题:Python PM_ToolButton.setChecked方法的具体用法?Python PM_ToolButton.setChecked怎么用?Python PM_ToolButton.setChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_ToolButton.PM_ToolButton
的用法示例。
在下文中一共展示了PM_ToolButton.setChecked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PM_ObjectChooser
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setChecked [as 别名]
#.........这里部分代码省略.........
from the list of segments ) is active
"""
if self._removeToolButton.isChecked():
if not self._addToolButton.isChecked():
#For safety
return True
return False
def hasFocus(self):
"""
Checks if the list widget that lists dnasegments (that will undergo
special operations such as 'resizing them at once or making
crossovers between the segments etc) has the
Qt focus. This is used to just remove items from the list widget
(without actually 'deleting' the corresponding Dnasegment in the GLPane)
@see: MultipleDnaSegment_GraphicsMode.keyPressEvent() where it is called
"""
if self._listWidget.hasFocus():
return True
return False
def activateAddTool(self,enable):
"""
Change the appearance of the list widget (that lists the dna segments
) so as to indicate that the add dna segments tool is
active
@param enable: If True, changes the appearance of list widget to
indicate that the add segments tool is active.
@type enable: bool
"""
if enable:
if not self._addToolButton.isChecked():
self._addToolButton.setChecked(True)
if self._removeToolButton.isChecked():
self._removeToolButton.setChecked(False)
self._listWidget.setAlternatingRowColors(False)
self._listWidget.setColor(lightgreen_2)
##objectType = self._modelObjectType
##objectChooserType = 'ADD'
##self.command.activateObjectChooser((objectType, objectChooserType))
##self.command.logMessage('ADD_SEGMENTS_ACTIVATED')
else:
if self._addToolButton.isChecked():
self._addToolButton.setChecked(False)
self._listWidget.setAlternatingRowColors(True)
self._listWidget.resetColor()
def activateRemoveTool(self,enable):
"""
Change the appearance of the list widget (that lists the dna segments
) so as to indicate that the REMOVE dna segments tool is
active
@param enable: If True, changes the appearance of list widget to
indicate that the REMOVE segments tool is active.
@type enable: bool
"""
if enable:
if not self._removeToolButton.isChecked():
self._removeToolButton.setChecked(True)
if self._addToolButton.isChecked():
self._addToolButton.setChecked(False)
self._listWidget.setAlternatingRowColors(False)
##self.command.logMessage('REMOVE_SEGMENTS_ACTIVATED')
self._listWidget.setColor(lightred_1)
else:
示例2: MultipleDnaSegmentResize_PropertyManager
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setChecked [as 别名]
#.........这里部分代码省略.........
list of segments to be resized) is active
"""
if self.addSegmentsToolButton.isChecked():
#For safety
if not self.removeSegmentsToolButton.isChecked():
return True
return False
def isRemoveSegmentsToolActive(self):
"""
Returns True if the remove segments tool (which removes the segments
from the list of segments to be resized) is active
"""
if self.removeSegmentsToolButton.isChecked():
if not self.addSegmentsToolButton.isChecked():
#For safety
return True
return False
def activateAddSegmentsTool(self,enable):
"""
Change the appearance of the list widget (that lists the dna segments
to be resized) so as to indicate that the add dna segments tool is
active
@param enable: If True, changes the appearance of list widget to
indicate that the add segments tool is active.
@type enable: bool
"""
if enable:
if not self.addSegmentsToolButton.isChecked():
self.addSegmentsToolButton.setChecked(True)
if self.removeSegmentsToolButton.isChecked():
self.removeSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(False)
self.segmentListWidget.setColor(lightgreen_2)
else:
if self.addSegmentsToolButton.isChecked():
self.addSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(True)
self.segmentListWidget.resetColor()
def activateRemoveSegmentsTool(self,enable):
"""
Change the appearance of the list widget (that lists the dna segments
to be resized) so as to indicate that the REMOVE dna segments tool is
active
@param enable: If True, changes the appearance of list widget to
indicate that the REMOVE segments tool is active.
@type enable: bool
"""
if enable:
if not self.removeSegmentsToolButton.isChecked():
self.removeSegmentsToolButton.setChecked(True)
if self.addSegmentsToolButton.isChecked():
self.addSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(False)
self.segmentListWidget.setColor(lightred_1)
else:
if self.removeSegmentsToolButton.isChecked():
self.removeSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(True)
self.segmentListWidget.resetColor()
示例3: _loadSegmentListWidget
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setChecked [as 别名]
#.........这里部分代码省略.........
"""
Returns True if the add segments tool (which adds the segments to the
list of segments) is active
"""
if self.addSegmentsToolButton.isChecked():
#For safety
if not self.removeSegmentsToolButton.isChecked():
return True
return False
def isRemoveSegmentsToolActive(self):
"""
Returns True if the remove segments tool (which removes the segments
from the list of segments ) is active
"""
if self.removeSegmentsToolButton.isChecked():
if not self.addSegmentsToolButton.isChecked():
#For safety
return True
return False
def activateAddSegmentsTool(self,enable):
"""
Change the appearance of the list widget (that lists the dna segments
) so as to indicate that the add dna segments tool is
active
@param enable: If True, changes the appearance of list widget to
indicate that the add segments tool is active.
@type enable: bool
"""
if enable:
if not self.addSegmentsToolButton.isChecked():
self.addSegmentsToolButton.setChecked(True)
if self.removeSegmentsToolButton.isChecked():
self.removeSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(False)
self.segmentListWidget.setColor(lightgreen_2)
self.command.logMessage('ADD_SEGMENTS_ACTIVATED')
else:
if self.addSegmentsToolButton.isChecked():
self.addSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(True)
self.segmentListWidget.resetColor()
def activateRemoveSegmentsTool(self,enable):
"""
Change the appearance of the list widget (that lists the dna segments
) so as to indicate that the REMOVE dna segments tool is
active
@param enable: If True, changes the appearance of list widget to
indicate that the REMOVE segments tool is active.
@type enable: bool
"""
if enable:
if not self.removeSegmentsToolButton.isChecked():
self.removeSegmentsToolButton.setChecked(True)
if self.addSegmentsToolButton.isChecked():
self.addSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(False)
self.command.logMessage('REMOVE_SEGMENTS_ACTIVATED')
self.segmentListWidget.setColor(lightred_1)
else:
if self.removeSegmentsToolButton.isChecked():
self.removeSegmentsToolButton.setChecked(False)
self.segmentListWidget.setAlternatingRowColors(True)
self.segmentListWidget.resetColor()
def _deactivateAddRemoveSegmentsTool(self):
"""
Deactivate tools that allow adding or removing the segments to the
segment list in the Property manager. This can be simply done by
resetting the state of toolbuttons to False.
Example: toolbuttons that add or remove
segments to the segment list in the Property manager. When self.show
is called these need to be unchecked.
@see: self.isAddSegmentsToolActive()
@see:self.isRemoveSegmentsToolActive()
@see: self.show()
"""
self.addSegmentsToolButton.setChecked(False)
self.removeSegmentsToolButton.setChecked(False)
def removeListWidgetItems(self):
"""
Removes selected itoms from the dna segment list widget
Example: User selects a bunch of items in the list widget and hits
delete key to remove the selected items from the list
IMPORTANT NOTE: This method does NOT delete the correspoinging model
item in the GLPane (i.e. corresponding dnasegment). It just 'removes'
the item from the list widget
This is intentional.
"""
self.segmentListWidget.deleteSelection()
itemDict = self.segmentListWidget.getItemDictonary()
self.command.setSegmentList(itemDict.values())
self.updateListWidgets()
self.win.win_update()