def __init__(self, category): super(ProfilingTaskView, self).__init__(category, 'Profile') self.profile = None self.sortKey = 'prim' self.sortDir = 0 self.table = self.addTopWidget(gui.TableView()) self.sortKeyBox = self.addLeftWidget(gui.GroupBox('Sort')) group = [] for name, key in Stat._fields: radio = self.sortKeyBox.addWidget(KeyRadioButton(group, name, key)) self.sortDirBox = self.addLeftWidget(gui.GroupBox('Sort')) group = [] for name, dir in [('Descending', 0), ('Ascending', 1)]: radio = self.sortDirBox.addWidget(DirRadioButton(group, name, dir)) self.saveBox = self.addLeftWidget(gui.GroupBox('Save')) self.save = gui.BrowseButton('save') self.saveBox.addWidget(self.save) self.save.setEnabled(False) self.table.setColumnCount(len(self._columns)) self.table.setHorizontalHeaderLabels(self._columns) self.table.setColumnWidth(len(self._columns) - 1, 300) @self.save.mhEvent def onClicked(path): if path: self.saveStats(path)
def __init__(self, category): super(ProfilingTaskView, self).__init__(category, 'Profile') self.sortKey = 'prim' self.sortDir = 0 self.table = self.addTopWidget(gui.TableView()) self.sortKeyBox = self.addLeftWidget(gui.GroupBox('Sort')) group = [] for name, key in Stat._fields: radio = self.sortKeyBox.addWidget(KeyRadioButton(group, name, key)) self.sortDirBox = self.addLeftWidget(gui.GroupBox('Sort')) group = [] for name, dir in [('Descending', 0), ('Ascending', 1)]: radio = self.sortDirBox.addWidget(DirRadioButton(group, name, dir)) self.table.setColumnCount(len(self._columns)) self.table.setHorizontalHeaderLabels(self._columns) self.table.setColumnWidth(len(self._columns) - 1, 300)