[Interest] how to get 3 pixel focus ring?

Kevin André hyperquantum at gmail.com
Wed Jun 10 01:53:39 CEST 2020


Just speculating without really knowing anything about this, but...

Have you made sure that there actually is enough space for painting
that focus ring?
Up until now I had never heard of a "focus ring", but after looking at
the screenshots, it seems that it is simply a wide border around a
widget that is only visible when the widget has focus. But if a widget
was not designed to have such a large border around it, there might
simply be no room around the widget to paint your focus ring and then
anything you try to paint might simply be completely or partially lost
by clipping. This could explain why your experiments show a partial
result on Mac but no result at all on Windows; Qt might put some extra
space around widgets on Mac but not on Windows just because both
platforms have their own style that Qt tries to mimic.



On Sun, Jun 7, 2020 at 11:21 PM David M. Cotter <dave at kjams.com> wrote:
>
> i have an example project (see below), that tries 6 different implementations, attempts to make the focus ring 3 pix wide. None of them work on windows, and only one of them PARTIALLY works on mac. What i want is the style you get around a text edit on mac, but i want that style on ALL widgets, and i want it on windows too.
>
> anyone have any idea how i can accomplish this?
>
> Please see the example project. I've set it up so the same code can be run on both mac and windows (use file sharing to run both at once).
>
> thanks
>
> -dave
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest


More information about the Interest mailing list