我们想要获取应用程序的目录 或者 应用程序所在的位置 可以通过以下静态方法获取
我们一般用 此来 做相对 路径 ,方便我们去生成我们的文件夹 或者 文件
QApplication -》QGuiApplication-》QCoreApplication-》QObject
qDebug()<<"core applicationDirPath :" <<QCoreApplication::applicationDirPath();
qDebug() <<"core applicationFilePath :"<<QCoreApplication::applicationFilePath();
qDebug() <<"core applicationName :" << QCoreApplication::applicationName();
qDebug() << "applicationDirPath :" << QApplication::applicationDirPath();
qDebug() << "applicationFilePath :" << QApplication::applicationFilePath();
qDebug() << "applicationName :" << QApplication::applicationName();
core applicationDirPath : "D:/msvcTest/Test/x64/Debug"
core applicationFilePath : "D:/msvcTest/Test/x64/Debug/HyperlinksLabel.exe"
core applicationName : "HyperlinksLabel"
applicationDirPath : "D:/msvcTest/Test/x64/Debug"
applicationFilePath : "D:/msvcTest/Test/x64/Debug/HyperlinksLabel.exe"
applicationName : "HyperlinksLabel"