aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/quickcontrols2/contactlist/CMakeLists.txt39
-rw-r--r--examples/quickcontrols2/contactlist/contactlist.qml2
2 files changed, 16 insertions, 25 deletions
diff --git a/examples/quickcontrols2/contactlist/CMakeLists.txt b/examples/quickcontrols2/contactlist/CMakeLists.txt
index 58e6299263..3bf15f7c4d 100644
--- a/examples/quickcontrols2/contactlist/CMakeLists.txt
+++ b/examples/quickcontrols2/contactlist/CMakeLists.txt
@@ -11,41 +11,32 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols2/contactlist")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick)
-qt_add_executable(contactlist
+qt_add_executable(contactlistexample WIN32 MACOSX_BUNDLE
contactmodel.cpp contactmodel.h
main.cpp
)
-set_target_properties(contactlist PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
+qt_add_qml_module(contactlistexample
+ URI contactlist
+ VERSION 1.0
+ NO_RESOURCE_TARGET_PATH
+ QML_FILES
+ "ContactDelegate.ui.qml"
+ "ContactDialog.qml"
+ "ContactForm.ui.qml"
+ "ContactView.ui.qml"
+ "SectionDelegate.ui.qml"
+ "contactlist.qml"
+ "designer/Backend/ContactModel.qml"
)
-target_link_libraries(contactlist PUBLIC
+target_link_libraries(contactlistexample PUBLIC
Qt::Core
Qt::Gui
Qt::Quick
)
-# Resources:
-set(qmake_immediate_resource_files
- "ContactDelegate.ui.qml"
- "ContactDialog.qml"
- "ContactForm.ui.qml"
- "ContactView.ui.qml"
- "SectionDelegate.ui.qml"
- "contactlist.qml"
- "designer/Backend/ContactModel.qml"
-)
-
-qt6_add_resources(contactlist "qmake_immediate"
- PREFIX
- "/"
- FILES
- ${qmake_immediate_resource_files}
-)
-
-install(TARGETS contactlist
+install(TARGETS contactlistexample
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/quickcontrols2/contactlist/contactlist.qml b/examples/quickcontrols2/contactlist/contactlist.qml
index aa8ab08e65..28f887f2db 100644
--- a/examples/quickcontrols2/contactlist/contactlist.qml
+++ b/examples/quickcontrols2/contactlist/contactlist.qml
@@ -16,7 +16,7 @@ ApplicationWindow {
ContactDialog {
id: contactDialog
- onFinished: {
+ onFinished: function(fullName, address, city, number) {
if (currentContact === -1)
contactView.model.append(fullName, address, city, number)
else