I'm using Qt 5.3 and trying to style a QSlider
. However, when I apply my style-sheet, the tick marks disappear. Does anyone know how to keep the styling without affecting the tick marks?
Here is the style sheet:
QSlider::groove:horizontal
{
border: 1px inset #B0B0B0;
background-color: #EAEAEA;
height: 2px;
}
QSlider::Handle
{
border: 1px solid black;
background: #B0B0B0;
background-image: url(:/metal_background_small);
width: 12px;
margin: -8px 0;
}
QSlider::Handle:Hover
{
border: 1px solid black;
background: #707070;
background-image: url(:/metal_background_small);
}
QSlider::sub-page
{
/* margin: 7px 1px 7px 0px;*/
height: 2px;
background: #05bcfe;
}
Qt Style Sheets and tick marks do NOT play nicely together. the simplest solution is to subclass
QSlider
and re-implement the paint_event.