Is QChart inside QTableWidget possible?
-
Hello everyone, I am super new to Qt and Google searches did not give me the answer I was looking for. So anyhow, I am trying to achieve something like this:
So I planned to use QTableWidget and in the last column use QChart. But I really don't know if QtableWidget supports QChart as a valid QTableWidgetItem. If not, can you recommend me another method?
Thank you and have a good day! -
Hi,
Create a custom QStyledItemDelegate and paint the chart with it.
-
@SGaist Hey thanks for your reply, I noticed that you can set icon for QTableWidget, so I convert the QChart from QGraphicWidget to pixmap and set icon like that.
-
It's indeed another possibility: using the decoration role. I don't know the amount of data that you need to process and how many times but you might want to use a cache to avoid rebuilding the image each time it's requested.