QScrollbar handle stretch problem
Hi all,
I'm styling my scrollbar and I have a problem on stretching the scrollbar's handle.
I read this post
http://www.qtcentre.org/forum/f-qt-p...eet-10569.html
and I understand that styling the handle means stretch an image like this:
"The middle parts will be stretched or repeated (depending on your settings) and corners will be applied without any scaling to prevent distortions."
I would like not to stretch the middle part and to strecth, instead, the corners.
Is it possible using QStyleSheet? I have to define my custom style?
Thank you for any suggestion.
Beppe
Re: QScrollbar handle stretch problem
I don't think you can do that using stylesheets... I can't think of any possible reason to want to stretch corners, anyway... I'd suggest you implemented your own widget style for the scroll bar and apply it using the proxy style technique.
2 Attachment(s)
Re: QScrollbar handle stretch problem
Thank you wysota,
if you say
Quote:
I can't think of any possible reason to want to stretch corners, anyway...
maybe I don't cope with the problem in the correct way.
I have an image (handle.jpg) applied to the handle of the scrollbar. With StyleSheet I set the handle's minimum size and it works correctly.
When the scrollbar grows, the handle image is stretched but the final effect is awful (see the second image).
my stylesheet code is
Code:
background:lightgray;\
border-color:black;\
border-style:solid;\
width: 50px;\
margin-top:1px;\
margin-bottom:1px;\
}\
\
border-image: url(handle.png);\
min-height: 96px; \
} \
\
background:none;\
border-width:0px;\
height: 0px;\
width: 0px; \
} \
\
background:none;\
border-width:0px;\
height: 0px;\
width: 0px; \
} \
\
background: none;\
}\
\
background: none;\
}
Thanks
Beppe
Re: QScrollbar handle stretch problem
But stretching corners will not help you in any way.
You should create your own style. Unfortunately QScrollBar doesn't have any special sub-control for the middle part of the handle.
Re: QScrollbar handle stretch problem