本文整理汇总了C++中QFileDialog::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileDialog::deleteLater方法的具体用法?C++ QFileDialog::deleteLater怎么用?C++ QFileDialog::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileDialog
的用法示例。
在下文中一共展示了QFileDialog::deleteLater方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: dialogRejected
void ParamCompareDialog::dialogRejected()
{
QFileDialog *dialog = qobject_cast<QFileDialog*>(sender());
QLOG_DEBUG() << "Dialog Rejected:" << dialog;
if (dialog){
dialog->deleteLater();
dialog = NULL;
}
}
示例3: 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);
}
示例4: loadDialogAccepted
void PresetManager::loadDialogAccepted()
{
QFileDialog *dialog = qobject_cast<QFileDialog*>(sender());
if (!dialog || (dialog->selectedFiles().size() == 0))
{
return;
}
m_presetFile.setFile(dialog->selectedFiles().first());
dialog->deleteLater();
// read presets
readPresetFile();
}
示例5: wizardFinished
void CalculationWizard::wizardFinished()
{
QFileDialog *fd = new QFileDialog ( this, tr ( "Select file for saving calculation results" ) );
fd->setDefaultSuffix ( ".txt" );
fd->setNameFilter ( "Text Documents (*.txt)" );
fd->setAcceptMode ( QFileDialog::AcceptSave );
if ( fd->exec() == true )
{
Data::UserInput input;
input.resultsFilePath = fd->selectedFiles().at ( 0 );
input.maximumValue = qobject_cast<WizardSettingsPage *> ( ui->wizard->wizardPages[0] )->getMaximumValue();
input.ipComparison = qobject_cast<WizardSettingsPage *> ( ui->wizard->wizardPages[0] )->getIpComparison();
input.log = qobject_cast<WizardSettingsPage *> ( ui->wizard->wizardPages[0] )->getLogarithmicBase();
input.maximumCalculations = qobject_cast<WizardAutoStopPage *> ( ui->wizard->wizardPages[2] )->getMaximumCalculations();
input.maximumCoincidences = qobject_cast<WizardAutoStopPage *> ( ui->wizard->wizardPages[2] )->getMaximumCoincidences();
input.extendedIpSearch = qobject_cast<WizardIpSearchPage *> ( ui->wizard->wizardPages[1] )->getExtendedIpSearch();
input.search = qobject_cast<WizardIpSearchPage *> ( ui->wizard->wizardPages[1] )->getIpSearch();
fd->deleteLater();
emit userInputCompleted ( input );
}
}