Focus ring around tree/table views?
-
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?
-
well i am on macOS 10.14 and Qt 5.13.0
-
@mpergand said in Focus ring around tree/table views?:
WA_MacShowFocusRect
can anyone try on latest Qt?
-
@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
-
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:
good:
bad:
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.zipthanks
-dave
-
@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. -
@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!? -
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
-
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