コード例 #1
0
void SettingsDialog::setFile( QLineEdit *le, const QString &caption )
{
    QFileDialog *fd = new QFileDialog( this );
    fd->setCaption( caption );
    fd->setMode( QFileDialog::AnyFile );
    fd->setDir( QDir::homeDirPath() );

    if ( fd->exec() == QDialog::Accepted ) {
	if ( !fd->selectedFile().isEmpty() )
	   le->setText( fd->selectedFile() );
    }
}
コード例 #2
0
void ossimQtElevationManagerDialog::addDirectoryClicked()
{
   if (!theController) return;

   QFileDialog* fd = new QFileDialog( this );
   fd->setMode(QFileDialog::DirectoryOnly);
   fd->setDir(ossimQtElevationManagerController::getLatestOpenCellPath().c_str());
   
   QString directory;
   if (fd->exec() == QDialog::Accepted )
   {
      directory = fd->selectedFile();
      theController->onAddDirectory(directory);
   }

   // Delete fd???
   delete fd;
   fd = NULL;
}
コード例 #3
0
void ossimQtIgenDialog::saveSpecFilePushButtonClicked()
{
   if (theController)
   {
      QFileDialog* fd = new QFileDialog( this );
      fd->setMode(QFileDialog::AnyFile);
      fd->setDir(ossimQtIgenController::getLatestOutputFilePath().c_str());
      
      QString file;
      if (fd->exec() == QDialog::Accepted )
      {
         file = fd->selectedFile();
         theController->saveSpecFile(file);
      }
      
      // Delete fd???
      delete fd;
      fd = NULL;
   }
}