Clearing QDateEdit and QLabel
-
Is there a way to set QDateEdit and QLabel containing an image to empty string like the example below? I have tried this method and it is not working for me. Please any assistance. Thank you.
QdateEdit method 1: dob = self.ui.dateEdit.clear() QdateEdit method 2: dob = self.ui.dateEdit.setText("") QLabel method 1: self.ui.Display_label.setPixmap(QPixmap(pixmap)).clear()
-
Hi
QDateEdit cannot be empty. ( it resets to 01-01-2000)Regarding the QLabel. This can contain emoty text but what you mean with the
image/icon ?Like an icon with nothing drawn ?
-
Is there a way to set QDateEdit and QLabel containing an image to empty string like the example below? I have tried this method and it is not working for me. Please any assistance. Thank you.
QdateEdit method 1: dob = self.ui.dateEdit.clear() QdateEdit method 2: dob = self.ui.dateEdit.setText("") QLabel method 1: self.ui.Display_label.setPixmap(QPixmap(pixmap)).clear()
-
Is there a way to set QDateEdit and QLabel containing an image to empty string like the example below? I have tried this method and it is not working for me. Please any assistance. Thank you.
QdateEdit method 1: dob = self.ui.dateEdit.clear() QdateEdit method 2: dob = self.ui.dateEdit.setText("") QLabel method 1: self.ui.Display_label.setPixmap(QPixmap(pixmap)).clear()
-
Hi
QDateEdit cannot be empty. ( it resets to 01-01-2000)Regarding the QLabel. This can contain emoty text but what you mean with the
image/icon ?Like an icon with nothing drawn ?
-
@mrjj thanks for your response. The Qlabel uses the QFileDialog.getOpenFilename() method to load an image into the QLabel with a help of a QPushButton.
-
@eyllanesc Thanks for your response. The .clear() worked.