summaryrefslogtreecommitdiffstats
path: root/examples/widgets/dialogs/licensewizard
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/dialogs/licensewizard')
-rw-r--r--examples/widgets/dialogs/licensewizard/CMakeLists.txt36
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.cpp5
-rw-r--r--examples/widgets/dialogs/licensewizard/main.cpp2
3 files changed, 24 insertions, 19 deletions
diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt
index 497cfff064..0cf2d61c8b 100644
--- a/examples/widgets/dialogs/licensewizard/CMakeLists.txt
+++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt
@@ -1,16 +1,13 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(licensewizard LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/licensewizard")
-
find_package(Qt6 REQUIRED COMPONENTS Core Gui PrintSupport Widgets)
+qt_standard_project_setup()
+
qt_add_executable(licensewizard
licensewizard.cpp licensewizard.h
main.cpp
@@ -21,11 +18,11 @@ set_target_properties(licensewizard PROPERTIES
MACOSX_BUNDLE TRUE
)
-target_link_libraries(licensewizard PUBLIC
- Qt::Core
- Qt::Gui
- Qt::PrintSupport
- Qt::Widgets
+target_link_libraries(licensewizard PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::PrintSupport
+ Qt6::Widgets
)
# Resources:
@@ -42,7 +39,14 @@ qt_add_resources(licensewizard "licensewizard"
)
install(TARGETS licensewizard
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION .
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+qt_generate_deploy_app_script(
+ TARGET licensewizard
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
index 05888ac67d..67fa46bf07 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
@@ -288,9 +288,12 @@ void ConclusionPage::initializePage()
"You can use this software for 30 days and make one "
"backup, but you are not allowed to distribute it.");
} else if (wizard()->hasVisitedPage(LicenseWizard::Page_Details)) {
+//! [accessField]
+ const QString emailAddress = field("details.email").toString();
licenseText = tr("<u>First-Time License Agreement:</u> "
"You can use this software subject to the license "
- "you will receive by email.");
+ "you will receive by email sent to %1.").arg(emailAddress);
+//! [accessField]
} else {
licenseText = tr("<u>Upgrade License Agreement:</u> "
"This software is licensed under the terms of your "
diff --git a/examples/widgets/dialogs/licensewizard/main.cpp b/examples/widgets/dialogs/licensewizard/main.cpp
index 13e13f0e32..d16b5dc6d1 100644
--- a/examples/widgets/dialogs/licensewizard/main.cpp
+++ b/examples/widgets/dialogs/licensewizard/main.cpp
@@ -10,8 +10,6 @@
int main(int argc, char *argv[])
{
- Q_INIT_RESOURCE(licensewizard);
-
QApplication app(argc, argv);
#ifndef QT_NO_TRANSLATION