Home > Mobile >  How to run qt-creator project with 'sudo nice x' prefixes?
How to run qt-creator project with 'sudo nice x' prefixes?

Time:02-13

So i have a C program that i made a while back that im going to remake in qt with additional features.

Typically how i ran the program is I open the terminal, navigate to the project folder, and use the command

$ sudo nice --10 ./myprogram

That is not the case anymore, since i am using qt-creator i now just simply click the 'run' button and the program starts. My program works best when it has elevated scheduler priority hence the nice --10.

How do i modify my qt-creator project to run my program with the sudo nice --10 command?

CodePudding user response:

I never tried, but in the config of your project you can add a user defined executable to be executed.

Maybe creator allows for a shellscript, than you can simply put your sudo nice --10 in a shellscript, or you write a little program which gets a program path as parameter and starts it with the elevated scheduler priority (guess there is a user api in linux for that...)

CodePudding user response:

To do that go to

Tools-> Options-> Environment -> System Tab under the terminal option write "/usr/bin/xterm sudo nice --10"

Also if you have not done it already go to Projects -> Build & Run -> Run and check the box Run in terminal.

  • Related