From Van Essen Lab

Jump to: navigation, search


Using Qt Creator for C++ Development

Set Qt Creator Preferences

  • Select Preferences from File Menu or Qt Creator Menu on Mac

Preferences Dialog

  • QT4
    • Press the + button (on the right) and Choose the "qmake" version in the "bin" directory of your QT library.
  • Text Editor
    • Verify that Insert spaces instead of tabs is selected and tabs/indent is 3.
  • Help
    • Filters
      • Remove version of QT not being used.
  • C++
    • Set source suffix to cxx.
    • Uncheck Lower case files names.
  • Projects
    • General
      • Set Projects Directory to Current directory.
      • Check all of the Build and Run checkboxes.

Press the OK button to close the Preferences Dialog.

Create a C++ Project from Caret Source in Qt Creator

  • Select File Menu->Open File or Project
  • Choose the ".pro" file in the source directory (ie: in caret_common) and press the Open button.
  • In the Project setup dialog, increase the width of the dialog and select only one of the QT Versions and be sure it is the one in the source directory (ie: caret_files) containing the .pro file. Press the Done button.
  • In the far left column of the Qt Creator Window, click the "Projects" (folder).
  • In the top of the Qt Creator Window, click the name of the .pro file that was selected to create the project (ie: caret_files).
  • In the second row at the top, select Build Settings.
  • In General, verify that the Build Directory is the directory containing the .pro file.
  • Click the Details arrow on the right side of the Build Environment.
  • Press the Add button once for each of these environment variables (NETCDF_INC_DIR, NETCDF_LIB_DIR, QWT_INC_DIR, QWT_LIB_DIR, VTK_INC_DIR, VTK_LIB_DIR) and enter their respective values.

Build Project

  • Click the Edit icon in the far left column of Qt Creator.
  • In the Projects column of the Qt Creator Window, click the project you just imported.
  • Select Build Menu->Build Project "<name of project>".

Set up Executables for Debugging

  • Click Projects icon in far left column of Qt Creator
  • Set Working Directory to desired directory such as the one containing the Caret files.
  • Select Project and Debug Menu->Start Debugging
  • The gdb debugger may take a while to start and QtCreator may popup a message indicating that gdb has not responded, give gdb more time.
  • You may be asked to build the "debugger help" library, go ahead and do so. It is built and installed in the QtCreator distribution (not your QT library).
Personal tools
Sums Database