PDA

View Full Version : Superuser Privileges



CodeFreak
30th July 2018, 13:15
Hi everyone,
I'm using some interfaces that are associated with system resources which you need Superuser Privileges to interact with them.
For instance, in Ubuntu, they don't execute right without "sudo" command in terminal.
I can run the Qt project from terminal in Ubuntu with "sudo" command and interact with interface.
Problem: Although it executes in Qt Creator but do not interact with the interface.

How can I benefit from Superuser Privileges to execute a program in Qt Creator (Any Platforms, specially Windows and Linux) ?
Or any alternative ...

d_stranz
30th July 2018, 17:21
If you want to run a program that requires superuser / admin privileges, you generally need to start the shell that runs the program with those privileges. That means running Qt Creator itself via sudo (or "Run as Administrator" in Windows), or configuring the run command in Qt Creator to run the program via sudo. I'm not sure how you would do it in Windows; I usually just set up a shortcut so it runs Qt Creator with elevated permission.