linux QT 配置

Do you want to do programming in Linux? Probably you need C++ programming environment in Linux. Then you need a GUI programming toolkit for C++.You can choose C++ with Qt Framework programming environment in Ubuntu. I will show you how to get them all (complete with C++ library and an IDE) Ubuntu 15.04. Magically, you get them all just by installing Qt Creator.

Qt Creator, C++, and Qt Framework

About build-essential

The build-essential is a metapackage (package that pull another packages) to install all C++ programming tools in Ubuntu. If you install it, you will get GNU g++ (a most used C++ compiler), GNU gcc (a most used C compiler), make (a build utility), libc-dev (a collection of GNU C Library), and dpkg-dev (a collection of dpkg tool for developing Debian package). In Ubuntu 15.04, you already got them all pre-installed. You do not need to install it again.

In Ubuntu 12.04, you still need to install build-essential by command

sudo apt-get install build-essential

Install Qt Creator

By GUI, you can use Ubuntu Software Center to search qt creator and install it.

Installing Qt Creator by GUI

By Terminal, you can use this command:

sudo apt-get install qtcreator
Installing Qt Creator by Terminal

It will download approximately 38 MB packages. It needs approximately 144 MB disk space when finished.

Install Qt Framework Complete Documentation

By default, you get no documentation by just installing qtcreator package. If you need Qt examples, demos, complete documentation, so you can read it inside Qt Creator offline, install them by this command.

sudo apt-get install qt5-doc qtbase5-examples qtbase5-doc-html
  • qt5-doc : this package contains  Qt 5 API Documentation.
  • qtbase5-examples : this package contains Qt base 5 examples.
  • qtbase5-doc-html : this package contains the HTML documentation for the Qt 5 base libraries
Qt C++ Program Examples

Using Qt Creator

For first usage, you can create a C++ GUI program by using Qt Widget Project option in Qt Creator. Actually, you have so many other project templates, but for the first time you should try this first. Create it by menu New File or Project (Ctrl+N) > select Project > select Qt Widget Application > press Choose button > type your project name > next, next, and finish. To compile your C++/Qt project, press Run button (green triangle icon on the left panel) or just Ctrl+R. See picture below.


Selecting Project

Running Program

Using Qt Documentation

1. C++/Qt Examples - After installing those three packages, open Examples section in Qt Creator. You will see many C++/Qt program examples. Click one and you have it. Just run (Ctrl+R) you build and execute it. See picture below.

Running C++/Qt Example

2. Qt API Reference - You get also Qt API Documentation completely. And you do not need internet to read it. For examples, if you use a Qt Class in your source code, say it QPushButton, just put your cursor on that text, and press F1. Qt Creator will show you the QPushButton Class API Reference in right panel. See picture below. See the right panel.

Left Panel Qt API Reference Documentation

You get also complete Qt API References for whole Qt Framework. To see them, open Qt Creator > click Help icon on the left panel > select Qt 5.x.x Reference from left entry > see documentation on the right panel. You also have all the rest of another Qt related documentation (such as Qt Dbus, Qt Designer, Qt Quick, and many more manuals) on the same left panel. See picture below.

Complete Qt Framework Documentation

3. Qt Creator IDE Documentation - You get also Qt Creator IDE documentation. It is a comprehensive help in Qt Creator usage as an advanced editor. You get all you need here. To see it, just open Qt Creator and click Help icon on the left panel and click Home icon on top panel. But you should configure it first to show the Main Page by menu Tools > Options > Help > tab Documentation > Add > the file path is /usr/share/qtcreator/doc/qtcreator.qch . See picture below.

Qt Creator IDE Documentation

Reference

时间: 2024-10-18 04:46:26

linux QT 配置的相关文章

嵌入式linux QT开发(四)——QT Creator工程管理

嵌入式linux QT开发(四)--QT Creator工程管理 一.QT Creator工程管理 QT Creator以工程项目的方式对源码进行管理,一个QT工程中包含不同类型的文件如下: A..pro项目描述文件 B..pro.user用户描述文件 C..h头文件 D..cpp源文件 E..ui界面描述文件 F.资源文件(图片.音频等) 二..pro项目描述文件 1..pro项目描述文件基本构成如下: A.#注释起始符 B.QT模块声明 C.TARGET可执行文件名 D.TEMPLATE程序

嵌入式linux QT开发(一)——QT简介

嵌入式linux QT开发(一)--QT简介 一.QT简介 1.QT简介 QT是一个跨平台的C++图形用户界面库,由挪威TrollTech公司出品,目前包括Qt Creator, QtEmbedded,Qt Designer快速开发工具,Qt Linguist国际化工具等部分,Qt支持所有Linux/Unix系统,还支持Windows平台. 2.QT优点 Qt是一个跨平台的C++图形用户界面应用程序框架,提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能.Qt很容易扩展,并且允许真正地组

嵌入式linux QT开发(二)——QT开发环境搭建

嵌入式linux QT开发(二)--QT开发环境搭建 一.Windows系统QT开发环境搭建 操作系统:Windows 7 QT Creator:qt-creator-win-opensource-2.4.1 QT SDK:qt-win-opensource-4.7.4-mingw 1.安装QT Creator 点击qt-creator-win-opensource-2.4.1源程序安装. 2.安装QT SDK 点击qt-win-opensource-4.7.4-mingw源程序安装. 选择mi

I.MX6 Linux Qt 启动流程跟踪

/************************************************************************** * I.MX6 Linux Qt 启动流程跟踪 * 声明: * 1. 源代码来源MY-I.MX6: * 2. 本文仅仅是对启动流程的解析,没有解释启动流程为什么是这样的问题. * * 2015-6-13 深圳 晴 南山平山村 曾剑锋 *********************************************************

芯灵思Sinlinx A64 Linux&qt编译安装

开发平台 芯灵思Sinlinx A64 内存: 1GB 存储: 4GB 详细参数 https://m.tb.cn/h.3wMaSKm 开发板交流群 641395230 前提条件搭建好CentOS环境 光盘目录 :芯灵思SIN-A64光盘资料\Linux & QT\source 将这些光盘资料拷贝到虚拟机解压 tar -xvf SINLINX-A64_lichee-src.tar.gz tar -xvf SINLINX_qt-4.8.7_src.tar.gz tar -xvf SINLINX_qt

linux下配置QT5.12 ERROR: Unknown command line option '-no-xcursor'.!

xcursor是个什么东西.为什么会报错,怎么处理!在qt的autoconfigure.sh中添加下三条命令都不行.提示不认识-no-xcursor或者不认识nomake命令. -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -no-fontconfig \-nomake examples -nomake tools -nomake tests -no-iconv \ linux下配置QT5.12 ERR

linux FTP配置详解

一.vsftpd说明: LINUX下实现FTP服务的软件很多,最常见的有vsftpd,Wu-ftpd和Proftp等.Red Hat Enterprise Linux中默认安装的是vsftpd. 访问FTP服务器时需要经过验证,只有经过了FTP服务器的相关验证,用户才能访问和传输文件.vsftpd提供了3种ftp登录形式:  (1)anonymous(匿名帐号) 使用anonymous是应用广泛的一种FTP服务器.如果用户在FTP服务器上没有帐号,那么用户可以以anonymous为用户名,以自己

Linux下配置tomcat + apr + native应对高并发

在慢速网络上Tomcat线程数开到300以上的水平,不配APR,基本上300个线程狠快就会用满,以后的请求就只好等待.但是配上APR之后,Tomcat将以JNI的形式调用Apache HTTP服务器的核心动态链接库来处理文件读取或网络传输操作,这时并发的线程数量明显下降,从原来的300可能会马上下降到只有几十,新的请求会毫无阻塞的进来. 一.Tomcat运行模式介绍 Tomcat 有三种(bio,nio.apr) 运行模式,首先来简单介绍下: (1)BIO    BIO(blocking I/O

Linux网络配置及SSH和Shell基础

Linux网络配置及SSH和Shell基础 一.Linux网络配置     ifconfig命令被用于配置和显示Linux内核中网络接口的网络参数.用ifconfig命令配置的网卡信息,在网卡重启后机器重启后,配置就不存在.要想将上述的配置信息永远的存的电脑里,那就要修改网卡的配置文件了. 二.hosts文件的作用及修改主机名      Hosts : The static table lookup for host name(主机名查询静态表)       Linux 的/etc/hosts是