本文整理汇总了Python中PyQt5.QtWidgets.QTreeWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QTreeWidget.__init__方法的具体用法?Python QTreeWidget.__init__怎么用?Python QTreeWidget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QTreeWidget
的用法示例。
在下文中一共展示了QTreeWidget.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, parent, items):
QTreeWidget.__init__( self )
self.setColumnCount( 2 )
header = QTreeWidgetItem( SubtleTreeWidget.ITEM_ROLE )
header.setText(0, 'File')
header.setText(1, 'Status')
self.setHeaderItem( header )
self.addTopLevelItems( items )
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.singleOverlaySelection = True
self.header().close()
self.setSortingEnabled(True)
self.installEventFilter(self)
self.spacePressed.connect(self.spacePressedTreewidget)
self.itemChanged.connect(self.treeItemChanged)
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self):
QTreeWidget.__init__(self)
self.setAnimated(True)
self.setHeaderLabel(self.tr("Folders"))
self.header().setStretchLastSection(False)
self.header().setHidden(True)
self.header().setSectionResizeMode(0, QHeaderView.ResizeToContents)
self.itemClicked.connect(self._open_file)
Amaru.load_component("tree_project", self)
示例4: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self._model = None
self._catRow = [-1, -1, -1]
self._filter = ""
self._lastID = -1
self._updating = False
self._showSubPlot = False
self.setRootIsDecorated(False)
self.setIndentation(10)
self.setColumnCount(1)
self._rootItem = QTreeWidgetItem()
self.insertTopLevelItem(0, self._rootItem)
示例5: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self._model = None
self._catRow = [-1, -1, -1]
self._filter = ""
self._lastID = -1
self._updating = False
self.setRootIsDecorated(False)
self.setIndentation(10)
self.setHeaderHidden(True)
self.setIconSize(QSize(24, 24))
self.setColumnCount(1)
self._rootItem = QTreeWidgetItem()
self.insertTopLevelItem(0, self._rootItem)
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, plugins):
QTreeWidget.__init__(self)
self.setHeaderHidden(True)
self.itemExpanded.connect(self.handleExpanded)
self.itemClicked.connect(self.handleClicked)
self.context = pyblish.api.Context()
for plugin in plugins:
p = plugin()
item = QTreeWidgetItem(self)
item.setText(0, p.__class__.__name__)
item.plugin = p
instance = pyblish.api.Instance(p.__class__.__name__, self.context)
item.instance = instance
self.addItems(item)
示例7: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, parent):
QTreeWidget.__init__(self)
self.parent = parent
self.setHeaderLabels([_('Connected node'), _('Height')])
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.create_menu)
示例8: __init__
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import __init__ [as 别名]
def __init__(self, parentWidget):
QTreeWidget.__init__(self, parentWidget)
self.setColumnCount(1)
self.setHeaderLabel("Notepads")
self.itemExpanded.connect(self.addLazyChildren)