@Moderator - I am aware that this is a borderline QT Programming issue, I hope you allow this post.

Hi,

I am running into a weird problem with QProcess and I would like your advice on how to solve this.
I have build a program installer. ( for several reasons I do not want to distribute my program using a package manager)

The installer needs to save icon files(.png) in the /usr/share/icons/hicolor/<icon-size>/apps/ folder and a desktop-entry file in /usr/share/applications. (for both folders, superuser privileges are mandatory on the main distro's)
I am developing the installer with QT 4.8 on (K)Ubuntu KDE-Desktop with kdesudo installed. I am not using kdesudo/gksudo, and neighter ssh-askpass function since Fedora, OpenSuse, Arch and CentOS don't support these functions as a standard. I therefore choose to use QProcess and the sudo command (re: security holes I am using QCA Libs and AES-128 for encryption/decryption of the superuser password).

On execution in a linux terminal I am asked for the sudo password (my test account is in the sudoers file, else I would get an error). The result is very disappointing: a KDESUDO related bug telling me that the Gui is owned by User 1000 (me) and not by Usr 0 (superuser). I found out that this has been a reported bug and it was confirmed.

I am now looking into an alternative to elevate privileges using Qt Process and the sudo command. The net hasn't been very helpful. So if you have successfully elevated permissions using sudo and Qt Process, I'd love to hear about how you did this?

Thanks.