Qt on Mobile

1:下载源码包,qt-embedded-wince-opensource-src-4.5.2.zip

 

2:参考INSTALL和README文件编译安装

 

a:解压源码包到相应目录如C:/Qt/4.5.2

b:添加环境变量PATH,指向c:/Qt/4.5.2/bin

c:在开始菜单中选择打开Visual Studio Command Prompt(visual studio 2005/tools)

d:进入C:/Qt/4.5.2目录,configure -platform win32-msvc2005 -xplatform wincewm60professional-msvc2005,具体配置项可以通过 configure -help查看

e:setcepaths wincewm60professional-msvc2005,设置PATH,LIB,INCLUDE

 f:nmake

 

3:测试运行

1:打开Visual Studio Command Prompt窗口

2:随便拷贝一个demo或example里的例子出来,进入该目录,运行qmake –tp vc,将qt的pro项目文件转换为studio 的proj项目同时更新lib、include路径

3:打开visual studio编译,将生成的exe和dll(注意要拷贝msvcr80d.dll)拷贝到板子上就可以运行了(debug编译出来的可以正常运行,但是release编译出来的却要证书签名,不知道为什么)

 

    

 

 

4:新建工程

 

a:新建目录helloworld,编写helloworld.cpp:

 

#include <QApplication>

#include <QPushButton>

#include <QTranslator>

 

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

{

    QApplication app(argc, argv);

    QTranslator translator;

    translator.load("hellotr_la");

    app.installTranslator(&translator);

    QPushButton hello(QPushButton::tr("Hello world!"));

    hello.resize(100, 30);

    hello.show();

    return app.exec();

}

 

b:从命令窗口进入该目录,运行qmake -project 生成helloworld.pro工程文件

c:运行qmake -tp vc生成visual studio 的工程文件

d:打开visual studio 编译生成helloworld.exe,将该文件拷贝到机子上运行即可

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值