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. Project tree files with qmake contains function
Forum Updated to NodeBB v4.3 + New Features

Project tree files with qmake contains function

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 534 Views 2 Watching
  • 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.
  • B Offline
    B Offline
    beecksche
    wrote on 16 Nov 2018, 07:10 last edited by beecksche
    #1

    Hi,
    i mentioned that if I add the contains function in the .pro file, where several header and source files are added, these files also are shown in the project tree in Qt Creator even if the contains function returns false.

    contains(DEFINES, MYCLASSES) {
        SOURCES += \
            myclass.cpp
    
        HEADERS += \
            myclass.h
    }
    

    Even if MYCLASSES is not defined, the files myclass.h and myclass.cpp is still shown in the project tree. Here is a screenshot.

    If I add the message function (not shown in the screenshot), I see that the scope isentered when the MYCLASSES is defined.

    I'm using Qt Creator 4.7.2 on macOS.

    But why is Qt Creator still shown these files in the project tree?

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Nov 2018, 22:41 last edited by
      #2

      Hi,

      Because the project view's role is to show you what's inside your project.

      The fact that the files are shown doesn't mean that they are going to be compiled.

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

      B 1 Reply Last reply 18 Nov 2018, 07:31
      2
      • S SGaist
        16 Nov 2018, 22:41

        Hi,

        Because the project view's role is to show you what's inside your project.

        The fact that the files are shown doesn't mean that they are going to be compiled.

        B Offline
        B Offline
        beecksche
        wrote on 18 Nov 2018, 07:31 last edited by
        #3

        @SGaist

        Thanks, make sense!

        1 Reply Last reply
        0

        2/3

        16 Nov 2018, 22:41

        • Login

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