Ejemplo n.º 1
0
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();
}
Ejemplo n.º 2
0
void ParamCompareDialog::dialogRejected()
{
    QFileDialog *dialog = qobject_cast<QFileDialog*>(sender());
    QLOG_DEBUG() << "Dialog Rejected:" << dialog;
    if (dialog){
        dialog->deleteLater();
        dialog = NULL;
    }

}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
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();
}
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 );
    }
}