I am very new to Pyqt5 and am trying to build a GUI. I made a QtreeWidget
under Qdockwidget
.
When I try to set QFileSystemModel
with <
The QTreeWidget only has a read-only model so you cannot replace it with another model, so in your case the error message tries to evidence it.
The solution in your case is to change it to QTreeView:
self.treeWidget_2 = QtWidgets.QTreeView(self.dockWidgetContents_5)
In addition, you must also delete the following line of code:
self.treeWidget_2.headerItem().setText(0, "1")