PDA

View Full Version : Add existing project



danesh
30th March 2009, 15:23
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.

wysota
30th March 2009, 16:01
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.

faldzip
30th March 2009, 19:25
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

danesh
31st March 2009, 10:52
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.

talk2amulya
31st March 2009, 11:50
have you read about pro files?

danesh
31st March 2009, 13:30
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.

talk2amulya
31st March 2009, 13:46
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.

faldzip
31st March 2009, 23:01
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 :]

danesh
2nd April 2009, 01:21
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.

wysota
2nd April 2009, 01:46
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).

Carlton
22nd April 2009, 14:12
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.:(

Carlton
23rd April 2009, 00:40
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.

wysota
23rd April 2009, 20:47
Could you check in the help if all plugins loaded successfully?