351 questions
1
vote
1
answer
40
views
QListView drag and drop items (IconMode)
I have a QListView that is configured like this:
self.added_items_model = ReorderableModel(self.ui.lstViewAddedItems)
lstViewAddedItems = self.ui.lstViewAddedItems
lstViewAddedItems.setModel(self....
0
votes
1
answer
126
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 <...
0
votes
1
answer
106
views
How to get rid of unwanted rounded squares (checkboxes) in QTableView items? [duplicate]
I have a QTableView with some data (numbers), but each cell contains an unwanted rounded square (maybe a non-functional checkbox). They look bad, occupy space, and can obscure my data.
Why do they ...
1
vote
1
answer
188
views
How do I get Qlistview to include all the search details for pdf hits in QPdfSearchModel Class for python like it does in the documentation
When I do a pdf search using the QPdfsearchmodel class my model only seems to include the word I searched for and context before/context after:
However, in the documentation there is also a listing ...
2
votes
1
answer
111
views
With QAbstractListModel, is it necessary to implement insertRows and removeRows if the model is resizable?
I'm implementing a QAbstractListModel-derived class (though this question can apply to QAbstractItemModel as well) that will be a QListView's model. The list view is intended to be a log with a ...
0
votes
1
answer
81
views
UI crashes when deleting the last child of an item in my QTreeView
my UI crashes without returning any error message when I try to delete the last child of an Item in my QTreeView. I saw this post that gave a solution but it dosn't work for me, even if I add those ...
-1
votes
1
answer
75
views
Tree selection clears when data model refresh
I have a treeview in which I have applied sorting/filtering using QSortFilterProxyModel.
When I perform some action on tree item(ex. RMB action), I refresh my data model(QAbstractItemModel).
I am ...
2
votes
0
answers
180
views
Displaying Qt tree through QAbstractItemModel and QModelIndex
I'm trying to display a user defined tree Family_tree through a TreeModel class derived from QAbstractItemModel containing a Family_tree ft_ member and the overrides for the index, parent, data etc ...
0
votes
1
answer
1k
views
Continuously update a QML LineSeries ChartView with a data model from C++
I have a ChartView in QML I'm trying to update from a data model in C++, however, I'm running into certain issues where I can't seem to figure out a way to update the LineSeries properly.
My Sample ...
0
votes
0
answers
436
views
QTreeView not updating after inserting new data in QAbstractItemModel with a QSortFilterProxyModel
I have a TreeView which is displaying items from an AbstractItemModel..
Now I wanted to add extra Filter functionality to my application, but somehow, the data is not visible in the TreeView (after ...
0
votes
1
answer
158
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
85
views
QAbstracktItemModel correctly remove row only for root element
I have a custom QAbstractItemModel
class QJsonTreeModel(QAbstractItemModel):
With this removeRows() method
def removeRows(self, position, rows, parent):
parentItem = self.getItem(parent)
...
1
vote
1
answer
479
views
How is the concept of a "parent" meaningful in a QAbstractListModel?
I have a subclass of QAbstractListModel that is the model for a QML ListView (using PySide6). Each row of the list has a checkbox in it, and when the user checks/unchecks a box, it updates a boolean ...
1
vote
1
answer
559
views
Qt and Python - QIdentityProxyModel does not get the right column count when nested on top of a QSortFilterProxyModel
I have three models, a QAbstractItemModel "sourceModel", QSortFilterProxyModel "proxyModel" for filtering, and a QIdentityProxyModel "dataModel" for modifying columns and ...
0
votes
0
answers
419
views
QT Widget Application freezes during QTableView update from worker
My C++ QTWidget application (both Qt 5.15.2 & also Qt 6.2.0(much worse)) are locking up during a large (~10,000 row) table (QTableView) update from a worker thread.
The rows are very simple and ...
0
votes
0
answers
261
views
Update QAbstractItemModel from external data source
I want to use QAbstractItemModel as many times before which will hold a tree structure from an external model. This model can send notifications before deleting a row and after finishing deleting a ...
2
votes
0
answers
533
views
Create new custom QtQuick view to use with model
I created a custom view to arrange photos in a seamless grid, like Google Photos does (see below). My view is based on QAbstractItemView (Qt Widgets based). I would like to port this to QtQuick, in ...
1
vote
1
answer
451
views
Qt: Attempt to add Drag and Drop to Editable Tree Model example not working
I'm trying to learn how to implement Drag and Drop to model/view settings in Qt. As an exercise, I attempted to do that to the Editable Tree Model example available at the Qt web site:
To extend it ...
1
vote
0
answers
868
views
Subclassing QAbstractItemModel to display nested dict data as a tree
I'm trying to implement tree-like structure using nested dicts to store my data and display it using QTreeView.
The crucial part for me is to track changes made to my data in either nested dict ...
1
vote
2
answers
1k
views
QAbstractItemModel::columnCount - variable column count for each row
We are implementing an QAbstractItemModel structure as shown in diagram below and would like that;
node A to contains 3 data columns
node B to contains 8 data columns
node C to contains 5 data ...
0
votes
0
answers
413
views
Display custom list of files in QTreeView using QFileSystemModel or QAbstractItemModel
I'm building an open source PySide6 app based on the custom file browser in QTreeView.
I've already subclassed QFileSystemModel to display a custom column with some extra data.
Now my goal is to ...
1
vote
1
answer
3k
views
How to insert a new column to a QAbstractTable Model at runtime using PYQT
I have created a model class of type QAbstractTableModel to which I have added a number of methods as shown here:
class resultsModel(QAbstractTableModel):
def __init__(self, parent, headerData, ...
0
votes
1
answer
328
views
Where and when QModelIndex created
Class QAbstractItemModel have a method QAbstractItemModel::createIndex() that creates QModelIndex.
When this object created for each QComboBox item for example?
In documentation we can find:
Note: ...
0
votes
1
answer
499
views
QAbstractItemModel: create a table of parent elements with mapped children
I need to make a table, where each item is parent, having two children (two parameters, that are mapped in lineEdit 'param 1' and 'param 2). Parent value in the table should be a multiplication result ...
0
votes
1
answer
1k
views
QTreeView QAbstractItemModel parent collapses after deleting item and sometimes crashes
Im trying to build a little list of entries within a QTreeView, and based on the example posted here, I got it to delete any child items via the right click context menu i added. but when i delete it ...