PyQt5 QDateEdit - Selecting Whole Date Last Updated : 07 Jul, 2020 Comments Improve Suggest changes Like Article Like Report In this article we will see how we can select the whole date of the QDateEdit. User can set a date to the date edit with the help of cursor and the keyboard. Selecting date means the text of the date, selecting date is used for copying or overwriting the text of date edit. In order to do this we use selectAll method with the QDateEdit object Syntax : date.selectAll() Argument : It takes no argument Return : It returns None Below is the implementation Python3 1== # importing libraries from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui from PyQt5.QtGui import * from PyQt5.QtCore import * import sys class Window(QMainWindow): def __init__(self): super().__init__() # setting title self.setWindowTitle("Python ") # setting geometry self.setGeometry(100, 100, 500, 400) # calling method self.UiComponents() # showing all the widgets self.show() # method for components def UiComponents(self): # creating a QDateEdit widget date = QDateEdit(self) # setting geometry of the date edit date.setGeometry(100, 100, 150, 40) # creating push button push = QPushButton("Select", self) # setting geometry to the push button push.setGeometry(100, 150, 120, 30) # adding action to the push button # when it get clicked push.clicked.connect(lambda: push_method()) # method called by push button def push_method(): # selecting text date.selectAll() # create pyqt5 app App = QApplication(sys.argv) # create the instance of our Window window = Window() # start the app sys.exit(App.exec()) Output : Comment More infoAdvertise with us Next Article PyQt5 QDateEdit - Setting Date Alignment R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Python PyQt-QDateEdit Practice Tags : python Similar Reads PyQt5 QDateEdit - Setting Date Time In this article we will see how we can set date time to the QDateEdit. User can set date to the date edit with the help of cursor and the keyboard but sometimes there is a need of setting initial date or date programmatically for showing date in the records, which can be done with the help of setDat 2 min read PyQt5 QDateEdit - Stepping Date by some value In this article we will see how we can step the date of the QDateEdit. Stepping date means to change the date with specific value, the current selected section i.e day, month or year value get changed every time. Arrow buttons performs same action but they increment only by one only, although we can 2 min read PyQt5 QDateEdit - Setting Time In this article we will see how we can set time to the QDateEdit. Unlike normal date we can set date time to it with the help of setDate method. But also we can set only time as well without changing the date. In order to do this we use setTime method with the QDateEdit object Syntax : date.setTime( 1 min read PyQt5 QDateEdit - Stepping Down Date In this article we will see how we can decrement i.e step up the date of the QDateEdit. Stepping date means to decrement the date, it decrements the current selected section i.e day, month or year. Down arrow buttons performs same action although we can remove that button and make our own button. No 2 min read PyQt5 QDateEdit - Setting Date Alignment In this article we will see how we can set the date alignment of the QDateEdit. By default the text is aligned on the left-hand side although by changing the alignment we can make the date appear in the center. Changing alignment does not effect the functionality of the date edit. In order to do thi 1 min read PyQt5 QDateEdit - Setting Style Sheet In this article we will see how we can set style sheet to the date edit. Setting style sheet makes the date edit look unique with the help of style sheet we can set color, border and many other things to the date edit. In order to do this we use setStyleSheet method with the QDateEdit object Syntax 2 min read Like