Results 1 to 12 of 12

Thread: QProcess problem with windows batch file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Shanghai, China
    Posts
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Re: QProcess problem with windows batch file

    Quote Originally Posted by wysota
    Oh, you're calling a QProcess::setWorkingDirectory() method... You're right then, it doesn't influence where QProcess looks for the program.

    How does your script work?
    Did you download my example in my first post?

    The example has two QProcess, one without setWorkingDirectory called before calling start(QProcess1), while the other does(QProcess2). And both QProcess start a batch file called test.bat under `bin` directory(the batch file just has an echo command to output a string), then readAll is called to collect the output which is later presented in a QMessageBox. You'll find the output collected from QProcess1 is empty while the other works as I expected.
    1. Users don't have the manual, and if they did, they wouldn't read it.
    2. In fact, users can't read anything, and if they could, they wouldn't want to.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QProcess problem with windows batch file

    The process here isn't started at all, so it looks like setWorkingDirectory influences the way QProcess starts the process. The problem is with the script itself, so it seems.

Similar Threads

  1. Qt + Portmidi in Windows... libraries problem
    By hipogrito in forum Newbie
    Replies: 2
    Last Post: 19th June 2009, 00:01
  2. Draging a non-existing file to the Windows Desktop
    By klaus1111 in forum Qt Programming
    Replies: 13
    Last Post: 20th September 2007, 11:47
  3. Replies: 3
    Last Post: 4th September 2007, 14:40
  4. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25
  5. QProcess +standard error + windows
    By antonio.r.tome in forum Qt Programming
    Replies: 0
    Last Post: 18th April 2006, 14:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.