`
mmdev
  • 浏览: 12894207 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

关于QT中使用到的文件有中文或者有空格的情况的一些解决

 
阅读更多


下面程序只在windows QT creator上测试过


//QPixmap tmpPix(QString::fromLocal8Bit("\"G:\\f ss\\Demo3_UV.png\"")); no

//QPixmap tmpPix(tr("G:/鬼了/f ss/Demo3_UV.png")); // no

//QPixmap tmpPix((QString::fromLocal8Bit(std::string("G:\\鬼了\\f ss\\Demo3_UV.png").c_str()))); // ok

//QPixmap tmpPix((QString::fromLocal8Bit(std::string("G:/鬼了/f ss/Demo3_UV.png").c_str()))); // ok

//QPixmap tmpPix(tr("C:\Documents and Settings\Demo3_UV.png")); // no

QPixmap tmpPix(tr("C:\\Documents and Settings\\Demo3_UV.png")); // ok

//QPixmap tmpPix(tr("G:/f ss/Demo3_UV.png")); // ok

//QPixmap tmpPix(tr("G:\\f ss\\Demo3_UV.png")); // ok

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics