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. qmake include() NOT work in the brakets scope
Forum Updated to NodeBB v4.3 + New Features

qmake include() NOT work in the brakets scope

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 599 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.
  • Q Offline
    Q Offline
    QtTester
    wrote on last edited by QtTester
    #1

    Hi guys ,

    Windows10 + Qt5.14.1

    I want to include some pri in some condition, but it not work, why?
    just give pictures:

    When not use condition(a variable):
    微信截图_20221020112825.png

    When use condition:
    微信截图_20221020112848.png

    From the file tree, it seems include() always works in any condition!!!

    jsulmJ 1 Reply Last reply
    0
    • Q QtTester

      Hi guys ,

      Windows10 + Qt5.14.1

      I want to include some pri in some condition, but it not work, why?
      just give pictures:

      When not use condition(a variable):
      微信截图_20221020112825.png

      When use condition:
      微信截图_20221020112848.png

      From the file tree, it seems include() always works in any condition!!!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @QtTester said in qmake include() NOT work in the brakets scope:

      From the file tree, it seems include() always works in any condition!!!

      Because you have if..else, so either project1 or project2 is included (this is also visible in the output you posted). So, I don't see any issue here.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Q 1 Reply Last reply
      0
      • jsulmJ jsulm

        @QtTester said in qmake include() NOT work in the brakets scope:

        From the file tree, it seems include() always works in any condition!!!

        Because you have if..else, so either project1 or project2 is included (this is also visible in the output you posted). So, I don't see any issue here.

        Q Offline
        Q Offline
        QtTester
        wrote on last edited by
        #3

        @jsulm
        we can see the message only output in the right if/else.
        not both message(project1/project2).
        So in the file tree, it should only include the right "Projectx.pri",

        in "both include" situation, we cannot know which pri is included and worked.

        Right?

        jsulmJ 1 Reply Last reply
        0
        • Q QtTester

          @jsulm
          we can see the message only output in the right if/else.
          not both message(project1/project2).
          So in the file tree, it should only include the right "Projectx.pri",

          in "both include" situation, we cannot know which pri is included and worked.

          Right?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @QtTester So, you're basically asking why QtCreator shows both projects in project tree, right? What QtCreator version do you use?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          Q 1 Reply Last reply
          0
          • jsulmJ jsulm

            @QtTester So, you're basically asking why QtCreator shows both projects in project tree, right? What QtCreator version do you use?

            Q Offline
            Q Offline
            QtTester
            wrote on last edited by
            #5

            @jsulm
            Hi, I am using 6.0.2.
            The important thing is , we are confused which pri is used.

            jsulmJ 1 Reply Last reply
            0
            • Q QtTester

              @jsulm
              Hi, I am using 6.0.2.
              The important thing is , we are confused which pri is used.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @QtTester I'm not sure but I think QtCreator will only show source code files for the project which is active, so try to add some source code files to project1 and project2 and see what is shown then.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              Q 1 Reply Last reply
              0
              • J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                I had the same grievances

                let me forward the answer I got from customer support:

                Qt Creator behavior differs from how qmake actually works because they have different goals

                Qt Creator parses qmake files so that it takes all available code paths. That is to make sure the whole project including possible platform specific files/projects are visible in editor.

                Not a really satisfying answer, especially as it is inconsistent behaviour. For example android scoped DISTFILES don't show up in QtCreator ProjectView.

                But it's as it is, "working as intended"


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                1 Reply Last reply
                0
                • jsulmJ jsulm

                  @QtTester I'm not sure but I think QtCreator will only show source code files for the project which is active, so try to add some source code files to project1 and project2 and see what is shown then.

                  Q Offline
                  Q Offline
                  QtTester
                  wrote on last edited by
                  #8

                  @jsulm
                  Source files are correctly included. but pri is not hided with inactive property.
                  In my project, file is not added in pri, just some variables are declared.
                  maybe it's a QC bug ?

                  微信截图_20221020140306.png

                  jsulmJ 1 Reply Last reply
                  0
                  • Q QtTester

                    @jsulm
                    Source files are correctly included. but pri is not hided with inactive property.
                    In my project, file is not added in pri, just some variables are declared.
                    maybe it's a QC bug ?

                    微信截图_20221020140306.png

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @QtTester said in qmake include() NOT work in the brakets scope:

                    Source files are correctly included. but pri is not hided with inactive property.

                    At least you can see which project is active (the one where you also see source files).

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    Q 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @QtTester said in qmake include() NOT work in the brakets scope:

                      Source files are correctly included. but pri is not hided with inactive property.

                      At least you can see which project is active (the one where you also see source files).

                      Q Offline
                      Q Offline
                      QtTester
                      wrote on last edited by
                      #10

                      @jsulm ba9e-fyqwiqk3041219.jpg

                      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