- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends

# QTextEdit Class Reference

Search for all occurrences

## Detailed Description

Definition at line 70 of file qtextedit.h.

`#include <qtextedit.h>`

Inheritance diagram for QTextEdit:
[legend]

List of all members.

## Classes
struct | ExtraSelection
## Public Types
enum | LineWrapMode { NoWrap, WidgetWidth, FixedPixelWidth, FixedColumnWidth }
enum | AutoFormattingFlag { AutoNone = 0, AutoBulletList = 0x00000001, AutoAll = 0xffffffff }
## Public Slots
void | setFontPointSize (qreal s)
void | setFontFamily (const QString &fontFamily)
void | setFontWeight (int w)
void | setFontUnderline (bool b)
void | setFontItalic (bool b)
void | setTextColor (const QColor &c)
void | setTextBackgroundColor (const QColor &c)
void | setCurrentFont (const QFont &f)
void | setAlignment (Qt::Alignment a)
void | setPlainText (const QString &text)
void | setHtml (const QString &text)
void | setText (const QString &text)
void | cut ()
void | copy ()
void | paste ()
void | undo ()
void | redo ()
void | clear ()
void | selectAll ()
void | insertPlainText (const QString &text)
void | insertHtml (const QString &text)
void | append (const QString &text)
void | scrollToAnchor (const QString &name)
void | zoomIn (int range=1)
void | zoomOut (int range=1)
## Signals
void | textChanged ()
void | undoAvailable (bool b)
void | redoAvailable (bool b)
void | currentCharFormatChanged (const QTextCharFormat &format)
void | copyAvailable (bool b)
void | selectionChanged ()
void | cursorPositionChanged ()
## Public Member Functions
| QTextEdit (QWidget *parent=0)
| QTextEdit (const QString &text, QWidget *parent=0)
virtual | ~QTextEdit ()
void | setDocument (QTextDocument *document)
QTextDocument * | document () const
void | setTextCursor (const QTextCursor &cursor)
QTextCursor | textCursor () const
bool | isReadOnly () const
void | setReadOnly (bool ro)
void | setTextInteractionFlags (Qt::TextInteractionFlags flags)
Qt::TextInteractionFlags | textInteractionFlags () const
qreal | fontPointSize () const
QString | fontFamily () const
int | fontWeight () const
bool | fontUnderline () const
bool | fontItalic () const
QColor | textColor () const
QColor | textBackgroundColor () const
QFont | currentFont () const
Qt::Alignment | alignment () const
void | mergeCurrentCharFormat (const QTextCharFormat &modifier)
void | setCurrentCharFormat (const QTextCharFormat &format)
QTextCharFormat | currentCharFormat () const
AutoFormatting | autoFormatting () const
void | setAutoFormatting (AutoFormatting features)
bool | tabChangesFocus () const
void | setTabChangesFocus (bool b)
void | setDocumentTitle (const QString &title)
QString | documentTitle () const
bool | isUndoRedoEnabled () const
void | setUndoRedoEnabled (bool enable)
LineWrapMode | lineWrapMode () const
void | setLineWrapMode (LineWrapMode mode)
int | lineWrapColumnOrWidth () const
void | setLineWrapColumnOrWidth (int w)
QTextOption::WrapMode | wordWrapMode () const
void | setWordWrapMode (QTextOption::WrapMode policy)
bool | find (const QString &exp, QTextDocument::FindFlags options=0)
QString | toPlainText () const
QString | toHtml () const
void | ensureCursorVisible ()
virtual QVariant | loadResource (int type, const QUrl &name)
QMenu * | createStandardContextMenu ()
QMenu * | createStandardContextMenu (const QPoint &position)
QTextCursor | cursorForPosition (const QPoint &pos) const
QRect | cursorRect (const QTextCursor &cursor) const
QRect | cursorRect () const
QString | anchorAt (const QPoint &pos) const
bool | overwriteMode () const
void | setOverwriteMode (bool overwrite)
int | tabStopWidth () const
void | setTabStopWidth (int width)
int | cursorWidth () const
void | setCursorWidth (int width)
bool | acceptRichText () const
void | setAcceptRichText (bool accept)
void | setExtraSelections (const QList< ExtraSelection > &selections)
QList< ExtraSelection > | extraSelections () const
void | moveCursor (QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode=QTextCursor::MoveAnchor)
bool | canPaste () const
void | print (QPrinter *printer) const
## Protected Member Functions
virtual bool | event (QEvent *e)
virtual void | timerEvent (QTimerEvent *e)
virtual void | keyPressEvent (QKeyEvent *e)
virtual void | keyReleaseEvent (QKeyEvent *e)
virtual void | resizeEvent (QResizeEvent *e)
virtual void | paintEvent (QPaintEvent *e)
virtual void | mousePressEvent (QMouseEvent *e)
virtual void | mouseMoveEvent (QMouseEvent *e)
virtual void | mouseReleaseEvent (QMouseEvent *e)
virtual void | mouseDoubleClickEvent (QMouseEvent *e)
virtual bool | focusNextPrevChild (bool next)
virtual void | contextMenuEvent (QContextMenuEvent *e)
virtual void | dragEnterEvent (QDragEnterEvent *e)
virtual void | dragLeaveEvent (QDragLeaveEvent *e)
virtual void | dragMoveEvent (QDragMoveEvent *e)
virtual void | dropEvent (QDropEvent *e)
virtual void | focusInEvent (QFocusEvent *e)
virtual void | focusOutEvent (QFocusEvent *e)
virtual void | showEvent (QShowEvent *)
virtual void | changeEvent (QEvent *e)
virtual void | wheelEvent (QWheelEvent *e)
virtual QMimeData * | createMimeDataFromSelection () const
virtual bool | canInsertFromMimeData (const QMimeData *source) const
virtual void | insertFromMimeData (const QMimeData *source)
virtual void | inputMethodEvent (QInputMethodEvent *)
QVariant | inputMethodQuery (Qt::InputMethodQuery property) const
| QTextEdit (QTextEditPrivate &dd, QWidget *parent)
virtual void | scrollContentsBy (int dx, int dy)
## Properties
AutoFormatting | autoFormatting
bool | tabChangesFocus
QString | documentTitle
bool | undoRedoEnabled
LineWrapMode | lineWrapMode
int | lineWrapColumnOrWidth
bool | readOnly
QString | html
QString | plainText
bool | overwriteMode
int | tabStopWidth
bool | acceptRichText
int | cursorWidth
Qt::TextInteractionFlags | textInteractionFlags
## Friends
class | QTextDocument
class | QTextControl

## Member Enumeration Documentation

enum LineWrapMode

Search for all occurrences

Enumerator:

  NoWrap | Search for all occurrences
  WidgetWidth | Search for all occurrences
  FixedPixelWidth | Search for all occurrences
  FixedColumnWidth | Search for all occurrences

Definition at line 94 of file qtextedit.h.

                          {
            NoWrap,
            WidgetWidth,
            FixedPixelWidth,
            FixedColumnWidth
        };

enum AutoFormattingFlag

Search for all occurrences

Enumerator:

  AutoNone | Search for all occurrences
  AutoBulletList | Search for all occurrences
  AutoAll | Search for all occurrences

Definition at line 101 of file qtextedit.h.

                                {
            AutoNone = 0,
            AutoBulletList = 0x00000001,
            AutoAll = 0xffffffff
        };

## Constructor & Destructor Documentation

QTextEdit | ( | QWidget * | parent = `0` | ) | `[explicit]`

QTextEdit | ( | const QString & | text,
|  | QWidget * | parent = `0`
| ) |  | `[explicit]`

virtual ~QTextEdit | ( |  | ) | `[virtual]`

QTextEdit | ( | QTextEditPrivate & | dd,
|  | QWidget * | parent
| ) |  | `[protected]`

## Member Function Documentation

void setDocument | ( | QTextDocument * | document | ) |

Search for all occurrences

QTextDocument* document | ( |  | ) | const

Search for all occurrences

void setTextCursor | ( | const QTextCursor & | cursor | ) |

Search for all occurrences

QTextCursor textCursor | ( |  | ) | const

Search for all occurrences

bool isReadOnly | ( |  | ) | const

Search for all occurrences

void setReadOnly | ( | bool | ro | ) |

Search for all occurrences

void setTextInteractionFlags | ( | Qt::TextInteractionFlags | flags | ) |

Search for all occurrences

Qt::TextInteractionFlags textInteractionFlags | ( |  | ) | const

Search for all occurrences

qreal fontPointSize | ( |  | ) | const

Search for all occurrences

QString fontFamily | ( |  | ) | const

Search for all occurrences

int fontWeight | ( |  | ) | const

Search for all occurrences

bool fontUnderline | ( |  | ) | const

Search for all occurrences

bool fontItalic | ( |  | ) | const

Search for all occurrences

QColor textColor | ( |  | ) | const

Search for all occurrences

QColor textBackgroundColor | ( |  | ) | const

Search for all occurrences

QFont currentFont | ( |  | ) | const

Search for all occurrences

Qt::Alignment alignment | ( |  | ) | const

Search for all occurrences

void mergeCurrentCharFormat | ( | const QTextCharFormat & | modifier | ) |

Search for all occurrences

void setCurrentCharFormat | ( | const QTextCharFormat & | format | ) |

Search for all occurrences

QTextCharFormat currentCharFormat | ( |  | ) | const

Search for all occurrences

AutoFormatting autoFormatting | ( |  | ) | const

Search for all occurrences

void setAutoFormatting | ( | AutoFormatting | features | ) |

Search for all occurrences

bool tabChangesFocus | ( |  | ) | const

Search for all occurrences

void setTabChangesFocus | ( | bool | b | ) |

Search for all occurrences

void setDocumentTitle | ( | const QString & | title | ) | `[inline]`

Search for all occurrences

Definition at line 168 of file qtextedit.h.

        { document()->setMetaInformation(QTextDocument::DocumentTitle, title); }

QString documentTitle | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 170 of file qtextedit.h.

        { return document()->metaInformation(QTextDocument::DocumentTitle); }

bool isUndoRedoEnabled | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 173 of file qtextedit.h.

        { return document()->isUndoRedoEnabled(); }

void setUndoRedoEnabled | ( | bool | enable | ) | `[inline]`

Search for all occurrences

Definition at line 175 of file qtextedit.h.

        { document()->setUndoRedoEnabled(enable); }

LineWrapMode lineWrapMode | ( |  | ) | const

Search for all occurrences

void setLineWrapMode | ( | LineWrapMode | mode | ) |

Search for all occurrences

int lineWrapColumnOrWidth | ( |  | ) | const

Search for all occurrences

void setLineWrapColumnOrWidth | ( | int | w | ) |

Search for all occurrences

QTextOption::WrapMode wordWrapMode | ( |  | ) | const

Search for all occurrences

void setWordWrapMode | ( | QTextOption::WrapMode | policy | ) |

Search for all occurrences

bool find | ( | const QString & | exp,
|  | QTextDocument::FindFlags | options = `0`
| ) |  |

Search for all occurrences

QString toPlainText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 189 of file qtextedit.h.

        { return document()->toPlainText(); }

QString toHtml | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 192 of file qtextedit.h.

        { return document()->toHtml(); }

void ensureCursorVisible | ( |  | ) |

Search for all occurrences

virtual QVariant loadResource | ( | int | type,
|  | const QUrl & | name
| ) |  | `[virtual]`

Search for all occurrences

Reimplemented in QTextBrowser.

QMenu* createStandardContextMenu | ( |  | ) |

Search for all occurrences

QMenu* createStandardContextMenu | ( | const QPoint & | position | ) |

Search for all occurrences

QTextCursor cursorForPosition | ( | const QPoint & | pos | ) | const

Search for all occurrences

QRect cursorRect | ( | const QTextCursor & | cursor | ) | const

Search for all occurrences

QRect cursorRect | ( |  | ) | const

Search for all occurrences

QString anchorAt | ( | const QPoint & | pos | ) | const

Search for all occurrences

bool overwriteMode | ( |  | ) | const

Search for all occurrences

void setOverwriteMode | ( | bool | overwrite | ) |

Search for all occurrences

int tabStopWidth | ( |  | ) | const

Search for all occurrences

void setTabStopWidth | ( | int | width | ) |

Search for all occurrences

int cursorWidth | ( |  | ) | const

Search for all occurrences

void setCursorWidth | ( | int | width | ) |

Search for all occurrences

bool acceptRichText | ( |  | ) | const

Search for all occurrences

void setAcceptRichText | ( | bool | accept | ) |

Search for all occurrences

void setExtraSelections | ( | const QList< ExtraSelection > & | selections | ) |

Search for all occurrences

QList<ExtraSelection> extraSelections | ( |  | ) | const

Search for all occurrences

void moveCursor | ( | QTextCursor::MoveOperation | operation,
|  | QTextCursor::MoveMode | mode = `QTextCursor::MoveAnchor`
| ) |  |

Search for all occurrences

bool canPaste | ( |  | ) | const

Search for all occurrences

void print | ( | QPrinter * | printer | ) | const

Search for all occurrences

void setFontPointSize | ( | qreal | s | ) | `[slot]`

Search for all occurrences

void setFontFamily | ( | const QString & | fontFamily | ) | `[slot]`

Search for all occurrences

void setFontWeight | ( | int | w | ) | `[slot]`

Search for all occurrences

void setFontUnderline | ( | bool | b | ) | `[slot]`

Search for all occurrences

void setFontItalic | ( | bool | b | ) | `[slot]`

Search for all occurrences

void setTextColor | ( | const QColor & | c | ) | `[slot]`

Search for all occurrences

void setTextBackgroundColor | ( | const QColor & | c | ) | `[slot]`

Search for all occurrences

void setCurrentFont | ( | const QFont & | f | ) | `[slot]`

Search for all occurrences

void setAlignment | ( | Qt::Alignment | a | ) | `[slot]`

Search for all occurrences

void setPlainText | ( | const QString & | text | ) | `[slot]`

Search for all occurrences

void setHtml | ( | const QString & | text | ) | `[slot]`

Search for all occurrences

void setText | ( | const QString & | text | ) | `[slot]`

Search for all occurrences

void cut | ( |  | ) | `[slot]`

Search for all occurrences

void copy | ( |  | ) | `[slot]`

Search for all occurrences

void paste | ( |  | ) | `[slot]`

Search for all occurrences

void undo | ( |  | ) | `[slot]`

Search for all occurrences

void redo | ( |  | ) | `[slot]`

Search for all occurrences

void clear | ( |  | ) | `[slot]`

Search for all occurrences

void selectAll | ( |  | ) | `[slot]`

Search for all occurrences

void insertPlainText | ( | const QString & | text | ) | `[slot]`

Search for all occurrences

void insertHtml | ( | const QString & | text | ) | `[slot]`

Search for all occurrences

void append | ( | const QString & | text | ) | `[slot]`

Search for all occurrences

void scrollToAnchor | ( | const QString & | name | ) | `[slot]`

Search for all occurrences

void zoomIn | ( | int | range = `1` | ) | `[slot]`

Search for all occurrences

void zoomOut | ( | int | range = `1` | ) | `[slot]`

Search for all occurrences

void textChanged | ( |  | ) | `[signal]`

Search for all occurrences

void undoAvailable | ( | bool | b | ) | `[signal]`

Search for all occurrences

void redoAvailable | ( | bool | b | ) | `[signal]`

Search for all occurrences

void currentCharFormatChanged | ( | const QTextCharFormat & | format | ) | `[signal]`

Search for all occurrences

void copyAvailable | ( | bool | b | ) | `[signal]`

Search for all occurrences

void selectionChanged | ( |  | ) | `[signal]`

Search for all occurrences

void cursorPositionChanged | ( |  | ) | `[signal]`

Search for all occurrences

virtual bool event | ( | QEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

Reimplemented in QTextBrowser.

virtual void timerEvent | ( | QTimerEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QObject.

virtual void keyPressEvent | ( | QKeyEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

Reimplemented in QTextBrowser.

virtual void keyReleaseEvent | ( | QKeyEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

virtual void resizeEvent | ( | QResizeEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual void paintEvent | ( | QPaintEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

Reimplemented in QTextBrowser.

virtual void mousePressEvent | ( | QMouseEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

Reimplemented in QTextBrowser.

virtual void mouseMoveEvent | ( | QMouseEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

Reimplemented in QTextBrowser.

virtual void mouseReleaseEvent | ( | QMouseEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

Reimplemented in QTextBrowser.

virtual void mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual bool focusNextPrevChild | ( | bool | next | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

Reimplemented in QTextBrowser.

virtual void contextMenuEvent | ( | QContextMenuEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual void dragEnterEvent | ( | QDragEnterEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual void dragLeaveEvent | ( | QDragLeaveEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual void dragMoveEvent | ( | QDragMoveEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual void dropEvent | ( | QDropEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual void focusInEvent | ( | QFocusEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

virtual void focusOutEvent | ( | QFocusEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

Reimplemented in QTextBrowser.

virtual void showEvent | ( | QShowEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

virtual void changeEvent | ( | QEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QFrame.

virtual void wheelEvent | ( | QWheelEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

virtual QMimeData* createMimeDataFromSelection | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

virtual bool canInsertFromMimeData | ( | const QMimeData * | source | ) | const `[protected, virtual]`

Search for all occurrences

virtual void insertFromMimeData | ( | const QMimeData * | source | ) | `[protected, virtual]`

Search for all occurrences

virtual void inputMethodEvent | ( | QInputMethodEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

QVariant inputMethodQuery | ( | Qt::InputMethodQuery | property | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

virtual void scrollContentsBy | ( | int | dx,
|  | int | dy
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

## Friends And Related Function Documentation

friend class QTextDocument `[friend]`

Search for all occurrences

Definition at line 418 of file qtextedit.h.

friend class QTextControl `[friend]`

Search for all occurrences

Definition at line 419 of file qtextedit.h.

## Property Documentation

AutoFormatting autoFormatting `[read, write]`

Search for all occurrences

Definition at line 76 of file qtextedit.h.

bool tabChangesFocus `[read, write]`

Search for all occurrences

Definition at line 77 of file qtextedit.h.

QString documentTitle `[read, write]`

Search for all occurrences

Definition at line 78 of file qtextedit.h.

bool undoRedoEnabled `[read, write]`

Search for all occurrences

Definition at line 79 of file qtextedit.h.

LineWrapMode lineWrapMode `[read, write]`

Search for all occurrences

Definition at line 80 of file qtextedit.h.

int lineWrapColumnOrWidth `[read, write]`

Search for all occurrences

Definition at line 82 of file qtextedit.h.

bool readOnly `[read, write]`

Search for all occurrences

Definition at line 83 of file qtextedit.h.

QString html `[read, write]`

Search for all occurrences

Definition at line 85 of file qtextedit.h.

QString plainText `[read, write]`

Search for all occurrences

Definition at line 87 of file qtextedit.h.

bool overwriteMode `[read, write]`

Search for all occurrences

Definition at line 88 of file qtextedit.h.

int tabStopWidth `[read, write]`

Search for all occurrences

Definition at line 89 of file qtextedit.h.

bool acceptRichText `[read, write]`

Search for all occurrences

Definition at line 90 of file qtextedit.h.

int cursorWidth `[read, write]`

Search for all occurrences

Definition at line 91 of file qtextedit.h.

Qt::TextInteractionFlags textInteractionFlags `[read, write]`

Search for all occurrences

Definition at line 92 of file qtextedit.h.

The documentation for this class was generated from the following file:

- QtGui/qtextedit.h

QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit
QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit QTextEdit