本文整理汇总了Python中PyQt4.Qt.QToolButton.hide方法的典型用法代码示例。如果您正苦于以下问题:Python QToolButton.hide方法的具体用法?Python QToolButton.hide怎么用?Python QToolButton.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QToolButton
的用法示例。
在下文中一共展示了QToolButton.hide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ImageController
# 需要导入模块: from PyQt4.Qt import QToolButton [as 别名]
# 或者: from PyQt4.Qt.QToolButton import hide [as 别名]
#.........这里部分代码省略.........
self._image_label.setLabel(text)
self._image_label.setLabelAlignment(Qt.AlignRight | Qt.AlignVCenter)
self._image_label.setZ(self.image.z() + 2 if self._z_markers is None else self._z_markers)
def setPlotBorderStyle(self, border_color=None, label_color=None):
if border_color:
self._border_pen.setColor(border_color)
self._image_border.setPen(self._border_pen)
if label_color:
self._image_label_text.setColor(label_color)
self._image_label.setLabel(self._image_label_text)
def showPlotBorder(self, show=True):
self._image_border.setVisible(show)
self._image_label.setVisible(show)
def attachToPlot(self, plot, z_markers=None):
for item in [self.image] + self._all_markers:
if item.plot() != plot:
item.attach(plot)
def setImageVisible(self, visible):
self.image.setVisible(visible)
def showRenderControls(self):
if not self._control_dialog:
dprint(1, "creating control dialog")
self._control_dialog = ImageControlDialog(self, self._rc, self._imgman)
dprint(1, "done")
if not self._control_dialog.isVisible():
dprint(1, "showing control dialog")
self._control_dialog.show()
else:
self._control_dialog.hide()
def _changeDisplayRangeToPercent(self, percent):
if not self._control_dialog:
self._control_dialog = ImageControlDialog(self, self._rc, self._imgman)
self._control_dialog._changeDisplayRangeToPercent(percent)
def _updateDisplayRange(self, dmin, dmax):
"""Updates display range widgets."""
self._wmin.setText("%.4g" % dmin)
self._wmax.setText("%.4g" % dmax)
self._updateFullRangeIcon()
def _changeDisplayRange(self):
"""Gets display range from widgets and updates the image with it."""
try:
newrange = float(str(self._wmin.text())), float(str(self._wmax.text()))
except ValueError:
return
self._rc.setDisplayRange(*newrange)
def _dataSubsetChanged(self, subset, minmax, desc, subset_type):
"""Called when the data subset changes (or is reset)"""
# hide the subset indicator -- unless we're invoked while we're actually setting the subset itself
if not self._setting_lmrect:
self._subset = None
self._subset_border.setVisible(False)
self._subset_label.setVisible(False)
def setLMRectSubset(self, rect):
self._subset = rect
l0, m0, l1, m1 = rect.getCoords()
self._subset_border.setData([l0, l0, l1, l1, l0], [m0, m1, m1, m0, m0])
示例2: StatusBar
# 需要导入模块: from PyQt4.Qt import QToolButton [as 别名]
# 或者: from PyQt4.Qt.QToolButton import hide [as 别名]
class StatusBar(QStatusBar):
def __init__(self, win):
QStatusBar.__init__(self, win)
self.statusMsgLabel = QLabel()
self.statusMsgLabel.setMinimumWidth(200)
self.statusMsgLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)
self.addPermanentWidget(self.statusMsgLabel)
self.progressBar = QProgressBar(win)
self.progressBar.setMaximumWidth(250)
qt4todo("StatusBar.progressBar.setCenterIndicator(True)")
self.addPermanentWidget(self.progressBar)
self.progressBar.hide()
self.simAbortButton = QToolButton(win)
self.simAbortButton.setIcon(geticon("ui/actions/Simulation/Stopsign.png"))
self.simAbortButton.setMaximumWidth(32)
self.addPermanentWidget(self.simAbortButton)
self.connect(self.simAbortButton, SIGNAL("clicked()"), self.simAbort)
self.simAbortButton.hide()
self.dispbarLabel = QLabel(win)
# self.dispbarLabel.setFrameStyle( QFrame.Panel | QFrame.Sunken )
self.dispbarLabel.setText("Global display style:")
self.addPermanentWidget(self.dispbarLabel)
# Global display styles combobox
self.globalDisplayStylesComboBox = GlobalDisplayStylesComboBox(win)
self.addPermanentWidget(self.globalDisplayStylesComboBox)
# Selection lock button. It always displays the selection lock state
# and it is available to click.
self.selectionLockButton = QToolButton(win)
self.selectionLockButton.setDefaultAction(win.selectLockAction)
self.addPermanentWidget(self.selectionLockButton)
# Only use of this appears to be commented out in MWsemantics as of 2007/12/14
self.modebarLabel = QLabel(win)
self.addPermanentWidget(self.modebarLabel)
self.abortableCommands = {}
def makeCommandNameUnique(self, commandName):
index = 1
trial = commandName
while self.abortableCommands.has_key(trial):
trial = "%s [%d]" % (commandName, index)
index += 1
return trial
def addAbortableCommand(self, commandName, abortHandler):
uniqueCommandName = self.makeCommandNameUnique(commandName)
self.abortableCommands[uniqueCommandName] = abortHandler
return uniqueCommandName
def removeAbortableCommand(self, commandName):
del self.abortableCommands[commandName]
def simAbort(self):
"""
Slot for Abort button.
"""
if debug_flags.atom_debug and self.sim_abort_button_pressed: # bruce 060106
print "atom_debug: self.sim_abort_button_pressed is already True before we even put up our dialog"
# Added confirmation before aborting as part of fix to bug 915. Mark 050824.
# Bug 915 had to do with a problem if the user accidently hit the space bar or espace key,
# which would call this slot and abort the simulation. This should no longer be an issue here
# since we aren't using a dialog. I still like having this confirmation anyway.
# IMHO, it should be kept. Mark 060106.
ret = QMessageBox.warning(
self,
"Confirm",
"Please confirm you want to abort.\n",
"Confirm",
"Cancel",
"",
1, # The "default" button, when user presses Enter or Return (1 = Cancel)
1,
) # Escape (1= Cancel)
if ret == 0: # Confirmed
for abortHandler in self.abortableCommands.values():
abortHandler.pressed()
def show_indeterminate_progress(self):
value = self.progressBar.value()
self.progressBar.setValue(value)
def possibly_hide_progressbar_and_stop_button(self):
if len(self.abortableCommands) <= 0:
self.progressBar.reset()
self.progressBar.hide()
self.simAbortButton.hide()
def show_progressbar_and_stop_button(self, progressReporter, cmdname="<unknown command>", showElapsedTime=False):
"""
Display the statusbar's progressbar and stop button, and
update it based on calls to the progressReporter.
#.........这里部分代码省略.........
示例3: PM_Dialog
# 需要导入模块: from PyQt4.Qt import QToolButton [as 别名]
# 或者: from PyQt4.Qt.QToolButton import hide [as 别名]
#.........这里部分代码省略.........
def _addGroupBoxes(self):
"""
Add various group boxes to this PM. Subclasses should override this
method.
"""
pass
def _addWhatsThisText(self):
"""
Add what's this text.
Subclasses should override this method.
"""
pass
def _addToolTipText(self):
"""
Add Tool tip text.
Subclasses should override this method.
"""
pass
def show(self):
"""
Shows the Property Manager.
"""
self.setSponsor()
# Show or hide the sponsor logo based on whether the user gave
# permission to download sponsor logos.
if env.prefs[sponsor_download_permission_prefs_key]:
self.sponsorButtonContainer.show()
else:
self.sponsorButtonContainer.hide()
if not self.pw or self:
self.pw = self.win.activePartWindow()
self.pw.updatePropertyManagerTab(self)
self.pw.pwProjectTabWidget.setCurrentIndex(
self.pw.pwProjectTabWidget.indexOf(self))
# Show the default message whenever we open the Property Manager.
self.MessageGroupBox.MessageTextEdit.restoreDefault()
def open(self, pm):
"""
Closes the current property manager (if any) and opens the
property manager I{pm}.
@param pm: The property manager to open.
@type pm: L{PM_Dialog} or QDialog (of legacy PMs)
@attention: This method is a temporary workaround for "Insert > Plane".
The current command should always be responsible for
(re)opening its own PM via self.show().
@see: L{show()}
"""
if 1:
commandSequencer = self.win.commandSequencer #bruce 071008
commandName = commandSequencer.currentCommand.commandName
# that's an internal name, but this is just for a debug print
print "PM_Dialog.open(): Reopening the PM for command:", commandName
# The following line of code is buggy when you, for instance, exit a PM