213 questions
1
vote
0
answers
49
views
QTableview in PySide6 calls data() multiple times for rows that should not be visible
I have tested QTableview in pyside6 using the code below. When QTableview gets focus and we minimize the window when we restore the window suddenly the data() procedure can be called multiple times ...
0
votes
0
answers
75
views
How to combine QtGraphs and XYModelMapper?
How can I map the X- and Y-values from the QAbstractTableModel to QML Mapper in QtGraphs?
There must be some commands I have to fill in these QML code lines:
GraphsView {
antialiasing: true
...
0
votes
0
answers
69
views
How to create a proper QAbstractTableModel subclass from PyQt5 for a pandas dataframe? [duplicate]
I have coded up this custom subclass for my project based on the multiple refrences online however when I run my project I get an empty window.
class TableModel(QAbstractTableModel):
def __init__(...
1
vote
2
answers
98
views
Is it more efficient to highlight cells in QAbstractTableModel's data method or QItemDelegate's paint method?
I'm building a Qt table in Python to display a large pandas DataFrame. The table uses a custom PandasTableModel (subclassing QAbstractTableModel) to connect to the DataFrame, and I want to highlight ...
1
vote
1
answer
94
views
Displaying Pandas Dataframe in QTextEdit using QDataWidgetMapper
I have a pandas dataframe (df) that is displayed in QTableView using TableModel. I also have QTextEditor, that should do some math operations with the df dataframe used in TableModel and should ...
2
votes
1
answer
256
views
How do I enable hundreds of millions of rows in Qt's QAbstractTableModel?
In Qt's QAbstractTableModel, if I set the row count to 71,582,788 the app performs well and scrolling in any direction works as desired. CPU usage is minimal, and memory usage is as expected.
If I add ...
0
votes
0
answers
50
views
Qt6 - QAbstractTableModel to create Bar chart in qml. How to define column names?
I have a ChartView that has a BarSeries. I use VBarModelMapper to get the model. I have managed to get the values I want. But what I have not been able to do is to display "names" for the ...
0
votes
0
answers
35
views
Pyside6 QAbstractTableModel - Replace Boolean value with centre aligned icon [duplicate]
I have a class GenericTableModel(QAbstractTableModel): in which I am trying to replace Boolean <class 'numpy.bool_'> with icons. I have had it working using the following:
if role == Qt....
0
votes
0
answers
127
views
QML GridLayout analogue to show table model content
It is possible to use GridLayout to show list models content in QML. I need a layout that can show content of table models that return data for row & column (QAbstractTableModel - derived classes),...
0
votes
0
answers
91
views
QAbstractTableModel don't work (Qt6.5.2 / Py 3.11 / )
I use this code and it works fine:
....
self.query_model = QSqlQueryModel()
view = QTableView()
view.setModel(self.query_model)
... but I would like to use a QAbstractTableModel ...
0
votes
1
answer
412
views
PySide6 - Color specific row with QTableView QAbstractTableModel and Pandas
This is the first application I have created with Python QT so apologies if I have missed something really fundamental.
The following table is populated via a QAbstractTableModel linked to a Pandas ...
1
vote
0
answers
176
views
Qt QTableView performance 60 fps
We encountered a problem with the performance of QTableView.
Use case:
The user wants to be able to open up to 10-30 windows with tabular data (we receive data via the Internet)
Each table can have ...
0
votes
0
answers
135
views
QSortFilterProxyModel - not updating
I am trying to use QTableView with a custom model and QSortFilterProxyModel.
If I set the base model: self.setModel(self._model) the table displays correctly.
However, if I set the proxy model: self....
0
votes
1
answer
447
views
How to handle custom data show in QTableView?
I have a QTableView with custom model, delegate and data class. I want to show different widgets in my table based on data types. this is done in my delegate class. background and checkbox types are ...
0
votes
1
answer
827
views
removing multiple rows in RemoveRow in QAbstractTableModel and refreshing - Pyside2
I have a QTableView using a QAbstractTableModel and I am trying create some remove row functionality. I have written in the removeRow code like so -
def removeRows(self, row, count, parent=QtCore....
0
votes
1
answer
955
views
How to set a QAbstractTableModel custom class model to the QML TableView
I have created a custom table model Python class, subclassing the QAbstractTableModel and when I try to set the instance of this class, model, to the model property of the TableView, the whole app ...
2
votes
1
answer
741
views
Memory Leak in Pyside6 QAbstractTableModel
I have a PySide6 application using an MVC structure. It utilizies two threads. The main thread is the Qt Event loop(GUI). The Model utilizes an asyncio event loop which runs in the other thread. The ...
1
vote
1
answer
918
views
how insertRow to QAbstractTableModel with indexes?
im try to create small app in PyQT that show table from database and user will be able to add new rows and fill them. Table's data taken from pd.dataframe with 2 cols and dates-indexes. New inserted ...
0
votes
0
answers
550
views
Increase performance in PYQT6 QAbstractTableModel when using Checkboxes
I'm using PyQT6 for my application. I'm creating my own QAbstractTableModel where each row has some details and last 3 columns are checkboxes representing received, packed, sent. I successfully ...
0
votes
2
answers
2k
views
How to implement setData on PyQt5 QAbstractTableModel with QSqlRelationalTableModel
I am newbie with Pyqt and need help with setting setData on QAbstractTableModel with QSqlRelationalTableModel table model
I have this simple code and I dont now how to implement setData function.
I ...
0
votes
0
answers
590
views
Pandas Model (QAbstractTableModel) binded with PyQt5 QTableView Add Rows not working
I'm using a custom Pandas Model(QAbstractTableModel) which is editable. I'm trying to add rows and then the user should be able to edit them and pass the values to the dataframe. Unfortunately, the ...
0
votes
0
answers
74
views
Display data from a text file into QAbstractTableModel
I have data that is stored in the a text file and I want to load the lines of the text file into a table model.
The class that is derived from QAbstractTableModel uses the following functions:
...
0
votes
0
answers
225
views
Filter checked checkboxes
By this I tried to make a minimal reproducible example of what I now have.
Using QSortFilterProxyModel() to find text and a custom SortFilterProxyModel to show all the selected checkboxes.
It looks ...
-2
votes
1
answer
222
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
...
2
votes
1
answer
1k
views
Hide column in QAbstractTableModel
I have a self created Qt-Model derieved by QAbstractTableModel. The data behind the model contains multiple QUuid-columns, whose cell-data I need to pass around the application. Due to design-reasons ...
2
votes
1
answer
955
views
PyQt5: Implement removeRows for pandas table model
I use QTableView to display and edit a Pandas DataFrame.
I use this method in the TableModel class to remove rows:
def removeRows(self, position, rows, QModelIndex):
start, end = position, ...
0
votes
0
answers
1k
views
PySide6 QAbstractTableModel not updating on dataChanged
Problem at hand
I a created a QAbstractTableModel to display a pandas dataframe which in turn is populated from a CSV file. In practice this application will be running in a CPython environment in a ....
0
votes
0
answers
31
views
PyQt5 - Model/View - allow user to request undisplayed data [duplicate]
How can I use pyqt5's model-view concept to allow a user access to a 'hidden' column in a view?
I often subclass QAbstractTableModel to show a Pandas DataFrame in PyQt5. (h/t to posts on this site). ...
3
votes
1
answer
5k
views
Qt: Updating data in a TableView with QAbstractTableModel
I try to implement a table view with two columns. The right columns shows parameters, which should not be changed by runtime, and left column shows values, that should be updated constantly at runtime....
0
votes
0
answers
569
views
How can I connect a change in QAbstractTableModel to trigger a function
I use QTableView to display a QAbstractTableModel. I edited the QAbstractTableModel so that I can edit the cells, when displayed.
The editing in the window works perfectly, but I want to connect the ...
0
votes
0
answers
409
views
QAbstractTableModel not updating on editing table cell in QTableView
Im using PyQt5 to develop an MVC application using sqlite DB.
I have a custom model inheriting from QAbstractTableModel. For the view im using in QTableView.
In the custom model i have added function ...
0
votes
1
answer
366
views
Format selected columns in QAbstractTableModel from large pandas dataframes
The code below produces a QTableView that is generated from a Pandas DataFrame. columns A and B contain int values, C contains a list of ints for each cell.
This currently is displayed as int values. ...
0
votes
1
answer
2k
views
Updating QTableView on the fly when data source changes with a QSortFilterProxyModel in between
I'm trying to update a QTableView when the data source (Pandas Dataframe) changes.
I'm using a QAbstractTableModel as the "base" table model and a QSortFilterProxyModel to do some filtering.
...
0
votes
1
answer
544
views
Columns not properly moving in QTableView (QAbstractTableModel) using beginMoveColumns?
I am trying to use beginMoveColumns to move a single column over in a QTableView, but it doesn't work properly in my example below. The cell selections get shuffled and column widths don't move. ...
2
votes
1
answer
1k
views
How can I move a row in a QTableView (QAbstractTableModel) using beginMoveRows?
I am trying to move rows in my QTableView in the example below, but am struggling to understand how to correctly call beginMoveRows. My example has 3 buttons to do various row movements, and the 3rd ...
0
votes
0
answers
107
views
How to add QComboBox to the first row of a QAbstractTable?
I would like to add QComboBox with inputs (Id, Name, Year) to the first row of QAbstractTableModel? I tried similar posts How to set data to QComboBox using QAbstractTableModel (Model/View)? and How ...
0
votes
1
answer
490
views
Alerting QDataWidgetMapper to changes when using a custom Model & Delegate
I'm using a subclassed QAbstractTableModel with dataclasses as items. Each dataclass contains a field "field1" with a list, which I'd like to display in a listview and have it automatically ...
1
vote
1
answer
802
views
Why do boolean values create a dropdown menu in QAbstractTableModel?
In my custom model setting a bool value automatically creates a combobox/dropdown menu with True/False options, whereas string values create a regular line edit type of editor.
I'm trying to ...
0
votes
0
answers
226
views
Qt remove row from custom QAbstractListModel does not work
In the following you'll find my custom model. I reduced it to the just necessary things:
class myClass : public QAbstractListModel
{
Q_OBJECT
enum Role {
id=Qt::UserRole,
...
1
vote
1
answer
438
views
Text can be seen behind delegate widgets in QTableView
I have a QTableView that uses QItemDelegate and QAbstractTableModel. A row contains a QPushButton, QCheckBox, QCombobox and QTimeEdit. My issue is that text appears behind the widgets. When a cell ...
0
votes
1
answer
474
views
QTableView dynamic row heigh for large QAbstractTableModel
I know there have been a lot of times question was answered on stackoverflow about how to set row height for QTableView. I'm asking one more time but my question is not exactly about "how", ...
0
votes
1
answer
887
views
Update QAbstractTableModel when combobox changed
I am trying to update my model when a combo box is changed. I have a function connected to the combobox that updates the model but from this question - "the delegates should use the base ...
0
votes
1
answer
2k
views
Adding row to QTableView with model and and delegate widgets
I am trying to add a row to QTableView with a QAbstractTableModel and QItemDelegate where the widgets appear in the added row. From what I've read I need to call .edit(index) on each item of the added ...
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, ...
2
votes
1
answer
2k
views
Insert and remove row in pyqts QTableView using the QAbstractTableModel
How can i insert and delete single rows in a QTableView using the QAbstractTableModel.
A new row will be given in a seperate thread which is connected via a pyqtsignal to the QAbstractTableModel.
The ...
1
vote
0
answers
664
views
PyQt5 - QTableView + QAbstractTableModel - html format cell/column text [duplicate]
Is there a way, perhaps using QStyledItemDelegate (like here PyQt / Qt, tableview with custom delegate to use ellipsis for text overflowing cell or here QStyledItemDelegate truncates text horizontally ...
0
votes
0
answers
688
views
Creating a QTreeView from a given list using pyqt
I want to create a TreeTable with a given data from a list of lists. At the moment I only managed to create a normal table with the help of a QTableView and a QAbstractTableModel. Now I want to ...
0
votes
1
answer
1k
views
Qt C++ QabstractTableModel set checkbox column to unchecked initially
I'm having trouble with correctly implementing a column of checkboxes on a class that inherits from QAbstractTableModel. Each row in the table has a checkbox that's initially checked when a new item ...
1
vote
1
answer
824
views
How to undo a change in QAbstractTableModel?
I have this simple example: a value in last column of my QAbstractTableModel equals value in column 1 multiplied by 2. So every time a change is made to value in column 1 - it results to a change in ...
0
votes
0
answers
972
views
Set 'role' in QAbstractTableModel
I was trying to build a simple QAbstractTableModel to familiarize myself with the concepts.
The model I build however, is not behaving as I anticipated. I would like the model to display a tick mark ...