Qt Creator Installation - Mac

Download and install Java Development Kit (JDK)

Go to Oracle's Java JDK download page. On that page, under the heading labeled "Java SE Development Kit 10.0.2", click the button to Accept the license agreement, then click the macOS link (it should be the middle one in the list) to download the appropriate installer for your operating system. You don't need to download the "Demos and Samples Downloads" link. Once you have downloaded the Java JDK installer .dmg file, double-click it to run it, which will install JDK on your computer. You can choose all default options during the installation.

(Yes, you do need to do this. Even though this course is in C++, our libraries also require Java to function properly.)

Install and Run Xcode

Though we will use Qt Creator for our programs in CS 106B/X, Mac OS X requires you to install their Xcode system to get a C++ compiler on your machine. To install Xcode, visit the Mac App Store and search for "XCode". You can get to the Mac App Store on your Mac by clicking the Apple Logo in the upper-left corner of your screen and selecting "App Store". The app store will open, and you should download Xcode. Xcode is a large app, so the download and installation may take some time.

App Store

Once your Xcode has installed, you have to actually launch the Xcode application one time in order to to install certain essential components. Open the newly downloaded Xcode application and accept the license agreement.

screencast

Download and install Qt Creator

  1. Download the installer:Go to the Qt Creator official download site to download this software. Choose Recommended download: Qt Online Installer for macOS and click the Download button at the bottom of the page. Your download will begin.
  2. Launch the installer:Once you have downloaded the Qt Creator .dmg installer, double-click it to mount it and launch the enclosed installer application, which will install Qt Creator on your computer.
  3. For most of the screens, you can just click "Next" to move to the next option, with the following exceptions.
    • At the "Registration" screen, you can press "Skip" to skip the registration step.
    • At the "Select Components" screen, do not choose to install any versions that are labeled "Alpha" or "Beta" or "Preview."
    • (IMPORTANT) At the "Select Components" screen, you must install the MacOS Component: To do this, expand the Qt triangle, then expand the "Qt 5.11.2" triangle, and then click the checkbox labeled, "macOS". See the screenshot below.

      You do not need to check any of the other options within the "Qt 5.11.2" category. You can leave un-checked every other checkbox except for "MacOS", as shown in the screenshot below. Accidentally checking too many boxes can increase the installation space needed from ~20gb to around 2gb, which you probably don't want.

      Qt Install Options Mac

    • For all subsequent screens, you can just press "Next" or "Agree" or "Install" to finish the installation.
    • When the installation finishes, click "Done" to launch Qt Creator.

You can now open up Qt Creator using Spotlight (the magnifying glass at the top right of your screen) and typing in "Qt Creator".

Try to compile/run a sample project

Let's make sure that all the parts are working together properly by building and running a sample Qt Creator project that uses the Stanford C++ libraries. The Stanford C++ libraries also interact with Java, so if this project runs properly for you, then you will be sure that your Qt Creator and Java JDK are both set up properly. Here's what to do:

  • Download the following project ZIP file to your computer.
  • Un-zip the file's contents to a directory of your choice. You should have a directory named sample-project with several files and folders inside.
  • Open the project. In Qt Creator, choose "File" → "Open File or Project..." or press Ctrl+O (or Command+O on Mac). Navigate to the sample-project folder and open the file sample-project.pro.
  • Qt Creator will ask you a few questions about how to set up the build process for this project. You can just accept the defaults and click "Configure Project".

    screenshot

  • Build it. Now you should be able to Build (Ctrl+B or Command+B) your project in Qt Creator. If it builds properly, your C++ compiler and the Stanford C++ libraries are at least compiling properly. The first time you build a given project, it will take a while (30-60 sec or more) to compile all of the various libraries. You can click the bottom "4 Compile Output" tab if you want to see the progress as it is compiling. (Recommended: In Qt Creator, click Tools → Options → Build & Run, and check the box labeled "Open Compile Output pane when building" to always see this output during compilation.)
  • Run it. Now that it's built, you should be able to Run (Ctrl+R or Command+R) your sample-project. This is the part where Java is needed, so if your Java isn't properly installed, this is probably where it will fail. If it runs properly, you will see a window appear with a smiley face. Congratulations, you're done! Now your machine should work just fine for working on our homework assignments.

    screenshot

If you encounter any problems during your attempt to compile and run the sample project, check out our Qt Creator troubleshooting page. Otherwise, congratulations; you're done!

This document and its content are copyright © Marty Stepp and Julie Zelenski, 2019. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the authors' expressed written permission.