summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextobject.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-10 15:43:15 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-12 18:29:54 +0000
commit7f48655fb83bbfe394dcc66f11b01bd634aa2388 (patch)
tree7fecab2cd0b76e12e033110f8515d426df34d5c3 /src/gui/text/qtextobject.h
parent6ffb0bdf60cbd592c37ad8104db288a30596c6bf (diff)
QTextFrame::iterator: restore nothrow move special members
The user-defined copy assignment and copy constructors inhibit the move special member functions. We cannot do something about it in Qt 5, because the class is exported (which it shouldn't be), and because making it trivially-copyable might change how it is passed to functions by value, so we need to supply all the missing member functions manually. Change-Id: Ic710b449f6abd386449fa6df71e8bc9bd0f98d2b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qtextobject.h')
-rw-r--r--src/gui/text/qtextobject.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 18df53945c..d3f6b3d0ac 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -148,10 +148,14 @@ public:
friend class QTextDocumentLayoutPrivate;
iterator(QTextFrame *frame, int block, int begin, int end);
public:
- iterator();
+ iterator(); // ### Qt 6: inline
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- iterator(const iterator &o);
- iterator &operator=(const iterator &o);
+ iterator(const iterator &o) Q_DECL_NOTHROW; // = default
+ iterator &operator=(const iterator &o) Q_DECL_NOTHROW; // = default
+ iterator(iterator &&other) Q_DECL_NOTHROW // = default
+ { memcpy(this, &other, sizeof(iterator)); }
+ iterator &operator=(iterator &&other) Q_DECL_NOTHROW // = default
+ { memcpy(this, &other, sizeof(iterator)); return *this; }
#endif
QTextFrame *parentFrame() const { return f; }