本文整理匯總了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()