Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. run process with file between quote
Forum Updated to NodeBB v4.3 + New Features

run process with file between quote

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 313 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    filipdns
    wrote on last edited by
    #1

    Hello,

    I need to run command using process with command line below:

    "magick convert -density 300 -trim "E:/messages/filename" -quality 100 "e:/output.jpg";
    }
    

    then the problem is about double quote.

    I try to use escape :

       QDir directory("E:/messages");
       QStringList images = directory.entryList(QStringList(),QDir::Files);
       foreach(QString filename, images) {
    program="magick convert -density 300 -trim \"E:/messages/" +filename+"\" -quality 100 \"e:/output.jpg\"";
    }
    

    but the output give:

    "magick convert -density 300 -trim \"E:/messages/test.pdf\" -quality 100 \"e:/output.jpg\""
    

    and then process is not working...

    could you help me?

    kind regards

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Instead of making one big string with both program and parameters, QProcess excepts you to use a list.
      http://doc.qt.io/qt-5/qprocess.html

          QString program = "./path/to/Qt/examples/widgets/analogclock";
          QStringList arguments;
          arguments << "-style" << "fusion";
      
          QProcess *myProcess = new QProcess(parent);
          myProcess->start(program, arguments); // notice program and parameters are separate.
      
      1 Reply Last reply
      3
      • F Offline
        F Offline
        filipdns
        wrote on last edited by
        #3

        great thanks a lot

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved