mac 安装qt creator和qt5

  1. 首先下载qt5,直接homebrew安装
(base) [xxx@xxxs-MacBook-Pro ~]$brew install qt5
Updating Homebrew...
^C
==> Downloading https://homebrew.bintray.com/bottles/qt-5.13.2.mojave.bottle.tar
Already downloaded: /Users/chenzhijie/Library/Caches/Homebrew/downloads/bfbceeb9e08901674d8dc52fcef59de47823a9e85c6712537e3f99a2820c79a5--qt-5.13.2.mojave.bottle.tar.gz
==> Pouring qt-5.13.2.mojave.bottle.tar.gz
==> Caveats
We agreed to the Qt open source license for you.
If this is unacceptable you should uninstall.

qt is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have qt first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile

For compilers to find qt you may need to set:
  export LDFLAGS="-L/usr/local/opt/qt/lib"
  export CPPFLAGS="-I/usr/local/opt/qt/include"

For pkg-config to find qt you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"

==> Summary
  /usr/local/Cellar/qt/5.13.2: 9,861 files, 336.5MB
  1. 然后下载qt creator,同样的homebrew,现在需要用cask。
(base) [xxx@xxxs-MacBook-Pro ~]$brew cask install qt-creator
Updating Homebrew...
^C
==> Downloading https://download.qt.io/official_releases/qtcreator/4.10/4.10.2/q
==> Verifying SHA-256 checksum for Cask 'qt-creator'.
==> Installing Cask qt-creator
==> Moving App 'Qt Creator.app' to '/Applications/Qt Creator.app'.
  qt-creator was successfully installed!
  1. 打开qt creator后,qt版本需要自己设置。在preference里的qt version里手动添加,上面brew install qt5后最下面可以看到Summary有/usr/local/Cellar/qt/5.13.2。于是添加这个文件中的 bin/qmake 文件(command+shift+.显示所有隐藏文件夹),完成后如下图。
    mac 安装qt creator和qt5_第1张图片
  2. 并且在 Preference/Kit 中将 gcc 改成 clang ,添加qt verison,完成后如下图。
    mac 安装qt creator和qt5_第2张图片
  3. 最后试着新建一个qt widget项目,其中QT creator文件夹是自己创建的。
    mac 安装qt creator和qt5_第3张图片
    mac 安装qt creator和qt5_第4张图片
    mac 安装qt creator和qt5_第5张图片
    mac 安装qt creator和qt5_第6张图片

mac 安装qt creator和qt5_第7张图片
mac 安装qt creator和qt5_第8张图片

mac 安装qt creator和qt5_第9张图片
显示窗口啦~

你可能感兴趣的:(树莓派)