def setGridPen(self, gridPen): """ Sets the pen that will be used when drawing the grid lines. :param gridPen | <QtGui.QPen> || <QtGui.QColor> """ self._gridPen = QtGui.QPen(gridPen)
def __init__(self, parent): super(XTreeWidgetDelegate, self).__init__(parent) # set custom properties self._gridPen = QtGui.QPen() self._showGrid = True self._showGridColumns = True self._showGridRows = True self._extendsTree = True self._showRichText = False self._displayMappers = {} self._foreground = {} self._background = {} self._headerIndex = 0 self._currentOverlay = None self._currentDisplay = None self._showHighlights = True self._disabledEditingColumns = set() self._datetimeFormat = '%m/%d/%y @ %I:%M%p' self._timeFormat = '%I:%M%p' self._dateFormat = '%m/%d/%y' self._hoverBackground = None self._hoverForeground = None self._hoverIcon = None self._expandIcon = None self._useCheckMaps = True self._checkOnMap = resources.find('img/check_on.png') self._checkPartialMap = resources.find('img/check_part.png') self._checkOffMap = resources.find('img/check_off.png') # setup defaults palette = parent.palette() base_clr = palette.color(palette.Base) avg = (base_clr.red() + base_clr.green() + base_clr.blue()) / 3.0 if avg < 80: grid_clr = base_clr.lighter(200) elif avg < 140: grid_clr = base_clr.lighter(140) else: grid_clr = base_clr.darker(140) self.setGridPen(grid_clr)