Jul-03-2020, 04:59 AM
I would like to create a pop up calendar and then select a date to print out the selected Date. So far,I only able to create it using QDateEdit but fail to return the selected date.
below are popupCalendar but not able to select and return the date into label.
below are popupCalendar but not able to select and return the date into label.
def setupUi(self): self.calendar1=QDateEdit(self) self.calendar1.setCalendarPopup(True) self.calendar1.dateChanged.connect(self.show_date) selectedDate=self.calendar1.dateChanged print(selectedDate) # check signal self.Date_label = QLabel(self) self.Date_label.move(50,320) self.Date_label.setText(selectedDate.toString()) def show_date(self, selectedDate): self.Date_label.setText(selectedDate.toString())fail to execute self.Date_label.setText(selectedDate.toString) ,how to return the selected date?

