From 48c82e90af12da74c713665ddfd7f8d825ae5bdb Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 16 Jan 2020 10:42:05 +0100 Subject: Post Merge Fixes Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce Reviewed-by: Alexandru Croitor --- examples/widgets/graphicsview/CMakeLists.txt | 4 - examples/widgets/graphicsview/boxes/CMakeLists.txt | 39 ----- .../widgets/painting/pathstroke/CMakeLists.txt | 185 ++++++++++++++++++++- 3 files changed, 182 insertions(+), 46 deletions(-) delete mode 100644 examples/widgets/graphicsview/boxes/CMakeLists.txt (limited to 'examples/widgets') diff --git a/examples/widgets/graphicsview/CMakeLists.txt b/examples/widgets/graphicsview/CMakeLists.txt index 19f60011e5..d7ef0fd0dc 100644 --- a/examples/widgets/graphicsview/CMakeLists.txt +++ b/examples/widgets/graphicsview/CMakeLists.txt @@ -14,7 +14,3 @@ add_subdirectory(flowlayout) add_subdirectory(anchorlayout) add_subdirectory(simpleanchorlayout) add_subdirectory(weatheranchorlayout) - -if(TARGET Qt::OpenGL AND NOT QT_FEATURE_opengles2 AND NOT QT_FEATURE_dynamicgl) - add_subdirectory(boxes) -endif() diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt deleted file mode 100644 index 0be040f90e..0000000000 --- a/examples/widgets/graphicsview/boxes/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# Generated from boxes.pro. - -cmake_minimum_required(VERSION 3.14) -project(boxes 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 OpenGL) -find_package(Qt6 COMPONENTS Widgets) - - -add_qt_gui_executable(boxes - 3rdparty/fbm.c 3rdparty/fbm.h - boxes.qrc - glbuffers.cpp glbuffers.h - glextensions.cpp glextensions.h - gltrianglemesh.h - main.cpp - qtbox.cpp qtbox.h - roundedbox.cpp roundedbox.h - scene.cpp scene.h - trackball.cpp trackball.h -) -target_link_libraries(boxes PUBLIC - Qt::OpenGL - Qt::Widgets -) - -install(TARGETS boxes - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt index 27f18bb848..9f5c24fe88 100644 --- a/examples/widgets/painting/pathstroke/CMakeLists.txt +++ b/examples/widgets/painting/pathstroke/CMakeLists.txt @@ -9,25 +9,204 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -set(INSTALL_EXAMPLEDIR "examples") +set(INSTALL_EXAMPLEDIR "examples/widgets/painting/pathstroke") +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Widgets) add_qt_gui_executable(pathstroke ../shared/arthurstyle.cpp ../shared/arthurstyle.h ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h ../shared/hoverpoints.cpp ../shared/hoverpoints.h - ../shared/shared.qrc main.cpp - pathstroke.cpp pathstroke.h pathstroke.qrc + pathstroke.cpp pathstroke.h ) target_include_directories(pathstroke PUBLIC ../shared ) + target_link_libraries(pathstroke PUBLIC + Qt::Core + Qt::Gui Qt::Widgets ) + +# Resources: +set_source_files_properties("../shared/images/button_normal_cap_left.png" + PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_left.png" +) +set_source_files_properties("../shared/images/button_normal_cap_right.png" + PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_cap_right.png" +) +set_source_files_properties("../shared/images/button_normal_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/button_normal_stretch.png" +) +set_source_files_properties("../shared/images/button_pressed_cap_left.png" + PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_left.png" +) +set_source_files_properties("../shared/images/button_pressed_cap_right.png" + PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_cap_right.png" +) +set_source_files_properties("../shared/images/button_pressed_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/button_pressed_stretch.png" +) +set_source_files_properties("../shared/images/frame_bottom.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottom.png" +) +set_source_files_properties("../shared/images/frame_bottomleft.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomleft.png" +) +set_source_files_properties("../shared/images/frame_bottomright.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_bottomright.png" +) +set_source_files_properties("../shared/images/frame_left.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_left.png" +) +set_source_files_properties("../shared/images/frame_right.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_right.png" +) +set_source_files_properties("../shared/images/frame_top.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_top.png" +) +set_source_files_properties("../shared/images/frame_topleft.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_topleft.png" +) +set_source_files_properties("../shared/images/frame_topright.png" + PROPERTIES QT_RESOURCE_ALIAS "images/frame_topright.png" +) +set_source_files_properties("../shared/images/groupframe_bottom_left.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_left.png" +) +set_source_files_properties("../shared/images/groupframe_bottom_right.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_right.png" +) +set_source_files_properties("../shared/images/groupframe_bottom_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_bottom_stretch.png" +) +set_source_files_properties("../shared/images/groupframe_left_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_left_stretch.png" +) +set_source_files_properties("../shared/images/groupframe_right_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_right_stretch.png" +) +set_source_files_properties("../shared/images/groupframe_top_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_top_stretch.png" +) +set_source_files_properties("../shared/images/groupframe_topleft.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topleft.png" +) +set_source_files_properties("../shared/images/groupframe_topright.png" + PROPERTIES QT_RESOURCE_ALIAS "images/groupframe_topright.png" +) +set_source_files_properties("../shared/images/line_dash_dot.png" + PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot.png" +) +set_source_files_properties("../shared/images/line_dash_dot_dot.png" + PROPERTIES QT_RESOURCE_ALIAS "images/line_dash_dot_dot.png" +) +set_source_files_properties("../shared/images/line_dashed.png" + PROPERTIES QT_RESOURCE_ALIAS "images/line_dashed.png" +) +set_source_files_properties("../shared/images/line_dotted.png" + PROPERTIES QT_RESOURCE_ALIAS "images/line_dotted.png" +) +set_source_files_properties("../shared/images/line_solid.png" + PROPERTIES QT_RESOURCE_ALIAS "images/line_solid.png" +) +set_source_files_properties("../shared/images/radiobutton-on.png" + PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton-on.png" +) +set_source_files_properties("../shared/images/radiobutton_off.png" + PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_off.png" +) +set_source_files_properties("../shared/images/radiobutton_on.png" + PROPERTIES QT_RESOURCE_ALIAS "images/radiobutton_on.png" +) +set_source_files_properties("../shared/images/slider_bar.png" + PROPERTIES QT_RESOURCE_ALIAS "images/slider_bar.png" +) +set_source_files_properties("../shared/images/slider_thumb_on.png" + PROPERTIES QT_RESOURCE_ALIAS "images/slider_thumb_on.png" +) +set_source_files_properties("../shared/images/title_cap_left.png" + PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_left.png" +) +set_source_files_properties("../shared/images/title_cap_right.png" + PROPERTIES QT_RESOURCE_ALIAS "images/title_cap_right.png" +) +set_source_files_properties("../shared/images/title_stretch.png" + PROPERTIES QT_RESOURCE_ALIAS "images/title_stretch.png" +) +set(shared_resource_files + "images/button_normal_cap_left.png" + "images/button_normal_cap_right.png" + "images/button_normal_stretch.png" + "images/button_pressed_cap_left.png" + "images/button_pressed_cap_right.png" + "images/button_pressed_stretch.png" + "images/frame_bottom.png" + "images/frame_bottomleft.png" + "images/frame_bottomright.png" + "images/frame_left.png" + "images/frame_right.png" + "images/frame_top.png" + "images/frame_topleft.png" + "images/frame_topright.png" + "images/groupframe_bottom_left.png" + "images/groupframe_bottom_right.png" + "images/groupframe_bottom_stretch.png" + "images/groupframe_left_stretch.png" + "images/groupframe_right_stretch.png" + "images/groupframe_top_stretch.png" + "images/groupframe_topleft.png" + "images/groupframe_topright.png" + "images/line_dash_dot.png" + "images/line_dash_dot_dot.png" + "images/line_dashed.png" + "images/line_dotted.png" + "images/line_solid.png" + "images/radiobutton-on.png" + "images/radiobutton_off.png" + "images/radiobutton_on.png" + "images/slider_bar.png" + "images/slider_thumb_on.png" + "images/title_cap_left.png" + "images/title_cap_right.png" + "images/title_stretch.png" +) + +qt6_add_resources(pathstroke "shared" + PREFIX + "/res" + BASE + "../shared" + FILES + ${shared_resource_files} +) +set(pathstroke_resource_files + "pathstroke.cpp" + "pathstroke.html" +) + +qt6_add_resources(pathstroke "pathstroke" + PREFIX + "/res/pathstroke" + FILES + ${pathstroke_resource_files} +) + +if(QT_FEATURE_opengl) + target_sources(pathstroke PUBLIC + ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h + ) + + target_link_libraries(pathstroke PUBLIC + Qt::OpenGL + ) +endif() + install(TARGETS pathstroke RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" -- cgit v1.2.3