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. QTableWidget: I need to know the text color on cell
Forum Updated to NodeBB v4.3 + New Features

QTableWidget: I need to know the text color on cell

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 2.9k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Stefanoxjx
    wrote on last edited by
    #1

    Hi,
    I've created a table with QTableWidget and the text in the cells can have a different color about text of another cell.
    Now, I must to read the content of this table and I need to have too the color of text.
    Is possible?

    Thanks.

    Stefano

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Stefanoxjx said in QTableWidget: I need to know the text color on cell:

      Is possible?

      Yes, see https://doc.qt.io/qt-5/qtablewidgetitem.html on what attributes you can set/get from an item

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • S Offline
        S Offline
        Stefanoxjx
        wrote on last edited by
        #3

        Hi Christian,
        I already have seen documentation, but I found only "set" method but not "get".
        Probably exists another method, but I haven't found it.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          https://doc.qt.io/qt-5/qtablewidgetitem.html#foreground

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          4
          • S Offline
            S Offline
            Stefanoxjx
            wrote on last edited by
            #5

            Oh yes!
            I've found 😊

            Many thanks.

            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