summaryrefslogtreecommitdiffstats
path: root/examples/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/dialogs')
-rw-r--r--examples/widgets/dialogs/CMakeLists.txt14
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.cpp8
2 files changed, 14 insertions, 8 deletions
diff --git a/examples/widgets/dialogs/CMakeLists.txt b/examples/widgets/dialogs/CMakeLists.txt
index 354424bf1f..32f8bc29a8 100644
--- a/examples/widgets/dialogs/CMakeLists.txt
+++ b/examples/widgets/dialogs/CMakeLists.txt
@@ -1,13 +1,13 @@
# Generated from dialogs.pro.
if(QT_FEATURE_wizard)
- add_subdirectory(classwizard)
- add_subdirectory(trivialwizard)
+ qt_internal_add_example(classwizard)
+ qt_internal_add_example(trivialwizard)
endif()
-add_subdirectory(extension)
-add_subdirectory(findfiles)
-add_subdirectory(standarddialogs)
-add_subdirectory(tabdialog)
+qt_internal_add_example(extension)
+qt_internal_add_example(findfiles)
+qt_internal_add_example(standarddialogs)
+qt_internal_add_example(tabdialog)
if(QT_FEATURE_wizard AND TARGET Qt::PrintSupport)
- add_subdirectory(licensewizard)
+ qt_internal_add_example(licensewizard)
endif()
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.cpp b/examples/widgets/dialogs/standarddialogs/dialog.cpp
index cd7e8085a2..7df24e06f6 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.cpp
+++ b/examples/widgets/dialogs/standarddialogs/dialog.cpp
@@ -388,8 +388,14 @@ void Dialog::setColor()
void Dialog::setFont()
{
const QFontDialog::FontDialogOptions options = QFlag(fontDialogOptionsWidget->value());
+
+ const QString &description = fontLabel->text();
+ QFont defaultFont;
+ if (!description.isEmpty())
+ defaultFont.fromString(description);
+
bool ok;
- QFont font = QFontDialog::getFont(&ok, QFont(fontLabel->text()), this, "Select Font", options);
+ QFont font = QFontDialog::getFont(&ok, defaultFont, this, "Select Font", options);
if (ok) {
fontLabel->setText(font.key());
fontLabel->setFont(font);