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;
181 init(
t, sv, attributes);
219 init(
t, sv, attributes);
286 if (sv.
data() ==
s.unicode() && sv.
size() ==
s.size())
299 if (!attributes || pos < 0 || pos >= sv.
size()) {
334 if (!attributes || pos <= 0 || pos > sv.
size()) {
342 while (pos > 0 && !attributes[pos].graphemeBoundary)
346 while (pos > 0 && !attributes[pos].wordBreak)
350 while (pos > 0 && !attributes[pos].sentenceBoundary)
354 while (pos > 0 && !attributes[pos].
lineBreak)
367 if (!attributes || pos < 0 || pos > sv.
size())
379 return attributes[pos].
lineBreak || pos == 0;
390 if (!attributes || pos < 0 || pos > sv.
size())
399 reasons &= (~EndOfItem);
400 else if (pos == sv.
size())
417 reasons &= (~EndOfItem);
418 else if (pos == sv.
size())
429 reasons &= (~EndOfItem);
430 else if (pos == sv.
size())
432 }
else if (pos > 0 && sv[pos - 1].unicode() == QChar::SoftHyphen) {
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
QChar * data()
Returns a pointer to the data stored in the QString.
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.
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])