aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/tutorials/extending-qml
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-08-22 11:45:45 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-08-23 13:51:06 +0000
commitb938edcfb3aa2c78e35c9d63d995f6824e14eadf (patch)
tree593a1eb2158d47b67d422259721198956d9f9a7f /examples/qml/tutorials/extending-qml
parent2be575b4b1e6f6e11a8dbd0b1c05c003828d2598 (diff)
Convert Examples
This patch converts all examples in qtdeclarative except for a few exceptions which require a public facing qml plugin api. Change-Id: I2cd2b1bb455be8b48796893a8235dea7f8b35aa2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/qml/tutorials/extending-qml')
-rw-r--r--examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt8
-rw-r--r--examples/qml/tutorials/extending-qml/CMakeLists.txt11
-rw-r--r--examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt47
-rw-r--r--examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt47
-rw-r--r--examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt47
-rw-r--r--examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt48
-rw-r--r--examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt48
7 files changed, 256 insertions, 0 deletions
diff --git a/examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt b/examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..8e41f3d77d
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt
@@ -0,0 +1,8 @@
+# Generated from extending-qml.pro.
+
+add_subdirectory(chapter1-basics)
+add_subdirectory(chapter2-methods)
+add_subdirectory(chapter3-bindings)
+add_subdirectory(chapter4-customPropertyTypes)
+add_subdirectory(chapter5-listproperties)
+add_subdirectory(chapter6-plugins)
diff --git a/examples/qml/tutorials/extending-qml/CMakeLists.txt b/examples/qml/tutorials/extending-qml/CMakeLists.txt
new file mode 100644
index 0000000000..8f8395ac95
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Generated from extending-qml.pro.
+
+add_subdirectory(chapter1-basics)
+add_subdirectory(chapter2-methods)
+add_subdirectory(chapter3-bindings)
+add_subdirectory(chapter4-customPropertyTypes)
+add_subdirectory(chapter5-listproperties)
+# special case begin
+# Needs public QML plugin API
+# add_subdirectory(chapter6-plugins)
+# special case end
diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt
new file mode 100644
index 0000000000..f015666898
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from chapter1-basics.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chapter1-basics LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Quick)
+
+add_qt_gui_executable(chapter1-basics
+ main.cpp
+ piechart.cpp piechart.h
+)
+target_link_libraries(chapter1-basics PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+set(chapter1-basics_resource_files
+ "app.qml"
+)
+
+QT6_ADD_RESOURCES(chapter1-basics "chapter1-basics"
+ PREFIX
+ "/"
+ FILES
+ ${chapter1-basics_resource_files}
+)
+
+
+install(TARGETS chapter1-basics
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt
new file mode 100644
index 0000000000..7b3a241db5
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from chapter2-methods.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chapter2-methods LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Quick)
+
+add_qt_gui_executable(chapter2-methods
+ main.cpp
+ piechart.cpp piechart.h
+)
+target_link_libraries(chapter2-methods PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+set(chapter2-methods_resource_files
+ "app.qml"
+)
+
+QT6_ADD_RESOURCES(chapter2-methods "chapter2-methods"
+ PREFIX
+ "/"
+ FILES
+ ${chapter2-methods_resource_files}
+)
+
+
+install(TARGETS chapter2-methods
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt
new file mode 100644
index 0000000000..7321e4adbc
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from chapter3-bindings.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chapter3-bindings LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Quick)
+
+add_qt_gui_executable(chapter3-bindings
+ main.cpp
+ piechart.cpp piechart.h
+)
+target_link_libraries(chapter3-bindings PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+set(chapter3-bindings_resource_files
+ "app.qml"
+)
+
+QT6_ADD_RESOURCES(chapter3-bindings "chapter3-bindings"
+ PREFIX
+ "/"
+ FILES
+ ${chapter3-bindings_resource_files}
+)
+
+
+install(TARGETS chapter3-bindings
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt
new file mode 100644
index 0000000000..5aea87d6e1
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt
@@ -0,0 +1,48 @@
+# Generated from chapter4-customPropertyTypes.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chapter4-customPropertyTypes LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Quick)
+
+add_qt_gui_executable(chapter4-customPropertyTypes
+ main.cpp
+ piechart.cpp piechart.h
+ pieslice.cpp pieslice.h
+)
+target_link_libraries(chapter4-customPropertyTypes PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+set(chapter4-customPropertyTypes_resource_files
+ "app.qml"
+)
+
+QT6_ADD_RESOURCES(chapter4-customPropertyTypes "chapter4-customPropertyTypes"
+ PREFIX
+ "/"
+ FILES
+ ${chapter4-customPropertyTypes_resource_files}
+)
+
+
+install(TARGETS chapter4-customPropertyTypes
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt
new file mode 100644
index 0000000000..38b7f4b52c
--- /dev/null
+++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt
@@ -0,0 +1,48 @@
+# Generated from chapter5-listproperties.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(chapter5-listproperties LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Quick)
+
+add_qt_gui_executable(chapter5-listproperties
+ main.cpp
+ piechart.cpp piechart.h
+ pieslice.cpp pieslice.h
+)
+target_link_libraries(chapter5-listproperties PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::Quick
+)
+
+# Resources:
+set(chapter5-listproperties_resource_files
+ "app.qml"
+)
+
+QT6_ADD_RESOURCES(chapter5-listproperties "chapter5-listproperties"
+ PREFIX
+ "/"
+ FILES
+ ${chapter5-listproperties_resource_files}
+)
+
+
+install(TARGETS chapter5-listproperties
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)