Hello and welcome to StackOverflow! I don't have time right now to make a quick project to test if it works, but have you tried using this method somewhere near the root widget of your software?