Qt Application with CLI Commands
-
Those arguments seem a little tricky...How's the order they should be written? For example the command line command for 7z is "7za a -t7z files.7z text1.txt" to create files.7z with text1.txt inside.
@QApplication a(argc, argv);
QObject *parent; QString program = "C:\Software\7za920\7za.exe"; QStringList arguments; arguments << "7za a -t7z files.7z text1.txt"; QProcess *myProcess = new QProcess(parent); myProcess->start(program, arguments); zipfile w; w.show(); return a.exec();@
-
Still...
@QObject *parent;
QString program = "/Software/7za920/7za.exe";
QStringList arguments;
arguments << "a" << "-t7z" << "/Users/croussou_dm4/Desktop/files.7z" << "/Users/croussou_dm4/Desktop/text1.txt";
QProcess *myProcess = new QProcess(parent);
myProcess->start(program, arguments);@By the way, thanks for your support...
-
I'd suggest reading through the docs for QProcess. There are various ways to find the return code of the finished process (was it ok?) or to read from stderr (were there any error messages), and that sort of thing.
In the long run, it will be much more beneficial than me or anyone else trying to guess what the problems may be.
By the way, you're welcome!