本文整理汇总了C++中QFileDialog::getExistingDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileDialog::getExistingDirectory方法的具体用法?C++ QFileDialog::getExistingDirectory怎么用?C++ QFileDialog::getExistingDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileDialog
的用法示例。
在下文中一共展示了QFileDialog::getExistingDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_loadButton_clicked
void MERTool::on_loadButton_clicked()
{
QFileDialog dialog;
dialog.setFileMode(QFileDialog::Directory);
dialog.setOption(QFileDialog::ShowDirsOnly);
QString directory = dialog.getExistingDirectory();
if(directory.toStdString().size() < 3){
return;
}
std::vector<std::string> p = mocca::splitString<std::string>(directory.toStdString(),'/');
std::shared_ptr<BrainVisIO::MERData::MERBundle> bunlde = BrainVisIO::MERData::MERFileManager::getInstance().openFolder(directory.toStdString());
MERBundleManager::getInstance().addMERBundle(p[p.size()-1], bunlde);
updateSettings(bunlde);
if( ui->BundleSelection->findText(QString(p[p.size()-1].c_str())) == -1)
ui->BundleSelection->addItem(QString(p[p.size()-1].c_str()));
ui->BundleSelection->setCurrentIndex(ui->BundleSelection->findText(QString(p[p.size()-1].c_str())));
on_BundleSelection_activated(ui->BundleSelection->currentText());
if( DataHandleManager::getInstance().getDataHandle(ActivityManager::getInstance().getActiveDataset()) != nullptr)
DataHandleManager::getInstance().getDataHandle(ActivityManager::getInstance().getActiveDataset())->incrementStatus();
}
示例2: on_cmdSelectImportFile_clicked
void ExportWidget::on_cmdSelectImportFile_clicked()
{
QFileDialog exportDirDialog;
QString dirname = exportDirDialog.getExistingDirectory(this, tr("Open Directory"), QApplication::applicationDirPath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (!dirname.isEmpty()) {
ui.txtDestFile->setText(dirname);
}
}
示例3: download
void FSTableView::download()
{
QFileDialog dialog;
dialog.setWindowTitle("Télécharger");
QString dirPath = dialog.getExistingDirectory(this);
if (!dirPath.isEmpty())
fsModel()->download(dirPath,currentIndex());
}
示例4: getDefaultSaveLoc
/*----------------------------------------------------------------------------
Name getDefaultSaveLoc
Purpose Slot: when Select Default Save Location is clicked;
History 8 Jun 16 AFB Created
----------------------------------------------------------------------------*/
void OptionMenu::getDefaultSaveLoc()
{
QFileDialog fileDialog;
mDefaultSaveLoc = fileDialog.getExistingDirectory(
this
, tr("Choose default save directory")
, QStandardPaths::displayName(QStandardPaths::DocumentsLocation));
}
示例5: on_Load_Result_Btn_clicked
void Dialog::on_Load_Result_Btn_clicked()
{
QFileDialog FileDialog;
QString path=FileDialog.getExistingDirectory(this, tr("Open Calibration Files"), "/home/nubot/ros_workspace/src/omni_vision/calibration/",
QFileDialog::ShowDirsOnly|QFileDialog::DontResolveSymlinks);
calibration_result_dir_=path.toStdString();
std::string file_path=calibration_result_dir_+"/CTable.dat";
std::ifstream CTable_Read(file_path.c_str(), std::ios::binary|std::ios::in);
CTable_Read.read((char *)CTable_,sizeof(unsigned char)*64*64*64);
CTable_Read.close();
file_path=calibration_result_dir_+"/CTableBGR.dat";
std::ifstream CTableBGR_Read(file_path.c_str(), std::ios::binary|std::ios::out);
CTableBGR_Read.read((char *)CTable_bgr_,sizeof(unsigned char)*64*64*64);
CTableBGR_Read.close();
file_path=calibration_result_dir_+"/ROI.xml";
cv::FileStorage roi_file(file_path, cv::FileStorage::READ);
int tmp1,tmp2;
roi_file["center_point_row"]>>tmp2;
roi_file["center_point_column"]>>tmp1;
circle_center_=QPoint(tmp1,tmp2);
roi_file["big_radius"] >>circle_radius_;
roi_file ["small_radius"] >> small_radius_;
roi_file ["rows"]>>height_;
roi_file ["cols"]<<width_;
roi_file.release();
file_path=calibration_result_dir_+"/calibration.xml";
cv::FileStorage calibration(file_path, cv::FileStorage::READ);
std::vector<int> poly_pts;
std::vector<int> lint_pts;
cv::FileNode calib_result = calibration["Color_Calib"];
cv::FileNodeIterator it = calib_result.begin(), it_end = calib_result.end();
int idx=0;
for( ; it != it_end; ++it)
{
QVector<QPoint> polys_pt;
(*it)["poly_pts"]>>poly_pts;
polys_pt.push_back(QPoint(poly_pts[0],poly_pts[1]));
polys_pt.push_back(QPoint(poly_pts[2],poly_pts[3]));
polys_pt.push_back(QPoint(poly_pts[4],poly_pts[5]));
polys_pt.push_back(QPoint(poly_pts[6],poly_pts[7]));
calib_final_result_[idx]=polys_pt;
QVector<QPoint> line_pt;
(*it)["line_pts"]>>lint_pts;
line_pt.push_back(QPoint(lint_pts[0],0));
line_pt.push_back(QPoint(lint_pts[1],0));
calib_Line_final_result_[idx]=line_pt;
idx++;
}
calibration.release();
load_interim_result();
}
示例6: onAddFolderToLibrary
void MainWindow::onAddFolderToLibrary(){
QFileDialog d;
QString folder;
folder = d.getExistingDirectory(this,tr("Select Folder"),
QDir::homePath(),
QFileDialog::ShowDirsOnly |
QFileDialog::DontResolveSymlinks);
ui->library->addToSearchPath(folder);
}
示例7: on_toolButtonBkPath_clicked
void DialogConfigBooks::on_toolButtonBkPath_clicked()
{
QFileDialog dlg;
QString dir = dlg.getExistingDirectory(this, tr("Open Directory"),
ui->lineEditPath->text(),
QFileDialog::ShowDirsOnly
|QFileDialog::DontResolveSymlinks);
<<<<<<< HEAD
示例8: on_buttonSpeicherort_clicked
/**
* @autor Alex
* @beschreibung wählt einen Speicherort aus und fügt ihn in das Feld ein
*/
void Hauptfenster::on_buttonSpeicherort_clicked()
{
QFileDialog SpeicherDialog;
QString speicherOrt = SpeicherDialog.getExistingDirectory();
if(speicherOrt!=""){
ui->editSpeicherort->setText(speicherOrt);
settings.set("Speicherort",ui->editSpeicherort->text());//Speichert Einstellung
}
}
示例9: on_folderPushButton_clicked
void MainWindow::on_folderPushButton_clicked()
{
QFileDialog folderDlg;
folder = folderDlg.getExistingDirectory(0,"Caption",QString(),QFileDialog::ShowDirsOnly);
ui->folderLineEdit->setText(folder);
QDir recoredDir(folder);
allFiles = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst);
videos = allFiles.filter(format,Qt::CaseSensitive);
ui->joinPushButton->setEnabled(true);
}
示例10: tr
void
FlumeSettings::setTempDirectory()
{
QFileDialog fd;
fd.setFileMode(QFileDialog::Directory);
fd.setOption(QFileDialog::ShowDirsOnly, true);
QString file = fd.getExistingDirectory(this, tr("Select Directory"));
if (file != "") {
ui->tempDirectoryEdit_2->setText(file);
}
}
示例11: btn_wallpaper_choose
void Launcher_page::btn_wallpaper_choose()
{
if(Global::srcPath == "")
{
QMessageBox::warning(this, "提示框", "必须先新建工厂或导入现有工程才可以修改!!", QMessageBox::Abort);
return;
}
QFileDialog *fileDlg = new QFileDialog();
QString wallpaperPath = fileDlg->getExistingDirectory(this);
le_wallpaper->setText(wallpaperPath);
}
示例12: Sync
/*
* Initialize/update/re-read from cache.
*/
void browse::Sync(int type){
if(type == 2 || type == 3){ /// import new entries into local db for each folder and file
QDir usrDir = QString(getenv("HOME"));
QFileDialog iDirect;
usrDir = iDirect.getExistingDirectory(this, tr("Import a directory"), usrDir.absolutePath());
if(usrDir.dirName() != NULL || usrDir.dirName() != ""){
if(type == 2){ /// import audio
if(lclSync.Sync(usrDir, 0)){
MenuMode = 0;
}
}
else if(type == 3){ /// import video
if(lclSync.Sync(usrDir, 1)){
MenuMode = 1;
}
}
}
}else if(type == 4){
radStat = new radiostat();
radStat->init(dbCon);
radStat->show();
if(radStat->exec() == QDialog::Accepted){
dbCon->readDB(Radio, "radios");
dbCon->readDB(RadioCat, "categories");
MenuMode = 2; /// set Mode to radio
updateMenu();
updateTitle(0);
}
}else if(type == 0){
QDir usrDir;
usrDir = QFileDialog::getOpenFileName(this, tr("Open a Audio/Video file"), QDir::currentPath(), tr("Video/Audio (*.avi *.mp4 *.mp3 *.flac *.wav)"));
if(usrDir.dirName() != NULL || usrDir.dirName() != ""){
emit startTempTrack(usrDir.dirName().toStdString(), usrDir.path().toStdString(), MenuMode);
}
}else if(type == -1){
web = new QWebUrl();
web->show();
if(web->exec() == QDialog::Accepted){
if(web->url_input != "http://" || web->url_input != ""){
emit startTempTrack("", web->url_input, MenuMode);
}
}
}
if(type ==1 || type == 2 || type == 3){ /// don't sync if we're playing a temp file
syncCache();
updateMenu();
}
}
示例13: on_actionRestore_Tasks_Settings_triggered
void MainWindow::on_actionRestore_Tasks_Settings_triggered()
{
QFileDialog fd;
QString dir = fd.getExistingDirectory(this, tr("Choose Directory To Restore From"), "", QFileDialog::ShowDirsOnly);
if(!dir.isEmpty())
{
QFile::remove(DataLoc.at(0) + "/settings.ini");
QFile::remove(DataLoc.at(0) + "/tasks.db");
QFile::copy(dir + "/settings.ini", DataLoc.at(0) + "/settings.ini");
QFile::copy(dir + "/tasks.db", DataLoc.at(0) + "/tasks.db");
QMessageBox::information(this, tr("Status"), tr("Restore Complete!"));
updateTable();
}
}
示例14: on_btn_destination_location_clicked
void MainWindow::on_btn_destination_location_clicked()
{
// Create new dialog
QFileDialog dialog;
// Set is to Directory
dialog.setFileMode(QFileDialog::Directory);
// Only show directories
dialog.setOption(QFileDialog::ShowDirsOnly);
// Set tb_destination_location to the selected directory
ui->tb_destination_location->setText(dialog.getExistingDirectory(0,"Select destination folder",QString(),QFileDialog::ShowDirsOnly));
}
示例15: on_pushButton_clicked
void Path::on_pushButton_clicked()
{
QFileDialog *fileDialog = new QFileDialog(this);
fileDialog->setWindowTitle(tr("模型位置"));
fileDialog->setDirectory(".");
QString fpath = fileDialog->getExistingDirectory();
std::cout << fpath.toStdString() << std::endl;
if(fpath.length() != 0) {
QMessageBox::information(NULL, tr("路径"), fpath);
ui->pathlabel->setText(fpath);
}
else {
QMessageBox::information(NULL, tr("错误"), "您没有选择任何文件夹!");
}
}