smallB
smallB

Reputation: 17110

How to get the *full* filepath of a selected file via QFileSystemModel?

How to get a filepath via QFileSystemModel? Selecting via selection model returns just file name, or drive name.

Note, that just file name isn't enough. Whole filepath is needed.

Upvotes: 3

Views: 5258

Answers (2)

Stefan Koenen
Stefan Koenen

Reputation: 2337

On qt website: http://doc.qt.io/qt-5/qfilesystemmodel.html

QString QFileSystemModel::filePath ( const QModelIndex & index ) const Returns the path of the item stored in the model under the index given.

I dont know if this answers your question, else you can give us some code about what you tried / are trying to reach.

Upvotes: 7

v01d
v01d

Reputation: 1507

You can do this by using something like this QFileSystemModel::filePath(index).

Upvotes: 0

Related Questions