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. How to add existing files to a project?
Forum Updated to NodeBB v4.3 + New Features

How to add existing files to a project?

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 12.8k 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.
  • T Offline
    T Offline
    tintin
    wrote on last edited by
    #1

    hi,

    I am new to qt creator.
    I am using ubuntu SDK. I have created a project and want to add some existing files to it.
    When I right click on the project, "add existing files" is not clickabe (disabled) for some reason I don't know.
    When I try to add using :
    File -> New File .... It gives File generation failure.

    So, is there any other way of doing it.
    Thanks

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Maby Canonical broke something.

      Is your project qmake-based? It should work. If you are using QBS, then that feature is not available (yet).

      (Z(:^

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tintin
        wrote on last edited by
        #3

        thanks for the reply....
        qmake-based?...I don't know...but in order to get the .pro file I ran qmake -project.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          OK so it is a qmake project. Looks like a bug from Canonical, then. This should work and is working for me with every platform and Qt Creator version I've tried (which is a lot).

          (Z(:^

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mikeosoft
            wrote on last edited by
            #5

            One way to work around this would be to shut down Qt Creator and edit the project .pro file using a text editor; adding the files manually, before you open Creator again.

            The .h files need to be added to the HEADERS section and the .cpp in the SOURCES. You need to make sure the last file in the list before each of your additional ones has a space and then a \ after it.

            If you restart Qt Creator the files should be part of the project.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              No need to restar, Qt Creator will reparse .pro file after it is modified.

              (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