Hello,
I'm trying to change some properties of the included Qt slider object in WinCC OA. For this I make my stylesheet in the config folder, here it is:
QSlider::groove:vertical {
position: absolute;
left: 4px;
}
QSlider::handle:vertical {
height: 20px;
width: 10px;
margin: 0 -4px;
}
It seems that it doesn't impact the sliders in my view. Is this the correct Qt object?
I want to reduce the handler size and have a margin between groove and handle, is it possible by this way?
Thanks in advance for your answers.
Change css properties slider
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Change css properties slider
Yes, it's the correct Qt object. The file loaded by the UI must have the name stylesheet.css in the config folder.
Here is an example which works (3.11.1):
Here is an example which works (3.11.1):
Code: Select all
QSlider::groove
{
border: 1px solid #999999;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #E6E6E6, stop:1 #EEEEEE);
}
QSlider::groove:disabled
{
background: #efefef;
}
QSlider::handle
{
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);
border: 1px solid #5c5c5c;
border-radius: 3px;
width: 15px;
height: 15px;
}
QSlider::handle:disabled
{
background: #D3D0CD;
}
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Change css properties slider
Yes it was in the config folder with the name stylesheet.css. I also have some properties for progress bar and it works fine.
I think my problem comes from :vertical in the name... (I followed Qt online doc about QSlider).
Thanks for your reply, it works great with Slider too now
I think my problem comes from :vertical in the name... (I followed Qt online doc about QSlider).
Thanks for your reply, it works great with Slider too now
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Change css properties slider
Hum, well just another question. With your css properties the tick bar disappear, is it normal? Is it any way to keep it visible? Thanks for your help
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Change css properties slider
I checked the Qt sources why the ticks disappear when it's styled and found:
so it seems, this is simply not implemented ... 
Code: Select all
if (slider->subControls & SC_SliderTickmarks) {
// TODO...
}