[Qt-interest] Add a QDir to a form

Andre Somers andre at familiesomers.nl
Mon Oct 3 22:21:04 CEST 2011


Op 3-10-2011 22:08, Cole, Derek schreef:
> So that seems to have me going down the right path. Do you know if 
> there is any kind of convenience method for finding the absolute path 
> of the currently selected directory that I am showing in a treeView?
Sure. QFileSystemModel has some additional data roles you can use for 
that (the getting the path part). For getting the current item, you can 
use QTreeView::currentIndex();

André

> ------------------------------------------------------------------------
> *From:* qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com 
> [qt-interest-bounces+dcole=integrity-apps.com at qt.nokia.com] on behalf 
> of Andre Somers [andre at familiesomers.nl]
> *Sent:* Monday, October 03, 2011 2:24 PM
> *To:* qt-interest at qt.nokia.com
> *Subject:* Re: [Qt-interest] Add a QDir to a form
>
> Op 3-10-2011 20:19, Cole, Derek schreef:
>> Hello,
>>
>> I am trying to build a pop-up dialog that would allow my users to 
>> select a directory, select some options, and click "Go" to run a 
>> process on files in the directory. I would like to make a dialog that 
>> contains the same type of "Select a directory" logic as a QDir can 
>> give me, but allows me to add some other labels, radio buttons, drop 
>> downs, etc, so that all of the options for a particular directoy can 
>> be set in one window. is this possible?
>>
> Sure. Take a look at QFileSystemModel, set the apropriate filters to 
> only show directories, and display the model using a QTreeView.
>
> André
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111003/11fc23cd/attachment.html 


More information about the Qt-interest-old mailing list