summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/dialogs/filedialogpanel.cpp10
-rw-r--r--tests/manual/dialogs/fontdialogpanel.cpp2
-rw-r--r--tests/manual/dialogs/messageboxpanel.cpp4
3 files changed, 16 insertions, 0 deletions
diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp
index e234835cdb..682e944556 100644
--- a/tests/manual/dialogs/filedialogpanel.cpp
+++ b/tests/manual/dialogs/filedialogpanel.cpp
@@ -355,6 +355,7 @@ void FileDialogPanel::getOpenFileNames()
void FileDialogPanel::getOpenFileUrls()
{
+#if QT_VERSION >= 0x050000
QString selectedFilter = m_selectedNameFilter->text().trimmed();
const QList<QUrl> files =
QFileDialog::getOpenFileUrls(this, tr("getOpenFileNames Qt %1").arg(QLatin1String(QT_VERSION_STR)),
@@ -367,6 +368,7 @@ void FileDialogPanel::getOpenFileUrls()
<< "\nName filter: " << selectedFilter;
QMessageBox::information(this, tr("getOpenFileNames"), result, QMessageBox::Ok);
}
+#endif // Qt 5
}
void FileDialogPanel::getOpenFileName()
@@ -386,6 +388,7 @@ void FileDialogPanel::getOpenFileName()
void FileDialogPanel::getOpenFileUrl()
{
+#if QT_VERSION >= 0x050000
QString selectedFilter = m_selectedNameFilter->text().trimmed();
const QUrl file =
QFileDialog::getOpenFileUrl(this, tr("getOpenFileUrl Qt %1").arg(QLatin1String(QT_VERSION_STR)),
@@ -398,6 +401,7 @@ void FileDialogPanel::getOpenFileUrl()
<< "\nName filter: " << selectedFilter;
QMessageBox::information(this, tr("getOpenFileName"), result, QMessageBox::Ok);
}
+#endif // Qt 5
}
void FileDialogPanel::getSaveFileName()
@@ -417,6 +421,7 @@ void FileDialogPanel::getSaveFileName()
void FileDialogPanel::getSaveFileUrl()
{
+#if QT_VERSION >= 0x050000
QString selectedFilter = m_selectedNameFilter->text().trimmed();
const QUrl file =
QFileDialog::getSaveFileUrl(this, tr("getSaveFileName Qt %1").arg(QLatin1String(QT_VERSION_STR)),
@@ -429,6 +434,7 @@ void FileDialogPanel::getSaveFileUrl()
<< "\nName filter: " << selectedFilter;
QMessageBox::information(this, tr("getSaveFileNames"), result, QMessageBox::Ok);
}
+#endif // Qt 5
}
void FileDialogPanel::getExistingDirectory()
@@ -442,12 +448,14 @@ void FileDialogPanel::getExistingDirectory()
void FileDialogPanel::getExistingDirectoryUrl()
{
+#if QT_VERSION >= 0x050000
const QUrl dir =
QFileDialog::getExistingDirectoryUrl(this, tr("getExistingDirectory Qt %1").arg(QLatin1String(QT_VERSION_STR)),
QUrl(m_directory->text()), options() | QFileDialog::ShowDirsOnly,
allowedSchemes());
if (!dir.isEmpty())
QMessageBox::information(this, tr("getExistingDirectory"), QLatin1String("Directory: ") + dir.toString(), QMessageBox::Ok);
+#endif // Qt 5
}
void FileDialogPanel::restoreDefaults()
@@ -493,9 +501,11 @@ void FileDialogPanel::applySettings(QFileDialog *d) const
if (!filter.isEmpty())
d->selectNameFilter(filter);
} else {
+#if QT_VERSION >= 0x050000
d->setMimeTypeFilters(filters);
if (!filter.isEmpty())
d->selectMimeTypeFilter(filter);
+#endif // Qt 5
}
foreach (LabelLineEdit *l, m_labelLineEdits)
l->apply(d);
diff --git a/tests/manual/dialogs/fontdialogpanel.cpp b/tests/manual/dialogs/fontdialogpanel.cpp
index c72bf77351..ff45402197 100644
--- a/tests/manual/dialogs/fontdialogpanel.cpp
+++ b/tests/manual/dialogs/fontdialogpanel.cpp
@@ -209,10 +209,12 @@ void FontDialogPanel::applySettings(QFontDialog *d) const
{
d->setOption(QFontDialog::NoButtons, m_noButtons->isChecked());
d->setOption(QFontDialog::DontUseNativeDialog, m_dontUseNativeDialog->isChecked());
+#if QT_VERSION >= 0x050000
d->setOption(QFontDialog::ScalableFonts, m_scalableFilter->isChecked());
d->setOption(QFontDialog::NonScalableFonts, m_nonScalableFilter->isChecked());
d->setOption(QFontDialog::MonospacedFonts, m_monospacedFilter->isChecked());
d->setOption(QFontDialog::ProportionalFonts, m_proportionalFilter->isChecked());
+#endif // Qt 5
QFont font = m_fontFamilyBox->currentFont();
font.setPointSizeF(m_fontSizeBox->value());
diff --git a/tests/manual/dialogs/messageboxpanel.cpp b/tests/manual/dialogs/messageboxpanel.cpp
index 529a8251e1..ced582981e 100644
--- a/tests/manual/dialogs/messageboxpanel.cpp
+++ b/tests/manual/dialogs/messageboxpanel.cpp
@@ -149,9 +149,11 @@ void MessageBoxPanel::setupMessageBox(QMessageBox &box)
if (box.standardButtons() == (QMessageBox::StandardButtons) 0)
box.setStandardButtons(QMessageBox::Ok); // just to have something.
+#if QT_VERSION >= 0x050000
box.setCheckBox(0);
if (m_checkboxText->text().length() > 0)
box.setCheckBox(new QCheckBox(m_checkboxText->text()));
+#endif // Qt 5
box.setIcon((QMessageBox::Icon) m_iconComboBox->currentIndex());
}
@@ -176,12 +178,14 @@ void MessageBoxPanel::doExec()
QString sres;
sres.setNum(res, 16);
m_resultLabel->setText(QString::fromLatin1("Return value (hex): %1").arg(sres));
+#if QT_VERSION >= 0x050000
if (m_msgbox->checkBox()) {
if (m_msgbox->checkBox()->isChecked())
m_checkBoxResult->setText(QString::fromLatin1("Checkbox was checked"));
else
m_checkBoxResult->setText(QString::fromLatin1("Checkbox was not checked"));
}
+#endif // Qt 5
}
void MessageBoxPanel::doShowApply()