Skip to content

Commit

Permalink
Merge pull request #216 from cneben/b/#214-collapse-groups
Browse files Browse the repository at this point in the history
B/#214 collapse groups
  • Loading branch information
cneben authored Nov 19, 2023
2 parents 3f5c0ea + 38f41ae commit 661f5b2
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 97 deletions.
2 changes: 1 addition & 1 deletion samples/advanced/AdvancedNode.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Qan.NodeItem {
anchors.fill: parent
radius: 10; color: light
border.color: "violet"; border.width: 2
readonly property color dark: "blue"
readonly property color dark: "#0097c9"
readonly property color light: "lightblue"
Label {
anchors.fill: parent
Expand Down
1 change: 0 additions & 1 deletion samples/advanced/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
qt_add_resources(source_files ${resources_files})

if(NOT TARGET QuickQanava)
#set(QUICK_QANAVA_BUILD_STATIC_QRC ON)
add_subdirectory(../../ quickqanava_build) # Use ../../src as quickqanava_build subdirectory
# see https://stackoverflow.com/questions/50408169/cmake-error-add-subdirectory-not-given-a-binary-directory/50408555
endif()
Expand Down
2 changes: 2 additions & 0 deletions samples/advanced/advanced.qml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ ApplicationWindow {
// Horizontal arrow
const arrow2H1 = topology.insertNode(hookDelegate);
arrow2H1.item.x = 550; arrow2H1.item.y = 500;
arrow2H1.item.dragOrientation = Qan.NodeItem.DragHorizontal;
const arrow2H2 = topology.insertNode(hookDelegate);
arrow2H2.item.x = 850; arrow2H2.item.y = 500;
arrow2H2.item.dragOrientation = Qan.NodeItem.DragHorizontal;
const arrow2 = topology.insertEdge(arrow2H1, arrow2H2);
arrow2.item.style = topology.styleManager.createEdgeStyle();
arrow2.item.style.lineColor = '#29ADB2'
Expand Down
1 change: 0 additions & 1 deletion samples/groups/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ include_directories(${Qt5Quick_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} "../../src")

if(NOT TARGET QuickQanava)
set(QUICK_QANAVA_BUILD_STATIC_QRC ON)
add_subdirectory(../../ quickqanava_build) # Use ../../src as quickqanava_build subdirectory
# see https://stackoverflow.com/questions/50408169/cmake-error-add-subdirectory-not-given-a-binary-directory/50408555
endif()
Expand Down
1 change: 0 additions & 1 deletion samples/style/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:QT_
set(CMAKE_INCLUDE_CURRENT_DIR ON)

if(NOT TARGET QuickQanava)
#set(QUICK_QANAVA_BUILD_STATIC_QRC ON)
add_subdirectory(../../ quickqanava_build) # Use ../../src as quickqanava_build subdirectory
# see https://stackoverflow.com/questions/50408169/cmake-error-add-subdirectory-not-given-a-binary-directory/50408555
endif()
Expand Down
1 change: 0 additions & 1 deletion samples/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ include_directories(${Qt5Quick_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} "../../src")

if(NOT TARGET QuickQanava)
#set(QUICK_QANAVA_BUILD_STATIC_QRC ON)
add_subdirectory(../../ quickqanava_build) # Use ../../src as quickqanava_build subdirectory
# see https://stackoverflow.com/questions/50408169/cmake-error-add-subdirectory-not-given-a-binary-directory/50408555
endif()
Expand Down
53 changes: 1 addition & 52 deletions src/CMakeLists.qt6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@ qt_wrap_cpp(qan_source_files, qan_header_files) # Creates .moc files from sour
set(CMAKE_AUTORCC ON)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:QT_QML_DEBUG>)

message(HOPLA2)

# Configure QuickQanava library ###############################################
if(QUICK_QANAVA_BUILD_STATIC_QRC)
list(APPEND qan_resources QuickQanava_static.qrc)
else()
list(APPEND qan_resources QuickQanava_plugin.qrc)
endif(QUICK_QANAVA_BUILD_STATIC_QRC)

list(APPEND qan_resources QuickQanava_static.qrc)
list(APPEND qan_resources GraphicalEffects6/QuickQanavaGraphicalEffects.qrc)
add_library(QuickQanava STATIC ${qan_source_files} ${qan_header_files} ${qan_resources})

Expand Down Expand Up @@ -53,49 +46,5 @@ target_link_libraries(QuickQanava PUBLIC Qt6::Core
Qt6::Qml
Qt6::Quick
Qt6::QuickControls2)
if(QUICK_QANAVA_BUILD_STATIC_QRC)
target_compile_definitions(QuickQanava PUBLIC -DQUICKQANAVA_STATIC)
endif(QUICK_QANAVA_BUILD_STATIC_QRC)

# Configure QuickQanava QML module plugin #####################################
set(PLUGIN_TARGET "quickqanavaplugin")
add_library(${PLUGIN_TARGET} SHARED ${qan_plugin_files})
target_link_libraries(${PLUGIN_TARGET} QuickQanava)

# QML module deployment
set(URI QuickQanava)
string(REPLACE "." "/" TARGETPATH ${URI})
if (NOT DEFINED QT_QMAKE_EXECUTABLE)
get_target_property (QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
if (NOT QT_QMAKE_EXECUTABLE)
message(FATAL_ERROR "Cannot find qmake")
endif()
endif()
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_QML OUTPUT_VARIABLE QT_INSTALL_QML_RAW)
string(STRIP ${QT_INSTALL_QML_RAW} QT_INSTALL_QML)
set(DESTDIR "${QT_INSTALL_QML}/${TARGETPATH}")
install(TARGETS ${PLUGIN_TARGET} DESTINATION ${DESTDIR})

# Install qmldir file
if(QUICK_QANAVA_BUILD_STATIC_QRC)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/qmldir_static
DESTINATION ${DESTDIR}
RENAME qmldir
)
else()
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/qmldir_plugin
DESTINATION ${DESTDIR}
RENAME qmldir
)
endif(QUICK_QANAVA_BUILD_STATIC_QRC)


# Install source QML files to ease debugging
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ # sic! Need leading slash, otherwise it will install into subdir src
DESTINATION ${DESTDIR}
FILES_MATCHING PATTERN "*.qml"
)

40 changes: 0 additions & 40 deletions src/quickcontainers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.1.0)
project(QuickContainers LANGUAGES CXX)

# Configure Qt
message(QuickContainers HOPLA)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Qml REQUIRED)
set(CMAKE_AUTOMOC ON)
Expand All @@ -28,9 +27,6 @@ set (qcm_plugin_files
)

# Configure QuickContainers library ###########################################
#target_include_directories(QuickContainers INTERFACE include)
#target_sources(QuickContainers INTERFACE ${qcm_header_files})

add_library(QuickContainers STATIC ${qcm_header_files} ${qcm_source_files})
set_target_properties(QuickContainers PROPERTIES LINKER_LANGUAGE CXX)

Expand All @@ -45,39 +41,3 @@ target_compile_features(QuickContainers
cxx_std_14
)

install(FILES
${qcm_header_files}
DESTINATION include/quickcontainers
)

install(TARGETS QuickContainers
EXPORT Targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
INCLUDES DESTINATION include/quickcontainers
)

# Configure QML QuickContainers plugin ########################################
set(PLUGIN_TARGET "quickcontainersplugin")
add_library(${PLUGIN_TARGET} SHARED ${qcm_plugin_files})

target_link_libraries(QuickContainers Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Qml)
target_link_libraries(${PLUGIN_TARGET} QuickContainers)

# QML module deployment
set(URI QuickContainers)
string(REPLACE "." "/" TARGETPATH ${URI})
if (NOT DEFINED QT_QMAKE_EXECUTABLE)
get_target_property (QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
endif()
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_QML OUTPUT_VARIABLE QT_INSTALL_QML_RAW)
string(STRIP ${QT_INSTALL_QML_RAW} QT_INSTALL_QML)
set(DESTDIR "${QT_INSTALL_QML}/${TARGETPATH}")
install(TARGETS ${PLUGIN_TARGET} DESTINATION ${DESTDIR})

# Install QML module qmldir file
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/qmldir
DESTINATION ${DESTDIR}
)

0 comments on commit 661f5b2

Please sign in to comment.