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. Selecting two rows in two different TableView
Forum Updated to NodeBB v4.3 + New Features

Selecting two rows in two different TableView

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.1k Views 2 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.
  • ZoptuneZ Offline
    ZoptuneZ Offline
    Zoptune
    wrote on last edited by
    #1

    Hi,

    I have a frame with two different QTableView displaying the same data.
    I want the user to select one row of each tableview and then press a button.

    The problem is that when i select the row in the second tableview, the first one become gray (and i need to keep it blue for the visibility).
    The problem is the same when i click a QCheckBox or anything else in the frame.

    I hope I was clear in explaining my problem.

    Thx

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

      Hi
      The reason the first one becomes grey is that it loses focus.
      Only 1 (one) widget can have focus. So there is no way, they both can be blue pr default.
      Its per design (for OS). if user clicks on other widget, it gets the focus.

      So all applications does this, so are u sure u need to alter that?

      1 Reply Last reply
      0
      • ZoptuneZ Offline
        ZoptuneZ Offline
        Zoptune
        wrote on last edited by
        #3

        Yes because the user need to clearly identify wich rows are selected.

        mrjjM 1 Reply Last reply
        0
        • ZoptuneZ Zoptune

          Yes because the user need to clearly identify wich rows are selected.

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

          @Zoptune
          well
          You might be able to change the color of the Selected, but not active state
          using a delegate.

          http://www.qtcentre.org/threads/21482-Change-appearence-of-selected-row-in-QTableView

          the_T 1 Reply Last reply
          1
          • mrjjM mrjj

            @Zoptune
            well
            You might be able to change the color of the Selected, but not active state
            using a delegate.

            http://www.qtcentre.org/threads/21482-Change-appearence-of-selected-row-in-QTableView

            the_T Offline
            the_T Offline
            the_
            wrote on last edited by
            #5

            @mrjj
            What about using stylesheets for this?

            -- No support in PM --

            ZoptuneZ mrjjM 2 Replies Last reply
            2
            • the_T the_

              @mrjj
              What about using stylesheets for this?

              ZoptuneZ Offline
              ZoptuneZ Offline
              Zoptune
              wrote on last edited by
              #6

              @the_ said:

              @mrjj
              What about using stylesheets for this?

              Yes ! Thank you
              In the detailled stylesheets (Qt Designer) of my both table view, i have set color of an inactive selected row the same as an active selected color.

              Exactly what i wanted.

              1 Reply Last reply
              0
              • the_T the_

                @mrjj
                What about using stylesheets for this?

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

                @the_
                of cause :)
                much easier than delegate.
                Good thought :)

                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