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>>How do I set the width of a QScrollBar in a QScrollArea. calling <br>>scrollarea->verticalScrollBar()->setFixedWidth(100) seems to have no <br>>effect. thanks!<br>>
<br>>-P<br>><br>><a href="http://www.patrickkidd.com">www.patrickkidd.com</a><br>><br>>--<br>>To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx <br>>with "unsubscribe" in the subject or the body.
<br>>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>=> e.g.<br>MyStyle : public QWindowsStyle<br><br>- Define length and width<br>=> e.g.<br>#define SCROLLBARWIDTH<br><br>- Override the method pixelMetric()<br>=> 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>=> e.g. mystyle = new MyStyle();<br> verticalScrollBar()->setStyle( mystyle );<br><br>Andrea</pre>
<br><div><span class="gmail_quote">On 3/2/06, <b class="gmail_sendername">Patrick Stinson</b> <<a href="mailto:patrickkidd@gmail.com">patrickkidd@gmail.com</a>> 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>