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. Focus ring around tree/table views?
Forum Updated to NodeBB v4.3 + New Features

Focus ring around tree/table views?

Scheduled Pinned Locked Moved Unsolved General and Desktop
33 Posts 5 Posters 10.6k Views 3 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #24

    Yes the views default to having "strongFocus". I have recreated the minimal project, which also does not show focus rings even with all the code correct as specified above.

    If anyone has a couple free minutes, please download and run this project, and tell me what's wrong?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #25

      Your project works as expected for me.
      But I can't test above Qt 5.8 and MacOs 10.9.
      Maybe a bug in more recent Qt versions ?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by davecotter
        #26

        well i am on macOS 10.14 and Qt 5.13.0

        1 Reply Last reply
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #27

          @mpergand said in Focus ring around tree/table views?:

          WA_MacShowFocusRect

          can anyone try on latest Qt?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            davecotter
            wrote on last edited by
            #28

            @mpergand or anyone, can you reproduce the problem? that the focus ring is 1px no matter what? if you see CORRECT results (nice ring like around the search box) can you screen shot that and tell me what version of Qt you're using?

            i still can not for the life of me get this ring to look good

            M 1 Reply Last reply
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by
              #29

              if i embed the views inside a QFrame, with 3px borders, then draw the focus on the QFrames, that looks good. i can tab between all 3 items and the borders look good (if the wrong color).

              but that leaves the wrong QObject with the focus. i need the tree/table views to have actual focus.

              soi try to do this:

              treeFrame->setFocusProxy(treeView);
              tableFrame->setFocusProxy(tableView);

              then the edit text and tree frame look good, but the table view is back to looking all wrong again (1 pixel border)

              good:
              Screen Shot 2020-06-05 at 9.32.55 PM.png

              good:
              Screen Shot 2020-06-05 at 9.33.00 PM.png

              bad:
              Screen Shot 2020-06-05 at 9.33.06 PM.png

              why 1 pixel? the code is correct.

              I've a new minimal project if some kind soul (who likes karaoke?) could take a look?
              http://kjams.com/downloads/qfocustest.zip

              thanks

              -dave

              JonBJ 1 Reply Last reply
              1
              • D davecotter

                @mpergand or anyone, can you reproduce the problem? that the focus ring is 1px no matter what? if you see CORRECT results (nice ring like around the search box) can you screen shot that and tell me what version of Qt you're using?

                i still can not for the life of me get this ring to look good

                M Offline
                M Offline
                mpergand
                wrote on last edited by
                #30

                @davecotter said in Focus ring around tree/table views?:

                @mpergand or anyone, can you reproduce the problem? that the focus ring is 1px no matter what? if you see CORRECT results (nice ring like around the search box) can you screen shot that and tell me what version of Qt you're using?

                i still can not for the life of me get this ring to look good

                I'm currently proceeding to a major update of my developement system.
                I hope looking at your issue in a few days.

                1 Reply Last reply
                1
                • D davecotter

                  if i embed the views inside a QFrame, with 3px borders, then draw the focus on the QFrames, that looks good. i can tab between all 3 items and the borders look good (if the wrong color).

                  but that leaves the wrong QObject with the focus. i need the tree/table views to have actual focus.

                  soi try to do this:

                  treeFrame->setFocusProxy(treeView);
                  tableFrame->setFocusProxy(tableView);

                  then the edit text and tree frame look good, but the table view is back to looking all wrong again (1 pixel border)

                  good:
                  Screen Shot 2020-06-05 at 9.32.55 PM.png

                  good:
                  Screen Shot 2020-06-05 at 9.33.00 PM.png

                  bad:
                  Screen Shot 2020-06-05 at 9.33.06 PM.png

                  why 1 pixel? the code is correct.

                  I've a new minimal project if some kind soul (who likes karaoke?) could take a look?
                  http://kjams.com/downloads/qfocustest.zip

                  thanks

                  -dave

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #31

                  @davecotter
                  Please take this lightheartedly, but she's spelt Eleanor Rigby :)
                  Probably not the cause of your issue, but it does imply you are typing these in by hand!?

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    davecotter
                    wrote on last edited by davecotter
                    #32

                    does it seem strange that every API for "focus rings" and even one i hacked together, doesn't work?

                    • setting a frame using styles DOES NOT WORK
                    • using the explicit API QFocusFrame DOES NOT WORK
                    • using the mac-only "Qt::WA_MacShowFocusRect" attribute DOES NOT WORK

                    or: i have not been able to understand the doc well enough to cause any of them to work

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      davecotter
                      wrote on last edited by
                      #33

                      I've updated the example project so you can test six different implementations of "focus ring", none of which are 100% successful.

                      The only one that comes close is kTest_PARENT_STYLE, and only on mac. On windows i can't for the LIFE of me make ANY focus ring bigger than 1 pixel, which is just too small. I really need 3 pixels in order to keep the UI appearing the same as the previous (10 year old, 32bit) app.

                      -dave

                      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