[Qt-creator] extracting path/filename from selected file in navigationwidget(Project)

Daniel Teske Daniel.Teske at theqtcompany.com
Thu Apr 9 12:30:56 CEST 2015

Am Donnerstag, 9. April 2015, 09:17:45 schrieb Hermann Fieger:
> After including  following line
>  "#include <projectexplorer/projectnodes.h>"
> i was able to compile.
> ProjectExplorerPlugin *plug = ProjectExplorerPlugin::instance(); // OK
> ProjectExplorer::Node *nod  = plug>currentNode();                // OK
> QString qs_path = nod->path();                                   // OK
> Now it compiles all, but crashes, because "nod" is NULL.
> So i think i made a wrong assumption. I 've not an open project,
> because i deal with python3.
> What i have to do, is to extract the path and filename from
> the "Filesystem" navigation widget and not from the "Project"
> navigation widget.

The file system view is implemented in FolderNavigationWidget and the rlated 
classes. There's no api that gives you the currently selected file in the that 
widget though.


More information about the Qt-creator mailing list