[Qt] Summary of commonly used codes in Qt projects

path

get current path

#include <QCoreApplication>
QString appDirPath = QCoreApplication::applicationDirPath();

Convert to the corresponding system path

Returns the pathname with the delimiter converted to the appropriate delimiter for the underlying operating system.
"\" under windows; "/" under linux

#include <QDir>
appDirPath = QDir::toNativeSeparators(appDirPath); 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325523097&siteId=291194637