文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>9 24

9 24

时间:2010-09-24  来源:harryxiyou

     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 <QtGui/QApplication>
#include <QTextCodec>
#include <QDebug>
#include <QString>
#include <stdio.h>
#include <QChar>
#include <QDebug>
#include <QByteArray>

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()<<string;
   


    return a.exec();
}

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载