Results 1 to 4 of 4

Thread: how to make 3 pixel "focus ring"?

  1. #1
    Join Date
    Jun 2020
    Location
    Santa Cruz
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default how to make 3 pixel "focus ring"?

    i have an example project here, 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).

    -dave

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to make 3 pixel "focus ring"?

    For those of us who have no idea what a "focus ring" around a text edit on a Mac is, it would be nice if you could post some screen shots of what you are trying to achieve, and what your current code actually does.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jun 2020
    Location
    Santa Cruz
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: how to make 3 pixel "focus ring"?

    it's trivial to run the example project, but okay here:

    how a text edit looks:
    text edit good.jpg

    table view looks fine:
    tree view good.jpg

    tree view has only one pixel?
    table view bad.jpg

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to make 3 pixel "focus ring"?

    You may have to implement your own style and override some of the drawing methods for primitive elements (PE_...) to accomplish this if the external methods you have tried with QFocusFrame or style sheets don't work.

    The default styles on each of your platforms may be the cause of the differences you see in your test programs. Try setting a different QStyle in main() on Windows to see if you get a change in appearance.

    And please don't assume that everyone on this forum has the time or resources to download, build, and run your test code on multiple platforms. This is an all-volunteer effort.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 1
    Last Post: 20th November 2015, 10:02
  2. Replies: 3
    Last Post: 16th March 2015, 07:31
  3. Replies: 4
    Last Post: 18th April 2010, 00:37
  4. "make install" and "make clean" on Windows for Qt
    By Berberis in forum Installation and Deployment
    Replies: 0
    Last Post: 29th November 2009, 23:02
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.