Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Change the background of the row
Qt 6.11 is out! See what's new in the release blog

Change the background of the row

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 327 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.
  • M Offline
    M Offline
    MarcinOS
    wrote on last edited by
    #1

    Dear all,
    How can I change the background of the selected row in the table so that I can reset it?

    Using, for example:

    table.item(currentRow, 0).setBackground(QtGui.QColor(182, 252, 189))
    table.item(currentRow, 1).setBackground(QtGui.QColor(182, 252, 189))
    

    the basic background color is overwritten irreversibly, and I cannot undo this process.

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

      Hi and welcome to devnet,

      Store the original color before changing it so you can reuse it when you want to reset the color to default.

      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

      • Login

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