Re: QFileDialog setFileMode blues
On Jul 29, 12:45 pm, Phil Thompson wrote: > On Wed, 29 Jul 2009 04:35:42 -0700 (PDT), Rincewind > wrote: > > > Heya, > > > I am fairly new to Python and even newer to Qt. > > The problem is opening a Qt file dialog to select folders only. > > QFileDialog has a nice and dandy setFileMode() function just for that. > > The only trouble is that I cannot make it work. > > Last thing I've tried was something like this: > > > self.fd = QtGui.QFileDialog() > > self.fd.setFileMode(self.fd.FileMode(4)) > > filename = self.fd.getOpenFileName() > > > ..but it was fruitless. > > > Any help? Tons of internets in return! > > QFileDialog.getOpenFileName() is a static method that creates its own > QFileDialog internally. It's not using the one you have created and > configured. > > Phil You are awesome, thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: QFileDialog setFileMode blues
On Wed, 29 Jul 2009 04:35:42 -0700 (PDT), Rincewind wrote: > Heya, > > I am fairly new to Python and even newer to Qt. > The problem is opening a Qt file dialog to select folders only. > QFileDialog has a nice and dandy setFileMode() function just for that. > The only trouble is that I cannot make it work. > Last thing I've tried was something like this: > > self.fd = QtGui.QFileDialog() > self.fd.setFileMode(self.fd.FileMode(4)) > filename = self.fd.getOpenFileName() > > ..but it was fruitless. > > Any help? Tons of internets in return! QFileDialog.getOpenFileName() is a static method that creates its own QFileDialog internally. It's not using the one you have created and configured. Phil -- http://mail.python.org/mailman/listinfo/python-list
QFileDialog setFileMode blues
Heya, I am fairly new to Python and even newer to Qt. The problem is opening a Qt file dialog to select folders only. QFileDialog has a nice and dandy setFileMode() function just for that. The only trouble is that I cannot make it work. Last thing I've tried was something like this: self.fd = QtGui.QFileDialog() self.fd.setFileMode(self.fd.FileMode(4)) filename = self.fd.getOpenFileName() ..but it was fruitless. Any help? Tons of internets in return! -- http://mail.python.org/mailman/listinfo/python-list