Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt5 focus ring offset not working?



  • Hello.
    I'm trying to style the focus ring of my application - I'd like it to appear around my buttons, as opposed to inside them. To that extent, I am trying to style the ring like this:

    app.setStyleSheet("""
    	/* Remove the little dotted focus ring. It's too hard to see. */
    	*:focus {
    		outline: 2px double blue;
    		outline-offset: 5px; /*This does not work.*/
    	}
    """)
    

    The outline-offset propertyhas no effect, positive or negative. What am I doing wrong? No errors or warnings are given by the program, and the outline property works fine.

    Thanks!


Log in to reply