From cd6ecea38327e8c2517a8a0bd87e7ddbf6a1288d Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Mon, 15 Jan 2024 10:24:53 +0100 Subject: [PATCH] QRegExp was deprecated in Qt5, gone in Qt6 --- src/rviz/default_plugin/depth_cloud_display.cpp | 7 +++---- src/rviz/default_plugin/depth_cloud_display.h | 11 ++++++----- src/rviz/tool_manager.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/rviz/default_plugin/depth_cloud_display.cpp b/src/rviz/default_plugin/depth_cloud_display.cpp index 7b98d73dcb..3e863e85b6 100644 --- a/src/rviz/default_plugin/depth_cloud_display.cpp +++ b/src/rviz/default_plugin/depth_cloud_display.cpp @@ -27,6 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include +#include #include "depth_cloud_display.h" #include @@ -78,8 +79,7 @@ DepthCloudDisplay::DepthCloudDisplay() { // Depth map properties - QRegExp depth_filter("depth"); - depth_filter.setCaseSensitivity(Qt::CaseInsensitive); + QRegularExpression depth_filter("depth", QRegularExpression::CaseInsensitiveOption); topic_filter_property_ = new Property("Topic Filter", true, @@ -100,8 +100,7 @@ DepthCloudDisplay::DepthCloudDisplay() depth_transport_property_->setStdString("raw"); // color image properties - QRegExp color_filter("color|rgb|bgr|gray|mono"); - color_filter.setCaseSensitivity(Qt::CaseInsensitive); + QRegularExpression color_filter("color|rgb|bgr|gray|mono", QRegularExpression::CaseInsensitiveOption); color_topic_property_ = new RosFilteredTopicProperty( "Color Image Topic", "", diff --git a/src/rviz/default_plugin/depth_cloud_display.h b/src/rviz/default_plugin/depth_cloud_display.h index 6a3ce750b9..4ba129637e 100644 --- a/src/rviz/default_plugin/depth_cloud_display.h +++ b/src/rviz/default_plugin/depth_cloud_display.h @@ -54,6 +54,7 @@ #endif #include +#include using namespace message_filters::sync_policies; @@ -81,7 +82,7 @@ class RosFilteredTopicProperty : public RosTopicProperty const QString& default_value = QString(), const QString& message_type = QString(), const QString& description = QString(), - const QRegExp& filter = QRegExp(), + const QRegularExpression& filter = QRegularExpression(), Property* parent = nullptr) : RosTopicProperty(name, default_value, message_type, description, parent) , filter_(filter) @@ -94,7 +95,7 @@ class RosFilteredTopicProperty : public RosTopicProperty const QString& default_value, const QString& message_type, const QString& description, - const QRegExp& filter, + const QRegularExpression& filter, Property* parent, Func&& changed_slot, const R* receiver) @@ -109,7 +110,7 @@ class RosFilteredTopicProperty : public RosTopicProperty const QString& default_value, const QString& message_type, const QString& description, - const QRegExp& filter, + const QRegularExpression& filter, P* parent, Func&& changed_slot) : RosFilteredTopicProperty(name, default_value, message_type, description, filter, parent) @@ -124,7 +125,7 @@ class RosFilteredTopicProperty : public RosTopicProperty fillTopicList(); } - QRegExp filter() const + QRegularExpression filter() const { return filter_; } @@ -142,7 +143,7 @@ protected Q_SLOTS: } private: - QRegExp filter_; + QRegularExpression filter_; bool filter_enabled_; }; diff --git a/src/rviz/tool_manager.cpp b/src/rviz/tool_manager.cpp index 5c48804602..31f674a754 100644 --- a/src/rviz/tool_manager.cpp +++ b/src/rviz/tool_manager.cpp @@ -28,7 +28,7 @@ */ #include -#include +#include #include @@ -42,7 +42,7 @@ namespace rviz { QString addSpaceToCamelCase(QString input) { - QRegExp re = QRegExp("([A-Z])([a-z]*)"); + QRegularExpression re = QRegularExpression("([A-Z])([a-z]*)"); input.replace(re, " \\1\\2"); return input.trimmed(); }