Results 1 to 2 of 2

Thread: The setWorking Directory doesn't works fine??

  1. #1
    Join Date
    Sep 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default The setWorking Directory doesn't works fine??

    Hi guys
    Well I am playing around with the QProcess and I am having this small (big) problem.
    When I run the application my current directory is this one

    /home/diego/Proyectos_Personales/Ejemplos/Using_QProcess-build-desktop
    And I need to make an operation in this directory
    /home/diego/Proyectos_Personales/Ejemplos/Using_QProcess-build-desktop/randy-1.0

    So I do this
    Qt Code:
    1. process->setWorkingDirectory(path);
    2. QString x=process->workingDirectory();//This returns me the directory I want :)
    3. //But when I do a pwd
    4. process->execute("pwd");//It return me the original directory :(
    5. process->execute("dh_make -e diegoturcios@ubuntu.com");
    6. process->write("s");//
    7. process->write("\n");
    To copy to clipboard, switch view to plain text mode 

    So I don't know how to solved this problem.
    Someone can give me an idea?
    Thanks

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

    Default Re: The setWorking Directory doesn't works fine??

    QProcess::execute() is a static method that doesn't operate on the object you call it from so everything you do with the "process" object is ignored by execute(). Use QProcess::start() instead.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. wince project doesn't work on wince, but works on win mobile
    By thedimitrius in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th March 2010, 12:01
  2. Replies: 3
    Last Post: 11th December 2009, 17:13
  3. Replies: 0
    Last Post: 16th July 2009, 15:58
  4. Replies: 1
    Last Post: 30th March 2009, 22:25
  5. update() works fine sometime but not everytime..!!
    By salmanmanekia in forum Qt Programming
    Replies: 19
    Last Post: 22nd August 2008, 09:11

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.