0

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 filesystem model Who did this do before? If so, Pls help me with the code.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
dauren slambekov
  • 378
  • 3
  • 15
  • use QTreeView .... + QFileSystemModel – eyllanesc Jun 20 '20 at 02:19
  • Hey, I dont want to use filesystem. I just want to use custom tree that do like filesystem. – dauren slambekov Jun 20 '20 at 02:46
  • 1) What about QFileSystemModel is an option, the important thing about my previous comment is that you should use QTreeView since, as I pointed out in my related answer, QTreeWidget has a read-only model unlike QTreeView that if you can set any model (either QFileSystemModel or your custom model), 2) If you consider my action to be against SO rules then please report it to a moderator. – eyllanesc Jun 20 '20 at 02:53
  • Of course I know about filesystem model, but it support only for real file system. I want to get customized tree widget – dauren slambekov Jun 20 '20 at 02:55
  • You point out that you already have a custom model (it is understood that it is a class based on QAbstractItemModel) with your comment: *I tried with setModel(QFileSystemModel) but it was private method*, and that you cannot place it in a QTreeWidget since that class does not allow to set models so I point again: use QTreeView – eyllanesc Jun 20 '20 at 02:59
  • Do you have multiple accounts in SO? I find it strange that 2 users ask the same thing. – eyllanesc Jun 20 '20 at 05:25
  • Who is he? same question? What do you mean? – dauren slambekov Jun 20 '20 at 05:28
  • See https://stackoverflow.com/questions/62481560/combine-qtreewidget-and-filesystemmodel-pyqt5 – eyllanesc Jun 20 '20 at 05:28
  • He is from india and memeber 3 years ago. I just member from 2 months – dauren slambekov Jun 20 '20 at 05:30
  • mmm, it is common for a user to create accounts later to get points and have more privileges like posting more questions. Why do you say he is from India? – eyllanesc Jun 20 '20 at 05:34
  • Oh , I can't understand why you are so bad for me. I didn't do any harm action to you before. Please forgive me. I am a honest man. I just guessed from his name so he is india – dauren slambekov Jun 20 '20 at 05:35

0 Answers0