From 1473cee7986c8987960d0c9bb729a43fb406a9c0 Mon Sep 17 00:00:00 2001 From: linbo <1034003879@qq.com> Date: Thu, 24 Sep 2026 15:04:42 +0800 Subject: [PATCH] Fix Qt 5.12 Windows and Linux compatibility --- src/configeditorwidget.cpp | 2 +- src/urdfviewerwidget.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/configeditorwidget.cpp b/src/configeditorwidget.cpp index 1219a39..9035e71 100644 --- a/src/configeditorwidget.cpp +++ b/src/configeditorwidget.cpp @@ -1800,7 +1800,7 @@ bool ConfigEditorWidget::prepareOverviewSave(QString *error) m_overviewSaveContents.clear(); m_overviewSaveRevisions.clear(); - for (const QString &path : std::as_const(affectedPaths)) { + for (const QString &path : qAsConst(affectedPaths)) { if (path.isEmpty()) continue; if (!m_overviewContents.contains(path) || !m_overviewRevisions.contains(path)) { diff --git a/src/urdfviewerwidget.cpp b/src/urdfviewerwidget.cpp index 6889282..9e06915 100644 --- a/src/urdfviewerwidget.cpp +++ b/src/urdfviewerwidget.cpp @@ -32,6 +32,16 @@ #include #include +// Windows headers define legacy near/far macros, while urdfdom uses those +// names as Camera data members. Keep the compatibility workaround local to +// this translation unit instead of patching the vendored urdfdom headers. +#ifdef near +#undef near +#endif +#ifdef far +#undef far +#endif + #include #include #include