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
3
votes
1 answer

populating combo box with folders on disk using QFileSystemModel

Hi I have written this basic code trying to populate folders underneath the /Users/ directory, but I don't know what I am missing its not populating. import sys from PyQt4 import QtGui from PyQt4 import QtCore class MyWindow(QtGui.QWidget): …
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
3
votes
1 answer

ScrollTo a file in QTreeView with a QFileSystemModel on start-up

Last few hours I've been reading but not finding a good solution to what would seem a simple common problem. I have a QTreeView with a QFileSystemModel. I want to set the current index to the last file saved by the user and to scroll to that…
Noe
  • 188
  • 1
  • 6
3
votes
0 answers

How to Sort the System Drives in QTreeView using QSortFilterProxyModel

I have a QTreeview where I am displaying all system drives using QFileSystemModel. I am looking for much better approach where a QTreeview can display Local Drives in one section, Removable Drive in another and so on. Basically sort the drives. Here…
Kreator
  • 39
  • 1
2
votes
1 answer

Custom QFIleSystemModel with QFileDialog

I am currently implementing a project system that uses an archive instead of a directory to hold subfiles. I keep a data structure that holds the project's virtual file system, and write it out as need be. I am now trying to implement the graphical…
beta
  • 647
  • 5
  • 19
2
votes
1 answer

PyQt : Editable QFileSystemModel in a QTreeView

I've got this on my file System : - myFolder - mySubFolder Within the TreeView I expand the folder "myFolder". Then I rename it as "myFolder_2". And finaly I try to rename the folder "mySubFolder" as "mySubFolder_2". "mySubFolder_2" in is…
J.D.
  • 45
  • 1
  • 6
2
votes
1 answer

QFileSystemModel and QFileSystemWatcher delete from disk

I have a QTreeView which is populated through a reimplementation of QFileSystemModel. As far as I know, QFileSystemModel installs a QFileSystemWatcher on the rootPath. What I'm trying to do is notify in my program when a file is being deleted…
Marco Antonio
  • 73
  • 1
  • 5
2
votes
1 answer

how to hide file extensions on a QFileSystemModel

I have bound a QFileSystemModel to a QTreeView. How can I hide the file extensions keeping the rename functional ? Meanwhile hide extension in the rename mode to avoid a wrong extension Thanks my code as below: import sys from PyQt5.QtCore import…
Mike
  • 37
  • 4
2
votes
1 answer

QFileSystemModel QTableView Date Modified highlighting

I am trying to make a little file browser using QFileSystemModel and QTableView. I was wondering if it is possible to highlight rows with same value in "Date Modified" column, for instance if I have two or more files which been modified today row…
2
votes
1 answer

Files still showing after calling QFileSystem::setNameFilters

I just make a simple example about showing files/directories using QFileSystemModel and QListView. It works fine. And I want to filter some types of files I define. QStringList list; list << "*.jpg" << ".png"; model.setNameFilters(list); the files…
catinred
  • 329
  • 4
  • 12
2
votes
1 answer

Hide Size, Type and Date modified columns in QFileSystemModel

I want to remove the following: I just want to show 'only' the file names. This is my QTreeView Code: self.model = QFileSystemModel() self.model.setRootPath(QDir.rootPath()) self.model.setFilter(QDir.NoDotAndDotDot | QDir.AllEntries | QDir.Dirs |…
JareBear
  • 467
  • 9
  • 27
2
votes
1 answer

How to get selected item in QFileSystemModel and QTreeView

I want to get the file path and the file name from a Tree View in pyqt5. I had it working, but I wanted to implement searching, which works, but doing that I sacrificed the ability to get the filename and file path. This is my tree: class…
JareBear
  • 467
  • 9
  • 27
2
votes
1 answer

Why my QFileSystemModel QModelIndex couldn't get child node infomation?

I am learn about Model/View architecture in pyqt, but when i follow the Using model indexes instruction and try to write a demo in pyqt5 style.The QModelIndex couldn't get child node information? The code: class DemoB(QPushButton): def…
jett chen
  • 1,067
  • 16
  • 33
2
votes
1 answer

How to display parent directory in tree view?

In my application I have a QTreeview. I have a folder named "test" that contains many subfolders. The treeview only shows the subfolders not the test forlder it self! def create_treeview(self): self.treeView = QTreeView() …
Rafa
  • 467
  • 4
  • 18
2
votes
1 answer

QTreeView with QFileSystemModel is not working properly

I set QFileSystemModel root path and then set it as QTreeView model, but if I try to find index of a speciffic file it is giving me D: I am sure the file is there ! self.model =…
2
votes
1 answer

How to filter files in qlistview python

I am trying to filter elements in listview from the dropdown option user selected. Here is my code so far. class DirectoryView(QWidget): def __init__(self): super().__init__() self.layout = QHBoxLayout(self) self.listview…
Abdul Ahad
  • 99
  • 2
  • 9
1 2
3
12 13