Chinaunix首页 | 论坛 | 博客
  • 博客访问: 346383
  • 博文数量: 168
  • 博客积分: 6895
  • 博客等级: 准将
  • 技术积分: 1726
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-12 23:01
文章分类

全部博文(168)

文章存档

2011年(6)

2010年(162)

我的朋友

分类: LINUX

2010-09-24 22:45:11

     Today, I just know some skills about qt so i get it to my blog. When you want to
change "char *" to "QString" and change "QString" to "char *", you can get following programs.


#include
#include
#include
#include
#include
#include
#include
#include

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QTextCodec::setCodecForTr( QTextCodec::codecForLocale() );
   
    //char *p;
/*    QString str = "hello world";
    QByteArray ba = str.toLatin1();
       char *p = ba.data();
*/

    char c_str2[]    = "hello world!";
   
    printf( "%s\n", c_str2 );
    QString string = QString(QLatin1String(c_str2));   
   
    qDebug()<   


    return a.exec();
}

阅读(419) | 评论(1) | 转发(0) |
0

上一篇:9 23

下一篇:course design

给主人留下些什么吧!~~

chinaunix网友2010-09-26 15:03:27

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com