Qt Environment on macOS

Qt is a widget toolkit for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native application with native capabilities and speed. (Wikipedia)

Install Qt and Qt Creator on macOS

brew install qt
brew install --cask qt-creator

Config Qt in Qt Creator

(1) Add a Qt Version.

image-20211007192759703

The default directory for qt installed by homebrew is /usr/local/Cellar/qt. Select your own qmake file and add it to QT Version.

(2) Config a Qt kit.

image-20211007193153782
image-20211007193102719

Make sure you set the right C and C++ compiler as well as the correct Qt version. Then, you will have no obstacle creating a Qt project.

QMake vs. CMake

Generally Speaking:

  • Orienting the simple Qt project, use qmake
  • Orienting project whose complexity is greater than capability of qmake, use cmake.