Clean up special functions for QTextFrame::iterator
Member initialization syntax allows declaring now inline default constructor as default. Remove copy/move/assignment operators, which had already been disabled. Change-Id: Ie407e65aa39c72f5e6436a6beaf9323663f78cfc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
84e76c37a5
commit
ea09e2f466
@ -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.
|
||||
|
@ -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<void *>(this), static_cast<void *>(&other), sizeof(iterator)); }
|
||||
iterator &operator=(iterator &&other) noexcept // = default
|
||||
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); return *this; }
|
||||
#endif
|
||||
|
||||
constexpr iterator() noexcept = default;
|
||||
QTextFrame *parentFrame() const { return f; }
|
||||
|
||||
QTextFrame *currentFrame() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user