I got a reply from qt-interest regarding this. What is the state of
QStyle sub-classes in pyqt4? is there a reason that they are not
included?<br>
<br>
Thanks. The qt-interest reply follows:<br>
<br>
<pre>At 09:34 07.03.2006, you wrote:<br>&gt;How do I set the width of a QScrollBar in a QScrollArea. calling <br>&gt;scrollarea-&gt;verticalScrollBar()-&gt;setFixedWidth(100) seems to have no <br>&gt;effect. thanks!<br>&gt;
<br>&gt;-P<br>&gt;<br>&gt;<a href="http://www.patrickkidd.com">www.patrickkidd.com</a><br>&gt;<br>&gt;--<br>&gt;To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx <br>&gt;with &quot;unsubscribe&quot; in the subject or the body.
<br>&gt;List archive and information: <a href="http://lists.trolltech.com/qt-interest/">http://lists.trolltech.com/qt-interest/</a><br><br><br>Hi Patrick,<br><br>Try this:<br><br>- Define an own style in a class derived from a QStyle
<br>=&gt; e.g.<br>MyStyle : public QWindowsStyle<br><br>- Define length and width<br>=&gt; e.g.<br>#define SCROLLBARWIDTH<br><br>- Override the method pixelMetric()<br>=&gt; e.g.:<br>int pixelMetric(PixelMetric metric, const QStyleOption *, const 
<br>QWidget *pWidget = 0) const<br>{<br>    if ( metric == PM_ScrollBarExtent )<br>    {<br>       return SCROLLBARWIDTH<br>    }<br>    return  QWindowsStyle::pixelMetric( metric, 0, pWidget );<br>   }<br>}<br><br><br>- Then set the style to the Scrollbar in your code.
<br>=&gt; e.g.  mystyle = new MyStyle();<br>   verticalScrollBar()-&gt;setStyle( mystyle );<br><br>Andrea</pre>
<br><div><span class="gmail_quote">On 3/2/06, <b class="gmail_sendername">Patrick Stinson</b> &lt;<a href="mailto:patrickkidd@gmail.com">patrickkidd@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="direction: ltr;">I am trying to set the width of a vertical scrollbar (or any for that
matter) of a QScrollArea. I use PyQt4, kde-3.5.1, and the default
plastic syle. The size prints 50 for each scrollbar, but the width does
not change. Ideas? thanks in advance.<br>
<br>
from PyQt4.QtGui import *<br>
from PyQt4.QtCore import *<br>
<br>
a = QApplication([])<br>
scroll = QScrollArea()<br>
w = QWidget()<br>
w.setFixedSize(2000,2000)<br>
scroll.setWidget(w)<br>
<br>
bar = scroll.verticalScrollBar()<br>
bar.setFixedWidth(50)<br>
print bar.width()<br>
<br>
bar = scroll.horizontalScrollBar()<br>
bar.setFixedWidth(50)<br>
print bar.width()<br>
<br>
scroll.show()<br>
a.exec_()<br></div><div style="direction: ltr;"><span class="sg">
<br clear="all"><br>-- <br>Patrick Kidd Stinson<br><a href="http://pkaudio.sourceforge.net/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://pkaudio.sourceforge.net/</a><br><a href="http://pksampler.sourceforge.net/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://pksampler.sourceforge.net/</a>

</span></div></blockquote></div><br><br clear="all"><br>-- <br>Patrick Kidd Stinson<br><a href="http://www.patrickkidd.com/">http://www.patrickkidd.com/</a><br><a href="http://pkaudio.sourceforge.net/">http://pkaudio.sourceforge.net/
</a><br><a href="http://pksampler.sourceforge.net/">http://pksampler.sourceforge.net/</a>