本文整理汇总了Python中PyQt4.Qt.QTreeWidgetItem.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QTreeWidgetItem.__init__方法的具体用法?Python QTreeWidgetItem.__init__怎么用?Python QTreeWidgetItem.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QTreeWidgetItem
的用法示例。
在下文中一共展示了QTreeWidgetItem.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.Qt import QTreeWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QTreeWidgetItem import __init__ [as 别名]
def __init__(self, parent, name=None):
QTreeWidgetItem.__init__(self)
self.filterList = ('mmp', 'MMP')
if isinstance(parent, QListView):
self.p = None
if name:
self.f = name
else:
self.f = '/'
else:
self.p = parent
self.f = name
self.readable = QDir( self.fullName() ).isReadable()
if not self.readable :
self.setIcon(0, folderLockedIcon)
else:
self.setIcon(0, folderClosedIcon)
if name is not None:
self.setText(1, name)
if isinstance(parent, QTreeWidget):
parent.addTopLevelItem(self)
else:
parent.addChild(self)
示例2: __init__
# 需要导入模块: from PyQt4.Qt import QTreeWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QTreeWidgetItem import __init__ [as 别名]
def __init__(self, parent, device):
QTreeWidgetItem.__init__(self, parent)
self._device = device
self.setText(0, device.lvname)
mountpoint = getattr(device.format, "mountpoint", "")
if not mountpoint:
mountpoint = ""
elif not (device.format and device.format.mountable):
mountpoint = "N/A"
self.setText(1, mountpoint)
self.setText(2, "%Ld" % device.size)
示例3: __init__
# 需要导入模块: from PyQt4.Qt import QTreeWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QTreeWidgetItem import __init__ [as 别名]
def __init__(self, src, *args):
QTreeWidgetItem.__init__(self, *args)
self._src = src
# fonts
self._initFonts()
# array of actual (i.e. numeric) column values
self._values = [None] * NumColumns
# set text alignment
for icol in range(NumColumns):
self.setTextAlignment(icol, Qt.AlignLeft)
self.setTextAlignment(ColumnR, Qt.AlignRight)
self.setTextAlignment(ColumnType, Qt.AlignHCenter)
# setup source
self._highlighted = self._highlighted_visual = False
self.setSource(src)
示例4: __init__
# 需要导入模块: from PyQt4.Qt import QTreeWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QTreeWidgetItem import __init__ [as 别名]
def __init__(self, parent, device=None):
QTreeWidgetItem.__init__(self, parent)
self.device = device