本文整理汇总了Python中PM.PM_ToolButton.PM_ToolButton.setMaximumWidth方法的典型用法代码示例。如果您正苦于以下问题:Python PM_ToolButton.setMaximumWidth方法的具体用法?Python PM_ToolButton.setMaximumWidth怎么用?Python PM_ToolButton.setMaximumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PM.PM_ToolButton.PM_ToolButton
的用法示例。
在下文中一共展示了PM_ToolButton.setMaximumWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_ProteinSequenceEditor
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setMaximumWidth [as 别名]
class Ui_ProteinSequenceEditor(PM_DockWidget):
"""
The Ui_DnaSequenceEditor class defines UI elements for the Sequence Editor
object. The sequence editor is usually visible while in DNA edit mode.
It is a DockWidget that is doced at the bottom of the MainWindow
"""
_title = "Sequence Editor"
_groupBoxCount = 0
_lastGroupBox = None
def __init__(self, win):
"""
Constructor for the Ui_DnaSequenceEditor
@param win: The parentWidget (MainWindow) for the sequence editor
"""
self.win = win
# Should parentWidget for a docwidget always be win?
#Not necessary but most likely it will be the case.
parentWidget = win
_superclass.__init__(self, parentWidget, title = self._title)
#A flag used to restore the state of the Reports dock widget
#(which can be accessed through View > Reports) see self.show() and
#self.closeEvent() for more details.
self._reportsDockWidget_closed_in_show_method = False
self.setFixedHeight(90)
def show(self):
"""
Shows the sequence editor. While doing this, it also closes the reports
dock widget (if visible) the state of the reports dockwidget will be
restored when the sequence editor is closed.
@see:self.closeEvent()
"""
self._reportsDockWidget_closed_in_show_method = False
if self.win.viewFullScreenAction.isChecked() or \
self.win.viewSemiFullScreenAction.isChecked():
pass
else:
if self.win.reportsDockWidget.isVisible():
self.win.reportsDockWidget.close()
self._reportsDockWidget_closed_in_show_method = True
_superclass.show(self)
def closeEvent(self, event):
"""
Overrides close event. Makes sure that the visible state of the reports
widgetis restored when the sequence editor is closed.
@see: self.show()
"""
_superclass.closeEvent(self, event)
if self.win.viewFullScreenAction.isChecked() or \
self.win.viewSemiFullScreenAction.isChecked():
pass
else:
if self._reportsDockWidget_closed_in_show_method:
self.win.viewReportsAction.setChecked(True)
self._reportsDockWidget_closed_in_show_method = False
def _loadWidgets(self):
"""
Overrides PM.PM_DockWidget._loadWidgets. Loads the widget in this
dockwidget.
"""
self._loadMenuWidgets()
self._loadTextEditWidget()
def _loadMenuWidgets(self):
"""
Load the various menu widgets (e.g. Open, save sequence options,
Find and replace widgets etc.
"""
#Note: Find and replace widgets might be moved to their own class.
self.loadSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Open.png")
self.saveSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Save_Strand_Sequence.png")
self.loadSequenceButton.setAutoRaise(True)
self.saveSequenceButton.setAutoRaise(True)
#Find and replace widgets --
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(60)
#.........这里部分代码省略.........
示例2: Ui_DnaSequenceEditor
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setMaximumWidth [as 别名]
#.........这里部分代码省略.........
self._loadTextEditWidget()
def _loadMenuWidgets(self):
"""
Load the various menu widgets (e.g. Open, save sequence options,
Find and replace widgets etc.
"""
#Note: Find and replace widgets might be moved to their own class.
self.loadSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Open.png")
self.saveSequenceButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Save_Strand_Sequence.png")
self.loadSequenceButton.setAutoRaise(True)
self.saveSequenceButton.setAutoRaise(True)
editDirectionChoices = ["5' to 3'", "3' to 5'"]
self.baseDirectionChoiceComboBox = \
PM_ComboBox( self,
choices = editDirectionChoices,
index = 0,
spanWidth = False )
#Find and replace widgets --
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(60)
self.replaceLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.replaceLineEdit.setMaximumWidth(60)
self.findOptionsToolButton = PM_ToolButton(self)
self.findOptionsToolButton.setMaximumWidth(12)
self.findOptionsToolButton.setAutoRaise(True)
self.findOptionsToolButton.setPopupMode(QToolButton.MenuButtonPopup)
self._setFindOptionsToolButtonMenu()
self.findNextToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Next.png")
self.findNextToolButton.setAutoRaise(True)
self.findPreviousToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Previous.png")
self.findPreviousToolButton.setAutoRaise(True)
self.replacePushButton = PM_PushButton(self, text = "Replace")
self.warningSign = QLabel(self)
self.warningSign.setPixmap(
getpixmap('ui/actions/Properties Manager/Warning.png'))
self.warningSign.hide()
示例3: SelectNodeByNameDockWidget
# 需要导入模块: from PM.PM_ToolButton import PM_ToolButton [as 别名]
# 或者: from PM.PM_ToolButton.PM_ToolButton import setMaximumWidth [as 别名]
#.........这里部分代码省略.........
"""
#Note: Find and replace widgets might be moved to their own class.
self.searchTypeComboBox = \
PM_ComboBox( self,
label = "Search options:",
choices = ["By node name", "By # of bases (DNA only)"],
setAsDefault = True)
#Find widgets --
self._nucleotidesSpinBox_1 = PM_SpinBox(self,
label = "",
value = 10,
setAsDefault = False,
singleStep = 10,
minimum = 1,
maximum = 50000)
self._nucleotidesSpinBox_2 = PM_SpinBox(self,
label = "",
value = 50,
setAsDefault = False,
singleStep = 10,
minimum = 1,
maximum = 50000)
self.findLineEdit = \
PM_LineEdit( self,
label = "",
spanWidth = False)
self.findLineEdit.setMaximumWidth(80)
self.findOptionsToolButton = PM_ToolButton(self)
self.findOptionsToolButton.setMaximumWidth(12)
self.findOptionsToolButton.setAutoRaise(True)
##self.findOptionsToolButton.setPopupMode(QToolButton.MenuButtonPopup)
##self._setFindOptionsToolButtonMenu()
self.searchToolButton = PM_ToolButton(
self,
iconPath = "ui/actions/Properties Manager/Find_Next.png")
self.searchToolButton.setAutoRaise(False)
self.warningSign = QLabel(self)
self.warningSign.setPixmap(
getpixmap('ui/actions/Properties Manager/Warning.png'))
self.warningSign.hide()
self.phraseNotFoundLabel = QLabel(self)
self.phraseNotFoundLabel.setText("Not Found")
self.phraseNotFoundLabel.hide()
# NOTE: Following needs cleanup in the PM_WidgetRow/ PM_WidgetGrid
# but this explanation is sufficient until thats done --
# When the widget type starts with the word 'PM_' , the
# PM_WidgetRow treats it as a well defined widget and thus doesn't try
# to create a QWidget object (or its subclasses)
# This is the reason why qLabels such as self.warningSign and
# self.phraseNotFoundLabel are defined as PM_Labels and not 'QLabels'