Use this tag for questions about the QDateEdit class - part of the Qt framework that provides a widget for editing dates. When using this tag also include the more generic [qt] tag where possible.
Questions tagged [qdateedit]
14 questions
4
votes
0 answers
QDateEdit Select Section Text on Single Click
I have a QDateEdit with current date as default and the date format as "dd/MM/yyyy". When I click on the Month then the MM text should be selected. Also, when I click on the date edit the cursor position of the lineEdit() returns 0 as the cursor…

Helen
- 41
- 2
3
votes
1 answer
Pyqt5: How can I create a manually editable QDateEdit widget?
I know that for QComboBox there is method called editable with which you can manually edit current value:
combo.setEditable(True). I could not find something similar with QDateEdit. I want user be able to delete entire date string and manually enter…

jabbarlee
- 110
- 2
- 11
2
votes
2 answers
How to set date in to QDateEdit from Variable or Text?
Below is the example code:
date = "1-Jan-2020"
widget_date = QtWidgets.QDateEdit()
widget_date .setDisplayFormat("d-MMM-yyyy")
widget_date .setDate(QDate.fromString(date))
I want to set that date to QtWidgets.QDateEdit().
But it is setting up the…

user3030327
- 411
- 1
- 7
- 19
2
votes
1 answer
Python Pyqt5 QDateEdit Get Date String
I'm trying to build a date printer using Pyqt5 QDateEdit. I can popup the calendar, but I want to write the clicked date's string in the console (or in a label in window). I tried print(self.calendarWidget().document().toPlainText()) or…

Wicaledon
- 710
- 1
- 11
- 26
2
votes
1 answer
Qt QDateEdit Custom Styling Sheet
I would like to apply custom styling sheet to a QDateEdit widget with the QCalendarPopup Activated.
My current CSS:
What it looks like:
I need to fix three things:
The background color and font color of the days name (i.e. mon. tue. ..,…

ZottoZ
- 43
- 1
- 6
1
vote
1 answer
Change QDateEdits behaviour on select all
I am learning Qt (in C++) and I have a question regarding the QDateEdit.
I want to be able to type after selecting the text in my QDateEdit. By default you cannot type if you select the whole date. I am sure there is an easy way to do that. How can…

Jonathan Fischer
- 21
- 3
1
vote
1 answer
How do I use the user value set in the in QDateEdit widget in another function?
I'm building a GUI using PyQT5 for some scripts I run which requires a user date input.
I've managed to get to a point where I can select a date using the DateEdit range, and have new date printed to the console every time the user changes it.…

A-Aron
- 29
- 6
0
votes
1 answer
Animate focused part of QDateTimeEdit
I need to animate QDateTimeEdit widget as follows;
When user focuses/edits year section, it should be animated using opacity property. ( like flickering, show and hide for every second )
Qt animation could only be used for widgets. But the part I'm…

developer_
- 1
- 1
0
votes
0 answers
how to get signal when field is activated (Python, PyQt5, QDateEdit)
I need to receive a signal when the field (QDateEdit) is activated. I did not find such a signal in the documentation.
Perhaps i need to redefine the class for this? but I don't know how to describe it all in working code

Pihto
- 15
- 3
0
votes
1 answer
PyQt5 DateEdit white background under arrows
is it possible to have a QDateEdit with custom arrows and set background and border color? I tried many options using setStyleSheet, but none worked.
My current code just changing the arrows and is bellow:
QDateEdit {
border: 1px solid…

Soky
- 15
- 4
0
votes
0 answers
How to change the "down-button" in QDateEdit with CalendarPopup?
I want to change the dropdown button in my QDateEdit but nothing works.
with:
QDateEdit::down-arrow{
height:12px;
width:12px;
image:url('://Assets/chevron-down-dark.png');
}
i can change the little down-arrow-icon but if use…

Robert
- 159
- 1
- 9
0
votes
2 answers
QDateEdit with calendar signals editingFinished() when calendar popup is clicked
I have a QDateEdit with the calendar enabled and am trying to capture the end of editing:
the_date = QDateEdit(...)
the_date.setCalendarPopup(True)
the_date.editingFinished.connect(checkDate)
...
def checkDate():
print…

Llaves
- 683
- 7
- 20
0
votes
1 answer
PyQt5 - How can I disable weekend on a QDateEdit
I'm using a QDateEdit to choose a specific date, but I would like to disbale weekends, I only want to choose week days.
self.date = QDateEdit(calendarPopup = True)
self.date.setDisplayFormat("dd-MM-yyyy")
self.date.setMinimumDate(QDate(2021,10,1)) …

Florian.G
- 17
- 8
0
votes
1 answer
How to change color for inactive days in QDateEdit or QCalendarWidget
Help me please, my friends!I need to calendar widget look like this:
desired calendar
But i have a problem. I only get this:
my calendar
I need to do this: dates that are out of range (minimalDate, maximumDate) should be colored as inactive (main…

igorotvertka
- 87
- 1
- 7