1 #include "ProxyStyle.hpp"
4 #include <QStyleOptionSlider>
7 using namespace QtCollider
;
10 void ProxyStyle::drawComplexControl ( ComplexControl ctrl
, const QStyleOptionComplex
*opt
,
11 QPainter
*p
, const QWidget
* w
) const
13 // FIXME this is a workaround for the WebKit bug #35681.
15 if( ctrl
== QStyle::CC_ScrollBar
16 && qobject_cast
<const QWebView
*>(w
) != 0
17 && opt
->type
== QStyleOption::SO_Slider
)
19 const QPoint topLeft
= opt
->rect
.topLeft();
22 p
->translate( topLeft
);
24 const QStyleOptionSlider
*optSlider
= static_cast<const QStyleOptionSlider
*>(opt
);
25 QStyleOptionSlider
opt2( *optSlider
);
26 opt2
.rect
.moveTo( QPoint(0, 0) );
28 QProxyStyle::drawComplexControl( ctrl
, &opt2
, p
, w
);
35 QProxyStyle::drawComplexControl( ctrl
, opt
, p
, w
);
39 int ProxyStyle::styleHint ( StyleHint hint
, const QStyleOption
* option
,
40 const QWidget
* widget
, QStyleHintReturn
* returnData
) const
43 case QStyle::SH_Slider_AbsoluteSetButtons
:
44 return Qt::LeftButton
;
45 case QStyle::SH_Slider_PageSetButtons
:
48 return QProxyStyle::styleHint( hint
, option
, widget
, returnData
);