views:

124

answers:

1

With a QFileDialog I'm trying to change the size of the side bar in a QFileDialog. I want it to have a larger width. I was looking at dir(QtGui.QFileDialog) which shows a plethora of functions/methods and dir(QtGui.QSizePolicy) which seemed like the right choice. I've not been able to manipulate the size of the side bar though.

print 'sizePolicy: ',  self.sizePolicy()
urls = [ QtCore.QUrl("file:"), QtCore.QUrl("file:///usr/home/")]
self.fileBrowser.setSidebarUrls( urls )

Returns // sizePolicy:

It seems to average out the length of the names to create the width of the side bar. Anyone know a way around this? Size policy returns back a QSizePolicy object, but I don't know how to manipulate the side bar's size.

Thanks!

A: 

I would suggest using find_children and then maybe qobject_cast to get the sidebar object and the manipulate it directly.

elcuco