[Solved] How to get file location from QTreeView

  • Hello. I am trying to make a simple application, that can open text files.

    I have made a QTreeView widget that has a model of QFileSystemModel, and I have made a QTextEdit that can read and write to text files.

    Can you tell me how to find file location of file that user has selected in the QTreeView.

  • Got it

    QString string=lista->fileInfo(index).absoluteFilePath();

  • Moderators

    Be sure and edit your first post to add [Solved] to the title if you've got it working. Thanks!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.