Hi,

I took the command to create a simple archive using the terminal and put every argument in a QStringlist, but the result is that the program creates an archive called mx9.7z in the folder where the program is located.
Why doesn't this example program do the same thing as the same command entered in the terminal?
(7z a -t7z mx9 /home/user/Desktop/Desktop.7z /home/user/Desktop/file1.pdf /home/user/Desktop/file2.doc)

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include <QPushButton>
  3. #include "program.h"
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. QPushButton *okButton = new QPushButton("OK");
  9. Program *mystarter = new Program();
  10. a.connect(okButton, SIGNAL(clicked()), mystarter, SLOT(startprocess()));
  11.  
  12. okButton->setMinimumWidth(150);
  13. okButton->show();
  14. return a.exec();
  15. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #ifndef PROGRAM_H
  2. #define PROGRAM_H
  3. #include <QObject>
  4. #include <QProcess>
  5.  
  6. class Program : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. QProcess myprocess;
  11. explicit Program(QObject *parent = 0);
  12.  
  13. public slots:
  14. void startprocess();
  15. };
  16.  
  17. #endif
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include "program.h"
  2. #include <QString>
  3. #include <QStringList>
  4.  
  5. Program::Program(QObject *parent) : QObject(parent)
  6. {}
  7.  
  8. void Program::startprocess()
  9. {
  10. list << "a" << "-t7z" << "mx9" << "/home/user/Desktop/Desktop.7z" << "/home/user/Desktop/file1.pdf" << "/home/user/Desktop/file2.doc";
  11. myprocess.start("7z", list);
  12. }
To copy to clipboard, switch view to plain text mode