本文整理汇总了Python中PySide.QtGui.QCheckBox.setStatusTip方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.setStatusTip方法的具体用法?Python QCheckBox.setStatusTip怎么用?Python QCheckBox.setStatusTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.setStatusTip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DataBrowser
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import setStatusTip [as 别名]
class DataBrowser(QWidget, Ui_DataBrowser):
"""
@since: 2011-08-24
"""
__author__ = "Moritz Wade"
__contact__ = "[email protected]"
__copyright__ = "Zuse Institute Berlin 2011"
def __init__(self, parent, id, dataSet):
super(DataBrowser, self).__init__(parent)
self.setupUi(self)
self._simWorkbench = None
self.dataService = None
self.id = id
self.data = dataSet
self.optionsService = OptionsService()
# create the custom selectable table header
self.selectableHeader = SelectableTableHeader(Qt.Horizontal, self.tableView)
self.selectableHeader.setNonSelectableIndexes([0])
self.selectableHeader.sectionSelectionChanged.connect(self.on_columnSelectionChanged)
self.tableView.setHorizontalHeader(self.selectableHeader)
# create the data model
self.dataModel = DataBrowserModel(self, self.id, self.data)
self.tableView.setModel(self.dataModel)
self._setUpSelectionCheckBox()
self._updateInfoPane()
if not self.optionsService.getDebug():
self.groupBoxPerturbation.setVisible(False)
def getId(self):
return self.id
def setSimulationWorkbench(self, simWorkbench):
self._simWorkbench = simWorkbench
def getSelectionCheckBox(self):
return self._selectionCheckBox
def isSelected(self):
checkState = self._selectionCheckBox.checkState()
return True if checkState == Qt.Checked else False
def _setUpSelectionCheckBox(self):
self._selectionCheckBox = QCheckBox()
self._selectionCheckBox.setChecked(True)
infoText = "Select or deselect this data (e.g. to be included in plots and computations)."
self._selectionCheckBox.setStatusTip(infoText)
self._selectionCheckBox.setToolTip(infoText)
self._selectionCheckBox.stateChanged.connect(self._selectionChanged)
def _updateInfoPane(self):
"""
Updates the info pane with basic info about the loaded data
and the data file (if any).
"""
self.lineEditInfoSpecies.setText(str(self.data.getNumOfRealData()))
self.lineEditInfoDataType.setText(self.data.type)
# self.lineEditInfoFormat.setText(self.data.format)
filepath = self.data.filename
if filepath and os.path.exists(filepath):
self.lineEditInfoPath.setText(filepath)
filesize = os.path.getsize(filepath)
filesize = filesize / 1024 # displaying kB
self.lineEditInfoFilesize.setText("%s kB" % filesize)
timeLastModifiedEpoch = os.path.getmtime(filepath)
timeLastModified = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime(timeLastModifiedEpoch))
self.lineEditInfoLastModified.setText(str(timeLastModified))
else:
noFileText = "No File"
self.lineEditInfoPath.setText(noFileText)
self.lineEditInfoFilesize.setText(noFileText)
self.lineEditInfoLastModified.setText(noFileText)
def remove(self):
"""
Cleans up stuff then destroys self.
It's not sure whether this is really needed
but it might serve to close some memory holes
(e.g. dangling references somewhere).
"""
del self.dataModel
del self
#.........这里部分代码省略.........