Compatibility Members for QTextEdit

The following members of class QTextEditare part of the Qt compatibility layer. We advise against using them in new code.

Public Types

enum CursorAction { MoveBackward, MoveForward, MoveWordBackward, MoveWordForward, ..., MovePageDown }
enum KeyboardAction { ActionBackspace, ActionDelete, ActionReturn, ActionKill, ActionWordBackspace, ActionWordDelete }

Public Functions

QTextEdit(QWidget * parent, const char * name)
bool bold() const
QColor color() const
void doKeyboardAction(KeyboardAction action)
QString family() const
bool find(const QString & exp, bool cs, bool wo)
bool hasSelectedText() const
void insert(const QString & text)
bool isModified() const
bool isRedoAvailable() const
bool isUndoAvailable() const
bool italic() const
void moveCursor(CursorAction action, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor)
void moveCursor(CursorAction action, bool select)
int pointSize() const
void redo() const
QString selectedText() const
void setBold(bool b)
void setFamily(const QString & family)
void setItalic(bool i)
void setPointSize(int size)
void setTextFormat(Qt::TextFormat f)
void setUnderline(bool b)
void sync()
QString text() const
Qt::TextFormat textFormat() const
bool underline() const
void undo() const
  • 57 public functions inherited from QWidget
  • 8 public functions inherited from QObject
  • 8 public functions inherited from QPaintDevice

Public Slots

void setColor(const QColor & color)
void setModified(bool m = true)
  • 1 public slot inherited from QWidget


void currentColorChanged(const QColor & color)
void currentFontChanged(const QFont & font)

Member Type Documentation

enum QTextEdit::CursorAction


enum QTextEdit::KeyboardAction


Member Function Documentation

QTextEdit::QTextEdit(QWidget * parent, const char * name)

Use one of the constructors that doesn't take the name argument and then use setObjectName() instead.

bool QTextEdit::bold() const

Use fontWeight() >= QFont::Bold instead.

See also setBold().

QColor QTextEdit::color() const

Use textColor() instead.

See also setColor().

[signal] void QTextEdit::currentColorChanged(const QColor & color)

Use currentCharFormatChanged() instead.

[signal] void QTextEdit::currentFontChanged(const QFont & font)

Use currentCharFormatChanged() instead.

void QTextEdit::doKeyboardAction(KeyboardAction action)

Executes keyboard action action.

Use the QTextCursor class instead.

See also textCursor().

QString QTextEdit::family() const

Use fontFamily() instead.

See also setFamily().

bool QTextEdit::find(const QString & exp, bool cs, bool wo)

Use the find() overload that takes a QTextDocument::FindFlags argument.

bool QTextEdit::hasSelectedText() const

Use textCursor().hasSelection() instead.

void QTextEdit::insert(const QString & text)

Use insertPlainText() instead.

bool QTextEdit::isModified() const

Use document()->isModified() instead.

bool QTextEdit::isRedoAvailable() const

Use document()->isRedoAvailable() instead.

bool QTextEdit::isUndoAvailable() const

Use document()->isUndoAvailable() instead.

bool QTextEdit::italic() const

Use fontItalic() instead.

See also setItalic().

void QTextEdit::moveCursor(CursorAction action, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor)

Use the QTextCursor class instead.

void QTextEdit::moveCursor(CursorAction action, bool select)

Use the QTextCursor class instead.

int QTextEdit::pointSize() const

Use int(fontPointSize()+0.5) instead.

See also setPointSize().

void QTextEdit::redo() const

This is an overloaded function.

Use the non-const overload instead.

QString QTextEdit::selectedText() const

Use textCursor().selectedText() instead.

void QTextEdit::setBold(bool b)

Use setFontWeight() instead.

See also bold().

[slot] void QTextEdit::setColor(const QColor & color)

Use setTextColor() instead.

See also color().

void QTextEdit::setFamily(const QString & family)

Use setFontFamily() instead.

See also family().

void QTextEdit::setItalic(bool i)

Use setFontItalic() instead.

See also italic().

[slot] void QTextEdit::setModified(bool m = true)

Use document->setModified() instead.

See also isModified().

void QTextEdit::setPointSize(int size)

Use setFontPointSize() instead.

See also pointSize().

void QTextEdit::setTextFormat(Qt::TextFormat f)

Sets the text format to format f.

See also textFormat().

void QTextEdit::setUnderline(bool b)

Use setFontUnderline() instead.

See also underline().

void QTextEdit::sync()

Does nothing.

QString QTextEdit::text() const

Returns all the text in the text edit as plain text.

See also setText().

Qt::TextFormat QTextEdit::textFormat() const

Returns the text format.

See also setTextFormat().

bool QTextEdit::underline() const

Use fontUnderline() instead.

See also setUnderline().

void QTextEdit::undo() const

This is an overloaded function.

Use the non-const overload instead.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.