I have 2 pandas dataframes
, one with 6 rows
and 7 columns
and another one with 21 rows
and 12 columns
, i would like to display them using QML, while googling i got to know about TableView TableView QML Type. In that example, the data has been entered already in ListElement
and it is being shown. But in my case the data is from python pandas dataframe, how can i fetch the columns and rows from pandas straight into QML, should i create those columns well before under listelement
? Any help would be appreciated
Note: I have used QtWidgets
to display dataframe, it was just a drag and drop tableview and use the model created and set them using tableView.setModel(model)
. But i am kind of clueless here in QML
You can create a class that inherits from
QAbstractTableModel
as implemented in this old answer and use the QTableView of QtQuick 2.12 that was released in Qt 5.12 since it supports theQAbstractTableModel
type model, so you will have to use the latest versions of PyQt5.main.py
main.qml
I have used: