Qt World Summit: Register Today!

qmake behavior different in QtCreator and on command line

  • I am observing a strange behavior difference between QTcreator and qmake on the command line.

    Here is an example .pro file to reproduce this :

    TEMPLATE = aux
    system(/bin/echo "foo" > /tmp/bar0)
    dummy = $$system(/bin/echo "foo" > /tmp/bar1)
        system(/bin/echo "foo" > /tmp/bar2)
        dummy = $$system(/bin/echo "foo" > /tmp/bar3)
    else {
        system(/bin/echo "foo" > /tmp/bar4)
        dummy = $$system(/bin/echo "foo" > /tmp/bar5)

    When executing qmake untitled.pro in a terminal, the files bar0, bar1, bar4 and bar5 are created in /tmp.

    When right-clicking on the project name in QtCreator and clicking on "run qmake", the files bar0, bar1, bar4 and bar5 are created in /tmp.

    So far, so good.

    But when I modify the .pro file in QtCreator text editor and save it (like adding a comment somewhere), a spinning wheel appears on the project name. Then only the files bar1 and bar5 are created. In some cases bar3 is also created (!), but I can't reproduce it reliably.

    Is this the intended behavior for the "project refresh" ? I planned to use this to automate some tasks that must be done before anything, and it prevents me from using system calls under conditions.

    I am using Qt Creator 4.6.1 based on Qt 5.10.1 (GCC 7.3.0, 64 bit), on debian.

  • Lifetime Qt Champion

    hi @QuentinV,

    Creators integrated QMake parser is thought to provide data for the code model and is by no means complete.

    I think you have to explicitely run qmake (from Build menu) for your changes to take effect.

    That should also happen on a regular build (the makefile contains rules for that). in practice, we have to run qmake by hand from time to time...


Log in to reply