def _create_table(self): table = QtGui.QTableWidget(0, 1) table.setGridStyle(QtCore.Qt.DotLine) table.setFocusPolicy(QtCore.Qt.NoFocus) table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) hh = table.horizontalHeader() hh.setStretchLastSection(True) hh.setVisible(False) vh = table.verticalHeader() vh.setVisible(False) return table
def __init__(self, parent=None): super(VariantSummaryWidget, self).__init__(parent) self.variant = None self.label = QtGui.QLabel() self.table = QtGui.QTableWidget(0, 1) self.table.setGridStyle(QtCore.Qt.DotLine) self.table.setFocusPolicy(QtCore.Qt.NoFocus) self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.table.setAlternatingRowColors(True) hh = self.table.horizontalHeader() hh.setStretchLastSection(True) hh.setVisible(False) vh = self.table.verticalHeader() vh.setResizeMode(QtGui.QHeaderView.ResizeToContents) create_pane([self.label, self.table], False, compact=True, parent_widget=self) self.clear()