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. Hide *.pri include in Project Tree
QtWS: Super Early Bird Tickets Available!

Hide *.pri include in Project Tree

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 5 Posters 6.0k 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.
  • W Offline
    W Offline
    walteste
    wrote on last edited by
    #1

    Each file "include.pri" that i include in my project.pro file is listed in the project tree of the Qt Creator.

    Is there a way to hide particular included files in the project tree?

    1 Reply Last reply
    0
  • W Offline
    W Offline
    walteste
    wrote on last edited by
    #2

    Unfortionetaly, i did not receive help in that matter. Let me reform my question(s).

    Question 1.) How do i hide an included PRI file from the QT Creator Project Tree?

    Question 2.) How can i change the name in the project tree of a PRI file include to something else than the filename?

    Question 3.) If a PRI file is included which includes another PRI file, then i would like to have them nested. how can i do this?

    1 Reply Last reply
    0
  • A Offline
    A Offline
    andre
    wrote on last edited by
    #3

    I don't think you can do either 1 or 2, but I think 3 is standard already?

    1 Reply Last reply
    0
  • W Offline
    W Offline
    walteste
    wrote on last edited by
    #4

    I have found some partial solutions to my own questions. :-)

    1.) I found the function called load and instead of a PRI file i include now $$PWD/xxxx.prf - I know it is not really an include but it does exactly what i needed.

    2.) Yes, i worried that this will not be possible.

    3.) According to your answer, i have tested it but it wont work. Can you give me an example how you make this work?

    1 Reply Last reply
    0
  • W Offline
    W Offline
    walteste
    wrote on last edited by
    #5

    My final solution is the function fromfile() instead of including that file.

    1 Reply Last reply
    0
  • G Offline
    G Offline
    GoblE
    wrote on last edited by
    #6

    I know it's an old post, but I have the same problem and I didn't found solution...
    Now, it's possible to hide some pri files into the QtCreator tree view?

    1 Reply Last reply
    0
  • A Offline
    A Offline
    andreyc
    wrote on last edited by
    #7

    I think that the solution that Stefan Walter is referring to is to use fromfile() function to get some variables from .pri file.
    It will hide the .pri file but it will evaluate the .pri file as many times as many variables your are assigning.
    Here is an example

    • variables.pri
      @
      BUILD_DIR = ../build
      TESTS_DIR = $${BUILD_DIR}/tests
      @

    • project.pro
      @
      DESTDIR = $$fromfile(variables.pri, BUILD_DIR)
      TESTDESTDIR = $$fromfile(variables.pri, TESTS_DIR)
      @

    As a result you will not see variables.pri on QtCreator "Projects" tree
    But qmake will read variables.pri twice.

    Convenience vs performance.

    1 Reply Last reply
    0
  • G Offline
    G Offline
    GoblE
    wrote on last edited by
    #8

    Thanks for your reply and for explanations about fromfile() solution.

    I'll see if I can use this solution, it's not sure because I set lot of custom variables in my pri files to create a specific environment (I use these pri like "plugins" for my different projects). In my case, I think, to use this solution mean copy all content of my pri files into my pro file. I'll study your solution.

    1 Reply Last reply
    0
  • X Offline
    X Offline
    Xam P
    wrote on last edited by Xam P
    #9

    Is there still no elegant solution to this?

    Can not get "load" to work, and another post suggests it might be broken.

    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