diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index b0e64a6ea3a..39768076256 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -642,16 +642,10 @@ QTextFrame::iterator QTextFrame::end() const } /*! + \fn QTextFrame::iterator::iterator() + Constructs an invalid iterator. */ -QTextFrame::iterator::iterator() -{ - f = nullptr; - b = 0; - e = 0; - cf = nullptr; - cb = 0; -} /*! \internal @@ -665,36 +659,6 @@ QTextFrame::iterator::iterator(QTextFrame *frame, int block, int begin, int end) cb = block; } -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - -/*! - Copy constructor. Constructs a copy of the \a other iterator. -*/ -QTextFrame::iterator::iterator(const iterator &other) noexcept -{ - f = other.f; - b = other.b; - e = other.e; - cf = other.cf; - cb = other.cb; -} - -/*! - Assigns \a other to this iterator and returns a reference to - this iterator. -*/ -QTextFrame::iterator &QTextFrame::iterator::operator=(const iterator &other) noexcept -{ - f = other.f; - b = other.b; - e = other.e; - cf = other.cf; - cb = other.cb; - return *this; -} - -#endif - /*! Returns the current frame pointed to by the iterator, or \nullptr if the iterator currently points to a block. diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h index 22e5e4e593e..ac82eb13d7e 100644 --- a/src/gui/text/qtextobject.h +++ b/src/gui/text/qtextobject.h @@ -136,27 +136,18 @@ public: QTextFrame *parentFrame() const; class Q_GUI_EXPORT iterator { - QTextFrame *f; - int b; - int e; - QTextFrame *cf; - int cb; + QTextFrame *f = nullptr; + int b = 0; + int e = 0; + QTextFrame *cf = nullptr; + int cb = 0; friend class QTextFrame; friend class QTextTableCell; friend class QTextDocumentLayoutPrivate; iterator(QTextFrame *frame, int block, int begin, int end); public: - iterator(); // ### Qt 6: inline -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - iterator(const iterator &o) noexcept; // = default - iterator &operator=(const iterator &o) noexcept; // = default - iterator(iterator &&other) noexcept // = default - { memcpy(static_cast(this), static_cast(&other), sizeof(iterator)); } - iterator &operator=(iterator &&other) noexcept // = default - { memcpy(static_cast(this), static_cast(&other), sizeof(iterator)); return *this; } -#endif - + constexpr iterator() noexcept = default; QTextFrame *parentFrame() const { return f; } QTextFrame *currentFrame() const;