I have created an app in Qt creator , when i run it in normal mode and sudo mode its colour and icons are different why it is happening , i feel in sudo mode have great look.see below images of both.
Above ones is when the app running in normal mode
This is how it looks in sudo mode,.
I need to run my application in sudo mode because it uses GPIO pins in raspberry pi. But running in sudo mode provide a warning that
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' when running sudo commands
and my QSettings file is saving in some where in root folder. To avoid this (so that settings file will save in .config folder) i started my app using following command
sudo -E ./MyApp
So the environment variable is preserved and QSettings are saved in .config folder, but the app looks like normal mode (first picture).
So my question is -How can I preserve the environment variable and same time app looks like sudo mode (second picture)?
i am using c++ in Qtcreator (qt5) for app creation in raspberry pi os