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. Set background color of a table cell
Forum Update on Monday, May 27th 2025

Set background color of a table cell

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 6.9k 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.
  • M Offline
    M Offline
    mg444
    wrote on last edited by
    #1

    Hello -

    I'm trying to figure out a way to set the background color of a table cell within a QTableView. I'm using Qt 4.7.1. Could somebody help?

    Thank You.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      anselmolsm
      wrote on last edited by
      #2

      "This link":http://doc.qt.nokia.com/4.7/stylesheet-reference.html and "this example":http://doc.qt.nokia.com/4.7/stylesheet-examples.html#customizing-qtableview may help you :-)

      Anselmo L. S. Melo (anselmolsm)

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Franzk
        wrote on last edited by
        #3

        Or you provide a Qt::BackgroundRole in our models data() function.

        "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

        http://www.catb.org/~esr/faqs/smart-questions.html

        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