QT中获取当前项目路径的写法

一 项目中文件的读取路径写法

1.1 QT中获取当前项目路径的写法(这个是项目编译build的路径)

qDebug()<<m_translator->load(QApplication::applicationDirPath()+"/en.qm");

1.2 方式二

使用这中方式(推荐使用这个方式)

../ThicknessMeasurementInstrument/lens/abc.csv

等价于这种方式

D:\develop\Projects\QTPro\TMI\tmi\ThicknessMeasurementInstrument\lens

猜你喜欢

转载自blog.csdn.net/qq_42817360/article/details/134031388