1

I´am developing an app with QT creator in linux and i''am with some difficults. I had already done this in windows and Mac without any problem(using similar techniques).

I include an executable which needs arguments in resources projects https://www.youtube.com/watch?v=sWIQIi4lg58 and seems like everything is ok. I tried to check the size of the file with path :/Aux/namefile and it gives the correct size.

QProcess *process = new QProcess(this);
QStringList arguments;
arguments<< "--help";
process->execute(":/Aux/namefile");
//already tried with start and no results too
//also tried sh.start(":/Aux/namefile",arguments) The arguments is a QStringList

process->write(arguments);
process->closeWriteChannel();
process->waitForFinished();
QString output = process->readAll();//already checked in readAllStandart(Output and error)
ui->outputLabel->setText(output);

The problem is .. i'am not getting any output. Any ideas about this ? Thank you in advance

My first problem is resolved and for that I have used

QFile::copy(":/path/to/file", "C:\\....\\file");
chmod 755 file

but now I have another problem how I can run this command as sudo ? doing in terminal I need to input the password. I don't find a good solution .. thank you in advance

  • 1
    I think that wouldn't work. I'd try copying the file from the resource to a real file in the filesystem and then spawning the process from there. – dschulz Mar 06 '17 at 13:26
  • Thank for your answer @dschulz I already see the the topic which was marked by Simon Kraemer. But don't help me directly. So that means don't exist any other option then create a copy of that file. I thought it can be already fixed in some update. I use QFile::copy(":/path/to/file", "C:\\....\\file"); then give it permissions with chmod 755 filename – ricardolima Mar 06 '17 at 15:19

0 Answers0