桌面路径
QString desktop_path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
qDebug()<< "desktop_path:" << desktop_path;
QStringList fileNames = QFileDialog::getOpenFileNames(this,tr("Select file"),
desktop_path);
qDebug()<< "fileNames:" << fileNames;
QString fileName = fileNames.join(",");
glb_in_put_file_path = fileName;
qDebug()<< "glb_in_put_file_path:" << glb_in_put_file_path;
app路径
QString AppPath = QApplication::applicationFilePath();
//qDebug() << "AppPath:" << AppPath;
QString openssl_path_dir = AppPath;
openssl_path_dir = openssl_path_dir.replace(QString("cmd_openssl.exe"), QString("openssl/bin/"));
//qDebug() << "openssl_path_dir:" << openssl_path_dir;
QFileInfo fileInfo(AppPath);
QString app_name = fileInfo.fileName();
qDebug() << "fileName--->:" << fileInfo.fileName();
qDebug() << "baseName--->:" <<fileInfo.baseName();
本文介绍了如何使用 Qt 库中的函数来获取用户的桌面路径及应用程序的文件路径,并展示了如何利用这些路径进行文件对话框的选择操作。
1826

被折叠的 条评论
为什么被折叠?



