MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / __init__

Method __init__

deeplabcut/gui/widgets.py:282–308  ·  view source on GitHub ↗
(self, cfg, filename="", parent=None)

Source from the content-addressed store, hash-verified

280
281class DictViewer(QtWidgets.QWidget):
282 def __init__(self, cfg, filename="", parent=None):
283 super().__init__(parent)
284 self.cfg = cfg
285 self.filename = filename
286 self.parent = parent
287 self.tree = QtWidgets.QTreeWidget()
288 self.tree.setHeaderLabels(["Parameter", "Value"])
289 self.tree.header().setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents)
290 self.tree.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
291 self.tree.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
292 self.tree.setAlternatingRowColors(True)
293 self.tree.setSortingEnabled(False)
294 self.tree.setHeaderHidden(False)
295 self.tree.itemChanged.connect(self.edit_value)
296 self.tree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
297 self.tree.customContextMenuRequested.connect(self.pop_context_menu)
298
299 self.root = self.tree.invisibleRootItem()
300 self.tree.addTopLevelItem(self.root)
301 self.populate_tree(cfg, self.root)
302
303 layout = QtWidgets.QHBoxLayout()
304 layout.addWidget(self.tree)
305 layout2 = QtWidgets.QVBoxLayout()
306 layout2.addWidget(QtWidgets.QLabel(filename))
307 layout2.addWidget(self.tree)
308 self.setLayout(layout2)
309
310 def pop_context_menu(self, point):
311 index = self.tree.indexAt(point)

Callers

nothing calls this directly

Calls 3

populate_treeMethod · 0.95
connectMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected