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

PySide: QFileSystemModel - Display/Show Root Item

i am using QFileSystemModel to display subdirectories of a set root path in a QTreeView. Works all fine but it would be very nice to also see the Root item as it is hidden right now. model =…
zwusel
  • 171
  • 12
2
votes
1 answer

TypeError : decorated slot has no signal compatible with doubleClicked(QModelIndex)

i was working on a project and i have deleted it by mistake. so while i was rewriting it i found a problem. i have this QDialog that shows Directory View with (QTreeView), and when i try to launch it from QMainWindow(Parent Class) it fails. so this…
user10567350
2
votes
1 answer

How to add a custom role to QFileSystemModel

I would like to add a custom role to a QFileSystemModel (probably to a derived model). I want to use this role to save the check state of a CheckBox which is displayed next to the filename in a custom delegate. How can this be done?
maxwell
  • 357
  • 4
  • 14
2
votes
0 answers

Qt WinRT Originate Error - 0x40080201

I am running into a peculiar issue with a Qt C++ application I am working on. For testing purposes, I tried this with a brand new project and I still get the same exceptions. I am using QFileSystemModel and displaying it inside a QTreeView and it…
Xesiius
  • 35
  • 6
2
votes
1 answer

SetRootPath doesn't set work as expected

I have used part of a code (PyQt5) from this post from PyQt5.QtWidgets import QTreeView,QFileSystemModel,QApplication class Main(QTreeView): def __init__(self): QTreeView.__init__(self) model = QFileSystemModel() …
Jakob
  • 31
  • 6
2
votes
2 answers

How to exclude mapped network drives from QFileSystemModel in QT?

I'm using a custom subclass QFileSystemModel in a treeview to allow users to select folders using checkboxes. My problem is that Mapped network drives are listed as hard drives, but I cannot operate on them, So I want to only show local drives. How…
ShayanOH
  • 132
  • 1
  • 10
2
votes
1 answer

Using QFileSystemModel to display only one directory

Is it possible to use QFileSystemModel to list only one directory contents instead of all drives in my computer (in Windows)?
Imran
  • 87,203
  • 23
  • 98
  • 131
2
votes
0 answers

Strange behavior with QTreeView / QFileSystemModel / QLineEdit

I have a QTreeView linked to a QFileSystemModel. I also have a QLineEdit with two purposes : when the user click the QTreeView, the QLineEdit is populate with the item clicked (path & filename if applied) when the user edit the QLineEdit and press…
Aesope
  • 445
  • 6
  • 15
2
votes
1 answer

background color for certain items(rows) in QFileSystemModel QTreeView

How do i set a custom background color for certain rows in a QFileSystemModel applied on a QTreeView?
Shinnok
  • 6,279
  • 6
  • 31
  • 44
2
votes
1 answer

How to delete Size, Type, Date Modified in QFileSystemModel?

I use the QFileSystemModel, but I just want to show the tree directory in QTreeView. I dont want to show Size,Type and Date Modified. This is my code: def setFileModel(self): self.model = QtGui.QFileSystemModel() …
Minh Tuan Nguyen
  • 137
  • 2
  • 2
  • 11
2
votes
2 answers

QTreeView and QFileSystemModel for showing only USB drives

I'm trying to write a dialog that allows the user to select from among any mounted USB drive found on the system. In Windows, I can definitely get this information manually, using calls to both GetLogicalDriveStrings and GetDriveType, so I could…
bmahf
  • 965
  • 2
  • 11
  • 27
2
votes
2 answers

My QFileSystemModel doesn't work as expected in PyQt

EDIT2: model.hasChildren(parentIndex) returns True, but model.rowCount(parentIndex) returns 0. Is QFileSystemModel just fubar in PyQt? EDIT: With a bit of adaptation this all works exactly as it should if I use QDirModel. This is deprecated, but…
Skilldrick
  • 69,215
  • 34
  • 177
  • 229
2
votes
1 answer

How to refresh a QFileSystemModel in a QTreeView after files change through another process?

I have a QTreeView with a QFileSystemModel as the model. Files and directories load correctly. In my application workflow, a different process copies and overwrites files on the file system. However, my QTreeView does not update the item/row for…
GraehamF
  • 1,971
  • 24
  • 24
2
votes
2 answers

QT - QFileSystemModel on server-client program

I am working on a server-client QT project that allows to transfer files between server and client. Being a GUI project, I want to display the server's file system on client program, like a file explorer. The question is : is there a way to send…
2
votes
1 answer

Filtering QFilesystemModel

I'm using a QFileSystemModel with a QListview to display all files from a directory. I'd like to filter that model to display some categories of files like : textual files : *.txt *.csv *.tab music : *.mp3 *.flac *.ogg movies : *.avi *.mkv My…
dlewin
  • 1,673
  • 1
  • 19
  • 37