Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Qt Creator UI header file location

    Tools
    3
    4
    8369
    Loading More Posts
    • 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.
    • G
      gibbogle last edited by

      I am building my Qt app with Qt Creator 2.0.1, on Windows 7 (from the SDK), using the mingw32 tools. My source code and .pro file all reside in foo\GUI, and I am doing a Shadow build in foo\build. It is annoying that when I make changes to a form the revised UI header is created in the build directory, and is not found by the compiler, which is looking for it in the source directory. I can copy the header file across manually, of course, but I'm sure there must be a way to have the file created in the same directory as all the other source files. Can someone throw some light on this?

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Take a look at how you include the ui_<filename>.h files in your headers. It's probably looking for them in current dir. Add foo/build to qmake's includepath, maybe? Never had that problem myself, to be honest.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • A
          andre last edited by

          You can change where to create them using the UI_DIR variable in your .pro file. I prefer to not have them mixed with my source files, but that may just be me. I like to keep generated files and manually created files separate in your projects.

          1 Reply Last reply Reply Quote 0
          • G
            gibbogle last edited by

            Thanks Andre, I'll try that. Any idea why in this case the compiler thinks the automatically-generated header is in foo\GUI, rather than in foo\build, which is where it usually looks?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post