Skip to content

Commit

Permalink
QRegExp was deprecated in Qt5, gone in Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschmeisser committed Jan 15, 2024
1 parent ab24014 commit cd6ecea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/rviz/default_plugin/depth_cloud_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <QObject>
#include <QRegularExpression>

#include "depth_cloud_display.h"
#include <rviz/visualization_manager.h>
Expand Down Expand Up @@ -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,
Expand All @@ -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", "",
Expand Down
11 changes: 6 additions & 5 deletions src/rviz/default_plugin/depth_cloud_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#endif

#include <QMap>
#include <QtCore/QRegularExpression>

using namespace message_filters::sync_policies;

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -124,7 +125,7 @@ class RosFilteredTopicProperty : public RosTopicProperty
fillTopicList();
}

QRegExp filter() const
QRegularExpression filter() const
{
return filter_;
}
Expand All @@ -142,7 +143,7 @@ protected Q_SLOTS:
}

private:
QRegExp filter_;
QRegularExpression filter_;
bool filter_enabled_;
};

Expand Down
4 changes: 2 additions & 2 deletions src/rviz/tool_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/

#include <QKeyEvent>
#include <QRegExp>
#include <QRegularExpression>

#include <ros/assert.h>

Expand All @@ -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();
}
Expand Down

0 comments on commit cd6ecea

Please sign in to comment.