Qt选择文件对话框-中文路径-转std::string

#include <QFileDialog>
#pragma execution_character_set("utf-8")

QString path = QFileDialog::getOpenFileName(this, tr("选择文件"), ".", tr("s3c文件(*.s3c);;全部文件(*.*)"));

std::string s = path.toLocal8Bit();

posted @ 2017-07-11 11:37  酷熊  阅读(568)  评论(0编辑  收藏  举报