Run a shell script in a own QT-Application
Hi there,
i've written a qt app with the QT Creator...just a simple one. For testing only, i've add a combobox and a "Apply" Button. The Button should run a shell script, which should do something. (with Variable from the combobox). My Problem is, that nothing happend, when i push the Button :mad: The part of the Button looks so: Code:
void MainWindow::on_applypush_clicked() |
Re: Run a shell script in a own QT-Application
Quote:
You can also leave out the . -mark from QT-code. And one more thing, you are running your QT-app as user, not as root are you? |
Re: Run a shell script in a own QT-Application
I'd start with the path to the binary. As pointed out above. the "." makes a difference.
With a path starting with ".", it becomes a relative path, relative to whatever the Qt application has as current working directory. So, remove that and try again. |
Re: Run a shell script in a own QT-Application
Hi & Thx 4 Reply D-livil
1st.: i start script 1 with following inserts : Quote:
So, yes...it`s start as root Im really new to Qt so, sorry for my bad knowledge *g Is'it working if i make the execution (chmod a+x /sbin/xicon) in a linux system an copy the Files to the place ? Or have i to go another Way? Kind Regards €dit: I remove the "." €dit2: It dosent work for me :( and hmm, how do i start the qt app.....i start it with the button *gg* how i said....im really ,really new to qt an i'm very thankfully for every tip ! here's my cpp + h... have i anything forgotten ? http://pastie.org/1061122 http://pastie.org/1061127 |
Re: Run a shell script in a own QT-Application
Hi,
RE. the script: You have whitelisted zicon in /etc/sudoers.d (and ran update-sudoers afterwards)? If you haven't, sudo's gonna be waiting asking for a password. And depending on the way you've written the could-be sudoers file, running "sudo zicon" as root will make sudo do absolutely nothing |
Re: Run a shell script in a own QT-Application
I think it is related to the path setting / or exec bits. You may verify by process->error() (or capture the error() signal) . If It is QProcess::FailedToStart , then it was not able to start the program.
|
Re: Run a shell script in a own QT-Application
Well, i think, that the Problem is from the other side....
I've the directory "Data" with all my realated Files in Subdirectories, but the Problem seems to be, that the Files are after the installation gone ?!? I don`t know how,but they are gone....*gg My "Sudoers File" -->gone My "scripts"-->gone. Such Problems on so a simple thing....can´t believe it.. I´m searching over and over.... KR |
Re: Run a shell script in a own QT-Application
...got it....it was a sudoers problem...thank you qwerty12 and all the others who helped me !
Now, is there a way to reboot the system with a Clicked Signal....? I mean this solution : Code:
dbus-send --system --type=method_call --print-reply --dest=com.nokia.mce "/com/nokia/mce/request" com.nokia.mce.request.req_rebootOr do I have to make a shellscript with an simple " reboot" inside. (ofcourse, with sudo rights) |
| All times are GMT. The time now is 10:09. |
vBulletin® Version 3.8.8