QT小问题记录

版权声明:微信 kobesdu https://blog.csdn.net/kobesdu/article/details/82052164

Qt QString类型 转换为 const char*

    std::string str = file_path.toStdString();

const char *pPath2 = str.c_str();

 

 

 

获取文件夹路径

     file_path = QFileDialog::getExistingDirectory(this,"Choose file path...","./");

 

获取文件路径

QString file_name=QFileDialog::getOpenFileName( 0, "OpenFile","","*.xml", 0 );

 

扫描二维码关注公众号,回复: 4511727 查看本文章

QString中内容替换

QString file_path;

file_path.replace("/","\\");//替换成左双斜杠

 

 

 

 

猜你喜欢

转载自blog.csdn.net/kobesdu/article/details/82052164