### Run QML Example with KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/pure_qml/README.md Use this command to run a QML example that utilizes KDDockWidgets. Ensure KDDockWidgets is built with `-DKDDockWidgets_QML_MODULE=ON` and the QML loader can find the plugin. ```bash $ qml -I main_example1.qml -platform xcb ``` -------------------------------- ### Qt Quick Frontend Source and Header Installation Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Configures and installs source files and headers for the Qt Quick frontend. This includes QML elements, helper files, and view-related headers. ```cmake if(KDDW_FRONTEND_QTQUICK) set(QT_QML_GENERATE_QMLLS_INI ON) set(KDDW_MODULE_QML_ELEMENTS qtquick/Singletons.cpp qtquick/Singletons_p.h qtquick/Helpers.cpp qtquick/Helpers_p.h qtquick/ViewFactory.cpp qtquick/ViewFactory.h core/ViewFactory.h qtquick/MainWindowInstantiator.cpp qtquick/MainWindowInstantiator.h qtquick/LayoutSaverInstantiator.cpp qtquick/LayoutSaverInstantiator.h qtquick/DockWidgetInstantiator.cpp qtquick/DockWidgetInstantiator.h qtquick/MainWindowMDIInstantiator.cpp qtquick/MainWindowMDIInstantiator.h qtquick/views/Group.cpp qtquick/views/Group.h qtquick/views/TitleBar.cpp qtquick/views/TitleBar.h ) if(NOT KDDockWidgets_QML_MODULE) # if we're not building a module, we need to build them explicitly target_sources(kddockwidgets PRIVATE ${KDDW_MODULE_QML_ELEMENTS}) endif() set(KDDW_QTQUICK_HEADERS qtquick/Platform.h qtquick/Action.h qtquick/ViewFactory.h qtquick/DockWidgetInstantiator.h qtquick/LayoutSaverInstantiator.h qtquick/MainWindowInstantiator.h qtquick/MainWindowMDIInstantiator.h qtquick/QmlConfig.h ) set(KDDW_QTQUICK_VIEW_HEADERS qtquick/views/ClassicIndicatorsWindow.h qtquick/views/View.h qtquick/views/Separator.h qtquick/views/MainWindowMDI.h qtquick/views/RubberBand.h qtquick/views/MainWindow.h qtquick/views/Separator.h qtquick/views/FloatingWindow.h qtquick/views/SideBar.h qtquick/views/TabBar.h qtquick/views/DockWidget.h qtquick/views/Stack.h qtquick/views/MDILayout.h qtquick/views/DropArea.h qtquick/views/Group.h qtquick/views/TitleBar.h ) if(KDDockWidgets_QML_MODULE) qt_policy(SET QTP0001 NEW) # fix resource paths since function(fix_resource_paths) foreach(srcfile IN LISTS ARGN) get_filename_component(FILENAME ${srcfile} NAME) set_source_files_properties(${srcfile} PROPERTIES QT_RESOURCE_ALIAS ${FILENAME}) endforeach() endfunction() ``` -------------------------------- ### Configure Install Include Path Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Sets the installation path for include directories based on whether Qt6 is being used. This ensures headers are installed to the correct location. ```cmake if(KDDockWidgets_QT6) set(DOCKS_INCLUDES_INSTALL_PATH "include/kddockwidgets-qt6") else() set(DOCKS_INCLUDES_INSTALL_PATH "include/") endif() ``` -------------------------------- ### Basic CMake Project Setup for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/tests/manual/qdockwidget/CMakeLists.txt Configures a CMake project to build an executable and link against the KDDockWidgets library. Ensure KDDockWidgets is installed or available in the CMake search path. ```cmake cmake_minimum_required(VERSION 3.15) project(old_qdockwidgets) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(old_qdockwidgets main.cpp) target_link_libraries(old_qdockwidgets PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/kdab/kddockwidgets/blob/main/src/core/layouting/examples/qtwidgets/CMakeLists.txt Sets up a basic CMake project, including minimum version, project name, description, and languages. Ensure KDDockWidgets is found before proceeding. ```cmake cmake_minimum_required(VERSION 3.15) project( qtwidgets_layouting_example DESCRIPTION "KDDockWidgets standalone layouting library example using QtWidgets" HOMEPAGE_URL "https://github.com/KDAB/KDDockWidgets" LANGUAGES CXX C ) if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # For KDBindings include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../3rdparty/) add_executable(qtwidgets_standalone_layouting main.cpp) target_link_libraries(qtwidgets_standalone_layouting PRIVATE KDAB::kddockwidgets) if(NOT TARGET nlohmann_json::nlohmann_json) include(../../../../nlohmann.cmake) link_to_nlohman(qtwidgets_standalone_layouting) endif() ``` -------------------------------- ### Qt Widgets Frontend Installation Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Installs header files for the Qt Widgets frontend. This includes general view headers and specific view headers for different components. ```cmake if(KDDW_FRONTEND_QTWIDGETS) set(KDDW_QTWIDGET_HEADERS qtwidgets/ViewFactory.h) set(KDDW_QTWIDGET_VIEW_HEADERS qtwidgets/views/DockWidget.h qtwidgets/views/Separator.h qtwidgets/views/RubberBand.h qtwidgets/views/SideBar.h qtwidgets/views/FloatingWindow.h qtwidgets/views/View.h qtwidgets/views/MainWindowMDI.h qtwidgets/views/MDILayout.h qtwidgets/views/MDIArea.h qtwidgets/views/DropArea.h qtwidgets/views/Stack.h qtwidgets/views/Group.h qtwidgets/views/TabBar.h qtwidgets/views/ClassicIndicatorsWindow.h qtwidgets/views/SegmentedDropIndicatorOverlay.h qtwidgets/views/MainWindow.h qtwidgets/views/TitleBar.h ) install(FILES ${KDDW_QTWIDGET_HEADERS} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets) install(FILES ${KDDW_QTWIDGET_HEADERS} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/qtwidgets/) install(FILES ${KDDW_QTWIDGET_VIEW_HEADERS} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/qtwidgets/) install(FILES ${KDDW_FRONTEND_QTWIDGETS_VIEW_HEADERS} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets/qtwidgets/views/ ) if(KDockWidgets_PRETTY_QTWIDGETS_HEADERS) set(KDDW_QTWIDGET_PRETTY_HEADERS fwd_headers/qtwidgets_pretty/kddockwidgets/MainWindow.h fwd_headers/qtwidgets_pretty/kddockwidgets/DockWidget.h fwd_headers/qtwidgets_pretty/kddockwidgets/ViewFactory.h ) install(FILES ${KDDW_QTWIDGET_PRETTY_HEADERS} DESTINATION ${DOCKS_INCLUDES_INSTALL_PATH}/kddockwidgets) endif() endif() ``` -------------------------------- ### Configuring Pretty QtWidgets Headers Option Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Sets up an option to install DockWidget.h and MainWindow.h as synonyms to their .h counterparts, controlled by KDDW_FRONTEND_QTWIDGETS. ```cmake option(KDockWidgets_PRETTY_QTWIDGETS_HEADERS "Install DockWidget.h and MainWindow.h as synonyms to the *.h counterparts." ${KDDW_FRONTEND_QTWIDGETS} ) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/kdab/kddockwidgets/blob/main/examples/misc/documents/CMakeLists.txt Sets up the minimum CMake version, project name, and enables automatic handling of MOC, RCC, and include directories. It also specifies the C++ standard to be used. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_documents) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customtitlebar/CMakeLists.txt Sets the minimum CMake version, project name, and enables automatic handling of meta-object, resource, and include directories. Requires C++17. ```cmake cmake_minimum_required(VERSION 3.15) project(qtquick_customtitlebar) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### CMakeLists.txt for KDDockWidgets Qt Quick Example Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customseparator/CMakeLists.txt This CMakeLists.txt file configures the build for a Qt Quick application using KDDockWidgets. It sets C++ standards, finds the KDDockWidgets package (Qt5 or Qt6), and links the executable against the library. ```cmake cmake_minimum_required(VERSION 3.15) project(qtquick_customseparator) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_customseparator main.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtquick_customseparator PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### CMake Project Setup and Slint Integration Source: https://github.com/kdab/kddockwidgets/blob/main/src/core/layouting/examples/slint/CMakeLists.txt Configures the CMake project, finds or fetches the Slint library, and sets up the build for a standalone executable. Ensure Slint is available or it will be downloaded. ```cmake cmake_minimum_required(VERSION 3.21) project(slint_standalone_layouting LANGUAGES CXX) find_package(Slint QUIET) if(NOT Slint_FOUND) message( "Slint could not be located in the CMake module search path. Downloading it from Git and building it locally" ) include(FetchContent) fetchcontent_declare( Slint GIT_REPOSITORY https://github.com/slint-ui/slint.git GIT_TAG release/1 SOURCE_SUBDIR api/cpp ) fetchcontent_makeavailable(Slint) endif(NOT Slint_FOUND) add_executable(slint_standalone_layouting src/main.cpp) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../3rdparty/) include_directories(${CMAKE_BINARY_DIR}) target_link_libraries(slint_standalone_layouting PRIVATE Slint::Slint KDAB::kddockwidgets) target_compile_definitions(slint_standalone_layouting PRIVATE SRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}") slint_target_sources(slint_standalone_layouting ui/appwindow.slint) ``` -------------------------------- ### Finding and Linking KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customtitlebar/CMakeLists.txt Finds the KDDockWidgets package, prioritizing Qt6 if available, and links the target executable against the found library. This setup is for example purposes; adjust for specific project needs. ```cmake if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_customtitlebar main.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtquick_customtitlebar PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Defining Resources and Executable Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/fixed_central_widget/CMakeLists.txt Specifies the resource files for the example and defines the main executable target. Includes source files and resource collection files. ```cmake set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_fixed_central_widget main.cpp ${RESOURCES_EXAMPLE_SRC}) ``` -------------------------------- ### Create Windows Demo Zip Installer Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Defines a custom CMake target to create a demo zip installer specifically for Windows. It executes a batch script to package the demo. ```cmake if(WIN32) add_custom_target( createZipDemo COMMAND cmd /c ${CMAKE_CURRENT_SOURCE_DIR}\deploy\create-demo-win-zip.bat ${CMAKE_PROJECT_NAME}-Demo-${${PROJECT_NAME}_VERSION} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Target to generate the Zip demo installer for Windows" ) endif() ``` -------------------------------- ### Generate Resource File Source: https://github.com/kdab/kddockwidgets/blob/main/python/examples-qt6/README.txt Use the 'rcc' tool to generate a Python resource file from a .qrc file. Ensure kddockwidgets is installed and PYTHONPATH is set. ```bash rcc -g python -o rc_assets.py ../../examples/dockwidgets/resources_example.qrc ``` -------------------------------- ### CMake Project Setup Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/mdi_with_docking/CMakeLists.txt Configures the minimum CMake version, project name, and essential build settings like automatic MOC/RCC and C++ standard. ```cmake cmake_minimum_required(VERSION 3.15) project(qtquick_dockwidgets) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### Set Default Installation Prefix for KDAB Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Configures the installation prefix for the KDDockWidgets library when KDAB_INSTALL is enabled. It sets platform-specific default paths for Unix-like systems and Windows. ```cmake if(KDAB_INSTALL) if(UNIX) set(CMAKE_INSTALL_PREFIX "/usr/local/KDAB/KDDockWidgets-${KDDockWidgets_VERSION}" CACHE INTERNAL "Install to default KDAB Location" ) elseif(WIN32) set(CMAKE_INSTALL_PREFIX "C:\\KDAB\\KDDockWidgets-${KDDockWidgets_VERSION}" CACHE INTERNAL "Install to default KDAB Location" ) endif() endif() ``` -------------------------------- ### Find KF5 Wayland Client Source: https://github.com/kdab/kddockwidgets/blob/main/tests/wayland/CMakeLists.txt Finds the KF5 Wayland client configuration. Ensure KF5 is installed and configured correctly. ```cmake find_package(KF${QT_VERSION_MAJOR}Wayland CONFIG) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WaylandClient Concurrent) ``` -------------------------------- ### CMakeLists.txt Configuration for Qt Quick MDI Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/mdi/CMakeLists.txt This CMake script configures a Qt Quick MDI project. It sets C++ standards, finds the KDDockWidgets package (Qt5 or Qt6), and links it to the executable. Ensure KDDockWidgets is installed or available in the build environment. ```cmake cmake_minimum_required(VERSION 3.15) project(qtquick_mdi) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_mdi_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_mdi main.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtquick_mdi PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### CMake Project Setup for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customplayground/CMakeLists.txt This snippet sets the minimum CMake version, project name, and enables automatic handling of Qt's meta-object, resource, and UI files. It also enforces C++17. ```cmake cmake_minimum_required(VERSION 3.15) project(qtquick_customplayground) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### CMakeLists.txt for KDDockWidgets Project Source: https://github.com/kdab/kddockwidgets/blob/main/examples/dockwidgets/CMakeLists.txt This CMakeLists.txt file configures a project to use KDDockWidgets. It sets C++ standards, finds the KDDockWidgets package (Qt5 or Qt6), and links the library to the executable. Ensure KDDockWidgets is installed or available in the CMake search path. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_dockwidgets) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_example.qrc) add_executable(qtwidgets_dockwidgets main.cpp MyViewFactory.cpp MyMainWindow.cpp MyWidget.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtwidgets_dockwidgets PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Find QtTest Package Source: https://github.com/kdab/kddockwidgets/blob/main/tests/CMakeLists.txt Finds the QtTest package, which is required for testing. Ensure QtTest is installed and discoverable by CMake. ```cmake if(KDDW_FRONTEND_QT) find_package(Qt${QT_VERSION_MAJOR}Test ${QT_MIN_VERSION} REQUIRED) endif() ``` -------------------------------- ### CPack Configuration Inclusion Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Includes the CPackConfig.cmake file, which is CMake's standard way to configure packaging and installation rules for the project. ```cmake include(CPackConfig) ``` -------------------------------- ### Conditional Wayland Tests Setup Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Enables Wayland tests only if KDDockWidgets_WAYLAND_TESTS is true. Requires developer mode and QtWidgets frontend. ```cmake if(KDDockWidgets_WAYLAND_TESTS) if(NOT KDDockWidgets_DEVELOPER_MODE) message(FATAL_ERROR "Wayland tests require developer mode") endif() if(NOT KDDW_FRONTEND_QTWIDGETS) message(FATAL_ERROR "Wayland tests require QtWidgets") endif() endif() ``` -------------------------------- ### Finding and Linking KDDockWidgets in CMake Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customplayground/CMakeLists.txt This section demonstrates how to find the KDDockWidgets package, prioritizing Qt6 if available, and then links it to the main executable. Ensure KDDockWidgets is installed or available in the CMake search path. ```cmake if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_customplayground main.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtquick_customplayground PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Set Target Include Directories Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Configures include directories for the kddockwidgets target, specifying installation and build interfaces. This controls where the compiler looks for header files. ```cmake target_include_directories( kddockwidgets PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) ``` -------------------------------- ### Custom Separator QML Implementation Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customseparator/README.md Implement your custom separator in a QML file (e.g., `MySeparator.qml`) and add it to your project's resource file (QRC). Base it on the provided example for boilerplate code. Adjust the `MouseArea` margins to improve hover detection if the thickness is small. ```qml import QtQuick 2.0 import KDDockWidgets 1.0 Separator { id: root implicitWidth: config.separatorThickness implicitHeight: config.separatorThickness MouseArea { anchors.fill: parent hoverEnabled: true // Increase margins to make it easier to hover anchors.margins: -config.separatorThickness } } ``` -------------------------------- ### Add Includes Test Subdirectory Source: https://github.com/kdab/kddockwidgets/blob/main/tests/CMakeLists.txt Includes the 'includes_test' subdirectory to perform checks related to installed headers. ```cmake add_subdirectory(includes_test) ``` -------------------------------- ### Enable Qt Quick Frontend Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Finds the Qt Quick and Qt Quick Controls 2 modules and sets the KDDW_FRONTEND_QTQUICK variable to ON if 'qtquick' is in the list of desired frontends. Includes logic for Qt 6.10+ private components. ```cmake if("qtquick" IN_LIST KDDockWidgets_FRONTENDS) find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS Quick QuickControls2) if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0") set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS QuickPrivate) endif() set(KDDW_FRONTEND_QTQUICK ON) endif() ``` -------------------------------- ### Basic CMake Configuration for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/vcpkg/CMakeLists.txt This snippet sets up the minimum CMake version, project name, and essential Qt build flags. It then finds the KDDockWidgets package and adds an executable target, linking against the KDDockWidgets library. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_vcpkg) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(KDDockWidgets-qt6 REQUIRED) set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc) add_executable(qtwidgets_vcpkg main.cpp MyWidget.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtwidgets_vcpkg PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Include Directory for Qt Quick Frontend Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Adds the Qt Quick include directory if the KDDW_FRONTEND_QTQUICK option is enabled. This is necessary for integrating Qt Quick components. ```cmake if(KDDW_FRONTEND_QTQUICK) target_include_directories(kddockwidgets PUBLIC $) endif() ``` -------------------------------- ### Find ECM and Set Module Path Source: https://github.com/kdab/kddockwidgets/blob/main/tests/wayland/CMakeLists.txt Finds the Extra CMake Modules (ECM) and sets the CMake module path. Requires ECM to be installed. ```cmake find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) ``` -------------------------------- ### Build Project Documentation Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Adds a custom CMake target to build the project's documentation using mdbook. The documentation is output to a 'book' subdirectory in the build directory. ```cmake add_custom_target( build-book COMMAND mdbook build --dest-dir ${CMAKE_CURRENT_BINARY_DIR}/book WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Building KDDW book" ) ``` -------------------------------- ### Include Directories Configuration Source: https://github.com/kdab/kddockwidgets/blob/main/tests/CMakeLists.txt Configures include directories for the current source and binary directories, as well as parent directories. Also defines QT_NO_KEYWORDS. ```cmake include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(..) include_directories(../src) add_definitions(-DQT_NO_KEYWORDS) ``` -------------------------------- ### Define Application Source Files and Resources Source: https://github.com/kdab/kddockwidgets/blob/main/examples/mdi_with_docking/CMakeLists.txt Specifies the main source file, additional C++ source files, and Qt resource files for the application. Ensure MyWidget.h is included in the build path. ```cmake set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc) ``` ```cmake # Just to reuse MyWidget.h include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/) ``` ```cmake add_executable(qtwidgets_mdi_with_docking main.cpp ../dockwidgets/MyWidget.cpp ${RESOURCES_EXAMPLE_SRC}) ``` -------------------------------- ### Configure KDDockWidgets Project Source: https://github.com/kdab/kddockwidgets/blob/main/examples/mdi/CMakeLists.txt Sets up the CMake build environment, including project name, C++ standard, and automatic handling of MOC, RCC, and UI files. Ensure KDDockWidgets is found before proceeding. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_mdi) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### Link Qt Quick Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Links Qt Quick and Qt Quick Controls 2 modules for kddockwidgets. Includes private linking for GuiPrivate and QuickPrivate. ```cmake if(KDDW_FRONTEND_QTQUICK) target_link_libraries(kddockwidgets PUBLIC Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::QuickControls2) target_link_libraries(kddockwidgets PRIVATE Qt${QT_VERSION_MAJOR}::GuiPrivate Qt${QT_VERSION_MAJOR}::QuickPrivate) target_compile_definitions(kddockwidgets PUBLIC KDDW_FRONTEND_QTQUICK KDDW_FRONTEND_QT) endif() ``` -------------------------------- ### Set up CMake Project for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/mdi_with_docking/CMakeLists.txt Configures the minimum CMake version, project name, and essential build settings like automatic moc/rcc processing and C++ standard. Ensure you have at least CMake 3.15. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_mdi_with_docking) ``` ```cmake set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### Defining Application Executable Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/mdi_with_docking/CMakeLists.txt Defines the main executable for the Qt Quick application, including source files and resource files. ```cmake set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_mdi_with_docking main.cpp ${RESOURCES_EXAMPLE_SRC}) ``` -------------------------------- ### Define Testing Resources and Sources Source: https://github.com/kdab/kddockwidgets/blob/main/tests/CMakeLists.txt Sets the testing resources file and initializes the list of source files for testing. Conditionally adds 'fatal_logger.cpp' if SPDLOG is available. ```cmake set(TESTING_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/test_resources.qrc) set(TESTING_SRCS utils.cpp) if(KDDockWidgets_HAS_SPDLOG) set(TESTING_SRCS ${TESTING_SRCS} fatal_logger.cpp) endif() ``` -------------------------------- ### Run Python Application Source: https://github.com/kdab/kddockwidgets/blob/main/python/examples-qt6/README.txt Execute the main Python script to run the application. This assumes the resource file has been generated and dependencies are met. ```bash python3 main.py ``` -------------------------------- ### Build KDDockWidgets for QtQuick Source: https://github.com/kdab/kddockwidgets/blob/main/README-QtQuick.md Explicitly build KDDockWidgets with only QtQuick support by setting the -DKDDockWidgets_FRONTENDS=qtquick CMake option. ```bash cd build && cmake -DKDDockWidgets_FRONTENDS=qtquick .. ``` -------------------------------- ### Set KDDW_FRONTEND_QT for Combined Use Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Sets KDDW_FRONTEND_QT to ON if either Qt Widgets or Qt Quick frontends are enabled. Includes a platform-specific check for Windows with problematic Qt versions (6.5.3, 6.6.1). ```cmake if(KDDW_FRONTEND_QTWIDGETS OR KDDW_FRONTEND_QTQUICK) if(WIN32 AND (Qt6Core_VERSION VERSION_EQUAL "6.5.3" OR Qt6Core_VERSION VERSION_EQUAL "6.6.1")) message( FATAL_ERROR "Qt 6.5.3 and 6.6.1 are not supported on Windows, as they suffer from a Qt regression: QTBUG-117704. " "Please either downgrade or upgrade to 6.6.2 or superior" ) endif() set(KDDW_FRONTEND_QT ON) endif() ``` -------------------------------- ### Defining Executable Target Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/dockwidgets/CMakeLists.txt Defines the executable target 'qtquick_dockwidgets' and includes necessary resource files. Ensure main.cpp is present in the source directory. ```cmake set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_dockwidgets main.cpp ${RESOURCES_EXAMPLE_SRC}) ``` -------------------------------- ### Aggregating Frontend Dependencies Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Collects necessary Qt modules (widgets, quick, quickcontrols2) into a single dependency string based on frontend flags. ```cmake set(KDDockWidgets_DEPS "") if(KDDW_FRONTEND_QTWIDGETS) set(KDDockWidgets_DEPS "widgets") endif() if(KDDW_FRONTEND_QTQUICK) set(KDDockWidgets_DEPS "${KDDockWidgets_DEPS} quick quickcontrols2") endif() ``` -------------------------------- ### Configure CMake for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/customtabbar/CMakeLists.txt Sets up the minimum CMake version, project name, and essential build flags. It also finds the KDDockWidgets package, prioritizing Qt5 or Qt6. ```cmake cmake_minimum_required(VERSION 3.15) project(qtquick_customtabbar) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources_qtquick_example.qrc ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc ) add_executable(qtquick_customtabbar main.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtquick_customtabbar PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Enable Qt Widgets Frontend Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Finds the Qt Widgets module and sets the KDDW_FRONTEND_QTWIDGETS variable to ON if 'qtwidgets' is in the list of desired frontends. Includes logic for Qt 6.10+ private components. ```cmake if("qtwidgets" IN_LIST KDDockWidgets_FRONTENDS) find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS Widgets) if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0") set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS WidgetsPrivate) endif() set(KDDW_FRONTEND_QTWIDGETS ON) endif() ``` -------------------------------- ### Defining Executable and Linking KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/misc/documents/CMakeLists.txt Adds an executable target named 'qtwidgets_documents' and links it against the KDDockWidgets library. It also includes necessary directories for headers. ```cmake set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets/resources_example.qrc) add_executable(qtwidgets_documents main.cpp ../../dockwidgets/MyWidget.cpp ${RESOURCES_EXAMPLE_SRC}) target_include_directories(qtwidgets_documents PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../dockwidgets) target_link_libraries(qtwidgets_documents PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Auto-detect Frontends if None Specified Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt If no frontends are explicitly set, this block attempts to find available Qt modules (Widgets, Quick, QuickControls2) and enables corresponding frontends. It also handles Qt 6.10+ private components. ```cmake else() set(ENABLED_FRONTENDS "") message("No frontends specified explicitly.") # find Qt modules before defining which frontends to build find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Widgets Quick QuickControls2) if(Qt${QT_VERSION_MAJOR}Widgets_FOUND) list(APPEND ENABLED_FRONTENDS "qtwidgets") set(KDDW_FRONTEND_QTWIDGETS ON) if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0") set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS WidgetsPrivate) endif() endif() # qtquick if(Qt${QT_VERSION_MAJOR}Quick_FOUND AND Qt${QT_VERSION_MAJOR}QuickControls2_FOUND) list(APPEND ENABLED_FRONTENDS "qtquick") set(KDDW_FRONTEND_QTQUICK ON) if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.10.0") set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE REQUIRED COMPONENTS QuickPrivate) endif() endif() if(NOT ENABLED_FRONTENDS) message(FATAL_ERROR "Failed to enable any frontends. Please install the required libraries and try again.") endif() message("Following frontends have been enabled:") foreach(frontend ${ENABLED_FRONTENDS}) message("* ${frontend}") endforeach() endif() ``` -------------------------------- ### Configure CMake Project for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/tests/manual/qtwidgets_leaks/CMakeLists.txt This CMake script sets up a Qt widgets application project. It ensures C++17 is used and links the application against the KDDockWidgets library. This is typically used for testing or integrating KDDockWidgets into a larger application. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_leak_test) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(qtwidgets_leak_test main.cpp) target_link_libraries(qtwidgets_leak_test PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### CMakeLists.txt Configuration for KDDockWidgets Source: https://github.com/kdab/kddockwidgets/blob/main/examples/minimal/CMakeLists.txt This CMake script configures a Qt project to use KDDockWidgets. It sets C++ standards, enables Qt's meta-object and resource compilers, and finds the KDDockWidgets library for linking. ```cmake cmake_minimum_required(VERSION 3.15) project(qtwidgets_minimal) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIRS ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if(NOT TARGET kddockwidgets) # For the purpose of our example, we're looking for Qt5 or Qt6 KDDW. # For your own purposes, just chose the one you need. find_package(KDDockWidgets QUIET) if(NOT KDDockWidgets_FOUND) find_package(KDDockWidgets-qt6 REQUIRED) endif() endif() set(RESOURCES_EXAMPLE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dockwidgets/resources_example.qrc) add_executable(qtwidgets_minimal main.cpp MyWidget.cpp ${RESOURCES_EXAMPLE_SRC}) target_link_libraries(qtwidgets_minimal PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Add QtQuick Test Executable Source: https://github.com/kdab/kddockwidgets/blob/main/tests/CMakeLists.txt Defines the 'tst_qtquick' executable, linking it against kddockwidgets and QtTest. It conditionally links spdlog and adds nlohmann JSON support. ```cmake if(KDDW_FRONTEND_QTQUICK) add_executable(tst_qtquick qtquick/tst_qtquick.cpp ${TESTING_SRCS} ${TESTING_RESOURCES}) target_link_libraries(tst_qtquick PRIVATE kddockwidgets Qt${QT_VERSION_MAJOR}::Test) kddw_link_to_kdbindings(tst_qtquick) if(KDDockWidgets_HAS_SPDLOG) target_link_libraries(tst_qtquick PRIVATE spdlog::spdlog) endif() kddw_add_nlohmann(tst_qtquick) set_compiler_flags(tst_qtquick) _add_test(tst_qtquick) endif() ``` -------------------------------- ### Include nlohmann.cmake Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Includes the nlohmann.cmake module and links it to the kddockwidgets library. ```cmake include(nlohmann.cmake) link_to_nlohman(kddockwidgets) ``` -------------------------------- ### Link Windows Specific Libraries Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Links dwmapi to kddockwidgets on Windows when using Qt Widgets. This is for Qt Private Gui. ```cmake if(KDDW_FRONTEND_QT) if(WIN32) target_link_libraries(kddockwidgets PRIVATE Qt${QT_VERSION_MAJOR}::GuiPrivate dwmapi) elseif( NOT APPLE AND NOT EMSCRIPTEN AND NOT KDDockWidgets_QT6 AND KDDockWidgets_X11EXTRAS ) find_package(Qt${QT_VERSION_MAJOR}X11Extras CONFIG) target_link_libraries(kddockwidgets PUBLIC Qt${QT_VERSION_MAJOR}::X11Extras) endif() if(KDDockWidgets_DEVELOPER_MODE) find_package(Qt${QT_VERSION_MAJOR}Test ${QT_MIN_VERSION} REQUIRED) target_link_libraries(kddockwidgets PUBLIC Qt${QT_VERSION_MAJOR}::Test) endif() endif() ``` -------------------------------- ### Private Include Directories for No Frontend Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Specifies private include directories when no frontend is used (KDDW_FRONTEND_NONE). This ensures core components are accessible during the build. ```cmake if(KDDW_FRONTEND_NONE) target_include_directories( kddockwidgets PRIVATE $ $ $ ) endif() ``` -------------------------------- ### Check for spdlog and fmt Libraries Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Sets a flag indicating whether both spdlog and fmt libraries are found. This is a prerequisite for certain features. ```cmake if(spdlog_FOUND AND fmt_FOUND) set(KDDockWidgets_HAS_SPDLOG TRUE) else() set(KDDockWidgets_HAS_SPDLOG FALSE) endif() ``` -------------------------------- ### Linking KDDockWidgets Library Source: https://github.com/kdab/kddockwidgets/blob/main/examples/qtquick/dockwidgets/CMakeLists.txt Links the KDDockWidgets library to the 'qtquick_dockwidgets' executable. Use PRIVATE to ensure the library is only available during the build of this target. ```cmake target_link_libraries(qtquick_dockwidgets PRIVATE KDAB::kddockwidgets) ``` -------------------------------- ### Enable None Frontend Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Sets the KDDW_FRONTEND_NONE variable to ON if 'none' is explicitly specified in the frontends list. ```cmake if("none" IN_LIST KDDockWidgets_FRONTENDS) set(KDDW_FRONTEND_NONE ON) endif() ``` -------------------------------- ### Add QtWidgets Test Executable Source: https://github.com/kdab/kddockwidgets/blob/main/tests/CMakeLists.txt Defines the 'tst_qtwidgets' executable, linking it against kddockwidgets and QtTest. It also conditionally links spdlog and adds nlohmann JSON support. ```cmake if(KDDW_FRONTEND_QTWIDGETS) set(CMAKE_AUTOUIC ON) add_executable( tst_qtwidgets qtwidgets/tst_qtwidgets.cpp qtwidgets/mainwindow.ui ${TESTING_SRCS} ${TESTING_RESOURCES} ) target_link_libraries(tst_qtwidgets PRIVATE kddockwidgets Qt${QT_VERSION_MAJOR}::Test) kddw_link_to_kdbindings(tst_qtwidgets) if(KDDockWidgets_HAS_SPDLOG) target_link_libraries(tst_qtwidgets PRIVATE spdlog::spdlog) endif() kddw_add_nlohmann(tst_qtwidgets) set_compiler_flags(tst_qtwidgets) _add_test(tst_qtwidgets) add_subdirectory(manual/qtwidgets_leaks) add_subdirectory(manual/qdockwidget) endif() ``` -------------------------------- ### Add Wayland Client Protocol Source: https://github.com/kdab/kddockwidgets/blob/main/tests/wayland/CMakeLists.txt Generates C++ sources from a Wayland protocol XML file. This is used for Wayland client communication. ```cmake ecm_add_qtwayland_client_protocol( wayland_SRCS PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/fake-input.xml BASENAME fake-input ) ``` -------------------------------- ### Validate Frontend Input Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Iterates through user-specified frontends and checks if they are valid options. Emits a fatal error for unknown frontends. ```cmake if(KDDockWidgets_FRONTENDS) set(KDDockWidgets_ALL_FRONTENDS "qtwidgets;qtquick;none") foreach(frontend ${KDDockWidgets_FRONTENDS}) if(NOT ${frontend} IN_LIST KDDockWidgets_ALL_FRONTENDS) message(FATAL_ERROR "Unknown frontend ${frontend}") endif() endforeach() endif() ``` -------------------------------- ### Link SPDLOG Source: https://github.com/kdab/kddockwidgets/blob/main/src/CMakeLists.txt Links the spdlog library to kddockwidgets when KDDWidgets_HAS_SPDLOG is enabled. ```cmake if(KDDockWidgets_HAS_SPDLOG) target_link_libraries(kddockwidgets PRIVATE spdlog::spdlog) endif() ``` -------------------------------- ### Disable Frontends by Default Source: https://github.com/kdab/kddockwidgets/blob/main/CMakeLists.txt Sets default values to disable Qt Widgets and Qt Quick frontends. Use this to ensure a clean state before explicit enabling. ```cmake set(KDDW_FRONTEND_QTWIDGETS OFF) set(KDDW_FRONTEND_QTQUICK OFF) ``` -------------------------------- ### Set QML_IMPORT_PATH Environment Variable Source: https://github.com/kdab/kddockwidgets/blob/main/README-QtQuick.md Set the QML_IMPORT_PATH environment variable to the directory containing your Qt Quick qml plugins. This is necessary when the 'QtQuick.Controls' module is not found. ```bash # Replace with your actual path export QML_IMPORT_PATH=/home/user/Qt/5.15.2/gcc_64/qml ```