All Questions
125
questions
1
vote
3
answers
43
views
Prevent root items from being dropped onto another root item in PyQt5 QTreeView
I'm working on a PyQt5 application where I have a QTreeView populated with a QStandardItemModel. The root items present documents and the child sections within the document. So they should not be ...
0
votes
2
answers
38
views
Prepend a main row counter as first column/text to QTreeView in PyQt5?
The example code below generates a GUI like this:
What I would like, is to prepend a row count before the main entries only (a, b and c in the image), as shown on the manually edited image:
How can ...
0
votes
0
answers
52
views
I am encountering issues on making a custom file browser with PyQt5 using QTreeView, QStandardItemModel and QStandardItem: my program randomly crashes
I am here to ask your help as my last hope to get out of this hell.
Just to be clear, I am not here for reading comments like: there is a builtin in PyQt for what you are doing etc... I know it, its ...
0
votes
1
answer
27
views
displaying several treeviews one below the other
I have a project that consists in displaying a datamodel using qtreeview from a folder that contains several files. I displayed a treeview of a single file but i couldn't display several treeviews one ...
0
votes
1
answer
263
views
Select QStandardItem inside a QTreeView based on another QTreeView's QStandardItem's visual position
i have a lot of data that i represent as QStandardItems inside two QTreeViews. I want to retrieve the visual position of an item inside the left tree in order to align the selection of it with the ...
1
vote
1
answer
698
views
How to sort items in Qtreeview in pyqt5?
How to sort items in QTreeview by the following concepts ?
Ascending Order ( From A to Z, 0 to 9)
Descending Order ( From Z to A , 9 to 0)
Given Order or Original order by user ( From A to Z )
...
0
votes
0
answers
109
views
I'm trying to save the state of qtreeview with the directories expanded or not (load in the state I left when I closed .) using Qsettings but I can't
I am using the code below. Mainwindow's state is preserved but qtreeviw's is not.
import sys
from PyQt5.QtCore import QSettings, QByteArray
from PyQt5.QtWidgets import QApplication, QTreeView, ...
0
votes
0
answers
66
views
pyqt5 treeview refresh with nas server
i have create a simple file namager with pyqt5 and QTreeView().
W΅hen my path is local folder ...creating ,deleting etc from the app it show it in treeview without problem , example path
C:\Users\...
0
votes
0
answers
80
views
Open a new window through a Treewidget child in PYQT5
I´ve been dealing these last days with a problem regarding enabling a treewidget child to perform actions as opening a new window for example by clicking on it.
I appreciate any help,
this is the code:...
1
vote
1
answer
623
views
Expanding item in QTreeView in PyQT5
I'm trying to learn PyQt and follow its documentation. So I have this simple code which is supposed to expand a selected item in a QteeView. Documentation https://doc.qt.io/qt-5/qtreeview.html#expand ...
0
votes
1
answer
161
views
Editing entries of QTreeView with QFileSystemModel
I have written a program to en/decyrpt files and folders (including the names of them). The encrypted folder looks like that:
- rootFolder: folder
- 19479: folder
91039 ...
0
votes
0
answers
18
views
Move forward and backwards between Items in QTreeView [duplicate]
I have a QTreeView with a QStandardItemModel and QStandardItems. I want to add buttons that lead from one element to the next or to the previous element. Getting the index from the current element ...
0
votes
1
answer
134
views
Can`t get QTreeView model of QSortFilterProxyModel() outside of the init function
I have an application which displays JSON-file to the QTreeView. For this I created my own QJsonTreeModel(QAbstractItemModel) class for QTreeView model
In my MainWindow.py I implemented it like this:
...
0
votes
1
answer
216
views
Insert child item to dict() in QAbsrtactItemModel
I have the next QJsonTreeItem with insertChildren() function::
class QJsonTreeItem(object):
...
def setData(self, column, value) -> None:
if column is 0:
self.key = ...
-2
votes
1
answer
168
views
Is it possible to add dict() or list() to insertRows() in QTreeView
I have this TreeItem:
class QJsonTreeItem(object):
def __init__(self, data, parent=None):
self._parent = parent
self._key = ""
self._value = ""
self._type = None
...