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();
}
阅读(457) | 评论(1) | 转发(0) |