def display_search(self, date): """Colour search result backgrounds""" year = date.year() month = date.month() day = date.day() year = Year(year) col = year.get_column(month, day) item = self.item(month - 1, col) item.child(0, 1).data = True # Flag for colouring background item.setBackground(self.colourSettings.searchday_col)
def add_brew(self, date): """Colour in brew dates and construct QStandardItem for is_brew flag""" year = date.year() month = date.month() day = date.day() colour = self.colourSettings.brewday_col year = Year(year) col = year.get_column(month, day) item = self.item(month - 1, col) item.setBackground(colour) is_brew = item.child(0, 0) is_brew.data = True