Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is QChart inside QTableWidget possible?
QtWS25 Last Chance

Is QChart inside QTableWidget possible?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 292 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • tjktak1002T Offline
    tjktak1002T Offline
    tjktak1002
    wrote on last edited by
    #1

    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:
    alt text
    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!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Create a custom QStyledItemDelegate and paint the chart with it.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • tjktak1002T Offline
        tjktak1002T Offline
        tjktak1002
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved