[PyQt] Tree View QFileDialog?

Andreas Pakulat apaku at gmx.de
Wed Jul 8 07:52:37 BST 2009


On 07.07.09 16:39:27, Brent Villalobos wrote:
> Perhaps I'm missing this, but is there a way to get a directory chooser  
> dialog that shows the directories in a tree view?  I've been using  
> "QtGui.QFileDialog.getExistingDirectory" as a directory-only selector,  
> but I don't have an option to show the directories in a tree view.  I  
> know I've used applications that show directories in a tree (where you  
> can expand/contract nodes) and I was just wondering if Qt supports it  
> out of the box as well and I'm just not seeing it.

When you're using the static methods of QFileDialog (like the above) your
operating system gets to decide how the view that you get looks like. The
static methods always try to use the native file dialogs of your desktop if
available. I'm not 100% sure how Qt's own implementation looks like for
getting a directory, but you can easily find out by using the
constructor+setters+_exec() instead of the class-method.

Andreas

-- 
You are number 6!  Who is number one?


More information about the PyQt mailing list