Reimplementing a Widgets Look
Hi
I'm making an application for a small black and white screen and need to change the appearance of the scroll bar in a listwidget. If I reimplement QScrollbar and modify its paint event is there a way to make the list widget use this reimplemented scrollbar? Or is there a better way of achieving this?
Thanks
Re: Reimplementing a Widgets Look
Quote:
If I reimplement QScrollbar and modify its paint event is there a way to make the list widget use this reimplemented scrollbar?
Why not ? It will be a new widget and you can use it.
Quote:
Or is there a better way of achieving this?
Try stylesheets. It will be easier. You can get examples from the docs under Qt StyleSheets
Re: Reimplementing a Widgets Look
Subclass QStyle and set the new style in your QApplication using QApplication::setStyle.
Re: Reimplementing a Widgets Look
thanks guys, I got it to look the way I wanted using style sheets. I'm using a stripped down version of Qt though and when I try to make it there it says QApplication has no member named setStyleSheet(). Do you know what needs to be included when configuring Qt to include setStyleSheet() ?
Re: Reimplementing a Widgets Look
There is definitely such a method in QApplication.
Re: Reimplementing a Widgets Look
Don't worry, I got it. When I was configuring I added -no-scripttools which meant qapplication didnt have the method. I reconfigured without that option and It's fine now. Thanks again for your help.
Re: Reimplementing a Widgets Look
-no-scripttools should have nothing to do with stylesheets. Scripttools are the debugger for the QScript-engine.
Re: Reimplementing a Widgets Look
Ok, I think I made a mistake and actually included everything when I thought I just removed -no-scriptools because somehow the qconfig file I was using had all of its content deleted. There is something I'm not including in the configuration though which means I can't use setStyleSheet, do you have any idea what that might be?
Re: Reimplementing a Widgets Look
From the header of QApplication, I see that there is a define:
QT_NO_STYLE_STYLESHEET