I am using QTreeView in PyQt5 to organize some data. A simple example of the serult can be reproduced with this code: import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QTreeView from PyQt5.QtGui import QStandardItemModel, QStandardItem from PyQt5.QtGui import QFont class StandardItem(QStandardItem): def __init__(self, txt): super().__init__() fnt = QFont(‘Open Sans’, 12) self.setEditable(False) self.setFont(fnt) self.setText(txt) class TreeApp(QMainWindow): ..
I want to organize some data in PyQt5 using QTreeView widget. My data has more than one column. My problem is, I can not find a simple function with which I can set the names of the columns (the headers). On some sites, I found that I should use QHeaderView, but I don’t understand how ..
I am started to use PyQT5 as a framework for a small project. I just need some template or some information on how I should plan this out. Description: I have two views created both of them should technically use the same dataframe from pandas but I have issues on figuring what I need to ..
I have a QTreeView with column header filters but would like to use a QTableView. Problem: I don’t know how to rework the header functionality for a QTableView. If I just switch the utilized class from QTreeView() to QTableView() I get dozens of error like AttributeError: ‘QTableView’ object has no attribute ‘setHeader’ Currently it looks ..
I’m using a treeview with a QAbstractItemModel and a custom QStyledItemDelegate. I’m removing the children of a row when I change the value of a QComboBox which leads to my model receiving a parent() call with a corrupt index. The GIF below should clarify what I’m doing. The second row b has two child elements ..
I am trying to create an application that will be getting data through an API and present them in QTreeView, using PySide6. As it takes a long time to get the data I want to retrieve them using a QThread. My example code is the following: import logging import time from PySide6.QtCore import * from ..
I am creating a Qtree view for the file manager I want mouse click event changed If arrow icon click (on the far left): expand of collapse item if item click (Space Except Arrow Only): just select if empty area click: clear select Here’s how you used it def mousePressEvent(self, event): if self.index.isValid(): if event.x() ..
I have recently been put onto a project which is using PyQt. It was using Qt4, but due to the pains of installing it on up-to-date systems, along with all other tools and packages, I decided to update everything to Python3, Qt5, etc.. In the old code, self.selectionModel().selectionChanged.connect(self.selection_changed_event) Was valid and worked. @QtCore.pyqtSlot("QTreeView, QItemSelection, QItemSelection") ..
I have something like this: I can’t show you more, but this is a simple QTreeView with QStandardItems in it. The items in the figure have a parent item which has a parent item as well. When I activate the breakpoint on a item I have this: which is ok but I also would like ..
I’m making a custom QTreeView with QFileSystem model, and I have a MouseMoveEvent set up to print the path of the item that is hovered over. I’m way down the rabbit hole and doing all kinds of weird things to make this work. Here is the latest minimal reproducible code: from PyQt5.QtWidgets import * from ..