ArneBurghardt
15th September 2010, 13:13
Hi,
i am designing a GUI for a touchscreen device (Plastique Style). So far everything is fine, except that it is very difficult to hit the slider handle, because it is way to small. Therefore i would like to increase the size of my slider handle.
My first try was to implement a style sheet for my vertical slider, like this one:
/* slider_pwm1 is the name of my slider */
#slider_pwm1::handle:vertical {
min-width: 50px;
width: 50px;
}
...but no success...
My second guess was to override the PixelMetric function:
// Override style for better Touchscreen handling
class MyProxyStyle : public QProxyStyle
{
public:
int pixelMetric ( PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) const
{
switch(metric) {
case PM_SliderControlThickness : return 50;
default : return (QProxyStyle::pixelMetric(metric,option,widget));
}
}
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setStyle(new MyProxyStyle);
...
}
And again i had no success... :crying:
Now i am running out of ideas... Does anybody out there has a clue/hint/link to solve this problem ?
Thank you for your help !
Arne
i am designing a GUI for a touchscreen device (Plastique Style). So far everything is fine, except that it is very difficult to hit the slider handle, because it is way to small. Therefore i would like to increase the size of my slider handle.
My first try was to implement a style sheet for my vertical slider, like this one:
/* slider_pwm1 is the name of my slider */
#slider_pwm1::handle:vertical {
min-width: 50px;
width: 50px;
}
...but no success...
My second guess was to override the PixelMetric function:
// Override style for better Touchscreen handling
class MyProxyStyle : public QProxyStyle
{
public:
int pixelMetric ( PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) const
{
switch(metric) {
case PM_SliderControlThickness : return 50;
default : return (QProxyStyle::pixelMetric(metric,option,widget));
}
}
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QApplication::setStyle(new MyProxyStyle);
...
}
And again i had no success... :crying:
Now i am running out of ideas... Does anybody out there has a clue/hint/link to solve this problem ?
Thank you for your help !
Arne