Qt Creator won't detect last changes



  • Hey everyone,
    I don't know what prevents Qt Creator from building my project recently. It worked great, but now every time I add some changes in the code (of one of my project files *cpp, *h, *ui), and I click on Build & Run as usual, the changes aren't added. For example, I change the title of my MainWindow, I build and run, and nothing changes! Like if you click on run.
    I tried Clean, Clean All, qmake, reboot (my PC), close Qt Creator and restart... but unfortunately none of them had solved my issue.

    I'm using Qt Creator v4.5.0, Qt 5.10.
    I will appreciate your help.


  • Lifetime Qt Champion

    Hi,

    Might be a silly question but did you had auto-save enabled and now it's not the case anymore ?



  • Do you mean this :
    0_1530573272919_dd.PNG
    It was already enabled, and I also tried to saveAll, it's really a silly question!
    However, thanks for the quick reply.



  • The problem disappeared finally, after closing Qt Creator and restarting it, and deleting debugging folder. However, I still ignore what happened. Anyway, I will mark that topic as solved, hoping that that silly problem never come back again.

    Have a good day.



  • Hello,

    are your sources or the build Folder on a Network drive ? check the System times!



  • Hi @Gerhard,
    The build folder and sources are all on my PC's hard drive 'C:'. For "check System times" maybe you're right, because the problem occurred when I started testing a function that deal with date changes (in my program I need to have a save file each day), and to test it, I was changing the date of my PC randomly. But I don't know how that would affect Qt Creator.


  • Qt Champions 2017

    @SamurayH

    creator uses make (in one of its derivates) to compile your app.

    make simply compiles every source file that is newer than the corresponding object file. otherwise it stays as is until you delete the object file, aka rebuild.



  • @aha_1980
    Honestly, I didn't get your point.


  • Moderators

    @SamurayH You should read about make tool. make is a tool to build software projects using Makefile files. QtCreator itself does NOT compile anything. It simply calls qmake which creates Makefile files and then make is called. make calls then compiler and linker to build your software project. Every time you (or QtCreator) call make it checks which source files are newer than the object files made out of them. Then it compiles all source files which are newer. Example:

    source_1.cpp is compiled to source_1.o object file
    source_1.cpp --> source_1.o
    
    // Here make would not compile source_1.cpp as the source_1.o is newer, so source_1.cpp is unchanged
    source_1.cpp - 11:00 04.07.18
    source_1.o   - 11:01 04.07.18
    
    // Now you change source_1.cpp
    source_1.cpp - 12:00 04.07.18
    source_1.o   - 11:01 04.07.18
    // If you now call make it will detect that source_1.cpp is newer (changed) and it will compile it (it will call the compiler)
    


  • @jsulm
    Thanks for clarifying.

    So now everything is clear. Like @Gerhard said: "check the System times!".
    I was telling make that the source file is not newer, by editing it in 05/07/2018 (because I forgot to reset the date after changing it earlier), and then I remember that the date has to be reset to 04/07/2018, and then saving and building.

    Thanks, all!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.