From 163d2b2516e476cb4746c7264dd288f9ea7f4866 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Wed, 16 Nov 2022 17:13:39 -0500 Subject: [PATCH 01/20] Try composite action for doxygen build --- .github/workflows/build-qx-linux.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-qx-linux.yml b/.github/workflows/build-qx-linux.yml index e3e1f6c1..eee44069 100644 --- a/.github/workflows/build-qx-linux.yml +++ b/.github/workflows/build-qx-linux.yml @@ -97,16 +97,9 @@ jobs: - name: Install XCB Related libs run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev - name: Install Doxygen - env: - doxy_build: doxygen-1.9.5 - doxy_arch_ext: linux.bin.tar.gz - doxy_repo: https://www.doxygen.nl/files - run: | - curl "$doxy_repo/$doxy_build.$doxy_arch_ext" --output "$general_download_dir/$doxy_build.$doxy_arch_ext" --create-dirs --location --silent --show-error - cd $general_download_dir - tar xf "$doxy_build.$doxy_arch_ext" - cd "$doxy_build" - sudo make install + uses: oblivioncth/actions/ubuntu/install-doxygen-from-source@dev + with: + ref: Release_1_9_5 - name: Install Graphviz run: sudo apt-get install graphviz - name: Install Ninja From e1269d3343752ba22e79de8015b280dd8ba86799 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Wed, 16 Nov 2022 17:38:22 -0500 Subject: [PATCH 02/20] Try sourceforge downlaod for Linux doxygen install --- .github/workflows/build-qx-linux.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-qx-linux.yml b/.github/workflows/build-qx-linux.yml index eee44069..dff14022 100644 --- a/.github/workflows/build-qx-linux.yml +++ b/.github/workflows/build-qx-linux.yml @@ -97,9 +97,16 @@ jobs: - name: Install XCB Related libs run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev - name: Install Doxygen - uses: oblivioncth/actions/ubuntu/install-doxygen-from-source@dev - with: - ref: Release_1_9_5 + env: + doxy_ver: 1.9.5 + doxy_arch_ext: linux.bin.tar.gz + doxy_repo: https://sourceforge.net/projects/doxygen/files + run: | + curl "$doxy_repo/rel-$doxy_ver/doxygen-$doxy_ver.$doxy_arch_ext" --output "$general_download_dir/doxygen-$doxy_ver.$doxy_arch_ext" --create-dirs --location --silent --show-error + cd $general_download_dir + tar xf "doxygen-$doxy_ver.$doxy_arch_ext" + cd "doxygen-$doxy_ver" + sudo make install - name: Install Graphviz run: sudo apt-get install graphviz - name: Install Ninja @@ -142,4 +149,4 @@ jobs: with: name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }} path: ${{ env.qx_install_path }} - if-no-files-found: error + if-no-files-found: error \ No newline at end of file From 7c9b969f35aa98dc9b1e816970dae92b43b7828e Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Wed, 16 Nov 2022 18:55:06 -0500 Subject: [PATCH 03/20] Try composite action for ubuntu doxygen sourceforge install --- .github/workflows/build-qx-linux.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-qx-linux.yml b/.github/workflows/build-qx-linux.yml index dff14022..3d4416ca 100644 --- a/.github/workflows/build-qx-linux.yml +++ b/.github/workflows/build-qx-linux.yml @@ -97,16 +97,9 @@ jobs: - name: Install XCB Related libs run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev - name: Install Doxygen - env: - doxy_ver: 1.9.5 - doxy_arch_ext: linux.bin.tar.gz - doxy_repo: https://sourceforge.net/projects/doxygen/files - run: | - curl "$doxy_repo/rel-$doxy_ver/doxygen-$doxy_ver.$doxy_arch_ext" --output "$general_download_dir/doxygen-$doxy_ver.$doxy_arch_ext" --create-dirs --location --silent --show-error - cd $general_download_dir - tar xf "doxygen-$doxy_ver.$doxy_arch_ext" - cd "doxygen-$doxy_ver" - sudo make install + uses: oblivioncth/actions/ubuntu/install-doxygen-from-sourceforge@dev + with: + version: 1.9.5 - name: Install Graphviz run: sudo apt-get install graphviz - name: Install Ninja @@ -149,4 +142,4 @@ jobs: with: name: ${{ steps.get_artifact_name.outputs[env.artifact_output_var] }} path: ${{ env.qx_install_path }} - if-no-files-found: error \ No newline at end of file + if-no-files-found: error From eab1aa83c84ca4f9a1851c5ba266cd6bfee7c052 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Fri, 18 Nov 2022 00:16:51 -0500 Subject: [PATCH 04/20] Actions: Install megatools using composite action for Ubuntu --- .github/workflows/build-qx-linux.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-qx-linux.yml b/.github/workflows/build-qx-linux.yml index 3d4416ca..d9780d7e 100644 --- a/.github/workflows/build-qx-linux.yml +++ b/.github/workflows/build-qx-linux.yml @@ -68,16 +68,9 @@ jobs: key: ${{ env.qt_install_url }} - name: Install megatools if: steps.cache-qt.outputs.cache-hit != 'true' - env: - mt_build: megatools-1.11.0.20220519-linux-x86_64 - mt_arch_ext: tar.gz - mt_repo: https://megatools.megous.com/builds/builds/ - run: | - curl "$mt_repo/$mt_build.$mt_arch_ext" --output "$general_download_dir/$mt_build.$mt_arch_ext" --create-dirs --location --silent --show-error - cd $general_download_dir - tar xf "$mt_build.$mt_arch_ext" - cd "$mt_build" - cp -p megatools /usr/local/bin + uses: oblivioncth/actions/ubuntu/install-megatools-from-megous@dev + with: + version: 1.11.0.20220519 - name: Create Qt Download Directory if: steps.cache-qt.outputs.cache-hit != 'true' run: mkdir -p "${{ env.qt_download_dir }}" From 243c3ee36decf77dbe3d7968bf7a4ee2c1304b35 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Fri, 18 Nov 2022 01:28:20 -0500 Subject: [PATCH 05/20] Use composite action for master PR version check --- .../workflows/master-pull-request-checks.yml | 40 +++---------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/.github/workflows/master-pull-request-checks.yml b/.github/workflows/master-pull-request-checks.yml index 23fe6f0c..517a5aec 100644 --- a/.github/workflows/master-pull-request-checks.yml +++ b/.github/workflows/master-pull-request-checks.yml @@ -5,40 +5,12 @@ on: branches: master jobs: - ensure-higher-version: - name: Ensure higher version than last tag has been set + check-pr-correctness: + name: Master PR correctness check runs-on: windows-latest - env: - qx_src_suffix: Qx/Source/ - qx_src_dir: ${{ github.workspace }}/Qx/Source/ steps: - - name: Checkout Qx - uses: actions/checkout@v3 + - name: Ensure higher version + uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev with: - path: ${{ env.qx_src_suffix }} - fetch-depth: 0 # Required for tag search to find previous tag - - name: Compare versions - env: - match_start: set\(QX_BASE_VERSION - match_end: \) - run: | - cd "${{ env.qx_src_dir }}" - echo "Checking for version tags..." - if(git tag -l v*.*){ - echo "Version tags found, comparing new and last tag..." - $last_tag_version = $(git describe --abbrev=0 --match v*.*).substring(1) - echo "Last tag version: ${last_tag_version}" - $project_lists = Get-Content -Raw CMakeLists.txt - if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ - throw "Could not get project version!" - } - $new_tag_version = $Matches[1].Trim() - echo "New tag version: ${new_tag_version}" - if(!([version]$new_tag_version -gt [version]$last_tag_version)){ - throw "Project version was not increased to be above previous tagged version!" - } - } - else{ - echo "No existing version tags present. Proceeding..." - } - \ No newline at end of file + ver_match_start: set\(QX_BASE_VERSION + ver_match_end: \) \ No newline at end of file From 11c9053df3749927138f3c856142897554bb2bea Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 21 Nov 2022 00:40:13 -0500 Subject: [PATCH 06/20] Use more composite actions --- .../master-pull-request-merge-reaction.yml | 6 +---- .github/workflows/pull-request-labeler.yml | 27 +++---------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml index c121da1f..6c38a50c 100644 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ b/.github/workflows/master-pull-request-merge-reaction.yml @@ -5,8 +5,6 @@ on: branches: - 'master' env: - ci_bot_username: ObyBotCI - ci_bot_email: 104651589+ObyBotCI@users.noreply.github.com qx_qtd_win_artifact_path: ${{ github.workspace }}/QxQtDWin qx_qts_win_artifact_path: ${{ github.workspace }}/QxQtSWin qx_qtd_linux_artifact_path: ${{ github.workspace }}/QxQtDLinux @@ -25,9 +23,7 @@ jobs: with: fetch-depth: 0 - name: Setup git user for bot - run: | - git config --global user.name "${{ env.ci_bot_username }}" - git config --global user.email "${{ env.ci_bot_email }}" + uses: oblivioncth/actions/git/set-git-user-to-oby-bot@dev - name: Tag master with new version tag id: tag_master env: diff --git a/.github/workflows/pull-request-labeler.yml b/.github/workflows/pull-request-labeler.yml index 0fa9b81e..97c5397a 100644 --- a/.github/workflows/pull-request-labeler.yml +++ b/.github/workflows/pull-request-labeler.yml @@ -4,28 +4,9 @@ on: types: [opened] jobs: - label_master_pr: - name: Label master pull-request - if: github.base_ref == 'master' + label_pr: + name: Label pull-request runs-on: ubuntu-latest steps: - - name: Create label - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: release-pr - label_other_pr: - name: Label other standard pull-requests - if: github.base_ref != 'master' - runs-on: ubuntu-latest - steps: - - name: Label bugfix PR - if: startsWith(github.head_ref, 'bugfix/') - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: bug - - name: Label feature PR - if: startsWith(github.head_ref, 'feature/') - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: enhancement - \ No newline at end of file + - name: Label via convention + uses: oblivioncth/actions/pull-request/label-pr-conventionally@dev From 3de0116d75f94dcc14ab5c9c0bcfa3c1854aba09 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sat, 3 Dec 2022 07:08:34 -0500 Subject: [PATCH 07/20] Add Cumulation::components(), returns list of component keys --- comp/core/include/qx/core/qx-cumulation.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/comp/core/include/qx/core/qx-cumulation.h b/comp/core/include/qx/core/qx-cumulation.h index caaeac2a..d79c51ee 100644 --- a/comp/core/include/qx/core/qx-cumulation.h +++ b/comp/core/include/qx/core/qx-cumulation.h @@ -7,6 +7,11 @@ // Extra-component Includes #include "qx/utility/qx-concepts.h" +/* TODO: An iterator can't be added to this class unless it deferences to a special class like the QJsonValueRef + * approach since when the value is modified the running total would need to be changed as well. That or the running + * total needs to be done away with and the total() method needs to calculate the total each time its called (ehhhh) + */ + namespace Qx { @@ -169,6 +174,7 @@ class Cumulation bool contains(K component) const { return mComponents.contains(component); } V value(K component) const { return mComponents.value(component); } V total() const { return mTotal; } + QList components() const { return mComponents.keys(); } qsizetype count() const { return mComponents.count(); } bool isEmpty() const { return mComponents.isEmpty(); } From 699af7978f87440404a50d13a7c1986c2ea2d534 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 4 Dec 2022 23:47:40 -0500 Subject: [PATCH 08/20] Add documentation for Cumulation::components() --- comp/core/src/qx-cumulation.dox | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/comp/core/src/qx-cumulation.dox b/comp/core/src/qx-cumulation.dox index 3ed07f5e..f4e0fc43 100644 --- a/comp/core/src/qx-cumulation.dox +++ b/comp/core/src/qx-cumulation.dox @@ -130,6 +130,14 @@ namespace Qx * Returns the current total of the cumulation, which is the sum of all its component values. */ +/*! + * @fn template QList Cumulation::components() const + * + * Returns a list containing all the components in the cumulation, in an arbitrary order. + * + * This function creates a new list, in linear time. + */ + /*! * @fn template qsizetype Cumulation::count() const * From c4496845eec9e6217d9dee2ffe3b6ffc80d68791 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 6 Dec 2022 05:56:30 -0500 Subject: [PATCH 09/20] Remove seperate CMake variable for project version No longer required (and doesn't work) with new composite action that handles version check. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 453f839b..8b603bdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,8 @@ set(TRUE_CMAKE_MINIMUM_REQUIRED ${CMAKE_MINIMUM_REQUIRED_VERSION}) # NOTE: For versions stick to w.x.y.z, where z is generally # avoided and only used for hotfixes. DON'T USE TRAILING # ZEROS IN VERSIONS -set(QX_BASE_VERSION 0.4.1) # Required for CI/CD project(Qx - VERSION ${QX_BASE_VERSION} + VERSION 0.4.1 LANGUAGES CXX DESCRIPTION "Qt Extensions Library" ) From 092f1645950f2717cf0bcb8b676c3b5c2b06d18a Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 6 Dec 2022 08:08:20 -0500 Subject: [PATCH 10/20] Actions: Further use of composite actions --- .../workflows/master-pull-request-checks.yml | 5 +--- .../master-pull-request-merge-reaction.yml | 24 +++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/master-pull-request-checks.yml b/.github/workflows/master-pull-request-checks.yml index 517a5aec..f434e64e 100644 --- a/.github/workflows/master-pull-request-checks.yml +++ b/.github/workflows/master-pull-request-checks.yml @@ -10,7 +10,4 @@ jobs: runs-on: windows-latest steps: - name: Ensure higher version - uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev - with: - ver_match_start: set\(QX_BASE_VERSION - ver_match_end: \) \ No newline at end of file + uses: oblivioncth/actions/cmake/ensure-project-version-gt-tag@dev \ No newline at end of file diff --git a/.github/workflows/master-pull-request-merge-reaction.yml b/.github/workflows/master-pull-request-merge-reaction.yml index 6c38a50c..f34ee8b3 100644 --- a/.github/workflows/master-pull-request-merge-reaction.yml +++ b/.github/workflows/master-pull-request-merge-reaction.yml @@ -18,27 +18,26 @@ jobs: outputs: version_tag: ${{ steps.tag_master.outputs.new_tag }} steps: - - name: Checkout Qx Master - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup git user for bot + - name: Get project version + id: get-proj-ver + uses: oblivioncth/actions/cmake/get-project-version@dev + - name: Set Git user to ObyBotCI uses: oblivioncth/actions/git/set-git-user-to-oby-bot@dev + - name: Checkout Project + id: proj-checkout + uses: oblivioncth/actions/git/smart-checkout@dev - name: Tag master with new version tag id: tag_master + working-directory: ${{ steps.proj-checkout.outputs.path }} env: - match_start: set\(QX_BASE_VERSION - match_end: \) + new_version: ${{ steps.get-proj-ver.outputs.version }} run: | - $project_lists = Get-Content -Raw CMakeLists.txt - if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ - throw "Could not get base version!" - } - $new_tag = "v$($Matches[1].Trim())" + $new_tag = "v${Env:new_version}" echo "new_tag=$new_tag" >> $Env:GITHUB_OUTPUT git tag -a $new_tag -m "Release $new_tag" git push --tags - name: Move 'latest' tag + working-directory: ${{ steps.proj-checkout.outputs.path }} run: | echo "Checking for 'latest' tag..." if(git tag -l latest){ @@ -53,6 +52,7 @@ jobs: git push origin latest - name: Fast-forward merge master into to dev if: always() + working-directory: ${{ steps.proj-checkout.outputs.path }} run: | git checkout dev git merge master --ff-only From f7d5f310757a76925b70b75010621fbff268badd Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Tue, 6 Dec 2022 12:29:21 -0500 Subject: [PATCH 11/20] Actions: Remove Doxygen_ROOT workaround Requires CMake 3.25.0 --- .github/workflows/build-qx-windows.yml | 4 +--- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-qx-windows.yml b/.github/workflows/build-qx-windows.yml index 2a395e0a..574ba90e 100644 --- a/.github/workflows/build-qx-windows.yml +++ b/.github/workflows/build-qx-windows.yml @@ -93,13 +93,11 @@ jobs: - name: Build/Install Qx working-directory: ${{ env.qx_src_dir }} shell: cmd - env: - doxygen_root: C:\Program Files\doxygen # Required because of #42 run: | echo "Setup C++ Build Environment..." CALL "${{ env.vs_dir }}\Common7\Tools\VsDevCmd.bat" -arch=amd64 echo "Configure CMake using Qt wrapper..." - CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.qx_src_dir}}" -B "${{ env.qx_build_dir }}" -D QX_DOCS_TARGET=ON -D Doxygen_ROOT="${{ env.doxygen_root }}" + CALL "${{ env.qt_cmake }}" -G "${{ env.cmake_gen }}" -S "${{ env.qx_src_dir}}" -B "${{ env.qx_build_dir }}" -D QX_DOCS_TARGET=ON" echo "Changing to build directory..." cd "%qx_build_dir%" echo "Building Qx debug..." diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b603bdb..823e441f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ #================= Project Setup ========================== # CMake -cmake_minimum_required(VERSION 3.21.1) +cmake_minimum_required(VERSION 3.25.0) if(NOT ${GENERATOR_IS_MULTI_CONFIG}) message(FATAL_ERROR "This project currently only supports multi-config generators!") endif() From 285b863ec9739d6eb7c803d9b6554d71afed75ee Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Thu, 22 Dec 2022 00:50:18 -0500 Subject: [PATCH 12/20] Add (in)equality operator to Cummulation --- comp/core/include/qx/core/qx-cumulation.h | 7 +++++++ comp/core/src/qx-cumulation.dox | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/comp/core/include/qx/core/qx-cumulation.h b/comp/core/include/qx/core/qx-cumulation.h index d79c51ee..7eb4df96 100644 --- a/comp/core/include/qx/core/qx-cumulation.h +++ b/comp/core/include/qx/core/qx-cumulation.h @@ -179,6 +179,13 @@ class Cumulation qsizetype count() const { return mComponents.count(); } bool isEmpty() const { return mComponents.isEmpty(); } V mean() const { return sMean(); } + + bool operator==(const Cumulation& other) const + { + return mComponents == other.mComponents && mScalers == other.mScalers && mTotal == other.mTotal; + } + + bool operator!=(const Cumulation& other) const { return !(*this == other); } }; } diff --git a/comp/core/src/qx-cumulation.dox b/comp/core/src/qx-cumulation.dox index f4e0fc43..28f568d6 100644 --- a/comp/core/src/qx-cumulation.dox +++ b/comp/core/src/qx-cumulation.dox @@ -159,4 +159,18 @@ namespace Qx * If @a V is an integral type, the result is rounded to the nearest integer. */ +/*! + * @fn template V Cumulation::operator==(const Cumulation& other) const + * + * Returns @c true if this Cumulation and @a other Cumulation are the same; + * otherwise, returns @c false. + */ + +/*! + * @fn template V Cumulation::operator!=(const Cumulation& other) const + * + * Returns @c true if this Cumulation and @a other Cumulation are not the same; + * otherwise, returns @c false. + */ + } From 6ee65021f23519904a2584a9cbce58c743c3f2d6 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 25 Dec 2022 11:30:05 -0500 Subject: [PATCH 13/20] Fix missing upper case name in component CMake configs --- cmake/module/Qx/ComponentHelper.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/module/Qx/ComponentHelper.cmake b/cmake/module/Qx/ComponentHelper.cmake index 711934cb..fa2c9622 100644 --- a/cmake/module/Qx/ComponentHelper.cmake +++ b/cmake/module/Qx/ComponentHelper.cmake @@ -7,6 +7,7 @@ macro(register_qx_component) # Determine component name via folder name get_filename_component(COMPONENT_NAME_LC "${CMAKE_CURRENT_SOURCE_DIR}" NAME) string_to_proper_case(${COMPONENT_NAME_LC} COMPONENT_NAME) + string(TOUPPER ${COMPONENT_NAME} COMPONENT_NAME_UC) create_header_guard(${PROJECT_NAME} ${COMPONENT_NAME} COMPONENT_HEADER_GUARD) # Name here needs to be as unique as possible for when this project is inlcuded From 0207028426efeb6f5c3c6eb280ff4b5e786c8d92 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 00:34:38 -0500 Subject: [PATCH 14/20] Fix some contents of component include dirs not being installed This change demonstrates an important distinction within the use of the CMake install(DIRECTORY ...) command. Originally the public headers of each component were install like so: ````````````````````````````````````````````````````````````````````````` install(DIRECTORY include/${PROJECT_NAME_LC} COMPONENT ${COMPONENT_TARGET_NAME} DESTINATION "include/${COMPONENT_NAME_LC}" ... ) ````````````````````````````````````````````````````````````````````````` This tells CMake to install the folder (for example, lets say the 'core' component) "include/qx" to "include/core" such that in the end there will be "include/core/qx/...". This made it seem like CMake can only copy the whole directory and was not able to copy just the directory's contents; however, it turns out this can be controlled by adding a trailing slash to the first argument, which will make CMake only copy the contents. This is reflected in the new method: ````````````````````````````````````````````````````````````````````````` install(DIRECTORY include/ COMPONENT ${COMPONENT_TARGET_NAME} DESTINATION "include/${COMPONENT_NAME_LC}/" ... ) ````````````````````````````````````````````````````````````````````````` This ensures that the entire contents of the components include directory are copied to the install directory, instead of just the "qx" folder within. For most components this didn't matter, but qx-windows has an extra include outside the "qx" sub-folder (qx_windows.h) that was not being copied because of the old approach. --- cmake/module/Qx/ComponentHelper.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/module/Qx/ComponentHelper.cmake b/cmake/module/Qx/ComponentHelper.cmake index fa2c9622..917dc453 100644 --- a/cmake/module/Qx/ComponentHelper.cmake +++ b/cmake/module/Qx/ComponentHelper.cmake @@ -179,9 +179,9 @@ macro(register_qx_component) ) # Install public headers - install(DIRECTORY include/${PROJECT_NAME_LC} + install(DIRECTORY include/ COMPONENT ${COMPONENT_TARGET_NAME} - DESTINATION "include/${COMPONENT_NAME_LC}" + DESTINATION "include/${COMPONENT_NAME_LC}/" ${SUB_PROJ_EXCLUDE_FROM_ALL} # "EXCLUDE_FROM_ALL" if project is not top-level ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/${PROJECT_NAME_LC}/${COMPONENT_NAME_LC}.h" From 1aa168fd7dd750820169126fb84b8a44946c9e84 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 11:02:04 -0500 Subject: [PATCH 15/20] Update Doxygen Awesome theme --- doc/theme/doxygen-awesome/doxygen-awesome.css | 179 ++++++++++++++---- 1 file changed, 137 insertions(+), 42 deletions(-) diff --git a/doc/theme/doxygen-awesome/doxygen-awesome.css b/doc/theme/doxygen-awesome/doxygen-awesome.css index ca6f0bc1..abd2893c 100644 --- a/doc/theme/doxygen-awesome/doxygen-awesome.css +++ b/doc/theme/doxygen-awesome/doxygen-awesome.css @@ -74,6 +74,7 @@ html { --content-line-height: 27px; /* The content is centered and constraint in it's width. To make the content fill the whole page, set the variable to auto.*/ --content-maxwidth: 1050px; + --table-line-height: 24px; --toc-sticky-top: var(--spacing-medium); --toc-width: 200px; --toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 85px); @@ -307,7 +308,10 @@ body { font-size: var(--page-font-size); } -body, table, div, p, dl, #nav-tree .label, .title, .sm-dox a, .sm-dox a:hover, .sm-dox a:focus, #projectname, .SelectItem, #MSearchField, .navpath li.navelem a, .navpath li.navelem a:hover { +body, table, div, p, dl, #nav-tree .label, .title, +.sm-dox a, .sm-dox a:hover, .sm-dox a:focus, #projectname, +.SelectItem, #MSearchField, .navpath li.navelem a, +.navpath li.navelem a:hover, p.reference, p.definition { font-family: var(--font-family); } @@ -317,10 +321,14 @@ h1, h2, h3, h4, h5 { line-height: initial; } -p, div, table, dl { +p, div, table, dl, p.reference, p.definition { font-size: var(--page-font-size); } +p.reference, p.definition { + color: var(--page-secondary-foreground-color); +} + a:link, a:visited, a:hover, a:focus, a:active { color: var(--primary-color) !important; font-weight: 500; @@ -406,6 +414,10 @@ a.anchor { margin-bottom: -1px; } +.main-menu-btn-icon, .main-menu-btn-icon:before, .main-menu-btn-icon:after { + background: var(--page-secondary-foreground-color); +} + @media screen and (max-width: 767px) { .sm-dox a span.sub-arrow { background: var(--code-background); @@ -540,12 +552,21 @@ a.anchor { margin-top: 0; } -.left #MSearchSelect { +/* until Doxygen 1.9.4 */ +.left img#MSearchSelect { left: 0; user-select: none; padding-left: 8px; } +/* Doxygen 1.9.5 */ +.left span#MSearchSelect { + left: 0; + user-select: none; + margin-left: 8px; + padding: 0; +} + .left #MSearchSelect[src$=".png"] { padding-left: 0 } @@ -662,6 +683,15 @@ html.dark-mode iframe#MSearchResults { filter: invert() hue-rotate(180deg); } +#MSearchResults .SRPage { + background-color: transparent; +} + +#MSearchResults .SRPage .SREntry { + font-size: 10pt; + padding: var(--spacing-small) var(--spacing-medium); +} + #MSearchSelectWindow { border: 1px solid var(--separator-color); border-radius: var(--border-radius-medium); @@ -718,6 +748,7 @@ html.dark-mode iframe#MSearchResults { overflow: auto; transform: translate(0, 20px); animation: ease-out 280ms slideInSearchResultsMobile; + width: auto !important; } /* @@ -846,7 +877,8 @@ div.header { } @media screen and (min-width: 1000px) { - #doc-content > div > div.contents { + #doc-content > div > div.contents, + .PageDoc > div.contents { display: flex; flex-direction: row-reverse; flex-wrap: nowrap; @@ -878,7 +910,7 @@ div.headertitle { div.header .title { font-weight: 600; - font-size: 210%; + font-size: 225%; padding: var(--spacing-medium) var(--spacing-large); word-break: break-word; } @@ -950,14 +982,18 @@ h2.groupheader { -500px 0 var(--page-background-color), 500px 0.75px var(--separator-color), -500px 0.75px var(--separator-color), - 1500px 0 var(--page-background-color), - -1500px 0 var(--page-background-color), - 1500px 0.75px var(--separator-color), - -1500px 0.75px var(--separator-color), - 2000px 0 var(--page-background-color), - -2000px 0 var(--page-background-color), - 2000px 0.75px var(--separator-color), - -2000px 0.75px var(--separator-color); + 900px 0 var(--page-background-color), + -900px 0 var(--page-background-color), + 900px 0.75px var(--separator-color), + -900px 0.75px var(--separator-color), + 1400px 0 var(--page-background-color), + -1400px 0 var(--page-background-color), + 1400px 0.75px var(--separator-color), + -1400px 0.75px var(--separator-color), + 1900px 0 var(--page-background-color), + -1900px 0 var(--page-background-color), + 1900px 0.75px var(--separator-color), + -1900px 0.75px var(--separator-color); } blockquote { @@ -1009,10 +1045,11 @@ table.params .paramname { font-family: var(--font-family-monospace); font-size: var(--code-font-size); padding-right: var(--spacing-small); + line-height: var(--table-line-height); } -.glow { - text-shadow: 0 0 15px var(--primary-light-color) !important; +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--primary-light-color); } .alphachar a { @@ -1046,6 +1083,12 @@ div.toc h3 { div.toc li { padding: 0; background: none; + line-height: var(--toc-font-size); + margin: var(--toc-font-size) 0 0 0; +} + +div.toc li::before { + display: none; } div.toc ul { @@ -1067,15 +1110,6 @@ div.toc li a.aboveActive { } -div.toc ul li.level1 { - margin: 0; -} - -div.toc ul li.level2, div.toc ul li.level3 { - margin-top: 0; -} - - @media screen and (max-width: 999px) { div.contents .toc { max-height: 45vh; @@ -1104,6 +1138,7 @@ div.toc ul li.level2, div.toc ul li.level3 { background-color: var(--toc-background); margin: 0; padding: var(--spacing-large) 0; + display: block; } div.contents .toc.interactive > h3::before { @@ -1112,11 +1147,10 @@ div.toc ul li.level2, div.toc ul li.level3 { height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; - border-top: 7px solid var(--primary-color); - margin-top: 5px; - display: block; - float: left; + border-top: 5px solid var(--primary-color); + display: inline-block; margin-right: var(--spacing-small); + margin-bottom: calc(var(--navigation-font-size) / 4); transform: rotate(-90deg); transition: transform 0.25s ease-out; } @@ -1271,6 +1305,15 @@ div.fragment .line:first-child .lineno { box-shadow: -999999px 0px 0 999999px var(--fragment-linenumber-background), -999998px 0px 0 999999px var(--fragment-linenumber-border); } +div.line { + border-radius: var(--border-radius-small); +} + +div.line.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + /* dl warning, attention, note, deprecated, bug, ... */ @@ -1390,7 +1433,6 @@ div.memitem { div.memproto, h2.memtitle { background: var(--fragment-background); - text-shadow: none; } h2.memtitle { @@ -1466,6 +1508,7 @@ div.memproto table.memname { font-family: var(--font-family-monospace); color: var(--page-foreground-color); font-size: var(--memname-font-size); + text-shadow: none; } div.memproto div.memtemplate { @@ -1473,6 +1516,7 @@ div.memproto div.memtemplate { color: var(--primary-dark-color); font-size: var(--memname-font-size); margin-left: 2px; + text-shadow: none; } table.mlabels, table.mlabels > tbody { @@ -1689,6 +1733,7 @@ table.memberdecls tr[class^='memitem'] .memTemplParams { font-family: var(--font-family-monospace); font-size: var(--code-font-size); color: var(--primary-dark-color); + white-space: normal; } table.memberdecls .memItemLeft, @@ -1714,7 +1759,7 @@ table.memberdecls .memTemplParams { border-left: 1px solid var(--separator-color); border-right: 1px solid var(--separator-color); border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; - padding-bottom: 0; + padding-bottom: var(--spacing-small); } table.memberdecls .memTemplItemLeft { @@ -1726,6 +1771,7 @@ table.memberdecls .memTemplItemLeft { table.memberdecls .memTemplItemRight { border-radius: 0 0 var(--border-radius-small) 0; border-right: 1px solid var(--separator-color); + padding-left: 0; border-top: 0; } @@ -1750,6 +1796,11 @@ table.memberdecls .mdescLeft, table.memberdecls .mdescRight { padding: var(--spacing-small) 0; } +table.memberdecls .memItemLeft, +table.memberdecls .memTemplItemLeft { + padding-right: var(--spacing-medium); +} + table.memberdecls .memSeparator { background: var(--page-background-color); height: var(--spacing-large); @@ -1764,30 +1815,41 @@ table.memberdecls .groupheader { table.memberdecls .inherit_header td { padding: 0 0 var(--spacing-medium) 0; text-indent: -12px; - line-height: 1.5em; color: var(--page-secondary-foreground-color); } -table.memberdecls img[src="closed.png"], table.memberdecls img[src="open.png"] { +table.memberdecls img[src="closed.png"], +table.memberdecls img[src="open.png"], +div.dynheader img[src="open.png"], +div.dynheader img[src="closed.png"] { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; - border-top: 7px solid var(--primary-color); + border-top: 5px solid var(--primary-color); margin-top: 8px; display: block; float: left; - margin-right: var(--spacing-small); margin-left: -10px; - margin-right: 10px; transition: transform 0.25s ease-out; } -table.memberdecls img[src="closed.png"] { +table.memberdecls img { + margin-right: 10px; +} + +table.memberdecls img[src="closed.png"], +div.dynheader img[src="closed.png"] { transform: rotate(-90deg); } +.compoundTemplParams { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--code-font-size); +} + @media screen and (max-width: 767px) { table.memberdecls .memItemLeft, @@ -1804,6 +1866,7 @@ table.memberdecls img[src="closed.png"] { border-right: none; border-left: none; border-radius: 0; + white-space: normal; } table.memberdecls .memItemLeft, @@ -1818,7 +1881,7 @@ table.memberdecls img[src="closed.png"] { } table.memberdecls .mdescLeft { - margin-top: calc(0px - var(--page-font-size)); + margin-bottom: calc(0px - var(--page-font-size)); } table.memberdecls .memItemRight, @@ -1916,8 +1979,25 @@ table.directory { width: 100%; } -table.directory td.entry { - padding: var(--spacing-small); +table.directory td.entry, table.directory td.desc { + padding: calc(var(--spacing-small) / 2) var(--spacing-small); + line-height: var(--table-line-height); +} + +table.directory tr.even td:last-child { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; +} + +table.directory tr.even td:first-child { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); +} + +table.directory tr.even:last-child td:last-child { + border-radius: 0 var(--border-radius-small) 0 0; +} + +table.directory tr.even:last-child td:first-child { + border-radius: var(--border-radius-small) 0 0 0; } table.directory td.desc { @@ -1928,6 +2008,10 @@ table.directory tr.even { background-color: var(--odd-color); } +table.directory tr.odd { + background-color: transparent; +} + .icona { width: auto; height: auto; @@ -1936,14 +2020,20 @@ table.directory tr.even { .icon { background: var(--primary-color); - width: 18px; - height: 18px; - line-height: 18px; + border-radius: var(--border-radius-small); + font-size: var(--page-font-size); + padding: calc(var(--page-font-size) / 5); + line-height: var(--page-font-size); + transform: scale(0.8); + height: auto; + width: var(--page-font-size); + user-select: none; } .iconfopen, .icondoc, .iconfclosed { background-position: center; margin-bottom: 0; + height: var(--table-line-height); } .icondoc { @@ -1976,6 +2066,10 @@ html.dark-mode .iconfopen, html.dark-mode .iconfclosed { border-radius: var(--border-radius-small); } +.classindex dl.even { + background-color: transparent; +} + /* Class Index Doxygen 1.8 */ @@ -2102,6 +2196,7 @@ div.memproto::-webkit-scrollbar, .contents .center::-webkit-scrollbar, .contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar, div.contents .toc::-webkit-scrollbar { + background: transparent; width: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); height: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); } From bebe9623f377dbe38c5b4c802113dea9d84a3329 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 11:03:16 -0500 Subject: [PATCH 16/20] Rollback to Doxygen 1.9.4, works better with Doxygen Awesome --- .github/workflows/build-qx-linux.yml | 2 +- .github/workflows/build-qx-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-qx-linux.yml b/.github/workflows/build-qx-linux.yml index d9780d7e..c0a8c7ef 100644 --- a/.github/workflows/build-qx-linux.yml +++ b/.github/workflows/build-qx-linux.yml @@ -92,7 +92,7 @@ jobs: - name: Install Doxygen uses: oblivioncth/actions/ubuntu/install-doxygen-from-sourceforge@dev with: - version: 1.9.5 + version: 1.9.4 - name: Install Graphviz run: sudo apt-get install graphviz - name: Install Ninja diff --git a/.github/workflows/build-qx-windows.yml b/.github/workflows/build-qx-windows.yml index 574ba90e..7b83c246 100644 --- a/.github/workflows/build-qx-windows.yml +++ b/.github/workflows/build-qx-windows.yml @@ -83,7 +83,7 @@ jobs: run: 7z x ${{ env.qt_install_dest }} -o${{ env.qt_install_dir }} - name: Install Doxygen & Graphviz run: | - choco install doxygen.install --version 1.9.5 + choco install doxygen.install --version 1.9.4 choco install graphviz - name: Checkout Qx uses: actions/checkout@v3 From 32b8db08726fada7b83a85af27f2e0a39bc7c966 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 11:23:28 -0500 Subject: [PATCH 17/20] Fix row/column expansion for Table::insertColumn()/insertRow() --- comp/core/include/qx/core/qx-table.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/comp/core/include/qx/core/qx-table.h b/comp/core/include/qx/core/qx-table.h index a999b66d..c3cda8a1 100644 --- a/comp/core/include/qx/core/qx-table.h +++ b/comp/core/include/qx/core/qx-table.h @@ -209,9 +209,11 @@ class Table { // Expand height if c is larger than current height qsizetype rows = rowCount(); - qsizetype rowGrowth = rows - c.size(); - if(rowGrowth > 0) + if(c.size() > rows) + { resizeRows(c.size()); + rows = c.size(); + } // Insert values from column, or default values if column is smaller than height for(qsizetype r = 0; r < rows; r++) @@ -222,13 +224,15 @@ class Table { // Expand width if r is larger than current width qsizetype columns = columnCount(); - qsizetype columnGrowth = columns - r.size(); - if(columnGrowth > 0) + if(r.size() > columns) + { resizeColumns(r.size()); + columns = r.size(); + } // Insert row, then expand it if it's smaller than the current width mTable.insert(i, r); - if(columnGrowth < 0) + if(r.size() < columns) mTable[i].resize(columns); } From aa7cb96d7277f570868cf8cecb63cef9a88a142a Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 11:33:40 -0500 Subject: [PATCH 18/20] Add assertion for index position in Table::insertColumn()/insertRow() Makes termination errors caused by an invalid index passed to these functions more explicit instead of relying on the underlying insertions within QList::insert(). --- comp/core/include/qx/core/qx-table.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/comp/core/include/qx/core/qx-table.h b/comp/core/include/qx/core/qx-table.h index c3cda8a1..50de96c7 100644 --- a/comp/core/include/qx/core/qx-table.h +++ b/comp/core/include/qx/core/qx-table.h @@ -207,6 +207,8 @@ class Table void insertColumn(qsizetype i, const QList& c) { + Q_ASSERT_X(i >= 0 && i <= columnCount(), "QTable::insertColumn", "index out of range"); + // Expand height if c is larger than current height qsizetype rows = rowCount(); if(c.size() > rows) @@ -222,6 +224,8 @@ class Table void insertRow(qsizetype i, const QList& r) { + Q_ASSERT_X(i >= 0 && i <= rowCount(), "QTable::insertRow", "index out of range"); + // Expand width if r is larger than current width qsizetype columns = columnCount(); if(r.size() > columns) From 4370e41bbe7e892fafc9fbd9f65b8e7f1c3a805d Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 11:35:35 -0500 Subject: [PATCH 19/20] Document append/prepend behavior of Table::insertRow()/insertColumn() --- comp/core/src/qx-table.dox | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/comp/core/src/qx-table.dox b/comp/core/src/qx-table.dox index 7d6936cc..9b8b741f 100644 --- a/comp/core/src/qx-table.dox +++ b/comp/core/src/qx-table.dox @@ -301,7 +301,8 @@ namespace Qx /*! * @fn template void Table::insertColumn(qsizetype i, const QList& c) * - * Inserts @a c as a column to column index @a i in the table. + * Inserts @a c as a column to column index @a i in the table. If @a i is 0, the column is prepended to the + * table. If @a i is columnSize(), the column is appended to the table. * * If @a c is smaller than the current height (rowCount()) of the table, it will be expanded with * default-constructed values after insertion to match the current height. If @a c is larger than the @@ -312,7 +313,8 @@ namespace Qx /*! * @fn template void Table::insertRow(qsizetype i, const QList& r) * - * Inserts @a r as a row to row index @a i in the table. + * Inserts @a r as a row to row index @a i in the table. If @a i is 0, the row is prepended to the + * table. If @a i is rowSize(), the row is appended to the table. * * If @a r is smaller than the current width (columnCount()) of the table, it will be expanded with * default-constructed values after insertion to match the current width. If @a r is larger than the From a35bd1137fd4bea72be69d23e9e22630086ca9d7 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 26 Dec 2022 11:55:31 -0500 Subject: [PATCH 20/20] Bump version for release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 823e441f..eee89cbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(TRUE_CMAKE_MINIMUM_REQUIRED ${CMAKE_MINIMUM_REQUIRED_VERSION}) # avoided and only used for hotfixes. DON'T USE TRAILING # ZEROS IN VERSIONS project(Qx - VERSION 0.4.1 + VERSION 0.4.2 LANGUAGES CXX DESCRIPTION "Qt Extensions Library" )