This bug report originated from issue QTBUG-3741
--- Description ---
The following code produce a scroll bar with no handle on OSX
<p>int main(int argc, char *argv)</p>
QApplication app(argc, argv);
Can be reproduced by running the QtLauncher with -style plastique http://www.tsr.ch
Scrollbars are missing the thum, and the clip seems to be broken when resizing the window
I encountered the same problem (scoll bar and scoll bar buttons are not correctly painted for the QWebView). I am using an own Qt Style which is based on QWindowsStyle.
The ScrollBars are working if you use QWebView with this style (or other styles like QWindowsStyle, QPlastiqueStyle) on a Windows system.
It is not working if you use QWebView and this style (or other styles like QWindowsStyle, QPlastiqueStyle) on a Mac system.
For a Mac systems the only Style offering correct ScrollBars with QWebView seems to be the QMacStyle.
Digging in the code I saw in the file ScrollbarThemeQt.cpp in the method ScrollbarThemeQt::paint() the following code part:
const QPoint topLeft = opt->rect.topLeft();
// The QStyle expects the background to be already filled
So for Mac there is no move of the rectangle to the position (0, 0) and also the coordinate system of the painter is not translated.
For the QMacStyle this seems to be OK (or it doesn't matter), but when using other styles like QWindowsStyle or QPlastiqueStyle then I think they expect also on a Mac system to have the rectangle relative to (0, 0).
As a workaround I have implemented in my own style for the handling of the complex control CC_ScrollBar to check if the given pointer to the widget is a QWebView object (using qobject_cast) and if it is QWebView then it there will be applied the movement of the rectangle and the translation of the painter's coordinate system as shown in the code part above. With this workaround the ScrollBars where painted correctly.
Instead of having a conditional compilation in ScrollbarThemeQt::paint() (see code above Q_WS_MAC) just statically depending on the system platform, it might be a solution if it would be possible to dynamically (at run-time) check which style is active in the ScrollbarThemeQt::paint() and then perform the movement and translation if it is not QMacStyle.
*** This bug has been marked as a duplicate of bug 34635 ***