Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17749

Project working directory from run settings initially not applied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • Qt Creator 4.3.0-rc1
    • Qt Creator 4.2.0
    • None
    • Windows 7 and Windows 10
      Qt 5.8 MinGW and MSVC2015 32bit

      The working directory setting from project's run configuration seems not to be applied after a fresh installation on Windows.

      Steps to reproduce:

      • Installation from scratch
      • Create a new empty QtQuick project
      • Add a `qDebug() << engine.baseUrl();` debug output right after initializing the engine in main.cpp
      • Debug output is *user's home directory*

      I guess this is due to the fact that empty QDir() uses the current working directory as base path, and as the working dir is not set from the Qt Creator session it falls back to the user dir.

      Steps to temp. fix the issue:

      • Open the projects run configuration
      • Check the checkbox "Run in terminal" and uncheck it again
      • From now on the baseUrl is correctly set to the *shadow build directory*, as it was the case with Qt Creator 4.1

      Interestingly, the setting is persistent somewhere outside of the project files, after closing Qt Creator, deleting the shadow build directory, clearing the .pro.user file and re-opening Qt Creator, the correct working directory is still applied.

      I tested this on latest Qt 5.8 MinGW and MSVC2015 32bit, they both have the same behavior.

      Probably related: https://bugreports.qt.io/browse/QTBUG-57651

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            hunger Tobias Hunger
            alexleutgoeb Alex Leutgöb
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes