QT开发--hello
来源:互联网 发布:淘宝iPhone7 编辑:程序博客网 时间:2024/05/05 06:47
创建QT第一个小程序:
使用标签创建一个窗口,并显示 "hello QT!"
1.创建cpp文件:hello.cpp
#include <QApplication>#include <QLabel> //标签int main(int argc,char *argv[]){ QApplication app(argc,argv); //创建QApplication对象app管理应用程序 QLabel *label = new QLabel("Hello QT!");//创建一个标签对象//QLabel *label = new QLabel("<h2><i>Hello</i> ""<font color=red>QT!</font></h2>"); label->show(); //显示标签 return app.exec(); //进入程序主循环}
2.使用Windows下的命令行,进入hello.cpp目录下;
3.使用命令"qmake -project",来创建工程;产生 hello.pro 文件
4.使用命令"qmake hello.pro",来产生makefile文件;
5.使用命令"make",对工程进行编译;
6.进入 debug 目录中,运行hello.exe。
至此,hello 工程从编写、创建、编译和运行完成!
F:\QT_Program\test01\hello>qmake -project
F:\QT_Program\test01\hello>qmake hello.pro
F:\QT_Program\test01\hello>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `F:/QT_Program/test01/hello'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"d:\Qt\4.7
.3\include\QtCore" -I"d:\Qt\4.7.3\include\QtGui" -I"d:\Qt\4.7.3\include" -I"." -
I"d:\Qt\4.7.3\include\ActiveQt" -I"debug" -I"d:\Qt\4.7.3\mkspecs\win32-g++" -o d
ebug\hello.o hello.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -Wl,-subsystem,windows -o debug\hello.exe debug/hello.o -L"d:\
Qt\4.7.3\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `F:/QT_Program/test01/hello'
F:\QT_Program\test01\hello>debug\hello.exe
F:\QT_Program\test01\hello>
- QT开发--hello
- QT开发--Hello
- 熟悉Qt开发环境--Hello Qt
- 熟悉Qt开发环境--Hello Qt
- Linux平台Qt开发之Hello world
- 使用VS2010进行QT开发Hello,Qt的实现
- Hello Qt
- Hello Qt
- Qt hello
- Hello Qt
- Hello QT
- Qt "hello Qt!"显示
- Linux平台下Qt应用程序开发之Hello world
- QT开发android应用(1)——hello world
- Qt开发环境的搭建和hello world
- Qt on Android:图文详解QT开发Andriod入门,Hello World全过程
- Qt基础之hello qt
- Essential Qt 第一章 Hello Qt
- 我为什么要写《一起学java》这个系列
- CYC-MKMapView用法
- mergesort
- Xcode 7.0过后,也就是iOS9.0过后适配时出现的问题
- 根据图片的网络URL获取Bitmap
- QT开发--hello
- 用链表实现栈功能
- EditText设置错误不显示
- Hive通过动态分区装载数据
- phpexcel 的摘录
- 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管
- Command模式
- spring InitializingBean接口分析
- UVA_12100: Printer Queue