summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qfileinfo.cpp36
-rw-r--r--src/corelib/io/qfileinfo.h2
-rw-r--r--src/corelib/tools/qmap.h4
-rw-r--r--src/gui/graphicsview/qgraphicslayout_p.h4
-rw-r--r--src/gui/itemviews/qwidgetitemdata_p.h2
-rw-r--r--src/gui/kernel/qeventdispatcher_mac_p.h2
-rw-r--r--src/gui/painting/qbrush.cpp8
-rw-r--r--src/gui/painting/qbrush.h2
-rw-r--r--src/gui/text/qfontengine_p.h2
-rw-r--r--src/gui/text/qfontmetrics.cpp30
-rw-r--r--src/gui/text/qfontmetrics.h4
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h2
12 files changed, 22 insertions, 76 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index f54818e0a6..c83c39195a 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -366,7 +366,7 @@ QFileInfo::~QFileInfo()
}
/*!
- \fn bool QFileInfo::operator!=(const QFileInfo &fileinfo)
+ \fn bool QFileInfo::operator!=(const QFileInfo &fileinfo) const
Returns true if this QFileInfo object refers to a different file
than the one specified by \a fileinfo; otherwise returns false.
@@ -380,7 +380,19 @@ QFileInfo::~QFileInfo()
*/
/*!
- \overload
+ Returns true if this QFileInfo object refers to a file in the same
+ location as \a fileinfo; otherwise returns false.
+
+ Note that the result of comparing two empty QFileInfo objects,
+ containing no file references, is undefined.
+
+ \warning This will not compare two different symbolic links
+ pointing to the same file.
+
+ \warning Long and short file names that refer to the same file on Windows
+ are treated as if they referred to different files.
+
+ \sa operator!=()
*/
bool QFileInfo::operator==(const QFileInfo &fileinfo) const
{
@@ -410,26 +422,6 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
}
/*!
- Returns true if this QFileInfo object refers to a file in the same
- location as \a fileinfo; otherwise returns false.
-
- Note that the result of comparing two empty QFileInfo objects,
- containing no file references, is undefined.
-
- \warning This will not compare two different symbolic links
- pointing to the same file.
-
- \warning Long and short file names that refer to the same file on Windows
- are treated as if they referred to different files.
-
- \sa operator!=()
-*/
-bool QFileInfo::operator==(const QFileInfo &fileinfo)
-{
- return const_cast<const QFileInfo *>(this)->operator==(fileinfo);
-}
-
-/*!
Makes a copy of the given \a fileinfo and assigns it to this QFileInfo.
*/
QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index 6ca0ae79e0..ab3d2dc847 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -75,9 +75,7 @@ public:
inline QFileInfo&operator=(QFileInfo &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
- bool operator==(const QFileInfo &fileinfo); // 5.0 - remove me
bool operator==(const QFileInfo &fileinfo) const;
- inline bool operator!=(const QFileInfo &fileinfo) { return !(operator==(fileinfo)); } // 5.0 - remove me
inline bool operator!=(const QFileInfo &fileinfo) const { return !(operator==(fileinfo)); }
void setFile(const QString &file);
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 36d8eefbdb..771959a3bf 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -352,8 +352,8 @@ public:
// ### Qt 5: not sure this is necessary anymore
#ifdef QT_STRICT_ITERATORS
private:
- inline bool operator==(const iterator &o) { return operator==(const_iterator(o)); }
- inline bool operator!=(const iterator &o) { return operator!=(const_iterator(o)); }
+ inline bool operator==(const iterator &o) const { return operator==(const_iterator(o)); }
+ inline bool operator!=(const iterator &o) const { return operator!=(const_iterator(o)); }
#endif
private:
diff --git a/src/gui/graphicsview/qgraphicslayout_p.h b/src/gui/graphicsview/qgraphicslayout_p.h
index 586cbc77e3..071a2ade25 100644
--- a/src/gui/graphicsview/qgraphicslayout_p.h
+++ b/src/gui/graphicsview/qgraphicslayout_p.h
@@ -98,9 +98,9 @@ public:
inline QStyle *style() const { return m_style; }
inline QWidget *widget() const { return m_widget; }
- inline bool operator==(const QLayoutStyleInfo &other)
+ inline bool operator==(const QLayoutStyleInfo &other) const
{ return m_style == other.m_style && m_widget == other.m_widget; }
- inline bool operator!=(const QLayoutStyleInfo &other)
+ inline bool operator!=(const QLayoutStyleInfo &other) const
{ return !(*this == other); }
inline void setDefaultSpacing(Qt::Orientation o, qreal spacing){
diff --git a/src/gui/itemviews/qwidgetitemdata_p.h b/src/gui/itemviews/qwidgetitemdata_p.h
index 19724a3ccc..e7a08de378 100644
--- a/src/gui/itemviews/qwidgetitemdata_p.h
+++ b/src/gui/itemviews/qwidgetitemdata_p.h
@@ -62,7 +62,7 @@ public:
inline QWidgetItemData(int r, QVariant v) : role(r), value(v) {}
int role;
QVariant value;
- inline bool operator==(const QWidgetItemData &other) { return role == other.role && value == other.value; }
+ inline bool operator==(const QWidgetItemData &other) const { return role == other.role && value == other.value; }
};
#ifndef QT_NO_DATASTREAM
diff --git a/src/gui/kernel/qeventdispatcher_mac_p.h b/src/gui/kernel/qeventdispatcher_mac_p.h
index 485b14c38f..f4cf16e8a0 100644
--- a/src/gui/kernel/qeventdispatcher_mac_p.h
+++ b/src/gui/kernel/qeventdispatcher_mac_p.h
@@ -141,7 +141,7 @@ struct MacTimerInfo {
QObject *obj;
bool pending;
CFRunLoopTimerRef runLoopTimer;
- bool operator==(const MacTimerInfo &other)
+ bool operator==(const MacTimerInfo &other) const
{
return (id == other.id);
}
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 97ea4dbc15..742a4ea071 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -1568,14 +1568,6 @@ bool QGradient::operator==(const QGradient &gradient) const
}
/*!
- \internal
-*/
-bool QGradient::operator==(const QGradient &gradient)
-{
- return const_cast<const QGradient *>(this)->operator==(gradient);
-}
-
-/*!
\class QLinearGradient
\ingroup painting
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h
index 4a0bfcc8e4..edf99924a3 100644
--- a/src/gui/painting/qbrush.h
+++ b/src/gui/painting/qbrush.h
@@ -249,8 +249,6 @@ public:
inline bool operator!=(const QGradient &other) const
{ return !operator==(other); }
- bool operator==(const QGradient &gradient); // ### Qt 5: remove
-
private:
friend class QLinearGradient;
friend class QRadialGradient;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 5570768ddb..5f779e155a 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -291,7 +291,7 @@ private:
struct GlyphCacheEntry {
void *context;
QExplicitlySharedDataPointer<QFontEngineGlyphCache> cache;
- bool operator==(const GlyphCacheEntry &other) { return context == other.context && cache == other.cache; }
+ bool operator==(const GlyphCacheEntry &other) const { return context == other.context && cache == other.cache; }
};
mutable QLinkedList<GlyphCacheEntry> m_glyphCaches;
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 9e1646f046..9fce85f25b 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -224,7 +224,6 @@ QFontMetrics &QFontMetrics::operator=(const QFontMetrics &fm)
}
/*!
- \overload
Returns true if \a other is equal to this object; otherwise
returns false.
@@ -240,21 +239,6 @@ bool QFontMetrics::operator ==(const QFontMetrics &other) const
}
/*!
- Returns true if \a other is equal to this object; otherwise
- returns false.
-
- Two font metrics are considered equal if they were constructed
- from the same QFont and the paint devices they were constructed
- for are considered compatible.
-
- \sa operator!=()
-*/
-bool QFontMetrics::operator ==(const QFontMetrics &other)
-{
- return d == other.d;
-}
-
-/*!
\fn bool QFontMetrics::operator!=(const QFontMetrics &other)
Returns true if \a other is not equal to this object; otherwise returns false.
@@ -1118,7 +1102,6 @@ QFontMetricsF &QFontMetricsF::operator=(const QFontMetricsF &fm)
}
/*!
- \overload
Returns true if the font metrics are equal to the \a other font
metrics; otherwise returns false.
@@ -1132,19 +1115,6 @@ bool QFontMetricsF::operator ==(const QFontMetricsF &other) const
}
/*!
- Returns true if the font metrics are equal to the \a other font
- metrics; otherwise returns false.
-
- Two font metrics are considered equal if they were constructed from the
- same QFont and the paint devices they were constructed for are
- considered to be compatible.
-*/
-bool QFontMetricsF::operator ==(const QFontMetricsF &other)
-{
- return d == other.d;
-}
-
-/*!
\fn bool QFontMetricsF::operator!=(const QFontMetricsF &other)
Returns true if the font metrics are not equal to the \a other font
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index 6a2db60b03..a23bb34e0d 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -117,9 +117,7 @@ public:
int strikeOutPos() const;
int lineWidth() const;
- bool operator==(const QFontMetrics &other); // 5.0 - remove me
bool operator==(const QFontMetrics &other) const;
- inline bool operator !=(const QFontMetrics &other) { return !operator==(other); } // 5.0 - remove me
inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); }
#ifdef QT3_SUPPORT
@@ -192,9 +190,7 @@ public:
qreal strikeOutPos() const;
qreal lineWidth() const;
- bool operator==(const QFontMetricsF &other); // 5.0 - remove me
bool operator==(const QFontMetricsF &other) const;
- inline bool operator !=(const QFontMetricsF &other) { return !operator==(other); } // 5.0 - remove me
inline bool operator !=(const QFontMetricsF &other) const { return !operator==(other); }
private:
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index e5f032747b..921df369f4 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -401,7 +401,7 @@ public:
bool useOpacityAttribute;
bool usePmvMatrixAttribute;
- bool operator==(const QGLEngineShaderProg& other) {
+ bool operator==(const QGLEngineShaderProg& other) const {
// We don't care about the program
return ( mainVertexShader == other.mainVertexShader &&
positionVertexShader == other.positionVertexShader &&