Here is function which is painting cells of some dates that were previously calculated and saved in the "dates" list, function is working fine but I want to call that function when QDateEdit is clicked(when popup calendar is shown)
def init_gui(self):
# Set signals of widgets
self.dockwidget.date_to.calendarWidget().clicked.connect(self.paint_cell) # !! the signal I'm looking for
def paint_cell(self):
#QDateEdit / QCalendarWidget Highlight Dates
keyword_format = QTextCharFormat()
keyword_format.setBackground(Qt.gray)
for date in dates:
self.dockwidget.date_from.calendarWidget().setDateTextFormat(QDate.fromString(date,"yyyy-MM-dd") ,keyword_format)
self.dockwidget.date_from() # QDateEdit
self.dockwidget.date_from.calendarWidget() # QCalendarWidget
I know that there are signals, but they are all working when QDate is clicked: self.dockwidget.date_to.calendarWidget().activated.connect(self.paint_cell) self.dockwidget.date_to.calendarWidget().clicked.connect(self.paint_cell) self.dockwidget.date_to.calendarWidget().selectionChanged.connect(self.paint_cell)
but I have to paint the cells before these signals ,when the popup is displayed.
Does anyone know what that signal is?
NOTE: Code will be part of QGis plugin