Hello,
I am trying to use a style sheet on a QDateEdit widget, with the calendar popup flag turned on. I am trying to set a color for a hover event over the drop-down arrow.
Here is the style sheet I am using:
border: 2px solid lightgray;
border-radius: 5px;
}
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
border-left-width: 1px;
border-left-color: darkgray;
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
image: url(:/DateEditTest/Resources/Combobox Arrow.png);
}
/* Does this work with QDateEdit??? */
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d8d7d7, stop: 1 #e9e9e9);
}
QDateEdit {
border: 2px solid lightgray;
border-radius: 5px;
}
QDateEdit::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
border-left-width: 1px;
border-left-color: darkgray;
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
QDateEdit::down-arrow {
image: url(:/DateEditTest/Resources/Combobox Arrow.png);
}
QDateEdit::drop-down:hover {
/* Does this work with QDateEdit??? */
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #d8d7d7, stop: 1 #e9e9e9);
}
To copy to clipboard, switch view to plain text mode
What I'm seeing is that the drop-down part doesn't change color when the mouse is hovered over it. If you take the same style sheet and use it on a QComboBox (ie, use the same style sheet code but change all QDateEdit strings to QComboBox), it works perfectly. (I noticed that if you move the mouse over the QDateEdit's drop-down part quickly, it does actually change color sometimes, though not too often.)
So, my question is: is there additional styling that needs to be done for QDateEdit widgets?
Thanks!
Bookmarks