PDA

View Full Version : QDateEdit down arrow frame



Henry Blue Heeler
14th January 2014, 20:29
This DateEdit is OK except for the rectangular frame around the down arrow.
Any way to eliminate or change the shape of the frame?

9927

ChrisW67
14th January 2014, 22:34
I assume you are using style sheets (to make user's eye bleed with the red). QDateEdit is styled the same way as QSpinBox.


The down button and arrow can be styled using the ::down-button and ::down-arrow subcontrols. By default, the down-button is placed in the bottom right corner in the Padding rectangle of the widget. Without an explicit size, it occupies half the height of its reference rectangle. The bottom-arrow is placed in the center of the Contents rectangle of the bottom-button.

Henry Blue Heeler
15th January 2014, 04:29
I assume you are using style sheets (to make user's eye bleed with the red). QDateEdit is styled the same way as QSpinBox.

Red was the client's request. Go figure.
I'm just gonna dig into the QSpinBox source code to ascertain what I can modify vis-a-vis the down-button.
down-button width: does nothing. Can't even set the height. Boo freaking hoo, I'll get over this limitation.
Ta.

ChrisW67
15th January 2014, 08:31
On second inspection that will style the up/down control when the date edit does not have a popup calendar. The button controlling the popup calendar is styled like the QComboBox drop-down sub-control. This give some control:


QDateEdit {
border: 1px solid gray;
border-radius: 3px;
padding: 1px 18px 1px 3px;
min-width: 6em;
}
QDateEdit::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
border-left-width: 1px;
border-left-color: red;
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
)

Henry Blue Heeler
15th January 2014, 20:24
You need to have an image to modify, e.g.

image: url(:/down-arrow.png);

No worries, thanks for the suggestions. I presently have more pressing issues.
I'll post what I discover.

Cheers!