3#include <QtCore/qtextboundaryfinder.h>
4#include <QtCore/qvarlengtharray.h>
6#include <private/qunicodetools_p.h>
15 QUnicodeTools::CharAttributeOptions options;
118 if (
other.attributes) {
134 if (
other.attributes) {
148 if (
other.attributes) {
153 attributes =
nullptr;
183 init(
t, sv, attributes);
223 init(
t, sv, attributes);
303 if (!attributes || pos < 0 || pos >= sv.
size()) {
338 if (!attributes || pos <= 0 || pos > sv.
size()) {
346 while (pos > 0 && !attributes[pos].graphemeBoundary)
350 while (pos > 0 && !attributes[pos].wordBreak)
354 while (pos > 0 && !attributes[pos].sentenceBoundary)
358 while (pos > 0 && !attributes[pos].
lineBreak)
371 if (!attributes || pos < 0 || pos > sv.
size())
383 return attributes[pos].
lineBreak || pos == 0;
394 if (!attributes || pos < 0 || pos > sv.
size())
403 reasons &= (~EndOfItem);
404 else if (pos == sv.
size())
421 reasons &= (~EndOfItem);
422 else if (pos == sv.
size())
433 reasons &= (~EndOfItem);
434 else if (pos == sv.
size())
constexpr char16_t unicode() const noexcept
Returns the numeric Unicode value of the QChar.
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
constexpr qsizetype size() const noexcept
Returns the size of this string view, in UTF-16 code units (that is, surrogate pairs count as two for...
const_pointer data() const noexcept
QString toString() const
Returns a deep copy of this string view's data as a QString.
\macro QT_RESTRICTED_CAST_FROM_ASCII
BoundaryReasons boundaryReasons() const
Returns the reasons for the boundary finder to have chosen the current position as a boundary.
QString string() const
Returns the string the QTextBoundaryFinder object operates on.
void setPosition(qsizetype position)
Sets the current position of the QTextBoundaryFinder to position.
~QTextBoundaryFinder()
Destructs the QTextBoundaryFinder object.
QTextBoundaryFinder & operator=(const QTextBoundaryFinder &other)
Assigns the object, other, to another QTextBoundaryFinder object.
qsizetype toNextBoundary()
Moves the QTextBoundaryFinder to the next boundary position and returns that position.
QTextBoundaryFinder()
Constructs an invalid QTextBoundaryFinder object.
qsizetype toPreviousBoundary()
Moves the QTextBoundaryFinder to the previous boundary position and returns that position.
void toStart()
Moves the finder to the start of the string.
void toEnd()
Moves the finder to the end of the string.
bool isAtBoundary() const
Returns true if the object's position() is currently at a valid text boundary.
qsizetype position() const
Returns the current position of the QTextBoundaryFinder.
BoundaryType
\value Grapheme Finds a grapheme which is the smallest boundary.
constexpr size_type size() const noexcept
Combined button and popup list for selecting options.
constexpr const T & qBound(const T &min, const T &val, const T &max)
GLsizei const GLchar *const * string
[0]
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static QString lineBreak(QString s)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
Q_CHECK_PTR(a=new int[80])