Reputation: 734
I am looking for some help to style my QTextBrowser Scroll Bar.
I have applied the fusion style to my app with the commands inside my main():
QApplication app(argc, argv);
app.setStyle("fusion");
This appears to work, some check boxes and buttons are now a different style than before and there are no errors.
However, I have a page in the app which has a QTabWidget and each tab contains a QTextBrowser widget. If i fill the QTextBrowser widget with text, a scroll bar appears and it is styled very strangely, nothing like the fusion style scroll bars:
I can apply a manual style sheet to the scrollbars using the examples here:
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qscrollbar
But this seems like a like a lot of work to make the scroll bars look nice.
What am I doing wrong? Why are the built in styles not being applied?
I should add, the QTabWidget is added using the designer but starts with no tabs, then the tabs and QTextBrowser's are added with code in the .cpp file because there is a variable amount.
Any help or suggestions would be appreciated.
Cheers
Upvotes: 0
Views: 439
Reputation: 34
Try to set the style directly to the QTextBrowser, it will discard styling propagation issues. You can check if you problem is about QTextBrowser rendering just by creating one and filling it with text, see what happens.
Upvotes: 1