本文整理汇总了Python中pyqtgraph.dockarea.DockArea.deleteLater方法的典型用法代码示例。如果您正苦于以下问题:Python DockArea.deleteLater方法的具体用法?Python DockArea.deleteLater怎么用?Python DockArea.deleteLater使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.dockarea.DockArea
的用法示例。
在下文中一共展示了DockArea.deleteLater方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AWGUi
# 需要导入模块: from pyqtgraph.dockarea import DockArea [as 别名]
# 或者: from pyqtgraph.dockarea.DockArea import deleteLater [as 别名]
#.........这里部分代码省略.........
self.clearCacheButton.clicked.connect(self.onClearCache)
#status bar
self.label = QtGui.QLabel('Sample Rate: {0}'.format(self.settings.deviceProperties['sampleRate']))
self.statusbar.addWidget(self.label)
#Restore GUI state
state = self.config.get(self.configname+'.state')
pos = self.config.get(self.configname+'.pos')
size = self.config.get(self.configname+'.size')
isMaximized = self.config.get(self.configname+'.isMaximized')
dockAreaState = self.config.get(self.configname+'.dockAreaState')
guiState = self.config.get(self.configname+".guiState")
restoreGuiState(self, guiState)
try:
if pos:
self.move(pos)
if size:
self.resize(size)
if isMaximized:
self.showMaximized()
if state:
self.restoreState(state)
for awgChannelUi in self.awgChannelUiList:
channelGuiState = self.config[self.configname+"channel{0}.guiState".format(awgChannelUi.channel)]
restoreGuiState(awgChannelUi, channelGuiState)
except Exception as e:
logger.warning("Error on restoring state in AWGUi {0}. Exception occurred: {1}".format(self.device.displayName, e))
try:
if dockAreaState:
self.area.restoreState(dockAreaState)
except Exception as e:
logger.warning("Cannot restore dock state in AWGUi {0}. Exception occurred: {1}".format(self.device.displayName, e))
self.area.deleteLater()
self.area = DockArea()
self.splitter.insertWidget(0, self.area)
for channelUi in self.awgChannelUiList:
dock = Dock("AWG Channel {0}".format(channel))
dock.addWidget(channelUi)
self.area.addDock(dock, 'right')
self.saveIfNecessary()
def onCacheDepth(self, newVal):
self.settings.cacheDepth = newVal
self.saveIfNecessary()
def onClearCache(self):
self.waveformCache.clear()
def onComboBoxEditingFinished(self):
"""a settings name is typed into the combo box"""
currentText = str(self.settingsComboBox.currentText())
if self.settingsName != currentText:
self.settingsName = currentText
if self.settingsName not in self.settingsDict:
self.settingsDict[self.settingsName] = copy.deepcopy(self.settings)
self.onLoad(self.settingsName)
def saveIfNecessary(self):
"""save the current settings if autosave is on and something has changed"""
currentText = str(self.settingsComboBox.currentText())
if self.settingsDict.get(self.settingsName)!=self.settings or currentText!=self.settingsName:
if self.autoSave:
self.onSave()
else:
self.saveButton.setEnabled(True)