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. QProcess QDir::currentPath() error
Forum Updated to NodeBB v4.3 + New Features

QProcess QDir::currentPath() error

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 481 Views
  • 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1
    Program A:
    QProcess *proc = new QProcess;
    proc->start(pathb);
    
    Program B:
    QDir::currentPath()
    

    QDir::currentPath() in program B,changed to QDir::currentPath() of A, cause config file read and write error.

    https://github.com/sonichy

    jsulmJ 1 Reply Last reply
    0
    • sonichyS sonichy
      Program A:
      QProcess *proc = new QProcess;
      proc->start(pathb);
      
      Program B:
      QDir::currentPath()
      

      QDir::currentPath() in program B,changed to QDir::currentPath() of A, cause config file read and write error.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @sonichy Use http://doc.qt.io/qt-5/qprocess.html#setWorkingDirectory
      As explained there:
      "Sets the working directory to dir. QProcess will start the process in this directory. The default behavior is to start the process in the working directory of the calling process."

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

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