There are a variety of ways to get Qt installed on a Mac. To begin the process of installing Qt 5 on your Mac, you need to get Xcode installed on your machine. Issue the following commands on the Terminal:
xcode-select --install
If you get the following output, then you are ready for the next series of steps:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
HomeBrew is a package management software tool that allows you to easily install Unix tools that don't come shipped with the macOS.
If you don't already have it on your machine, you can install it by issuing the following command in a Terminal:
/user/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that, you should issue yet another set of commands to get Qt installed via the Terminal:
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/fdfc724dd532345f5c6cdf47dc43e99654e6a5fd/Formula/qt5.rb
brew install ./qt5.rb
In a few chapters' time, we will be working with the MySql database. To configure Qt 5 with MySql, issue the following command:
brew install ./qt5 --with-mysql
This command should take a while to complete and, assuming nothing goes wrong, you are ready to write Qt programs.