I want to highlight every day in a CalendarWidget that is between a selected start and end date. My problem is that a CalendarWidget only allows SingleSelection in QTCreator but says that other things can be changed programmatically though.
I found some hints to use a QPainter and the paintCell() Method but i till dont know where to begin. The Internet wasn't helpful in my case. I tried to change a single date first on buttonClick but even this didnt work, can you give me an advice how to use this?
btn_test_pressed(self):
painter = QPainter()
painter.setPen(QtGui.QPen(QtCore.Qt.green))
painter.fillRect(QtCore.QRectF(250, 250, 10, 10), 0, 5760)
rect = QRect()
date = datetime.datetime.now() - datetime.timedelta(1)
self.calendarWidget.paintCell(painter, rect, date)