I want to execute a sudo command with QProcess on a GUI Application.
My question is: How to handle the password prompt to help user enter a password on a dialog?
I want to execute a sudo command with QProcess on a GUI Application.
My question is: How to handle the password prompt to help user enter a password on a dialog?
A better plan would be to use polkit-qt, which is a Qt wrapper around polkit.
If your using KDE or Gnome, then these frameworks use polkit already; something like KAuth should work well.
An other solution is to use a kdesudo (in KDE) or gksudo (in Gnome) command instead of a sudo command within the QProcess statement. A new window will be opened and ask to the root password.
Bookmarks