KTextWidgets
krichtextwidget.cpp
206 d->action_text_foreground_color = new QAction(QIcon::fromTheme(QStringLiteral("format-stroke-color")), i18nc("@action", "Text &Color…"), this);
220 d->action_text_background_color = new QAction(QIcon::fromTheme(QStringLiteral("format-fill-color")), i18nc("@action", "Text &Highlight…"), this);
236 connect(d->action_font_family, &KSelectAction::textTriggered, this, &KRichTextWidget::setFontFamily);
246 connect(d->action_font_size, &KFontSizeAction::fontSizeChanged, this, &KRichTextEdit::setFontSize);
252 d->action_text_bold = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-bold")), i18nc("@action boldify selected text", "&Bold"), this);
266 new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-italic")), i18nc("@action italicize selected text", "&Italic"), this);
280 new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-underline")), i18nc("@action underline selected text", "&Underline"), this);
293 d->action_text_strikeout = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-strikethrough")), i18nc("@action", "&Strike Out"), this);
307 d->action_align_left = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-left")), i18nc("@action", "Align &Left"), this);
313 d->action_align_center = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-center")), i18nc("@action", "Align &Center"), this);
319 d->action_align_right = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-right")), i18nc("@action", "Align &Right"), this);
325 d->action_align_justify = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-justify-fill")), i18nc("@action", "&Justify"), this);
344 d->action_direction_ltr = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-direction-ltr")), i18nc("@action", "Left-to-Right"), this);
350 d->action_direction_rtl = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-direction-rtl")), i18nc("@action", "Right-to-Left"), this);
365 d->action_list_style = new KSelectAction(QIcon::fromTheme(QStringLiteral("format-list-unordered")), i18nc("@title:menu", "List Style"), this);
396 d->action_list_indent = new QAction(QIcon::fromTheme(QStringLiteral("format-indent-more")), i18nc("@action", "Increase Indent"), this);
408 d->action_list_dedent = new QAction(QIcon::fromTheme(QStringLiteral("format-indent-less")), i18nc("@action", "Decrease Indent"), this);
420 d->action_insert_horizontal_rule = new QAction(QIcon::fromTheme(QStringLiteral("insert-horizontal-rule")), i18nc("@action", "Insert Rule Line"), this);
423 connect(d->action_insert_horizontal_rule, &QAction::triggered, this, &KRichTextEdit::insertHorizontalRule);
429 d->action_manage_link = new QAction(QIcon::fromTheme(QStringLiteral("insert-link")), i18nc("@action", "Link"), this);
441 d->action_format_painter = new KToggleAction(QIcon::fromTheme(QStringLiteral("draw-brush")), i18nc("@action", "Format Painter"), this);
462 d->action_text_subscript = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-subscript")), i18nc("@action", "Subscript"), this);
467 d->action_text_superscript = new KToggleAction(QIcon::fromTheme(QStringLiteral("format-text-superscript")), i18nc("@action", "Superscript"), this);
470 connect(d->action_text_superscript, &QAction::triggered, this, &KRichTextEdit::setTextSuperScript);
636 const QColor selectedColor = QColorDialog::getColor(currentColor.isValid() ? currentColor : defaultColor, q);
653 const QColor selectedColor = QColorDialog::getColor(currentColor.isValid() ? currentColor : defaultColor, q);
705 q->viewport()->setCursor(QCursor(QIcon::fromTheme(QStringLiteral("draw-brush")).pixmap(32, 32), 0, 32));
The KRichTextEdit class provides a widget to edit and display rich text.
Definition krichtextedit.h:51
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 insertHorizontalRule()
Inserts a horizontal rule below the current block.
Definition krichtextedit.cpp:122
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 setTextUnderline(bool underline)
Toggles the underline formatting of the current word or selection at the current cursor position.
Definition krichtextedit.cpp:222
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 makeLeftToRight()
Sets the direction of the current block to Left-To-Right.
Definition krichtextedit.cpp:187
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
void alignCenter()
Sets the alignment of the current block to Centered.
Definition krichtextedit.cpp:147
QFlags< RichTextSupportValues > RichTextSupport
Stores a combination of RichTextSupportValues values.
Definition krichtextwidget.h:235
void setActionsEnabled(bool enabled)
Disables or enables all of the actions created by createActions().
Definition krichtextwidget.cpp:515
void updateActionStates()
Tells KRichTextWidget to update the state of the actions created by createActions().
Definition krichtextwidget.cpp:713
void setRichTextSupport(const KRichTextWidget::RichTextSupport &support)
Sets the supported rich text subset available.
@ SupportTextBackgroundColor
Action to change the background color of the currently selected text.
Definition krichtextwidget.h:121
@ SupportFontFamily
Action to change the font family of the currently selected text.
Definition krichtextwidget.h:96
@ SupportDirection
Action to change direction of text to Right-To-Left or Left-To-Right.
Definition krichtextwidget.h:214
@ SupportHeading
Action to make the current line a heading (up to six levels, corresponding to HTML h1....
Definition krichtextwidget.h:225
@ SupportDedentLists
Action to decrease the current list nesting level.
Definition krichtextwidget.h:147
@ SupportHyperlinks
Action to convert the current text to a hyperlink.
Definition krichtextwidget.h:186
@ SupportChangeListStyle
Action to make the current line a list element, change the list style or remove list formatting.
Definition krichtextwidget.h:136
@ SupportToPlainText
Action to change the text of the whole text edit to plain text.
Definition krichtextwidget.h:199
@ SupportFontSize
Action to change the font size of the currently selected text.
Definition krichtextwidget.h:105
@ SupportTextForegroundColor
Action to change the text color of the currently selected text.
Definition krichtextwidget.h:113
@ SupportFormatPainting
Action to make the mouse cursor a format painter.
Definition krichtextwidget.h:193
@ SupportAlignment
Actions to align the current paragraph left, righ, center or justify.
Definition krichtextwidget.h:172
@ SupportSuperScriptAndSubScript
Actions to format text as superscript or subscript.
Definition krichtextwidget.h:207
@ SupportIndentLists
Action to increase the current list nesting level.
Definition krichtextwidget.h:142
virtual QList< QAction * > createActions()
Creates the actions and adds them to the given action collection.
void indexTriggered(int index)
void textTriggered(const QString &text)
bool event(QEvent *) override
Reimplemented to catch "delete word" shortcut events.
Definition ktextedit.cpp:298
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QCA_EXPORT void init()
virtual void mouseReleaseEvent(QMouseEvent *e) override
void toggled(bool checked)
void triggered(bool checked)
QAction * addAction(QAction *action)
const QColor & color() const const
bool isValid() const const
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, ColorDialogOptions options)
void accepted()
bool bold() const const
QString family() const const
bool italic() const const
int pointSize() const const
void setBold(bool enable)
void setItalic(bool enable)
void setStrikeOut(bool enable)
void setUnderline(bool enable)
bool strikeOut() const const
bool underline() const const
QIcon fromTheme(const QString &name)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
Active
Text
typedef Alignment
IBeamCursor
Key_B
LayoutDirection
CTRL
WA_DeleteOnClose
VerticalAlignment
QFont font() const const
VerticalAlignment verticalAlignment() const const
void setCharFormat(const QTextCharFormat &format)
QTextCharFormat currentCharFormat() const const
void currentCharFormatChanged(const QTextCharFormat &f)
void cursorPositionChanged()
void setFontFamily(const QString &fontFamily)
void setTextCursor(const QTextCursor &cursor)
QTextCursor textCursor() const const
QBrush background() const const
enabled
QStyle * style() const const
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.