8#include <QtQuick/private/qquicktextcontrol_p.h>
9#include <QtQuick/private/qquicktextcontrol_p_p.h>
10#include <QtQuick/private/qquicktextedit_p_p.h>
47 this, &QQuickTextSelection::updateFromCharFormat);
49 this, &QQuickTextSelection::updateFromBlockFormat);
68 if (cur.selectedText() ==
text)
90 if (cur.selection().isEmpty())
93 if (
font == cur.charFormat().font())
98 cur.mergeCharFormat(
fmt);
117 if (cur.selection().isEmpty())
120 if (
color == cur.charFormat().foreground().color())
125 cur.mergeCharFormat(
fmt);
167 if (
fmt.font() != m_charFormat.
font())
175inline void QQuickTextSelection::updateFromBlockFormat()
187#include "moc_qquicktextselection_p.cpp"
const QColor & color() const
Returns the brush color.
The QColor class provides colors based on RGB, HSV or CMYK values.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void currentCharFormatChanged(const QTextCharFormat &format)
void cursorPositionChanged()
QTextCursor textCursor() const
static QQuickTextEditPrivate * get(QQuickTextEdit *item)
void setColor(QColor color)
void setFont(const QFont &font)
QQuickTextSelection(QObject *parent=nullptr)
\qmltype TextSelection \instantiates QQuickTextSelection \inqmlmodule QtQuick
void setText(const QString &text)
void setAlignment(Qt::Alignment align)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Qt::Alignment alignment() const
Returns the paragraph's alignment.
void setAlignment(Qt::Alignment alignment)
Sets the paragraph's alignment.
QFont font() const
Returns the font for this character format.
void setFont(const QFont &font, FontPropertiesInheritanceBehavior behavior=FontPropertiesAll)
\reentrant \inmodule QtGui
QString selectedText() const
Returns the current selection's text (which may be empty).
QTextBlockFormat blockFormat() const
Returns the block format of the block the cursor is in.
QTextCharFormat charFormat() const
Returns the format of the character immediately before the cursor position().
void mergeBlockFormat(const QTextBlockFormat &modifier)
Modifies the block format of the current block (or all blocks that are contained in the selection) wi...
void setForeground(const QBrush &brush)
Sets the foreground brush to the specified brush.
QBrush foreground() const
Returns the brush used to render foreground details, such as text, frame outlines,...
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum format
QVideoFrameFormat::PixelFormat fmt
QGraphicsWidget * textEdit