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 row selection highlight colour light blue
Forum Updated to NodeBB v4.3 + New Features

QTableWidget row selection highlight colour light blue

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 4.5k 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.
  • E Offline
    E Offline
    E106JZ
    wrote on last edited by
    #1

    Qt newbie here

    I have a QTableWidget and I'm trying to change the row highlight selection colour from the default dark blue to the light blue that you see on every table widget in the QtCreator. It must be really obvious but I cannot seem to get the colour right;

    I can't find any setting on the form designer to do this so I tried using

    setStyleSheet("selection-background-color: rgb(195, 225, 225);");
    

    But it comes out as an ugly light green colour.

    How can I get the row selection highlight colour to be like the image below?

    db050049-7863-4d1e-b198-230b9755eb65-image.png

    Thanks

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

      @E106JZ said in QTableWidget row selection highlight colour light blue:

      How can I get the row selection highlight colour to be like the image below?

      Don't use the Windows Style - you can't change it there.

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

      E 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @E106JZ said in QTableWidget row selection highlight colour light blue:

        How can I get the row selection highlight colour to be like the image below?

        Don't use the Windows Style - you can't change it there.

        E Offline
        E Offline
        E106JZ
        wrote on last edited by
        #3

        @Christian-Ehrlicher Sorry what do you mean by that? Can you explain more please

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

          Sorry, did not read correctly.

          But it comes out as an ugly light green colour.

          But you specified this color: https://duckduckgo.com/?t=ffsb&q=color+c3e1e1&ia=answer

          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
          2
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #5

            Hi and welcome to the forums

            Seems to work fine?

            alt text

            try with selection-background-color: rgb(204, 232, 255);
            alt text

            E 1 Reply Last reply
            1
            • mrjjM mrjj

              Hi and welcome to the forums

              Seems to work fine?

              alt text

              try with selection-background-color: rgb(204, 232, 255);
              alt text

              E Offline
              E Offline
              E106JZ
              wrote on last edited by
              #6

              @mrjj THanks this worked

              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