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 447 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.
  • S Offline
    S Offline
    sonichy
    wrote on 20 Apr 2018, 08:20 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

    J 1 Reply Last reply 20 Apr 2018, 08:42
    0
    • S sonichy
      20 Apr 2018, 08:20
      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.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 Apr 2018, 08:42 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

      1/2

      20 Apr 2018, 08:20

      • Login

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