设为首页 收藏本站
查看: 739|回复: 0

[经验分享] linux QT 配置

[复制链接]

尚未签到

发表于 2018-5-19 14:06:26 | 显示全部楼层 |阅读模式
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.
DSC0000.png
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-essentialInstall Qt Creator
By GUI, you can use Ubuntu Software Center to search qt creator and install it.
DSC0001.png
Installing Qt Creator by GUI
By Terminal, you can use this command:
sudo apt-get install qtcreator
DSC0002.png
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
DSC0003.png
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.
DSC0004.png
Selecting Project
DSC0005.png
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.
DSC0006.png
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.
DSC0007.png
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.
DSC0008.png
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.
DSC0009.png
Qt Creator IDE Documentation
Reference
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-462059-1-1.html 上篇帖子: Linux_Varnish_(2) 下篇帖子: busybox diy mini linux
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表