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 gray;
border-radius: 4px;
padding: 0 8px;
selection-background-color: darkgray;
}
QDateEdit::down-arrow {
image: url(arrow.png);
max-width: 1px
}
QDateEdit::up-arrow {
image: url(up-arrow.png);
max-width: 1px
}
This is how it looks now:
https://i.stack.imgur.com/uXN5T.png
And this is how my comboBox looks and how should dateEdit looks too:
The
QDateEdit
can be styled in the same way that aQSpinBox
can. There is anup-arrow
,down-arrow
control as well asup-button
,down-button
.Setting the background an border color styles for the buttons should be set to each button sub-control.
From the Qt docs, here are some examples of how to style a
QSpinBox
.If you replace the
QSpinBox
withQDateEdit
all of those controls should work identically.