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 Updated to NodeBB v4.3 + New Features

Adding search directory in Qt IDE

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 812 Views 1 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.
  • A Offline
    A Offline
    ArbolOne
    wrote on 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
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on 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

      • Login

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