Qt application changes font when run as root

783 views Asked by At

I have simple Qt application (Qt version is 4.8.2) run on Debian Linux. When it is run as usual user, everything is ok. When it is run as root, app font is different, so UI looks ugly. I suppose that it cannot find some stylesheets. How can I solve the problem?

2

There are 2 answers

3
Joel On BEST ANSWER

I think you need to run qtconfig application in root mode in order to choose which style to use when qt apps run in administrative mode.

0
UmNyobe On

This is a well known issue which affect several app under debian. Don't try to resolve this issue in your Qt application.

Rather you have two choices. I prefer the first one :

  1. Set a specific theme for the root application
  2. Set a specific style inside your application. I remember having a lot of issues with this approach. At the time, depending on the style the application will crash. Use with caution.