Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set up my project hierarchy in QtCreator?

I'm quite new to QtCreator, so perhaps I left my heart in eclipse-ville, but I can't for the life of me understand how I should be setting up a project hierarchy in QtCreator. I understand there is an option to create a kind of root project and then from there add sub-projects to it, which makes sense but it leaves me wondering whether or not this is necessary at the time of creating the project, e.g. can I just create a library in one project and reference it later by another project?

I've tried setting up a blanket type of project by creating a new subdirs project and then adding the main program as a subproject, but then how should I add my library project?

Ideally, I'd like to create one project as the main application and reference another project as a library. Help?

like image 610
Joey Carson Avatar asked Oct 02 '12 03:10

Joey Carson


People also ask

How do I create a subfolder in Qt?

you can add folders in your folders manager but they should contain a file, then go QT and right-click on your project then click on "add existing directory" and select your folder. if the folder is empty it's not going to show up. it's only based on what I've done yesterday, after missing around with it.

How do I delete a project in Qt?

go to File>recent projects>clear menu. DONE!


1 Answers

The documentation of Qt Creator contains two sections that may help you find the answers to your questions:

  • Adding Subprojects to Projects
  • Adding Libraries to Projects

EDIT: You can find a really simple sample project here: QtSymbianDllExample. "It is intended to demonstrate how to create and use a DLL with Qt on the Symbian platform". It is a sample for Symbian development but that is irrelevant now, I do not have a Symbian phone. What is important is that it contains a root project (QtSymbianDllExample\qtssymbiandllexample.pro) and two subprojects (QtSymbianDllExample\qtenginedll\qtenginedll.pro, QtSymbianDllExample\testui_simpledllengine\testui_simpledllengine.pro) which you can examine and compare to you projects. I have checked that I can build the root project by doing the following steps:

  1. Download and install the Windows Offline Installer from http://www.qt.io/download/
  2. Download and extract QtSymbianDllExample.zip
  3. Run Qt Creator
  4. File / Open File or Project... Select qtssymbiandllexample.pro
  5. Build / Run qmake
  6. Build / Build project "qtsymbiandllexample"
like image 128
Bill Avatar answered Sep 28 '22 06:09

Bill