KTextWidgets
krichtextedit.cpp
53 if (!cursor.hasSelection() && cursor.position() != wordStart.position() && cursor.position() != wordEnd.position()) {
326 fmt.setVerticalAlignment(superscript ? QTextCharFormat::AlignSuperScript : QTextCharFormat::AlignNormal);
337 fmt.setVerticalAlignment(subscript ? QTextCharFormat::AlignSubScript : QTextCharFormat::AlignNormal);
510 format.setUnderlineColor(KColorScheme(QPalette::Active, KColorScheme::View).foreground(KColorScheme::LinkText).color());
511 format.setForeground(KColorScheme(QPalette::Active, KColorScheme::View).foreground(KColorScheme::LinkText).color());
560 && (textCursor().blockFormat().headingLevel() != textCursor().block().previous().blockFormat().headingLevel()))
562 && (textCursor().blockFormat().headingLevel() != textCursor().block().next().blockFormat().headingLevel()))) {
633 static const QRegularExpression EMPTYLINEREGEX(QStringLiteral("<p style=\"-qt-paragraph-type:empty;(.*?)</p>"));
635 static const QString OLLISTPATTERNQT = QStringLiteral("<ol style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px;");
637 static const QString ULLISTPATTERNQT = QStringLiteral("<ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px;");
639 static const QString ORDEREDLISTHTML = QStringLiteral("<ol style=\"margin-top: 0px; margin-bottom: 0px;");
641 static const QString UNORDEREDLISTHTML = QStringLiteral("<ul style=\"margin-top: 0px; margin-bottom: 0px;");
LinkText
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:316
void setTextStrikeOut(bool strikeOut)
Toggles the strikeout formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:234
void setTextSubScript(bool subscript)
Toggles the subscript formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:332
void alignRight()
Sets the alignment of the current block to Right Aligned.
Definition krichtextedit.cpp:157
void setTextForegroundColor(const QColor &color)
Sets the foreground color of the current word or selection to color.
Definition krichtextedit.cpp:245
void setTextBackgroundColor(const QColor &color)
Sets the background color of the current word or selection to color.
Definition krichtextedit.cpp:256
void insertHorizontalRule()
Inserts a horizontal rule below the current block.
Definition krichtextedit.cpp:123
bool canDedentList() const
Returns true if the list item at the current position can be dedented.
Definition krichtextedit.cpp:616
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:426
void setFont(const QFont &font)
Sets the current word or selection to the font font.
Definition krichtextedit.cpp:289
void alignJustify()
Sets the alignment of the current block to Justified.
Definition krichtextedit.cpp:166
void switchToPlainText()
This will switch the editor to plain text mode.
Definition krichtextedit.cpp:300
void setTextOrHtml(const QString &text)
Replaces all the content of the text edit with the given string.
Definition krichtextedit.cpp:410
void setTextUnderline(bool underline)
Toggles the underline formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:223
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:343
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:623
void selectLinkText() const
Convenience function to select the link text using the active cursor.
Definition krichtextedit.cpp:434
void setFontSize(int size)
Sets the current word or selection to the font size size.
Definition krichtextedit.cpp:278
void indentListLess()
Decreases the nesting level of the current block or selected blocks.
Definition krichtextedit.cpp:116
void setFontFamily(const QString &fontFamily)
Sets the current word or selection to the font family fontFamily.
Definition krichtextedit.cpp:267
void makeLeftToRight()
Sets the direction of the current block to Left-To-Right.
Definition krichtextedit.cpp:188
KRichTextEdit(const QString &text, QWidget *parent=nullptr)
Constructs a KRichTextEdit object.
Definition krichtextedit.cpp:61
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:480
void setListStyle(int _styleIndex)
Sets the list style of the current list, or creates a new list using the current block.
Definition krichtextedit.cpp:99
void indentListMore()
Increases the nesting level of the current block or selected blocks.
Definition krichtextedit.cpp:108
void alignLeft()
Sets the alignment of the current block to Left Aligned.
Definition krichtextedit.cpp:139
void setTextSuperScript(bool superscript)
Toggles the superscript formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:321
void setTextBold(bool bold)
Toggles the bold formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:201
void setTextItalic(bool italic)
Toggles the italic formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:212
void makeRightToLeft()
Sets the direction of the current block to Right-To-Left.
Definition krichtextedit.cpp:175
bool canIndentList() const
Returns true if the list item at the current position can be indented.
Definition krichtextedit.cpp:609
void alignCenter()
Sets the alignment of the current block to Centered.
Definition krichtextedit.cpp:148
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:485
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
Active
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
void setFocus()
size
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:47:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:47:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.