Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to display line graph in QtTableWidget cells using Python?



  • Hi,

    I'm new to QT and using the Windows desktop version. I'm able to use Qt Creator and Python to display the QtTableWidget with data plus use matplotlib to display a line graph in a separate window. What I want is to display line graph within the table cells, like this website
    https://coinmarketcap.com

    How on Earth would I do that? Thanks for your help.


  • Lifetime Qt Champion

    Hi,

    What about rendering that graph in an image and just show the image in your cell ?



  • Thanks, I got it working by using matplotlib to plot to canvas. Then converting this to a an rgb uint8 numpy array. Then converted to QImage that I could send to either a background brush or a QIcon to set a QTableWidgetItem to set to the QtTableWidget.


Log in to reply