本文整理汇总了C++中QFileDialog::close方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileDialog::close方法的具体用法?C++ QFileDialog::close怎么用?C++ QFileDialog::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileDialog
的用法示例。
在下文中一共展示了QFileDialog::close方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openDicomdir
void QtDcm::openDicomdir()
{
this->clearDisplay();
d->mode = QtDcm::CD;
// Open a QFileDialog for choosing a Dicomdir
QFileDialog * dialog = new QFileDialog( this );
dialog->setFileMode ( QFileDialog::ExistingFile );
dialog->setDirectory ( QDir::home().dirName() );
dialog->setWindowTitle ( tr ( "Open dicomdir" ) );
QStringList filters;
filters << "Dicomdir files (dicomdir* DICOMDIR*)";
filters << "Any files (*)";
dialog->setNameFilters(filters);
QString fileName;
if ( dialog->exec() )
{
fileName = dialog->selectedFiles() [0];
}
dialog->close();
if ( !fileName.isEmpty() ) // A file has been chosen
{
if (QString::compare(fileName, "dicomdir", Qt::CaseInsensitive))
{
QtDcmManager::instance()->setDicomdir ( fileName );
this->loadPatientsFromDicomdir();
}
}
dialog->deleteLater();
}
示例2: on_loadLstButton_clicked
void MainWindow::on_loadLstButton_clicked()
{
QFileDialog loader;
std::string fileName = loader.getOpenFileName(this, tr("Open File"), "../lst files", tr("Files (*.lst*)") ).toStdString();
this->repaint();
loader.close();
if( fileName != "")
glWidget->LoadLST(fileName);
glWidget->GenerateMeshFromLST();
}
示例3: on_actionLoadFolder_triggered
void MainWindow::on_actionLoadFolder_triggered()
{
QFileDialog dialog;
dialog.setFileMode(QFileDialog::Directory);
dialog.setOption(QFileDialog::ShowDirsOnly);
int result = dialog.exec();
dialog.close();
if(result && dataManager)
{
dataManager->loadData(dialog.directory().path());
}
}
示例4: on_pushButton_select_clicked
void MainWindow::on_pushButton_select_clicked()
{
QFileDialog dialog;
//QString fileName = dialog.getOpenFileName(this, tr("Open File"), QDir::currentPath(),tr("Videos(*.avi)"));
QString fileName = dialog.getOpenFileName(this, tr("Open File"), "/home/ren/Videos",tr("Videos(*.avi *.avi.ln)"));
if(fileName.isEmpty())
return;
if(dialog.close() == true)
process(fileName,false);
}
示例5: fileSelected
void MainWindow::fileSelected(const QStringList &selected)
{
QFileDialog *dialog = qobject_cast<QFileDialog*>(QObject::sender());
Q_ASSERT(dialog);
this->settings->setValue(QStringLiteral("paths/openFilter"), dialog->selectedNameFilter());
dialog->close();
dialog->deleteLater();
for(QString file : selected)
this->openFile(file);
}
示例6: onSelectButtonClicked
void ShredDialog::onSelectButtonClicked()
{
// QString fileName=QFileDialog::getOpenFileName(0, tr("Select file"), QDir::homePath(), tr("All Files(*)"));
QStringList fileNameList;
QString fileName;
QFileDialog* fd = new QFileDialog(this);
fd->resize(500, 471);
fd->setFilter(tr("Allfile(*)"));
// fd->setFilter( "Allfile(*.*);;mp3file(*.mp3);;wmafile(*.wma);;wavefile(*.wav)");
fd->setViewMode(QFileDialog::List);//设置浏览模式,有 列表(list) 模式和 详细信息(detail)两种方式
if (fd->exec() == QDialog::Accepted)
{
fileNameList = fd->selectedFiles();
fileName = fileNameList[0];
select_edit->setText(fileName);
}
else
fd->close();
}