QTCreator Installation

QT changes their webpage frequently and releases updates to QTCreator. If what you see does not exactly match the screenshots below, do your best to select similar options.

Requirements

  1. You must have a fairly up to date version of your operating system (Windows, MacOS, or Linux).
  2. You will need to download multiple gigabytes of data. If you do not have fast internet service at home, and have a laptop, consider trying to do the installation at a library.

Prep

If you are on Mac or Linux, you need to do some quick setup:

Mac

You will need to install XCode (Apple's development tool) before installing QT. Find and install it on the app store.

Linux

Linux you may need to install other packages first. You need gcc, cmake and gdb for Ubuntu and other apt based distros you can try installing build-essential, gdb and cmake like this:

sudo apt-get install build-essential
sudo apt-get install gdb
sudo apt-get install cmake

If while installing you get errors about not being able to find -lGL you will need:

sudo apt-get install libglu1-mesa-dev

Download

Go to https://www.qt.io/download

You want the Open source version:

QTCreator open source selection

On the following page, scroll down to the bottom to download the online installer:

QTCreator online installer link

The installer needs to run on a computer that is connected to the internet so it can download the components you select. If you need to install on a computer that is not connected to the internet, or has a slow or metered connection, you should try downloading the Offline Installer at school or somewhere with a fast connection, putting it on a flash drive, and then install from that.

Installation

Launch the QT Online installer. Continue until you get to the account screen. If this is your first install, you will need to make a new Qt Account to download the software.

QTCreator account creation

Acknowledge the Open Source License:

QTCreator open source license

Then continue until you get to the Installation Folder screen. On it, look for Desktop Development installation

Desktop Installation

If it is available, select it. If not, select Custom installation:

Custom Installation

If you are doing a custom installation the following screen you pick the things to install.

Windows - Custom Installation

Skip this if you were able to do Desktop Development Installation

Open the topmost menu item that says Qt X.XX (highest number version). Look for whatever item starts with MinGW and check it:

Install options part 1

Then, scroll way down to Developer and Designer Tools. Within that section, look for the biggest number version of MinGW and check it. (If there is a version that says 32bit and one that says 64bit you want the 64bit one.)

Install options part 2

Mac

Skip this if you were able to do Desktop Development Installation

You will want to do something just like the Windows first step, only instead of looking for MinGW under QT X.XX, you should look for a version that specifies macOS (Mac).

Install options for mac

You will not need to do the second step under Developer and Designer Tools.

Linux

QTCreator is available as a package that you can install via:

sudo apt install qtcreator

If that does not work, you can try the installer. Don't worry about the "MinGW" related options that are needed for Windows.

Post Installation - Mac Only

If you are using MacOS 12.3 or above ( here is how to find out), you will need to do the following after installing QTCreator. If you are using an older version of MacOS, you can skip this step.

Download this file: openTerminal.py Make sure to save it to your Downloads folder (that should be the default location). Then, open a Terminal window (this is a window where you can type text commands to interact with your computer).

Once the terminal window is open, copy and paste in these two lines - one at a time - into the terminal (or type them):

cd ~/Downloads
cp -f openTerminal.py /Users/$USER/Qt/Qt\ Creator.app/Contents/MacOS/../Resources/scripts/openTerminal.py

These should copy the openTerminal.py file you downloaded into QTCreator to replace the original one.

QTProject Template Setup

QTCreator stores its preferences in a folder called QTProject. To install the Chemeketa project templates and set some important preferences, grab this compressed QTProject folder: https://computerscience.chemeketa.edu/guides/qtcreator-setup/QtProject.zip

Then unzip the folder. You should end up with a folder called QtProject with this inside it:

Contents of the QTProject folder: qtcreator folder and QtCreator.ini file

(There should NOT be a second folder called QtProject inside the first one. If there is, ignore the outer QtProject folder and use the inner one that actually contains QtCreator.ini and qtcreator.)

We need to move the QtProject folder to the location that QTCreator will look for it. Directions vary by platform:

Windows

The QTProject folder needs to be placed in the directory:

C:\Users\YOUR_NAME\AppData\Roaming

To find this folder, you need to enable viewing of hidden items:

Windows folder options

Then you should be able to navigate from C: to Users to YOUR_NAME to AppData then Roaming. Move or Copy the QTProject folder there:

QtProject folder placed in the AppData\Roaming folder

Mac / Linux

The QTProject folder needs to be placed in the directory:

~/.config/

This is a hidden folder named .config in your home directory (~/ is your home directory). You can get there on Mac using Command+Shift+G and typing ~/.config/ as the destination.

The .config folder may or may not already exist. If you are told that folder does not exist, you will have to create it. Open a Terminal window. Type the following two commands into it:

cd ~/
mkdir .config

The first makes sure you are in your home directory (cd: change directory). The second one makes a new folder (directory) called .config.

Place the QtProject folder inside this .config folder.

Testing the Project Template

Once you install the QTProject folder, start QTCreator and do the following to confirm your setup:

  1. Create a New Project: QtCreator File, New File or Project menu item

  2. You should see Chemeketa Projects as an option: Chemeketa Projects templates If you do not see the Chemeketa Project templates, the most likely problem is that your QTProject folder is in the wrong location. When you start QTCreator, if it cannot find a QTProject folder it will make one. Look for this folder and replace it with the provided one.

  3. Select Chemeketa Basic Project

  4. Click Next until you get to Kit Selection. Make sure at least one kit is selected. If you are on Windows, you should make sure that it is the MinGW kit: Kit selection dialog If Next button is grayed out on the Kit Selection Screen. screen, then you most likely did not install the compiler (MinGW on Windows, Xcode on Mac). If on a Mac, make sure Xcode is installed and then reinstall QT. If on Windows, rerun the installer and make sure MinGW is selected in two locations.

  5. You now should be looking at code that shows "Hello World". Build the code with Build > Build Project menu item (or ctrl-B). Then run the program with Build > Run (or ctrl-R).

  6. A window should appear that displays the text Hello World!. (If you are on a mac it will display some other text as well - you can ignore the other text.) Hello World displayed in a terminal window.