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. Adding search directory in Qt IDE
Forum Update on Monday, May 27th 2025

Adding search directory in Qt IDE

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 794 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
    ArbolOne
    wrote on 1 Oct 2013, 04:24 last edited by
    #1

    I would like to add a very long path directly into my Qt project, so that I don't have to write something like:

    @#include "C:\dir1\dir2\dir3\dir4\dir5\dir6\dir7\dir8\my_header.hpp"@

    Can this be done using QTIDE?

    Thanks

    This is not the first time you've been here, at the end you've always lost. You create viruses and we the cure, and in this battle you've always lost.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 1 Oct 2013, 06:08 last edited by
      #2

      This has nothing to do with Qt Creator. You need to add your header to INCLUDEPATH in you .pro file (if you are using qmake):
      @
      INCLUDEPATH+=C:/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
      @

      Then, in your source file:
      @
      #include "my_header.hpp"
      @

      On a related note, don't use absolute paths in your source code! Make them relative to your project's root directory. Otherwise your code will not be useful on other machines.

      (Z(:^

      1 Reply Last reply
      0

      1/2

      1 Oct 2013, 04:24

      • Login

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