qt学习(一) qt安装

QT5现在安装已经方便了许多 相比QT4 可以一路点击到底 无需额外的太多的操作.

http://download.qt.io/official_releases/

下载

1 windows下可以选择 将qt作为VC插件安装

首先根据系统和vs的版本选择 qt的安装版本

选择 qt-opensource-windows-x86-msvc2013-5.5.1.exe

一路默认安装

然后安装VC插件 将QT与VC集成

这个网上有很多 见《将qt 5.6集成到vs2015》

http://my.oschina.net/jthmath/blog/640227?fromerr=DuayM2Ec

2 Windows下使用mingw版本的QT

选择qt-opensource-windows-x86-mingw492-5.6.0.exe

一路安装完毕 

3 linux安装

选择qt-opensource-linux-x86-5.5.1.run

需要使用  chmod +x  改变文件权限

 chmod +x qt-opensource-linux-x86-5.5.1.run

./qt-opensource-linux-x86-5.5.1.run

期间可能需要安装其他的一些基本软件 比如GDB GCC G++

我在DEBIAN系统下全部安装

apt-get install GDB 

apt-get install g++ 

apt-get install gcc

//=============================================

qt5 下第一个hello 程序

首先创建工程 如图

改写main.cpp

#include "mainwindow.h"
#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QLabel* label = new QLabel("Hello Qt!");

    label->show();

    return a.exec();
}

  最后效果

原文地址:https://www.cnblogs.com/itdef/p/5555301.html