1

I am trying to show remote directories with QFileSystemModel. But it shows me root of localhost. Here is my part of code:

mFileSystemModel = new QFileSystemModel(this);
mFileSystemModel->setReadOnly(true);

mFileSystemModel->setRootPath("st@192.168.4.3:/sql.db");

ui->treeView->setModel(mFileSystemModel);

ui->treeView->setRootIndex(mFileSystemModel->index("st@192.168.4.3:/sql.db"));

However in treeView I see root ("/") of my localhost computer. Could you please help me how I can make ssh and show remote files?

goGud
  • 4,163
  • 11
  • 39
  • 63

1 Answers1

1

I think it only works for the local file system, but it will work if you can mount the remote files to your file system.

The QFileSystemModel class provides a data model for the local filesystem.

dtech
  • 47,916
  • 17
  • 112
  • 190
  • I see, so how can I get those files? Do you have any idea? – goGud Apr 20 '16 at 10:28
  • As I already said, you must mount them to your local file system https://www.google.com/search?q=ssh+connection+mount&ie=utf-8&oe=utf-8&gws_rd=cr&ei=HFsXV6aLJ4Gb6AS63YWAAw – dtech Apr 20 '16 at 10:35