KTextWidgets
krichtextedit.cpp
52 if (!cursor.hasSelection() && cursor.position() != wordStart.position() && cursor.position() != wordEnd.position()) {
325 fmt.setVerticalAlignment(superscript ? QTextCharFormat::AlignSuperScript : QTextCharFormat::AlignNormal);
336 fmt.setVerticalAlignment(subscript ? QTextCharFormat::AlignSubScript : QTextCharFormat::AlignNormal);
559 && (textCursor().blockFormat().headingLevel() != textCursor().block().previous().blockFormat().headingLevel()))
561 && (textCursor().blockFormat().headingLevel() != textCursor().block().next().blockFormat().headingLevel()))) {
632 static const QRegularExpression EMPTYLINEREGEX(QStringLiteral("<p style=\"-qt-paragraph-type:empty;(.*?)</p>"));
634 static const QString OLLISTPATTERNQT = QStringLiteral("<ol style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px;");
636 static const QString ULLISTPATTERNQT = QStringLiteral("<ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px;");
638 static const QString ORDEREDLISTHTML = QStringLiteral("<ol style=\"margin-top: 0px; margin-bottom: 0px;");
640 static const QString UNORDEREDLISTHTML = QStringLiteral("<ul style=\"margin-top: 0px; margin-bottom: 0px;");
static void setAutoHideCursor(QWidget *w, bool enable, bool customEventFilter=false)
The KRichTextEdit class provides a widget to edit and display rich text.
Definition krichtextedit.h:51
void insertPlainTextImplementation()
Definition krichtextedit.cpp:315
void setTextStrikeOut(bool strikeOut)
Toggles the strikeout formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:233
void setTextSubScript(bool subscript)
Toggles the subscript formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:331
void alignRight()
Sets the alignment of the current block to Right Aligned.
Definition krichtextedit.cpp:156
void setTextForegroundColor(const QColor &color)
Sets the foreground color of the current word or selection to color.
Definition krichtextedit.cpp:244
void setTextBackgroundColor(const QColor &color)
Sets the background color of the current word or selection to color.
Definition krichtextedit.cpp:255
void insertHorizontalRule()
Inserts a horizontal rule below the current block.
Definition krichtextedit.cpp:122
bool canDedentList() const
Returns true if the list item at the current position can be dedented.
Definition krichtextedit.cpp:615
QString currentLinkText() const
Returns the text of the link at the current position or an empty string if the cursor is not on a lin...
Definition krichtextedit.cpp:425
void setFont(const QFont &font)
Sets the current word or selection to the font font.
Definition krichtextedit.cpp:288
void alignJustify()
Sets the alignment of the current block to Justified.
Definition krichtextedit.cpp:165
void switchToPlainText()
This will switch the editor to plain text mode.
Definition krichtextedit.cpp:299
void setTextOrHtml(const QString &text)
Replaces all the content of the text edit with the given string.
Definition krichtextedit.cpp:409
void setTextUnderline(bool underline)
Toggles the underline formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:222
void textModeChanged(KRichTextEdit::Mode mode)
Emitted whenever the text mode is changed.
void setHeadingLevel(int level)
Sets the heading level of a current block or selection.
Definition krichtextedit.cpp:342
QString toCleanHtml() const
This will clean some of the bad html produced by the underlying QTextEdit It walks over all lines and...
Definition krichtextedit.cpp:622
void selectLinkText() const
Convenience function to select the link text using the active cursor.
Definition krichtextedit.cpp:433
void setFontSize(int size)
Sets the current word or selection to the font size size.
Definition krichtextedit.cpp:277
void indentListLess()
Decreases the nesting level of the current block or selected blocks.
Definition krichtextedit.cpp:115
void setFontFamily(const QString &fontFamily)
Sets the current word or selection to the font family fontFamily.
Definition krichtextedit.cpp:266
void makeLeftToRight()
Sets the direction of the current block to Left-To-Right.
Definition krichtextedit.cpp:187
KRichTextEdit(const QString &text, QWidget *parent=nullptr)
Constructs a KRichTextEdit object.
Definition krichtextedit.cpp:60
QString currentLinkUrl() const
Returns the URL target (href) of the link at the current position or an empty string if the cursor is...
Definition krichtextedit.cpp:479
void setListStyle(int _styleIndex)
Sets the list style of the current list, or creates a new list using the current block.
Definition krichtextedit.cpp:98
void indentListMore()
Increases the nesting level of the current block or selected blocks.
Definition krichtextedit.cpp:107
void alignLeft()
Sets the alignment of the current block to Left Aligned.
Definition krichtextedit.cpp:138
void setTextSuperScript(bool superscript)
Toggles the superscript formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:320
void setTextBold(bool bold)
Toggles the bold formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:200
void setTextItalic(bool italic)
Toggles the italic formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:211
void makeRightToLeft()
Sets the direction of the current block to Right-To-Left.
Definition krichtextedit.cpp:174
bool canIndentList() const
Returns true if the list item at the current position can be indented.
Definition krichtextedit.cpp:608
void alignCenter()
Sets the alignment of the current block to Centered.
Definition krichtextedit.cpp:147
void updateLink(const QString &linkUrl, const QString &linkText)
Replaces the current selection with a hyperlink with the link URL linkUrl and the link text linkText.
Definition krichtextedit.cpp:484
bool event(QEvent *) override
Reimplemented to catch "delete word" shortcut events.
Definition ktextedit.cpp:298
void keyPressEvent(QKeyEvent *) override
Reimplemented for internal reasons.
Definition ktextedit.cpp:1031
Bold
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
Q_EMITQ_EMIT
QObject * parent() const const
bool isEmpty() const const
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
bool mightBeRichText(const QString &text)
AlignLeft
Key_Backspace
RightToLeft
QTextCharFormat charFormat() const const
int headingLevel() const const
void setHeadingLevel(int level)
SingleUnderline
AlignSuperScript
QString anchorHref() const const
void setAnchor(bool anchor)
void setAnchorHref(const QString &value)
void setFont(const QFont &font, FontPropertiesInheritanceBehavior behavior)
void setFontFamilies(const QStringList &families)
void setFontItalic(bool italic)
void setFontPointSize(qreal size)
void setFontStrikeOut(bool strikeOut)
void setFontUnderline(bool underline)
void setFontWeight(int weight)
void setUnderlineColor(const QColor &color)
void setUnderlineStyle(UnderlineStyle style)
void setVerticalAlignment(VerticalAlignment alignment)
QColor underlineColor() const const
UnderlineStyle underlineStyle() const const
MoveAnchor
StartOfWord
WordUnderCursor
int anchor() const const
void beginEditBlock()
QTextBlockFormat blockFormat() const const
QTextCharFormat charFormat() const const
void endEditBlock()
bool hasSelection() const const
void joinPreviousEditBlock()
void mergeCharFormat(const QTextCharFormat &modifier)
bool movePosition(MoveOperation operation, MoveMode mode, int n)
int position() const const
void select(SelectionType selection)
void setPosition(int pos, MoveMode m)
QTextBlock begin() const const
void setAcceptRichText(bool accept)
void cursorPositionChanged()
document
QString fontFamily() const const
void setHtml(const QString &text)
void setAlignment(Qt::Alignment a)
void setPlainText(const QString &text)
void setTextCursor(const QTextCursor &cursor)
QTextCursor textCursor() const const
QString toPlainText() const const
FontSizeAdjustment
QBrush foreground() const const
void setBackground(const QBrush &brush)
void setForeground(const QBrush &brush)
void setLayoutDirection(Qt::LayoutDirection direction)
void setProperty(int propertyId, const QList< QTextLength > &value)
cursor
font
palette
void setFocus()
size
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:58:19 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:58:19 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.