Questions tagged [qfilesystemmodel]

A QFileSystemModel is a class from the Qt toolkit which provides a data model for the local filesystem.

The QFileSystemModel class gives access to the local filesystem. It provides functions for renaming and removing files and directories, and for creating new directories. In the simplest case, it can be used with a suitable display widget (such as a QTreeView) as part of a browser or filter.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

187 questions
1
vote
2 answers

How to hide an item from QFileSystemModel in QTreeView in PySide?

I cannot figure out how to hide an item or a row from QFileSystemModel? After using removeRows nothing happens. I've also tried self.model.beginRemoveRows(QtCore.QAbstractItemModel.index(), 0, 10) self.model.endRemoveRows() With no result.…
Kowalski Paweł
  • 594
  • 1
  • 6
  • 27
1
vote
0 answers

QIconProvider's icon method is called for files that are not in the filter

I am trying to populate a QListWidget (in icon view) with a QFileSystemModel. I want to list folders and only files with specific extension. I want to show the preview of my files as their thumbnail, so I am subclassing QIconProvider class and I am…
willy
  • 487
  • 5
  • 21
1
vote
1 answer

How to connect the QFileSystemModel dataChanged signal in PyQt5?

I'm trying to connect the QFileSystemModel.dataChanged signal, but with no luck so far. The code below is spawning this error: TypeError: bytes or ASCII string expected not 'list' import sys from PyQt5 import QtGui, QtWidgets, QtCore from…
BPL
  • 9,632
  • 9
  • 59
  • 117
1
vote
2 answers

How to add extra data to qfilesystemmodel items?

I'm trying to make an pyqt app, which examines directory structure and the files in it. What I want to do is to add some extra info to the items in the qfilesystemmodel, for example, tagging files as 'checked' or 'unchecked'. I have found that each…
1
vote
1 answer

QFileSystemModel with FTP

I have the listing of a FTP server as a list of strings. Is there a way to give the list to the QFileSystemModel and display the files without existing on the local system ?
1
vote
1 answer

How to hide Particular directories in QFileSytemModel

I have a QFileSystemModel which is use as a model in QTreeView . This work fine now I have names of some directories. Which I want to hide in QTreeview. QString strCompleteDirectoryPath = "/Volumes/"; QTreeView *SourceTreeView = new…
Rohit Chauhan
  • 151
  • 1
  • 3
  • 14
1
vote
1 answer

How to show remote files with QFileSystemModel? (SSH connection)

I am trying to show remote directories with QFileSystemModel. But it shows me root of localhost. Here is my part of code: mFileSystemModel = new…
goGud
  • 4,163
  • 11
  • 39
  • 63
1
vote
1 answer

Getting the index in the tree view for the available path

I have constructed a checkable tree-view listing files / folders. I am saving the files / folders that are checked, and writing them to a file. When I launch the tree-view again, I want it checked for all the paths I saved. But I am unable to get…
Harsh
  • 72
  • 1
  • 7
1
vote
1 answer

How to get an icon associated with a certain file type using PyQt/PySide?

I have a QListView that adds a newly added file to a folder using QFileSystemWatcher, however I also want QListView to show the icon for that filetype just as QFileSystemModel would add. I do not want to add any custom icon only the icon that…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
1
vote
1 answer

QTreeView QFileSystemModel - limit expandable to only root

I'm using QTreeView and QFileSystemModel. I want only the root to be expandable, showing 1 level of subdirectory and that's it, the subdirectories should only be selectable but not expandable. Any guidance how I can archive this please? Thank you.
Panupat
  • 452
  • 6
  • 21
1
vote
1 answer

Show "Windows Libraries" in QTreeView and QFileSystemModel

I have a QTreeView in my program for picking a directory on Windows OS. It works, however, some users complain that in order to pick My Documents they must expand C:\Users\\Documents, which is quite slow. They'd prefer to access…
Andrej Repiský
  • 477
  • 1
  • 6
  • 19
1
vote
1 answer

How to update file permissions in a QFileSystemModel

Is there a way to update a file's permissions in QFileSystemModel (c++)? Prior to allowing a user to rename a file listed in the model using a qtreeview, I make sure the file gets checked out of source control. At this point the file is no longer…
1
vote
1 answer

Using QFileSystemModel in PySide, getting the item from the index

I had a look for the answer to this but couldn't find anything on here so I'm asking it. With QStandardModel it is fairly straight forward to get the item from the QModelIndex with the command function itemFromIndex. model = openedIndex.model() item…
ceorron
  • 1,230
  • 1
  • 17
  • 28
1
vote
1 answer

Hide a folder from a QFileSystemModel

I would like to know how to hide a specific folder in a treeView with QFileSystemModel. I know that we can filter folders to show only some files using setFilter but I don't know how to filter a folder. I want to display folders except one. I know…
Jeanstackamort
  • 309
  • 2
  • 4
  • 16
1
vote
1 answer

Qt 5 running file from treeView and QFileSystemModel

The issue is that I've only recently started c++ programming. My question is as follows: How do I make the file viewed in mainwindow/treeview run? The document to view is a plain text document with a static path. sPath is the path to the directory…