diff --git a/src/core/api/qwebengineurlscheme.cpp b/src/core/api/qwebengineurlscheme.cpp
index 24bcae1959153d8c8cfc8f0b664917f5d243c0ad..59899769bdcf156a62db26fd76c157980043cb95 100644
--- a/src/core/api/qwebengineurlscheme.cpp
+++ b/src/core/api/qwebengineurlscheme.cpp
@@ -237,7 +237,7 @@ QWebEngineUrlScheme::~QWebEngineUrlScheme() = default;
 /*!
   Returns \c true if this and \a that object are equal.
 */
-bool QWebEngineUrlScheme::operator==(const QWebEngineUrlScheme &that)
+bool QWebEngineUrlScheme::operator==(const QWebEngineUrlScheme &that) const
 {
     return (d == that.d)
         || (d->name == that.d->name
@@ -247,7 +247,7 @@ bool QWebEngineUrlScheme::operator==(const QWebEngineUrlScheme &that)
 }
 
 /*!
-  \fn bool QWebEngineUrlScheme::operator!=(const QWebEngineUrlScheme &that)
+  \fn bool QWebEngineUrlScheme::operator!=(const QWebEngineUrlScheme &that) const
 
   Returns \c true if this and \a that object are not equal.
 */
diff --git a/src/core/api/qwebengineurlscheme.h b/src/core/api/qwebengineurlscheme.h
index ee5bf3c3cf124af79f31e948b74bc06932b591a9..dd936bd9dbc8fcadbbbf905f0359cb5abc70fce5 100644
--- a/src/core/api/qwebengineurlscheme.h
+++ b/src/core/api/qwebengineurlscheme.h
@@ -84,8 +84,8 @@ public:
 
     ~QWebEngineUrlScheme();
 
-    bool operator==(const QWebEngineUrlScheme &that);
-    bool operator!=(const QWebEngineUrlScheme &that) { return !(*this == that); }
+    bool operator==(const QWebEngineUrlScheme &that) const;
+    bool operator!=(const QWebEngineUrlScheme &that) const { return !(*this == that); }
 
     QByteArray name() const;
     void setName(const QByteArray &newValue);