829 questions
1
vote
0
answers
43
views
How to make QTableView's drag selection behave like a QTreeView
There's a difference in behaviour between QTableView and QTreeView when it comes to selecting multiple items by dragging the mouse.
In a QTreeView you can start outside the populated area and drag ...
6
votes
0
answers
114
views
Updating mouse cursor in Qt based on whats underneath
I'm currently overriding mouseMoveEvent to update mouse cursor based on what's beneath it.
This works pretty well, but I noticed one scenario where it fails. Scrolling.
If the widget has scroll bars, ...
0
votes
0
answers
50
views
QTreeView/QFileSystemModel sort behavior in PyQt6 differs from PyQt5 -- bug or intentionally changed feature?
I have an application using a QTreeView widget and a subclass of the QFileSystemModel. The purpose of the subclass is to modify the way sorting is done on file type (col 2).
With PyQt5, items are ...
0
votes
0
answers
51
views
Indicate QTreeView is Busy Expanding Node
I'm using a QTreeView to display a directory tree rooted at an SSHFS mount. This works well, but if I expand a node containing ~150 files or more there is a significant delay between clicking the '>...
3
votes
0
answers
112
views
How to set viewport margins on a QTreeView?
I'm trying to set a margin on the top side of a QTreeView viewport.
I tried setViewportMargins but it doesn't change anything.
I also tried adjust the painting rect directly at drawRow: opt.rect....
3
votes
2
answers
116
views
How to remove the area on the left of QTreeView first column?
How can I remove this area seen inside the red rectangle?
Things I have tried:
setIndentation(0);
setRootIsDecorated(false);
overriding drawBranches
Styling it with QTreeView::branch and setting ...
0
votes
1
answer
107
views
PyQt6 QTreeView Drag & Drop Indicator Not Showing After Overriding Drag Events
I'm trying to implement drag-and-drop functionality in a QTreeView widget in PyQt6. I have enabled drag-and-drop support using setDragEnabled(True), setAcceptDrops(True), and setDropIndicatorShown(...
1
vote
0
answers
77
views
QTreeView dotted rectangle around selected (or active) cell
I'm using QStandardItemModel to populate a QTreeView which contain more than a single column (i.e., a fusion of ListView and TreeView functionality). The problem is, no matter what I do, I cannot get ...
1
vote
0
answers
54
views
PyQt5 Crashes when I open a folder which contains files with .json or .js extension in QTreeView
I work in VSCode on Ubuntu LTS 24.04.
I use PyQt5.
I have the following folders with files in the root path of my project:
I use the following code:
from pathlib import Path
from PyQt5 import ...
0
votes
1
answer
96
views
QTreeView Pyside6 not sorting 2 last columns of QstandardItem
I build a tree as illustrated on the image.
I want the tree to be able to sort each column.
This works for the Well Name column and Depth type column (I may have different depth type called "...
0
votes
1
answer
77
views
Build Qtreeview with expandable item in column 1, 2 or 3 instead of column 0
I am trying to achieve a Treeview like this:
It is easy to do with a QtreeWidget, however I am struggling to achieve the same thing with a QtreeView.
Every time I try to insert a row with empty cells ...
1
vote
0
answers
56
views
a shortcut file in QTreeView and QFileSystemModel-Python
I encounter a problem using Qtreeview and QFilesystemModel in Pyqt5 with Python Ver3.12. a shortcut file will be shown as a target folder in the Qtreeview. so if I would like to select this shortcut ...
0
votes
0
answers
221
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
89
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
1
answer
127
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 <...