Questions tagged [qtreeview]
QTreeView is a class in Qt framework. It provides a default model/view implementation of a tree view.
qtreeview
823
questions
0
votes
0
answers
44
views
Custom QAbstractItemModel or QAbstractItemView like explorer
I've been experimenting with the model view concept in qt and c++ for some time now. My goal is to present the data in a table like Windows file explorer can do...
There is no problem with tabular ...
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 ...
1
vote
1
answer
59
views
Why is this QAbstractItemModel based model not working?
I create a simple QMainWindow app as follows:
The header file:
//mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QAbstractItemModel>
#include <QTreeView>
#include <...
-1
votes
0
answers
23
views
Obtain full details about available default hotkeys on QTreeView?
There are a couple of ways of implementing new hotkey functionality.
But I'm just wondering if there is any way to find out what's there out of the box. Maybe somewhere in the source code? I looked ...
0
votes
0
answers
27
views
PyQt6 TreeWidget not importing colors from ui fil
I am trying to set the individual colors of each line in a QtreeWidget, I have tried setting them manually as I fill the treeView with .setForeground(col, QBrush(QColor(R, G, B, a))) and without the ...
0
votes
1
answer
52
views
What should I do to use a QTreeView child to select a subset of data in a model to show it in a QTableView?
Here I'm trying to create an Qt model/view that shows different subsets of data in a table view from a model depending of the child selected/clicked in the QTreeView, but I'm new at this and the ...
0
votes
1
answer
94
views
Displaying data in different widgets: PySide6
My question is what would be the most efficient way to display an object (in my case Project class) attributes in different widgets? I read that there are proxy models, but I couldn't figure out if it ...
0
votes
1
answer
54
views
Python Qt6 Updating Model Based on View Edits
I am attempting to create a mvc app that can take a JSON file, make a TreeView from it, allow the user to make edits, then save the edits to a JSON file. I am having trouble understanding how to ...
0
votes
1
answer
67
views
Qt6: Disable drawing of default background for QTreeView items
Prior to Qt 6.5 background for items was rendered only when alternating background for items was specified, allowing QStyledItemDelegate to render background independently. This however was changed by ...
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
1
answer
18
views
QTreeView with reorderable elements, but elements should nstay in the same parent folder
i am using PyQt6.
I want to have a QTreeview with reorderable Elements.
But the elements shuld only be moved in the same hierarchy deep than it was, like in this picture, Item 'A1' should only be ...
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
85
views
How can I append directories with many subdirectories to a QTree from a list of paths?
The function I am using works, but not as I would like it to. With each new entry from the list of paths, it adds a new line in the tree instead of appending it to the previous one if the path is ...
0
votes
0
answers
34
views
Vertical scroll bar of Qtreeview is not proportional to the size of the content
When you tested Qtreeview in the application below, the vertical scrollbar normally works proportional to the content.
class MyTreeView(QtWidgets.QWidget):
def __init__(self):
super()....