From 1171175a567eb6ad515f98e0074dda12c9712264 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Dec 2013 11:19:16 +0100 Subject: [PATCH] Add QFileDialog::ShowDirsOnly to manual dialog test. Task-number: QTBUG-35396 Change-Id: I6ccb59d6bd3857aea66911e03200f28d093e57b4 Reviewed-by: J-P Nurmi --- tests/manual/dialogs/filedialogpanel.cpp | 5 +++++ tests/manual/dialogs/filedialogpanel.h | 1 + 2 files changed, 6 insertions(+) diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index 2ae6241849..57624a0d37 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -124,6 +124,7 @@ private: FileDialogPanel::FileDialogPanel(QWidget *parent) : QWidget(parent) + , m_showDirsOnly(new QCheckBox(tr("Show dirs only"))) , m_readOnly(new QCheckBox(tr("Read only"))) , m_confirmOverWrite(new QCheckBox(tr("Confirm overwrite"))) , m_nameFilterDetailsVisible(new QCheckBox(tr("Name filter details visible"))) @@ -150,6 +151,7 @@ FileDialogPanel::FileDialogPanel(QWidget *parent) optionsLayout->addRow(tr("FileMode:"), m_fileMode); optionsLayout->addRow(tr("ViewMode:"), m_viewMode); optionsLayout->addRow(tr("Allowed Schemes:"), m_allowedSchemes); + optionsLayout->addRow(m_showDirsOnly); optionsLayout->addRow(m_native); optionsLayout->addRow(m_confirmOverWrite); optionsLayout->addRow(m_nameFilterDetailsVisible); @@ -293,6 +295,8 @@ QString FileDialogPanel::filterString() const QFileDialog::Options FileDialogPanel::options() const { QFileDialog::Options result; + if (m_showDirsOnly->isChecked()) + result |= QFileDialog::ShowDirsOnly; if (!m_nameFilterDetailsVisible->isChecked()) result |= QFileDialog::HideNameFilterDetails; if (!m_resolveSymLinks->isChecked()) @@ -439,6 +443,7 @@ void FileDialogPanel::restoreDefaults() setComboBoxValue(m_acceptMode, d.acceptMode()); setComboBoxValue(m_fileMode, d.fileMode()); setComboBoxValue(m_viewMode, d.viewMode()); + m_showDirsOnly->setChecked(d.testOption(QFileDialog::ShowDirsOnly)); m_allowedSchemes->setText(QString()); m_confirmOverWrite->setChecked(d.confirmOverwrite()); m_nameFilterDetailsVisible->setChecked(d.isNameFilterDetailsVisible()); diff --git a/tests/manual/dialogs/filedialogpanel.h b/tests/manual/dialogs/filedialogpanel.h index 1e86e0f18e..8a9d93da03 100644 --- a/tests/manual/dialogs/filedialogpanel.h +++ b/tests/manual/dialogs/filedialogpanel.h @@ -92,6 +92,7 @@ private: void applySettings(QFileDialog *d) const; QFormLayout *filesLayout; + QCheckBox *m_showDirsOnly; QCheckBox *m_readOnly; QCheckBox *m_confirmOverWrite; QCheckBox *m_nameFilterDetailsVisible;