Add QFileDialog::ShowDirsOnly to manual dialog test.

Task-number: QTBUG-35396

Change-Id: I6ccb59d6bd3857aea66911e03200f28d093e57b4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
This commit is contained in:
Friedemann Kleint 2013-12-10 11:19:16 +01:00 committed by The Qt Project
parent 639b4e85ae
commit 1171175a56
2 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,7 @@ private:
FileDialogPanel::FileDialogPanel(QWidget *parent) FileDialogPanel::FileDialogPanel(QWidget *parent)
: QWidget(parent) : QWidget(parent)
, m_showDirsOnly(new QCheckBox(tr("Show dirs only")))
, m_readOnly(new QCheckBox(tr("Read only"))) , m_readOnly(new QCheckBox(tr("Read only")))
, m_confirmOverWrite(new QCheckBox(tr("Confirm overwrite"))) , m_confirmOverWrite(new QCheckBox(tr("Confirm overwrite")))
, m_nameFilterDetailsVisible(new QCheckBox(tr("Name filter details visible"))) , 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("FileMode:"), m_fileMode);
optionsLayout->addRow(tr("ViewMode:"), m_viewMode); optionsLayout->addRow(tr("ViewMode:"), m_viewMode);
optionsLayout->addRow(tr("Allowed Schemes:"), m_allowedSchemes); optionsLayout->addRow(tr("Allowed Schemes:"), m_allowedSchemes);
optionsLayout->addRow(m_showDirsOnly);
optionsLayout->addRow(m_native); optionsLayout->addRow(m_native);
optionsLayout->addRow(m_confirmOverWrite); optionsLayout->addRow(m_confirmOverWrite);
optionsLayout->addRow(m_nameFilterDetailsVisible); optionsLayout->addRow(m_nameFilterDetailsVisible);
@ -293,6 +295,8 @@ QString FileDialogPanel::filterString() const
QFileDialog::Options FileDialogPanel::options() const QFileDialog::Options FileDialogPanel::options() const
{ {
QFileDialog::Options result; QFileDialog::Options result;
if (m_showDirsOnly->isChecked())
result |= QFileDialog::ShowDirsOnly;
if (!m_nameFilterDetailsVisible->isChecked()) if (!m_nameFilterDetailsVisible->isChecked())
result |= QFileDialog::HideNameFilterDetails; result |= QFileDialog::HideNameFilterDetails;
if (!m_resolveSymLinks->isChecked()) if (!m_resolveSymLinks->isChecked())
@ -439,6 +443,7 @@ void FileDialogPanel::restoreDefaults()
setComboBoxValue(m_acceptMode, d.acceptMode()); setComboBoxValue(m_acceptMode, d.acceptMode());
setComboBoxValue(m_fileMode, d.fileMode()); setComboBoxValue(m_fileMode, d.fileMode());
setComboBoxValue(m_viewMode, d.viewMode()); setComboBoxValue(m_viewMode, d.viewMode());
m_showDirsOnly->setChecked(d.testOption(QFileDialog::ShowDirsOnly));
m_allowedSchemes->setText(QString()); m_allowedSchemes->setText(QString());
m_confirmOverWrite->setChecked(d.confirmOverwrite()); m_confirmOverWrite->setChecked(d.confirmOverwrite());
m_nameFilterDetailsVisible->setChecked(d.isNameFilterDetailsVisible()); m_nameFilterDetailsVisible->setChecked(d.isNameFilterDetailsVisible());

View File

@ -92,6 +92,7 @@ private:
void applySettings(QFileDialog *d) const; void applySettings(QFileDialog *d) const;
QFormLayout *filesLayout; QFormLayout *filesLayout;
QCheckBox *m_showDirsOnly;
QCheckBox *m_readOnly; QCheckBox *m_readOnly;
QCheckBox *m_confirmOverWrite; QCheckBox *m_confirmOverWrite;
QCheckBox *m_nameFilterDetailsVisible; QCheckBox *m_nameFilterDetailsVisible;