Scrollbars sometimes appear black when the widget is transparent. This happens with Qbittorrent compiled against Qt5 and probably other applications as well. See https://github.com/qbittorrent/qBittorrent/issues/2930 Qt 5.4.1 Reproducible: Always
Created attachment 92721 [details] Qbittorrent Scrollbar
Hi Can reproduce working on it.
(In reply to Nick from comment #0) > Scrollbars sometimes appear black when the widget is transparent. This > happens with Qbittorrent compiled against Qt5 and probably other > applications as well. do you have any example of "and probably other applications as well" ? Investigating locally, I find that the issues is triggered by scroll->setStyleSheet("QFrame { background: transparent; }"); (line 770 of transferlistfilterswidget.cpp) Not sure this is a widely used feature :) In any case, I'll try to find a workaround.
Sorry, I don't. I didn't realize it was an uncommon feature. I should probably avoid making such assumptions in bug reports :) Thanks for looking in to it!
Git commit 02ceed6ef677618a171aeb8dce1e240a74c0e161 by Hugo Pereira Da Costa. Committed on 21/05/2015 at 14:11. Pushed by hpereiradacosta into branch 'Plasma/5.3'. - Cleanup tests in scrollarea event filter - do not render background behind scrollbars when parent scrollarea has a stylesheet set, because the viewport palette is broken (all black) M +6 -5 kstyle/breezestyle.cpp http://commits.kde.org/breeze/02ceed6ef677618a171aeb8dce1e240a74c0e161
Git commit 46ca7603843b0215d13560f4b68b6139b4d61c6d by Hugo Pereira Da Costa. Committed on 21/05/2015 at 14:09. Pushed by hpereiradacosta into branch 'master'. - Cleanup tests in scrollarea event filter - do not render background behind scrollbars when parent scrollarea has a stylesheet set, because the viewport palette is broken (all black) M +6 -5 kstyle/breezestyle.cpp http://commits.kde.org/breeze/46ca7603843b0215d13560f4b68b6139b4d61c6d
Looks like that fixed it. Thanks!
This is rather old, but I ran into exactly the same issue with a Qt program and Breeze 5.8.6 (cf. the attached screenshot). No style has been added/changed using the QScrollArea that displays the black scrollbar, the only thing done is setFrameShape(QFrame::NoFrame). The sources can be found at http://git.l3u.de/?p=muckturnier.git . This is definitely Breeze dependant: When I use the Oxygen style, a normal scrollbar appears. Either, the original issue has not been fixed for all cases, or this is a regression.
Created attachment 105802 [details] Screenshot of the wrong styled scrollbar
(In reply to Tobias Leupold from comment #8) > This is rather old, but I ran into exactly the same issue with a Qt program > and Breeze 5.8.6 (cf. the attached screenshot). > > No style has been added/changed using the QScrollArea that displays the > black scrollbar, the only thing done is setFrameShape(QFrame::NoFrame). The > sources can be found at http://git.l3u.de/?p=muckturnier.git . > > This is definitely Breeze dependant: When I use the Oxygen style, a normal > scrollbar appears. Either, the original issue has not been fixed for all > cases, or this is a regression. Thanks for the report, This is not a regression, but rather an improper fix, due to the fact that the original report was slightly different (the broken scrollbar was the result of a stylesheet being set, while in your case this is the result of a "noFrame" being set). Anyway, I'll investigate.
Tried to compile and run the provided code but cannot reproduce the issue because the main window stays disabled (I miss some background app it seems). Is there a chance you make a "simple" program that reproduces the issues in a straigtforward way ? I have here quite some code with NoFrame ScrollArea, that does not reproduce the issue though, so there must be more to it. (see: http://i.imgur.com/MJtpmas.png) Or does it happen only with horizontal bars ?
Created attachment 105804 [details] Demo database You can use this database with my program to see the error. Just start it with the file as a command line argument (sorry, I didn't think it through when just posting the sources ;-), and you should see the relevant part. The respective code lives in src/ScorePage.cpp. If this doesn't work for you, I can try to strip it down to a minimal example, but of course, it would be less work if you could see it using the demo db.
ok. With the provided demo db, I can reproduce the problem. Thanks ! Investigating.
Investigating, "app.setStyleSheet(STYLE);" is what causes the issue, similar, in fact, to the original report. (but the stylesheet was applied to the scrollarea, not to the application). The real issue is upstream: why, as soon as a style sheet is set, the viewport's pallette become broken (and it is broken here. It returns #000000 for its background color) Now, I can also check for application styleSheet (on top of the widget's), but the most most complete test would be to check on app, or any parent of the view port, though. or of course to fix the upstream issue. I'll investigate some more ...
ok. In fact, the issue is "QScrollArea { background-color: transparent;" in the stylesheet you set. This is the color I retrieve, which then breaks the code. I'll try protect against this.
Thanks for tracking this down! I actually forgot that there's an application-wide style sheet set in main.cpp and thus claimed that no style was applied to the scrollarea (I think I set this back then because the background color was wrong on my Windows build of the program). Best thing would of course be to fix the issue upstream, if it's a upstream bug.