Python Forum
[PyQt] Adding a new file/node to QFileSystemModel
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Adding a new file/node to QFileSystemModel
#2
I would not expect such a thing. Unlike remove, rmdir and mkdir, file creation requires you to specify a mode, and is usually associated with writing to the file.

File creation is missing in the description of QFileSystemModel.
Quote:Detailed Description
This class provides access to the local filesystem, providing 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 as part of a browser or filter.

QFileSystemModel can be accessed using the standard interface provided by QAbstractItemModel, but it also provides some convenience functions that are specific to a directory model. The fileInfo(), isDir(), fileName() and filePath() functions provide information about the underlying files and directories related to items in the model. Directories can be created and removed using mkdir(), rmdir().
DrakeSoft likes this post
Reply


Messages In This Thread
RE: Adding a new file/node to QFileSystemModel - by deanhystad - Feb-06-2023, 01:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Part of code is adding extra new line when saving to text file. lovepeace 9 5,202 Aug-24-2019, 12:52 PM
Last Post: lovepeace

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020