How install Qt Creator for ubuntu 16.04

来源:互联网 发布:mac os x 版本升级 编辑:程序博客网 时间:2024/06/07 10:07

This tutorial was done with the following software versions:

  • Ubuntu 16.04 LTS
  • Qt Creator 3.5.1
  • Qt 5.5.1

Install Qt

sudo apt-get install build-essential
sudo apt-get install qtcreator
sudo apt-get install qt5-default

Install documentation and examples

If Qt Creator is installed thanks to the Ubuntu Sofware Center or thanks to the synaptic package manager, documentation for Qt Creator is not installed. Hitting the F1 key will show you the following message : "No documentation available". This can easily be solved by installing the Qt documentation:
sudo apt-get install qt5-doc

And eventually:

sudo apt-get install qt5-doc-html qtbase5-doc-html

If you the examples are also missing:

sudo apt-get install qtbase5-examples
wgb@wgb:~$ cp Downloads/qt-opensource-linux-x64-5.7.0.run .wgb@wgb:~$ sudo chmod a+x qt-opensource-linux-x64-5.7.0.runwgb@wgb:~$ ./qt-opensource-linux-x64-5.7.0.runwgb@wgb:~$ sudo cp -a Qt5.7.0/5.7/gcc_64/lib/.  /usr/lib/x86_64-linux-gnu/wgb@wgb:~$ gedit ~/.bashrcwgb@wgb:~$ source ~/.bashrc

1. 修改系统配置文件让Qt启动器选择新版的Qt Creator

首先需要修改下面的文件目的是让Qt的启动器选择新版的Qt Creator,我原本安装的Qt是Qt5.5.1(Qt Creator 3.0.1),然后后面安装插件的脚本帮我下载了最新版的Qt Creator 4.0.3,花了好长时间下载

sudo gedit /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

打开文件看到的是下面两行

/usr/lib/x86_64-linux-gnu/qt4/bin/usr/lib/x86_64-linux-gnu

我们需要把它们替换成如下两个路径

/home/zjl/Qt5.5.1/5.5/gcc_64/bin/home/zjl/Qt5.5.1/5.5/gcc_64/lib

注意/home/zjl是我的主文件夹绝对路径
后面的路径是从Qt安装目录下面进入5.5/gcc_64/找到binlib文件夹,用这两个文件夹路径替换掉default.conf文件原来的两行就是了,我安装Qt的时候选择安装在主文件夹的Qt5.5.1下,并且我的Qt版本是5.5,所以路径如上所示,安装到其他地方或者其他版本的类似



 
原创粉丝点击