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. Qt Creator rebuilds all headers and cpp files to new objects
Forum Update on Monday, May 27th 2025

Qt Creator rebuilds all headers and cpp files to new objects

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 320 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.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on 18 Jan 2024, 16:37 last edited by JacobNovitsky
    #1

    When I add button to mainwindow form and paste some code inside derived function '
    void MainWindow::on_pushButton_3_clicked()' , it takes 20 seconds to rebuild whole project

    Question:
    I can understand why does it rebuild moc_files, but why other objects?.
    It rebuilds all headers and cpp files to new objects - why is that?

    What I'm trying to achive: I need deduct building time
    Previously I had 20-30 sec, now It takes 3-9 seconds if affect cpp files, not including new headers and not changing previous derivation

    If link some headers to shared lib it takes 10-20 seconds to compile and build, but it looks reasonable (it rebuilds all headers and cpp files to fresh objects)

    I moved all Qt related headers to shared library (.so) and now it seems to build significantly faster

    A S 2 Replies Last reply 18 Jan 2024, 19:03
    0
    • J JacobNovitsky
      18 Jan 2024, 16:37

      When I add button to mainwindow form and paste some code inside derived function '
      void MainWindow::on_pushButton_3_clicked()' , it takes 20 seconds to rebuild whole project

      Question:
      I can understand why does it rebuild moc_files, but why other objects?.
      It rebuilds all headers and cpp files to new objects - why is that?

      What I'm trying to achive: I need deduct building time
      Previously I had 20-30 sec, now It takes 3-9 seconds if affect cpp files, not including new headers and not changing previous derivation

      If link some headers to shared lib it takes 10-20 seconds to compile and build, but it looks reasonable (it rebuilds all headers and cpp files to fresh objects)

      I moved all Qt related headers to shared library (.so) and now it seems to build significantly faster

      A Offline
      A Offline
      Anonymous_Banned275
      wrote on 18 Jan 2024, 19:03 last edited by Anonymous_Banned275
      #2

      @JacobNovitsky this does not help you -- but I have been posting similar messages and it looks nobody cares. I actually got a stupid reply once - it is better to do that then not to build when required ...

      A 1 Reply Last reply 18 Jan 2024, 20:16
      0
      • J JacobNovitsky
        18 Jan 2024, 16:37

        When I add button to mainwindow form and paste some code inside derived function '
        void MainWindow::on_pushButton_3_clicked()' , it takes 20 seconds to rebuild whole project

        Question:
        I can understand why does it rebuild moc_files, but why other objects?.
        It rebuilds all headers and cpp files to new objects - why is that?

        What I'm trying to achive: I need deduct building time
        Previously I had 20-30 sec, now It takes 3-9 seconds if affect cpp files, not including new headers and not changing previous derivation

        If link some headers to shared lib it takes 10-20 seconds to compile and build, but it looks reasonable (it rebuilds all headers and cpp files to fresh objects)

        I moved all Qt related headers to shared library (.so) and now it seems to build significantly faster

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 18 Jan 2024, 19:38 last edited by
        #3

        @JacobNovitsky hi,

        You should double check your includes.

        It seems you are having quite a lot of them. A good rule: include only what you actually use and use forward declarations for everything else. That should already drive down the compilation time. When using Qt, do not use module includes.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • A Anonymous_Banned275
          18 Jan 2024, 19:03

          @JacobNovitsky this does not help you -- but I have been posting similar messages and it looks nobody cares. I actually got a stupid reply once - it is better to do that then not to build when required ...

          A Offline
          A Offline
          Axel Spoerl
          Moderators
          wrote on 18 Jan 2024, 20:16 last edited by
          #4

          @AnneRanch said in Qt Creator rebuilds all headers and cpp files to new objects:

          this does not help you

          You asked the very same question in this post. As usual, you got a polite answer. As usual, you did not reply. So we don't know if it was helpful or not.

          Thanks for calling my answer stupid and not helpful. Made my evening.

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          5

          1/4

          18 Jan 2024, 16:37

          • Login

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