Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] .pro-Files without HEADERS
Forum Update on Monday, May 27th 2025

[SOLVED] .pro-Files without HEADERS

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 3 Posters 2.3k 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on 21 Feb 2013, 08:37 last edited by
    #1

    I was asked why we need to include the HEADERS into our .pro files. I should note that we do not use Creator as our primary IDE, we create the .pro-Files in order to use qmake for batch compilation.

    Is there any good reason other than the IDE to include the HEADERS? Will omitting them cause dependency problems? Would a .pro-File without HEADERS still open & compile in Creator (for those of us who occasionally use that IDE)?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tilsitt
      wrote on 21 Feb 2013, 09:09 last edited by
      #2

      Hi,

      According to the "doc":http://doc.qt.digia.com/4.7/qmake-variable-reference.html#headers, the HEADERS variable is used by qmake to generate dependency information and detect if moc is required. So, yes, there are good reasons ;)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on 21 Feb 2013, 09:39 last edited by
        #3

        But shouldn't adding a DEPENDSPATH to the path where the headers are located do the same thing?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 21 Feb 2013, 09:40 last edited by
          #4

          No, this tells qmake to check wether something has changed in these paths and rebuild if necessary

          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
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on 21 Feb 2013, 10:00 last edited by
            #5

            If I understand you correctly, moc might not be run based on a header file change, even if the folder containing the header file is part of the DEPENDS_PATH.
            Right?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 21 Feb 2013, 10:06 last edited by
              #6

              Yes, qmake will take the files from HEADERS and parse them to know if moc needs to be run.

              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
              0
              • A Offline
                A Offline
                Asperamanca
                wrote on 21 Feb 2013, 10:17 last edited by
                #7

                Thanks!

                (Note: Seems like a plain "Thanks" does not conform to some posting rule. So I add this rather pointless explanation)

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 21 Feb 2013, 10:36 last edited by
                  #8

                  You're welcome !
                  You might also want to set this thread as solved

                  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
                  0

                  1/8

                  21 Feb 2013, 08:37

                  • Login

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