您的位置:首页 > 产品设计 > UI/UE

ubuntu 13.04 build QT develop env

2014-02-05 14:23 316 查看
1. install qt5

sudo apt-get install qt5-default qttools5-dev-tools

2. install g++

sudo apt-get install g++

3. install vim

sudo apt-get install vim

4. test:

4.1 mkdir hello_qt folder and create hello_qt.cpp file as follow :

#include <QApplication>

#include <QLabel>

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

QLabel *label = new QLabel("Hello QT!");

label->show();

return app.exec();

}

4.2

qmake -project

4.3 add

QT += widgets

into hello_qt.pro file

4.4 qmake hello_qt.pro

4.5 make

4.6 run ./hello_qt

5. some informations:

Qt4过渡至Qt5


QtWebKitWidgets也是一个独立的模块:


例如编译时错误

error: invaliduse of incomplete type 'classQWebFrame'

error: forwarddeclaration of 'classQWebFrame'


解决办法:

在*.pro文件里添加:

QT += webkitwidgets

注意:当有QT+= webkitwidgets的时候,就不再需要QT += widgets
6. install QT4:

sudo apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designer qt4-qtconfig


use the follow command to compile the code:

qmake-qt4 -project;

qmake-qt4 *.pro

make
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: