Difference between revisions of "HowTo Use OpenFOAM with QtCreator"

From OpenFOAMWiki
(Starting an OpenFOAM project)
(Starting an OpenFOAM project)
Line 30: Line 30:
 
(Obs.: ''Using Qt Creator version 2.5.0'')
 
(Obs.: ''Using Qt Creator version 2.5.0'')
  
#Open ''Qt Creator''
+
#Open ''Qt Creator''.
#Go to ''File''  <math>\to</math> ''New File or Project'' <math>\to</math> ''Other Project''
+
#Go to ''File''  <math>\to</math> ''New File or Project'' <math>\to</math> ''Other Project''.
#Click on ''Import Existing Project''
+
#Click on ''Import Existing Project''. [[File:Qt-ImportExistingProject.png|center|600px|Import existing project]]
[[File:Qt-ImportExistingProject.png]]
+
#Give your project a name and select the location to your project source tree. Select the directory where the source-files (*.C, *.H) of your OpenFOAM application are. A project-file '''''<project name>.creator''''' will be created inside the selected directory. [[File:Qt-ImportExistingProject-NameAndLocation.png|center|400px|Give a name and directory location]]
#Give your project a name and select the location to your project source tree. Click on Next.
+
#You should now have your project open in Qt Creator and ready to proceed to project settings. On the left side of Qt Creator click on Projects. Right now you’re looking at the Build Settings screen. This is where you set your project building and cleaning steps.
[[File:Qt-ImportExistingProject-NameAndLocation.png]]
+
  
 
= References =
 
= References =

Revision as of 18:02, 31 August 2012

Qt Creator is a powerful and flexible cross-platform integrated development environment (IDE) with strong orientation and support for C/C++ native development.

1 Why to use Qt Creator?

  • Open Source
  • Cross Platform – Works perfectly on Linux, Windows and Mac OS X
  • Direct compatibility with other applications of Qt SDK (great for building GUI-applications!)
  • Actively developed and improved
  • Excellent syntax highlighting
  • Magnificent code browsing and navigation in combination with useful and customizable keyboard shortcuts
  • Great and generic (works with any file you include, it doesn’t have to know anything special about it)
  • Code completion support
  • Easily customizable and Extensible through plugins
  • Support for integration with various Source Control Management tools like Git, Subversion, Bazaar, Mercurial, CVS and more.
  • Debugger integration with both GDB and Microsoft’s Debugging Tools for Windows through CDB
  • Custom configure, build, clean and deployment steps
  • Integration with tools like Valgrind
  • Per project settings
  • Vim editing mode
  • Code snippets
  • A pretty fast IDE, even when indexing hundreds of files with hundreds of thousands lines of code for the first time
  • Linux Man Pages context help integration - thanks to the flexible Qt Help System, this can be extended to almost any API

2 Download and installation

Most of the main Linux distributions have binaries in their repositories. Otherwise, download and install Qt Creator from http://qt.nokia.com/downloads.

Installation example in Debian/Ubuntu:

# apt-get install qtcreator

3 Starting an OpenFOAM project

(Obs.: Using Qt Creator version 2.5.0)

  1. Open Qt Creator.
  2. Go to File \to New File or Project \to Other Project.
  3. Click on Import Existing Project.
    Import existing project
  4. Give your project a name and select the location to your project source tree. Select the directory where the source-files (*.C, *.H) of your OpenFOAM application are. A project-file <project name>.creator will be created inside the selected directory.
    Give a name and directory location
  5. You should now have your project open in Qt Creator and ready to proceed to project settings. On the left side of Qt Creator click on Projects. Right now you’re looking at the Build Settings screen. This is where you set your project building and cleaning steps.

4 References

This tutorial is based on: