summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h6
-rw-r--r--src/gui/text/qfont.cpp16
-rw-r--r--src/gui/text/qfont.h3
-rw-r--r--src/gui/text/qfontinfo.h2
-rw-r--r--src/gui/text/qfontmetrics.cpp18
-rw-r--r--src/gui/text/qfontmetrics.h5
-rw-r--r--src/gui/text/qglyphrun.cpp8
-rw-r--r--src/gui/text/qglyphrun.h2
-rw-r--r--src/gui/text/qrawfont.cpp8
-rw-r--r--src/gui/text/qrawfont.h2
-rw-r--r--src/gui/text/qstatictext.cpp8
-rw-r--r--src/gui/text/qstatictext.h2
-rw-r--r--src/gui/text/qtextcursor.cpp8
-rw-r--r--src/gui/text/qtextcursor.h2
-rw-r--r--src/gui/text/qtextformat.cpp8
-rw-r--r--src/gui/text/qtextformat.h3
16 files changed, 101 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index 5865e0a27d..a884d8b5de 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -117,6 +117,8 @@ public:
QColorDialogOptions &operator=(const QColorDialogOptions &rhs);
~QColorDialogOptions();
+ void swap(QColorDialogOptions &other) { qSwap(d, other.d); }
+
QString windowTitle() const;
void setWindowTitle(const QString &);
@@ -171,6 +173,8 @@ public:
QFontDialogOptions &operator=(const QFontDialogOptions &rhs);
~QFontDialogOptions();
+ void swap(QFontDialogOptions &other) { qSwap(d, other.d); }
+
QString windowTitle() const;
void setWindowTitle(const QString &);
@@ -226,6 +230,8 @@ public:
QFileDialogOptions &operator=(const QFileDialogOptions &rhs);
~QFileDialogOptions();
+ void swap(QFileDialogOptions &other) { qSwap(d, other.d); }
+
QString windowTitle() const;
void setWindowTitle(const QString &);
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 2144930f70..5fc98cdf04 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -739,6 +739,14 @@ QFont &QFont::operator=(const QFont &font)
}
/*!
+ \fn void QFont::swap(QFont &other)
+ \since 5.0
+
+ Swaps this font instance with \a other. This function is very fast
+ and never fails.
+*/
+
+/*!
Returns the requested font family name, i.e. the name set in the
constructor or the last setFont() call.
@@ -2294,6 +2302,14 @@ QFontInfo &QFontInfo::operator=(const QFontInfo &fi)
}
/*!
+ \fn void QFontInfo::swap(QFontInfo &other)
+ \since 5.0
+
+ Swaps this font info instance with \a other. This function is very
+ fast and never fails.
+*/
+
+/*!
Returns the family name of the matched window system font.
\sa QFont::family()
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 5e2fd5227b..38086a989d 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -161,6 +161,9 @@ public:
QFont(const QFont &);
~QFont();
+ void swap(QFont &other)
+ { qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); }
+
QString family() const;
void setFamily(const QString &);
diff --git a/src/gui/text/qfontinfo.h b/src/gui/text/qfontinfo.h
index edaed281fe..c0c478f0c2 100644
--- a/src/gui/text/qfontinfo.h
+++ b/src/gui/text/qfontinfo.h
@@ -59,6 +59,8 @@ public:
QFontInfo &operator=(const QFontInfo &);
+ void swap(QFontInfo &other) { qSwap(d, other.d); }
+
QString family() const;
QString styleName() const;
int pixelSize() const;
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 22b9038524..41e561bf7a 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -214,6 +214,14 @@ QFontMetrics &QFontMetrics::operator=(const QFontMetrics &fm)
}
/*!
+ \fn void QFontMetrics::swap(QFontMetrics &other)
+ \since 5.0
+
+ Swaps this font metrics instance with \a other. This function is
+ very fast and never fails.
+*/
+
+/*!
Returns true if \a other is equal to this object; otherwise
returns false.
@@ -1005,6 +1013,16 @@ QFontMetricsF &QFontMetricsF::operator=(const QFontMetrics &other)
}
/*!
+ \fn void QFontMetricsF::swap(QFontMetricsF &other)
+ \since 5.0
+
+ Swaps this font metrics instance with \a other. This function is
+ very fast and never fails.
+*/
+
+
+
+/*!
Constructs a font metrics object for \a font.
The font metrics will be compatible with the paintdevice used to
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index e48460ffd0..3de7011cde 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -72,6 +72,8 @@ public:
{ qSwap(d, other.d); return *this; }
#endif
+ void swap(QFontMetrics &other) { qSwap(d, other.d); }
+
int ascent() const;
int descent() const;
int height() const;
@@ -139,6 +141,9 @@ public:
inline QFontMetricsF &operator=(QFontMetricsF &&other)
{ qSwap(d, other.d); return *this; }
#endif
+
+ void swap(QFontMetricsF &other) { qSwap(d, other.d); }
+
qreal ascent() const;
qreal descent() const;
qreal height() const;
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index c298893002..b3191891ae 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -153,6 +153,14 @@ QGlyphRun &QGlyphRun::operator=(const QGlyphRun &other)
}
/*!
+ \fn void QGlyphRun::swap(QGlyphRun &other)
+ \since 5.0
+
+ Swaps this glyph run instance with \a other. This function is very
+ fast and never fails.
+*/
+
+/*!
Compares \a other to this QGlyphRun object. Returns true if the list of glyph indexes,
the list of positions and the font are all equal, otherwise returns false.
*/
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index b590775d8b..8188e13e27 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -71,6 +71,8 @@ public:
QGlyphRun(const QGlyphRun &other);
~QGlyphRun();
+ void swap(QGlyphRun &other) { qSwap(d, other.d); }
+
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 468ab4e8cb..7148edf304 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -186,6 +186,14 @@ QRawFont &QRawFont::operator=(const QRawFont &other)
}
/*!
+ \fn void QRawFont::operator=(QRawFont &other)
+ \since 5.0
+
+ Swaps this raw font with \a other. This function is very fast and
+ never fails.
+*/
+
+/*!
Returns true if the QRawFont is valid and false otherwise.
*/
bool QRawFont::isValid() const
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index 870e714340..35a17675f0 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -81,6 +81,8 @@ public:
QRawFont &operator=(const QRawFont &other);
+ void swap(QRawFont &other) { qSwap(d, other.d); }
+
bool operator==(const QRawFont &other) const;
inline bool operator!=(const QRawFont &other) const
{ return !operator==(other); }
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 534ba8345e..775051bc9c 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -224,6 +224,14 @@ QStaticText &QStaticText::operator=(const QStaticText &other)
}
/*!
+ \fn void QStaticText::swap(QStaticText &other)
+ \since 5.0
+
+ Swaps this static text instance with \a other. This function is
+ very fast and never fails.
+*/
+
+/*!
Compares \a other to this QStaticText. Returns true if the texts, fonts and text widths
are equal.
*/
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index a67d4ca595..6f9c9d8526 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -69,6 +69,8 @@ public:
QStaticText(const QStaticText &other);
~QStaticText();
+ void swap(QStaticText &other) { qSwap(data, other.data); }
+
void setText(const QString &text);
QString text() const;
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index 1beff17e8d..2beda0d223 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1119,6 +1119,14 @@ QTextCursor &QTextCursor::operator=(const QTextCursor &cursor)
}
/*!
+ \fn void QTextCursor::swap(QTextCursor &other)
+ \since 5.0
+
+ Swaps this text cursor instance with \a other. This function is
+ very fast and never fails.
+*/
+
+/*!
Destroys the QTextCursor.
*/
QTextCursor::~QTextCursor()
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index bf7c4a8787..f9441daf6d 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -79,6 +79,8 @@ public:
QTextCursor &operator=(const QTextCursor &other);
~QTextCursor();
+ void swap(QTextCursor &other) { qSwap(d, other.d); }
+
bool isNull() const;
enum MoveMode {
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index d8c7a4c52f..4dd7b285c9 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -796,6 +796,14 @@ QTextFormat &QTextFormat::operator=(const QTextFormat &rhs)
}
/*!
+ \fn void QTextFormat::swap(QTextFormat &other)
+ \since 5.0
+
+ Swaps this text format with \a other. This function is very fast
+ and never fails.
+*/
+
+/*!
Destroys this text format.
*/
QTextFormat::~QTextFormat()
diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h
index 6843995124..58525a3dd0 100644
--- a/src/gui/text/qtextformat.h
+++ b/src/gui/text/qtextformat.h
@@ -291,6 +291,9 @@ public:
QTextFormat &operator=(const QTextFormat &rhs);
~QTextFormat();
+ void swap(QTextFormat &other)
+ { qSwap(d, other.d); qSwap(format_type, other.format_type); }
+
void merge(const QTextFormat &other);
inline bool isValid() const { return type() != InvalidFormat; }