def PopulateForm(self): ### init widgets # model self.sim = QtGui.QStandardItemModel() self.sim.setHorizontalHeaderLabels( ['ThreadId', 'Address', 'Disasm', 'Stack Comment', 'CPU Context']) # toolbar self.utb = QtWidgets.QToolBar() self.ltb = QtWidgets.QToolBar() # tree view self.treeView = QtWidgets.QTreeView() self.treeView.setExpandsOnDoubleClick(True) self.treeView.setSortingEnabled(False) self.treeView.setSelectionBehavior( QtWidgets.QAbstractItemView.SelectRows) self.treeView.setToolTip( 'Highlights:\n Rust red - Input\n Violet - Output\n Olive - Both') ### populate widgets # fill model with data self.PopulateModel() # fill toolbar with data self.PopulateUpperToolbar() self.PopulateLowerToolbar() self.treeView.setModel(self.sim) # finalize layout layout = QtWidgets.QGridLayout() layout.addWidget(self.utb) layout.addWidget(self.treeView) layout.addWidget(self.ltb) self.parent.setLayout(layout)
def PopulateForm(self): ### init widgets # model self.sim = QtGui.QStandardItemModel() self.sim.setHorizontalHeaderLabels( ['ThreadId', 'Address', 'Disasm', 'Stack Comment', 'CPU Context']) # toolbar self.ftb = QtWidgets.QToolBar() self.stb = QtWidgets.QToolBar() # tree view self.treeView = QtWidgets.QTreeView() self.treeView.setToolTip('Double click a grade to filter') self.treeView.setExpandsOnDoubleClick(True) self.treeView.setSortingEnabled(False) self.treeView.setSelectionBehavior( QtWidgets.QAbstractItemView.SelectRows) # Context menus self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.treeView.customContextMenuRequested.connect( self.OnCustomContextMenu) self.treeView.doubleClicked.connect(self.ItemDoubleClickSlot) self.treeView.setModel(self.sim) ### populate widgets # fill model with data self.PopulateModel(0) # finalize layout layout = QtWidgets.QGridLayout() layout.addWidget(self.treeView) self.parent.setLayout(layout)
def PopulateForm(self): ### init widgets # model self.sim = QtGui.QStandardItemModel() # tree view self.treeView = QtWidgets.QTreeView() self.treeView.setExpandsOnDoubleClick(True) self.treeView.setSortingEnabled(False) self.treeView.setSelectionBehavior( QtWidgets.QAbstractItemView.SelectRows) self.treeView.setToolTip( 'Filter instructions/clusters/basic blocks from trace by double clicking on them.' ) # Context menus self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.treeView.customContextMenuRequested.connect( self.OnCustomContextMenu) self.treeView.doubleClicked.connect(self.ItemDoubleClickSlot) self.treeView.setModel(self.sim) ### populate widgets # fill model with data self.PopulateModel() # self.treeView.setFirstColumnSpanned(0, self.treeView.rootIndex(), True) # finalize layout layout = QtWidgets.QGridLayout() layout.addWidget(self.treeView) self.parent.setLayout(layout)
def PopulateForm(self): ### init widgets # model self.sim = QtGui.QStandardItemModel() self.sim.setHorizontalHeaderLabels([ 'Stack Address', 'Address Mapped to CPU Reg', 'Value Changes during Execution' ]) # tree view self.treeView = QtWidgets.QTreeView() self.treeView.setExpandsOnDoubleClick(True) self.treeView.setSortingEnabled(False) self.treeView.setSelectionBehavior( QtWidgets.QAbstractItemView.SelectRows) ### populate widgets # fill model with data self.PopulateModel() self.treeView.setModel(self.sim) # finalize layout layout = QtWidgets.QGridLayout() layout.addWidget(self.treeView) self.parent.setLayout(layout)