Results 1 to 13 of 13

Thread: Add existing project

  1. #1
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Add existing project

    Hi all,

    I have just started to use Qt Creator 1.0.0 with Qt 4.5.0. I would like to create my GUI in Qt Creator and then add my existing sources of my project to Qt Creator and re-compile the whole project. Is there any way to import sources into Qt Creator? I did import some files manually (by copying into my Qt project path) but this will not work when I want to import all files (Make file problem, paths, etc.) Have you done this before?

    Regards,

    D.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Add existing project

    I don't see the problem... You don't have to "import" anything. Just open the project file with Qt Creator and it will use the files from the project.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    and if you want to add some existing files just right-click on your project tree in QtCreator and choose Add existing files...
    Rather simple and dont need any special investigation or even reading docs - i think that less time is needed to discover that functionality yourself than for writing that post :P
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  4. #4
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    Well I did know that files can be added to project like you said, but the problem is that it seems to me that some features are missing such as put all added files in a folder so added files are classified in project tree and also adding path to include folders and libraries. I had tried to add files and Qt Creator updated Makefile and everything was OK, but I need to add bunch of files and paths which I don't know how to do it in an efficient way.

    D.

  5. #5
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    have you read about pro files?

  6. #6
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    Yes I know ".pro" files and I prefer not to modify them manually since they will be updated when I add sources. I don't think my problem is there.

    D.

  7. #7
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    Quote Originally Posted by danesh View Post
    Well I did know that files can be added to project like you said, but the problem is that it seems to me that some features are missing such as put all added files in a folder so added files are classified in project tree and also adding path to include folders and libraries. I had tried to add files and Qt Creator updated Makefile and everything was OK, but I need to add bunch of files and paths which I don't know how to do it in an efficient way.
    D.
    you are using qt creator's initial version and it doesnt have all the features of a full-fledged IDE. Most functions u mentioned like adding path to include folders and libraries and putting files in a particular folder is all done through pro files AFAIK. So nothing is wrong with your Qt creator.

  8. #8
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    such as put all added files in a folder
    it can add files to your project, but can't copy them - have to copy manually.
    so added files are classified in project tree
    just add them and they will be in project tree
    Yes I know ".pro" files and I prefer not to modify them manually
    QtCreator isn't a gui wrapper for all the qmake functionality so except of addin and removing files, rest you have to add to pro file manually. Whats more, you can do it staright from QtCreator - it gives you at least some syntax highlighting.
    So:
    - want to add some files from different folders - copy them into folder with some nice folder tree (to keep the folders and project parts more clean) and create pro file (adding files in Creator, manually or creating pro file with qmake - last is good at the beginning to get some startup pro file for modify).
    - read about qmake options to make your pro file work in your favourite way (e.g. DESTDIR, UI_DIR, MOC_DIR, INSTALLS, CONFIG += build_all warn_on etc.)
    - have fun with QtCreator :]
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  9. #9
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    Thanks. It works so far, however all files are in same level in project tree. Anyway, Qt Creator is good enough to ignore such things.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Add existing project

    Creator currently doesn't provide any groupping mechanism other than on the level of qmake project files (i.e. files defined in separate .pri files will be available as separate groups in the project tree).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Oct 2007
    Location
    Warminster, England
    Posts
    31
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    Quote Originally Posted by wysota View Post
    I don't see the problem... You don't have to "import" anything. Just open the project file with Qt Creator and it will use the files from the project.
    When I open a project file, it just opens in the editor, without importing the project data.

  12. #12
    Join Date
    Oct 2007
    Location
    Warminster, England
    Posts
    31
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Add existing project

    I checked my Linux installation when I got home tonight. Here when you open a .pro flile in Qtcreator, the complete project is set up enabling the project to be built. On my XP installation at work, the .pro file is opened as a file to edit, and the project not set up . Should I just reinstall it?, sound broken to me.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Add existing project

    Could you check in the help if all plugins loaded successfully?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 06:34
  2. help needed with complicated project
    By Muzz in forum Newbie
    Replies: 12
    Last Post: 15th February 2008, 10:54
  3. Importing qt project to an eclipse workspace
    By isahin in forum Installation and Deployment
    Replies: 2
    Last Post: 28th January 2008, 19:00
  4. how do i use a same project in multiple systems ?
    By nhatkhang in forum KDE Forum
    Replies: 6
    Last Post: 21st December 2006, 17:32
  5. Replies: 2
    Last Post: 11th July 2006, 15:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.