Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved how to change style on a selected row

    General and Desktop
    2
    6
    4597
    Loading More Posts
    • 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
      Suzy Q last edited by

      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 Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • S
          Suzy Q last edited by

          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

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Suzy Q last edited by

            @Suzy-Q
            Hmm. Strange.

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

            1 Reply Last reply Reply Quote 3
            • S
              Suzy Q last edited by

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

              mrjj 1 Reply Last reply Reply Quote 0
              • mrjj
                mrjj Lifetime Qt Champion @Suzy Q last edited by

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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post