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. how to change style on a selected row

how to change style on a selected row

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 5.7k 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.
  • S Offline
    S Offline
    Suzy Q
    wrote on last edited by
    #1

    Hello everybody,

    When I select a row from a table I want that row to has only border. I already did this

    QTableView::item:selected {
    border: 2px solid red;
    }

    in a external .css file but it doesn't work. What do you suggest?

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

      Hi
      in what way " but it doesn't work."

      You can try
      setStyleSheet("QTableView {selection-background-color: transparent;}");

      Im not sure what look you are after.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Suzy Q
        wrote on last edited by
        #3

        I want the selected row not to have a background color but red border. And by "it doesn't work" I mean that I don't get any border

        mrjjM 1 Reply Last reply
        0
        • S Suzy Q

          I want the selected row not to have a background color but red border. And by "it doesn't work" I mean that I don't get any border

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Suzy-Q
          Hmm. Strange.

          QTableView::item:selected {
          border: 2px solid red;
          }
          works for me..

          1 Reply Last reply
          3
          • S Offline
            S Offline
            Suzy Q
            wrote on last edited by
            #5

            I am sorry this is what I get. 0_1478869597102_2016-11-11-140139_1280x1024_scrot.png

            mrjjM 1 Reply Last reply
            0
            • S Suzy Q

              I am sorry this is what I get. 0_1478869597102_2016-11-11-140139_1280x1024_scrot.png

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Suzy-Q
              Hi. Image upload is broken here. so I cant see your picture. Please use external site.

              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