Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

File has been removed ???



    1. Why am I getting this message ?
      It seems at random.
    2. isn't "moc" system generated so why saving it ?
    3. If it was removed - how can it be saved anyway?
      Illogical Mr Spock

    3f495751-16b9-47fa-8c43-1aa2630609ee-image.png


  • Moderators

    @AnneRanch said in File has been removed ???:

    1. Why am I getting this message ?
      It seems at random.

    You got this message because you opened moc_mainwindow.cpp in Qt Creator's code editor, and then moc_mainwindow.cpp was deleted while it was still open.

    1. isn't "moc" system generated so why saving it ?

    The code editor doesn't differentiate between generated files vs. user-written files.

    Normally, you don't want a file to disappear from disk while you're viewing/editing it, right? The code editor noticed that a file that you opened has disappeard. So, it's letting you know and asking how you'd like to proceed.

    1. If it was removed - how can it be saved anyway?
      Illogical Mr Spock

    Even though the file is no longer on disk, the file's contents are still in loaded into the code editor's memory. The code editor can use its memory to re-save a new copy of the file.



  • @JKSH said in File has been removed ???:

    @AnneRanch said in File has been removed ???:

    1. Why am I getting this message ?
      It seems at random.

    You got this message because you opened moc_mainwindow.cpp in Qt Creator's code editor, and then moc_mainwindow.cpp was deleted while it was still open.

    No, I am not editing opening moc file .
    Even so - I am not deleting any file.

    1. isn't "moc" system generated so why saving it ?

    The code editor doesn't differentiate between generated files vs. user-written files.

    If so - who what is deleting this file and why should I care if it is generated ?
    It seem that the message is "just because" and has no purpose for the user.

    Normally, you don't want a file to disappear from disk while you're viewing/editing it, right? The code editor noticed that a file that you opened has disappeard. So, it's letting you know and asking how you'd like to proceed.

    1. If it was removed - how can it be saved anyway?
      Illogical Mr Spock

    Even though the file is no longer on disk, the file's contents are still in loaded into the code editor's memory. The code editor can use its memory to re-save a new copy of the file.

    Again - the logic of the message is superfluous.
    File which normally is not edited got deleted from disk, and not by the user and will be (hopefully) regenerated and can be restored / renamed (?) from memory.

    Basically nothing to write home about it...


  • Moderators

    @AnneRanch said in File has been removed ???:

    No, I am not editing opening moc file .

    In that case, we have a mystery on our hands.

    If it happens again, please post a screenshot of the "File Has Been Removed" dialog, with the "Open Documents" pane visible:

    Even so - I am not deleting any file.....
    who what is deleting this file

    Generated files get deleted when you clean your project.



  • I am not sure if this will help.
    Got the same error when attempting to "clear" the project.

    I will frelly admit I did not look inoto "moc" . My limited knowldge is that these are generated .

    I guess the main question would be - why I am getting all these "moc" error and NOT any real references to the SOURCE of the error.

    These errors should logically be because my SOURCE is wrong and that is what I can correct - not the result.

    Maybe I need to revisit my "debug" options ?
    If that is the case (and group interest) I could post the screen shot of my debug options to see which one is source of this "moc" showing up and not the real source of the problem.

    7395bbb8-569c-4ef7-bdc8-e609bb915fc2-image.png


  • Lifetime Qt Champion

    Then don't open this file in the IDE as @JKSH already told you...


  • Moderators

    @AnneRanch said in File has been removed ???:

    I could post the screen shot of my debug options

    This screenshot won't help us diagnose the issue.

    What will help is what I said in my previous post: Please post a screenshot of the "File Has Been Removed" dialog, with the "Open Documents" pane visible. Look at the red, highlighted part of my screenshot.


  • Moderators

    @AnneRanch said in File has been removed ???:

    I am not deleting any file.

    Look closely at "Compile Output" in your last screenshot: You ran "/usr/bin/make" clean -j4, which deleted all of your generated moc files via rm -f.


Log in to reply