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. Do .pri subprojects have a name?

Do .pri subprojects have a name?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
8 Posts 3 Posters 1.7k 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.
  • R Offline
    R Offline
    rmam
    wrote on last edited by
    #1

    As Qt Creator handles .pri files in a special way, somewhere in between a module and a subproject, does anyone know if this particular concept/feature received a specific official name by the Qt community? A specific name would simplify how this feature could be addressed in technical discussions.

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

      .pri is simply an include file, there is no special name for it. And there is nothing special about .pri files either - they are more or less copy pasted into .pro when you call include().

      (Z(:^

      R 1 Reply Last reply
      4
      • R rmam

        As Qt Creator handles .pri files in a special way, somewhere in between a module and a subproject, does anyone know if this particular concept/feature received a specific official name by the Qt community? A specific name would simplify how this feature could be addressed in technical discussions.

        VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        @rmam said in Do .pri subprojects have a name?:

        somewhere in between a module and a subproject

        I always treated it as nothing more than a copy/paste machine. Happy to see if someone have a more insightful view

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        0
        • sierdzioS sierdzio

          .pri is simply an include file, there is no special name for it. And there is nothing special about .pri files either - they are more or less copy pasted into .pro when you call include().

          R Offline
          R Offline
          rmam
          wrote on last edited by
          #4

          @sierdzio said in Do .pri subprojects have a name?:

          And there is nothing special about .pri files either

          Actually there is, when using Qt Creator. Qt Creator lists files included in .pri files differently, in dedicated sections which are something between a subproject and a module.

          1 Reply Last reply
          0
          • VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by
            #5

            This is just a display difference. There is no functionality change due to things being in a pri file

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            R 1 Reply Last reply
            3
            • VRoninV VRonin

              This is just a display difference. There is no functionality change due to things being in a pri file

              R Offline
              R Offline
              rmam
              wrote on last edited by
              #6

              @VRonin said in Do .pri subprojects have a name?:

              This is just a display difference. There is no functionality change due to things being in a pri file

              Representing groups of related components differently is already a significant change in functionality.

              Furthermore, multiple subprojects can include the same .pri file, which propagates the same pseudo-module throughout multiple projects. That's also a significant functionality change as well.

              sierdzioS 1 Reply Last reply
              0
              • R rmam

                @VRonin said in Do .pri subprojects have a name?:

                This is just a display difference. There is no functionality change due to things being in a pri file

                Representing groups of related components differently is already a significant change in functionality.

                Furthermore, multiple subprojects can include the same .pri file, which propagates the same pseudo-module throughout multiple projects. That's also a significant functionality change as well.

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

                @rmam said in Do .pri subprojects have a name?:

                Furthermore, multiple subprojects can include the same .pri file, which propagates the same pseudo-module throughout multiple projects. That's also a significant functionality change as well.

                But it's still only about displaying the .pri. You project is build by qmake, and to qmake the pri file is just a simple include.

                Think of it like of a global header you might have in your source code: you may include it across different modules, even across libraries of your project, but from compiler's perspective there is nothing special about it: just a header that it has to parse more often than other headers.

                (Z(:^

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

                  Since you mention functionality change: there is, of course, a way to use .pri cleverly. Consider this code:

                  CONFIG += feature1
                  
                  # ...
                  
                  feature1 {
                    include(mySuperFeature.pri)
                  } else {
                    include(myOtherSuperFeature.pri)
                  }
                  

                  In this simple way you can include different headers, sources, rules etc. based on some config values. However, even here, the pri file is only a simple include. You would get exactly the same results if you copy-pasted the contents of mySuperFeature.pri and myOtherSuperFeature.pri directly into the code above.

                  (Z(:^

                  1 Reply Last reply
                  2

                  • Login

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