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] qmake: += but avoiding duplicates
QtWS25 Last Chance

[Solved] qmake: += but avoiding duplicates

Scheduled Pinned Locked Moved Qt Creator and other tools
qmake
8 Posts 3 Posters 1.9k 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 last edited by Asperamanca
    #1

    A few months ago, someone posted that an alternative to += exists, which will append to a list just as += does, but will avoid duplicate entries.

    So instead of HEADERS += ... you could write HEADERS (?)= ... and be sure that every file is only mentioned once.

    For some reason, this is not in the docs (or very well hidden).

    Does anyone know the thing I'm talking about?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      This is documented: link. You should use star for this: HEADERS *= something.h

      (Z(:^

      A 1 Reply Last reply
      2
      • sierdzioS sierdzio

        This is documented: link. You should use star for this: HEADERS *= something.h

        A Offline
        A Offline
        Asperamanca
        wrote on last edited by Asperamanca
        #3

        @sierdzio
        Thanks. I somehow missed that one.

        Edit: Now how do I mark the topic "solved"?

        sierdzioS 1 Reply Last reply
        0
        • A Asperamanca

          @sierdzio
          Thanks. I somehow missed that one.

          Edit: Now how do I mark the topic "solved"?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by sierdzio
          #4

          @Asperamanca said:

          @sierdzio
          Thanks. I somehow missed that one.

          Yes, I've noticed this part of help has seen a major rewrite in Qt 5. Not sure where the note is located in new docs. If it is missing, then it is probably a bug.

          Edit: Now how do I mark the topic "solved"?

          You need to go to "Topic Tools" menu - there is a button for marking threads as solved there. If it does not work (I know there used to be some glitches here after forum transition), you can do the good old manual approach: add [solved] to topic title.

          (Z(:^

          A 1 Reply Last reply
          1
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            It's now in qmake Language

            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
            4
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Ah, indeed. Thanks, @SGaist :-)

              (Z(:^

              1 Reply Last reply
              0
              • sierdzioS sierdzio

                @Asperamanca said:

                @sierdzio
                Thanks. I somehow missed that one.

                Yes, I've noticed this part of help has seen a major rewrite in Qt 5. Not sure where the note is located in new docs. If it is missing, then it is probably a bug.

                Edit: Now how do I mark the topic "solved"?

                You need to go to "Topic Tools" menu - there is a button for marking threads as solved there. If it does not work (I know there used to be some glitches here after forum transition), you can do the good old manual approach: add [solved] to topic title.

                A Offline
                A Offline
                Asperamanca
                wrote on last edited by
                #7

                @sierdzio Tools menu doesn't offer that option (but it strangely has an empty space exactly the size of a button). But good old way works of course :-)

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  Hm, maybe it's available only to admins at the moment. I know Tero has some problems with this issue (in the forum software Qt IO is using, changing topic title - to prepend [Solved] - requires admin priviledges), but is working on it.

                  (Z(:^

                  1 Reply Last reply
                  0

                  • Login

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