Skip to content

fix compile with Qt6#282

Open
mosfet80 wants to merge 6 commits intoPickNikRobotics:ros2from
mosfet80:qt6
Open

fix compile with Qt6#282
mosfet80 wants to merge 6 commits intoPickNikRobotics:ros2from
mosfet80:qt6

Conversation

@mosfet80
Copy link
Contributor

fix compile with Qt6

@codecov
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 13.29%. Comparing base (101b1d1) to head (ea17646).
⚠️ Report is 4 commits behind head on ros2.

Additional details and impacted files
@@            Coverage Diff             @@
##             ros2     #282      +/-   ##
==========================================
- Coverage   19.86%   13.29%   -6.57%     
==========================================
  Files           5       12       +7     
  Lines        1858     2302     +444     
  Branches        0      131     +131     
==========================================
- Hits          369      306      -63     
- Misses       1489     1986     +497     
- Partials        0       10      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mosfet80 mosfet80 force-pushed the qt6 branch 2 times, most recently from 327346d to 34b8e91 Compare September 2, 2025 17:11
@mosfet80 mosfet80 force-pushed the qt6 branch 2 times, most recently from d4bb430 to 63a9621 Compare September 2, 2025 17:38
@mosfet80 mosfet80 force-pushed the qt6 branch 2 times, most recently from c1877f5 to 847184c Compare September 12, 2025 08:38
@mosfet80 mosfet80 mentioned this pull request Oct 9, 2025
@mosfet80
Copy link
Contributor Author

mosfet80 commented Dec 18, 2025

Close #288

@mosfet80
Copy link
Contributor Author

@tylerjw ping

@mosfet80
Copy link
Contributor Author

mosfet80 commented Jan 5, 2026

@nbbrooks ping

@mosfet80 mosfet80 force-pushed the qt6 branch 3 times, most recently from 6da8b38 to 388f117 Compare January 7, 2026 12:22
Update CMakeLists.txt

Replace ament_target_dependencies with target_link_libraries

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@nbbrooks
Copy link
Member

While resolving a conflict I've added a link libraries list pattern to reduce the redundant listing.

Comment on lines 44 to 56
find_package(QT NAMES Qt6 Qt5 COMPONENTS Test Widgets)

if(Qt${QT_VERSION_MAJOR} STREQUAL "6")
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Widgets Core5Compat)
if(${QT_VERSION} VERSION_LESS 5.15.0)
function(qt_wrap_cpp out)
qt5_wrap_cpp(_sources ${ARGN})
set("${out}" ${_sources} PARENT_SCOPE)
endfunction()
endif()
else()#Qt5
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Widgets)
endif()
Copy link
Member

@nbbrooks nbbrooks Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
find_package(QT NAMES Qt6 Qt5 COMPONENTS Test Widgets)
if(Qt${QT_VERSION_MAJOR} STREQUAL "6")
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Widgets Core5Compat)
if(${QT_VERSION} VERSION_LESS 5.15.0)
function(qt_wrap_cpp out)
qt5_wrap_cpp(_sources ${ARGN})
set("${out}" ${_sources} PARENT_SCOPE)
endfunction()
endif()
else()#Qt5
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Widgets)
endif()
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Test Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
if(${QT_VERSION} VERSION_LESS 5.15.0)
function(qt_wrap_cpp out)
qt5_wrap_cpp(_sources ${ARGN})
set("${out}" ${_sources} PARENT_SCOPE)
endfunction()
endif()
if(Qt${QT_VERSION_MAJOR} STREQUAL "6")
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core5Compat)
endif()

CI problem might be here. if(${QT_VERSION} VERSION_LESS 5.15.0) is inside the if(Qt${QT_VERSION_MAJOR} STREQUAL "6") block.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the explicit check might just move the failure to find_package time, as we have nothing in package.xml to selectively install stuff like libqt6-core and libqt6core5compat6-dev

I don't know enough about qt5 and qt6 support to know what should get changed there though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind about the explciit check, I do see it is in find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test Widgets Core5Compat) already

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is inside the incorrect if(Qt${QT_VERSION_MAJOR} STREQUAL "6") syntax. OK let's see what my suggested change does. Prob move the error to find_package time. And then we may need to figure out how to support selective package.xml dependencies based on ROS version (a topic that came up in the December community meeting)

mosfet80 and others added 2 commits January 16, 2026 01:19
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@simonschmeisser
Copy link
Contributor

In ROS 1 branch this followed the Qt version exported by RViz, is this no longer available here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants