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
0
votes
0 answers

How to best show the contents of a .zip within QTreeView of a QFileSystemModel

In my current program I have a QTreeView that is modeled from QFileSystem as follows: self.model= QFileSystemModel() self.model.setRootPath('') self.model.setFilter(QDir.Dirs | QDir.NoDotAndDotDot | QDir.Files) …
0
votes
1 answer

How to drag and drop files items inside a folder item using QFileSystemModel and QListView?

I'm creating a widget to explore and manage files inside my qt application. To construct that, I'm using a QFileSystemModel and a QListView with the IconMode view mode. It should allow moving files (items) into folders (other items) with the…
E.G. Cortes
  • 65
  • 12
0
votes
0 answers

pyqt5 QTreeWidget implement like filesystemmodel

I want to implement filesystemmodel with QTreeWidget. I tried with setModel(QFileSystemModel) but it was private method so I can't use it, I think I should customize it. I want to implement drag and drops of child node and create directory etc like…
dauren slambekov
  • 378
  • 3
  • 15
0
votes
1 answer

Applying two FileFilterProxyModel on one QFileSystemModel

The problem: I am making a sort of file explorer, that has one view of the directories, and another view shows the files in the selected directory. So the idea was to have one QFileSystemModel, and apply two FileFilterProxyModel's on it, one to show…
dkish
  • 319
  • 3
  • 13
0
votes
0 answers

PyQt5 adding a folder to QFileSystemModel

I am trying to make a QListView where it only shows specific folders on my computer. Note that the folders can be in separate directories. I am using QFileSystemModel for my QListView, but cannot find a method that appends a folder to the end of my…
Evan Zhao
  • 70
  • 1
  • 7
0
votes
1 answer

Why expanding in QTreeView may work incorrectly?

I'm trying to create a small app, which will find, read and export some *.xml documents. App must read the hierarchical folder structure and visualise it in QTreeView on the form. For better managing I want it to expand all objects of treeview on…
0
votes
0 answers

Qt custom QFileSystemModel to group sequential files

I am trying to create a file browser which will group sequential files in the same director together in a tree view. For example if you had the following files in a directory: img.001.png img.002.png img.003.png, images 2 & 3 would appear as…
Spencer
  • 1,931
  • 1
  • 21
  • 44
0
votes
1 answer

Change Root Path of Model during runtime - PyQt5

I have a QWidget where I use QTreeView und QFileSystemModel. I created a function which receives a path. If it is a valid path I expect the TreeView to update its root to the given path. This part works so far flawlessly. But if there is no path…
0
votes
1 answer

How to scroll to current index?

I am making a file browser using QTreeView and QFileSystemModel. It must be selected and scroll the tree to a selected item automatically. But it doesn't work scroll automatically without getting keyboard. QString strFile =…
tnrgus
  • 355
  • 1
  • 2
  • 14
0
votes
1 answer

Can't move/rename/delete folder while some of its subfolders are expanded in QFileSystemModel

I'm developing a Qt application on Windows. To show the files of a specific folder, I'm using QTreeView together with QFileSystemModel. So far so good, but I came across a very specific issue which is driving me nuts: while I'm with a folder…
0
votes
1 answer

Hide items of a QFileSystemModel/QTreeView via indexes using a specific rule

I'm displaying the contents of a folder in my Qt program using a QTreeView + QFileSystemModel. Now I want to hide specific items of that view. The display rule is not based on the file names, so I can't use setNameFilters(). What I have is a simple…
0
votes
0 answers

QFileSystemModel and Listview to list directories

I have a problem using QFileSystemModel and Listview (qml). I want to use 2 listviews: - one to list directories of a directory - one to list files available in the directory selected in the first view At first, I am trying to list directories in a…
boudafc
  • 1
  • 1
0
votes
0 answers

Qt: extend QFileSystemModel with another model

I have a Qt model that represents the content of hdf5 files (but it can be any other container type for this matter). Can I "extend" QFileSystemModel by this specialized model in order to browse files and container items in a single tree view? I…
klmn
  • 113
  • 1
  • 1
  • 6
0
votes
1 answer

Qt: What's the difference between remove() and rmdir()

QFileSystemModel* _dirModel = new QFileSystemModel(this); . . _dirModel->rmdir(index); _dirModel->remove(index); "rmdir" seems to be made for removing directories, but I succesfully deleted directory with "remove" as well. What's the point of…
iamalminko
  • 105
  • 8
0
votes
1 answer

Using QFileSystemModel's features for arbitrary list of files (not a directory)?

I've created a frontend to the UNIX locate command. Right now I'm just feeding the filenames from locate's output to a QListWidget. From the documentation it seems QFileSystemModel is better suited for displaying filenames (it automatically shows…
sashoalm
  • 75,001
  • 122
  • 434
  • 781