diff options
author | Zhang Hao <zhanghao@uniontech.com> | 2022-01-07 11:21:19 +0800 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-07-22 11:12:38 +0200 |
commit | 7c00aa7aa1476fc45adc5abf54185545ecc4c14e (patch) | |
tree | 0d031abbf250f9059813ecf95b0cd5502d17a3fb /examples/location/places_list | |
parent | c335c5119003b26bcdd55fb1722fdb370cbfaf1b (diff) |
Porting Examples: use CMake replace qmake
This commit re-enables follow examples:
* places
* places_list
* places_map
* minimal_map
* itemview_transitions
* planespotter
Since mapviewer and geojson_viewer example need refactoring for Qt6,so
this patch ignore them, but this patch will create them's CMakeList.txt
file.
Task-number: QTBUG-96795
Done-with: Lauri Laanmets <lauri.laanmets@eesti.ee>
Pick-to: 6.2
Change-Id: Ib1385b978b243165163729668ca5d5504e81d9f9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/location/places_list')
-rw-r--r-- | examples/location/places_list/CMakeLists.txt | 58 | ||||
-rw-r--r-- | examples/location/places_list/Marker.qml | 2 | ||||
-rw-r--r-- | examples/location/places_list/places_list.qml | 6 |
3 files changed, 62 insertions, 4 deletions
diff --git a/examples/location/places_list/CMakeLists.txt b/examples/location/places_list/CMakeLists.txt new file mode 100644 index 00000000..c4815a0a --- /dev/null +++ b/examples/location/places_list/CMakeLists.txt @@ -0,0 +1,58 @@ +# Generated from places_list.pro. + +cmake_minimum_required(VERSION 3.16) +project(places_list LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/location/places_list") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Network) +find_package(Qt6 COMPONENTS Positioning) +find_package(Qt6 COMPONENTS Location) + +qt_add_executable(places_list WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(places_list PUBLIC + Qt::Core + Qt::Gui + Qt::Location + Qt::Network + Qt::Positioning + Qt::Qml + Qt::Quick +) + + +# Resources: +set(places_list_resource_files + "Marker.qml" + "marker.png" + "places_list.qml" +) + +qt6_add_resources(places_list "places_list" + PREFIX + "/" + FILES + ${places_list_resource_files} +) + +install(TARGETS places_list + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/location/places_list/Marker.qml b/examples/location/places_list/Marker.qml index c1f33dee..7b1a7c13 100644 --- a/examples/location/places_list/Marker.qml +++ b/examples/location/places_list/Marker.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick Rectangle { width: image.width diff --git a/examples/location/places_list/places_list.qml b/examples/location/places_list/places_list.qml index 931983e2..01c2e15e 100644 --- a/examples/location/places_list/places_list.qml +++ b/examples/location/places_list/places_list.qml @@ -49,9 +49,9 @@ ****************************************************************************/ //! [Imports] -import QtQuick 2.0 -import QtPositioning 5.5 -import QtLocation 5.6 +import QtQuick +import QtPositioning +import QtLocation //! [Imports] Rectangle { |