QToolButton remains highlighted after press.
-
I have added one tool button in tool bar. When I press the button and then some action is called like( select a file from open dialog box) after I click cancel button on Open Dialog box . Tht QToolButton still remains highlighted.
This seems to happen when I try to open the file dialog box to select a file to open or save.
Please let me know how can i fix this.
-
Hi, @Ayush-Gupta
that's a common enough issue.
The Button is still highlighted, because it has still the active focus of the application.
Either force the focus on an other item, or define the stylesheet int such a way that the highlight is removed. That would be "outline:none;"
-
@J-Hilk
How can I do through style sheet can you please provide me the code -
@Ayush-Gupta I did
myToolButton->setStyleSheet("outline:none;");
-
@J.Hilk said in QToolButton remains highlighted after press.:
"outline:none;"
This does not works for me :(
-
@Ayush-Gupta said in QToolButton remains highlighted after press.:
This does not works for me
In what way? Does not compile? Does not change the behaviour?
-
@jsulm It does not change behaviour
-
I had the same problem. Changing the QToolButton connection event from "pressed" to "clicked" solved it for me. Apparently, displaying another window in response to "pressed" cut short the button's view state handling.