|  | Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions |

# Qt 3 Support Members for QTextEdit

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

- QTextEdit class reference

### Public Types

- 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 )
- int pointSize () const
- QString selectedText () const
- void setBold ( bool b )
- void setFamily ( const QString & family )
- void setItalic ( bool i )
- void setPointSize ( int size )
- void setText ( const QString & text )
- void setTextFormat ( Qt::TextFormat f )
- void setUnderline ( bool b )
- void sync ()
- QString text () const
- Qt::TextFormat textFormat () const
- bool underline () const

- 60 public functions inherited from QWidget
- 8 public functions inherited from QObject
- 8 public functions inherited from QPaintDevice

### Public Slots

- void redo () const
- void setColor ( const QColor & color )
- void setModified ( bool m = true )
- void undo () const

- 1 public slot inherited from QWidget

### Signals

- void currentColorChanged ( const QColor & color )
- void currentFontChanged ( const QFont & font )
- void redoAvailable ( bool b )
- void textChanged ()
- void undoAvailable ( bool b )

## Member Type Documentation

### enum QTextEdit::KeyboardAction

Constant | Value
--- | ---
`QTextEdit::ActionBackspace` | `0`
`QTextEdit::ActionDelete` | `1`
`QTextEdit::ActionReturn` | `2`
`QTextEdit::ActionKill` | `3`
`QTextEdit::ActionWordBackspace` | `4`
`QTextEdit::ActionWordDelete` | `5`

## 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.

### QColor QTextEdit::color () const

Use textColor() instead.

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

Use currentCharFormatChanged() instead.

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

Use currentCharFormatChanged() instead.

### void QTextEdit::doKeyboardAction ( KeyboardAction action )

Executes keyboard action action.

Use the QTextCursor API instead.

See also textCursor().

### QString QTextEdit::family () const

Use fontFamily() instead.

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

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

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.

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

Use the QTextCursor() class instead.

### int QTextEdit::pointSize () const

Use int(fontPointSize()+0.5) instead.

### void QTextEdit::redo () const `[slot]`

Redoes the last operation.

If there is no operation to redo, i.e. there is no redo step in the undo/redo history, nothing happens.

See also undo().

### void QTextEdit::redoAvailable ( bool b ) `[signal]`

###

### QString QTextEdit::selectedText () const

Use textCursor().selectedText() instead.

### void QTextEdit::setBold ( bool b )

Use setFontWeight() instead.

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

Use setTextColor() instead.

### void QTextEdit::setFamily ( const QString & family )

Use setFontFamily() instead.

### void QTextEdit::setItalic ( bool i )

Use setFontItalic() instead.

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

Use document->setModified() instead.

### void QTextEdit::setPointSize ( int size )

Use setFontPointSize() instead.

### void QTextEdit::setText ( const QString & text )

Sets the text edit's text. The text can be plain text or HTML and the text edit will try to guess the right format.

Use setHtml() or setPlainText() directly to avoid text edit's guessing.

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

Sets the text format to format f.

See also textFormat().

### void QTextEdit::setUnderline ( bool b )

Use setFontUnderline() instead.

### void QTextEdit::sync ()

Does nothing.

### QString QTextEdit::text () const

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

### void QTextEdit::textChanged () `[signal]`

###

### Qt::TextFormat QTextEdit::textFormat () const

Returns the text format.

See also setTextFormat().

### bool QTextEdit::underline () const

Use fontUnderline() instead.

### void QTextEdit::undo () const `[slot]`

Undoes the last operation.

If there is no operation to undo, i.e. there is no undo step in the undo/redo history, nothing happens.

See also redo().

### void QTextEdit::undoAvailable ( bool b ) `[signal]`

###