tempFileDialog::tempFileDialog(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags){ ui.setupUi(this); dialog_ = new QFileDialog(this, "caption", ".", "*.*"); dialog_->setAcceptMode(QFileDialog::AcceptSave); QTimer::singleShot(3000, this, SLOT(timeout())); if (dialog_->exec() == QDialog::Accepted) { qDebug() << dialog_->selectedFiles(); }}void tempFileDialog::timeout(){ dialog_->reject();}