Eneboo - Documentación para desarrolladores
|
The QTextEdit widget provides a powerful single-page rich text editor. Más...
#include <qtextedit.h>
The QTextEdit widget provides a powerful single-page rich text editor.
This enum is used by moveCursor() to specify in which direction the cursor should be moved:
MoveBackward Moves the cursor one character backward
MoveWordBackward Moves the cursor one word backward
MoveForward Moves the cursor one character forward
MoveWordForward Moves the cursor one word forward
MoveUp Moves the cursor up one line
MoveDown Moves the cursor down one line
MoveLineStart Moves the cursor to the beginning of the line
MoveLineEnd Moves the cursor to the end of the line
MoveHome Moves the cursor to the beginning of the document
MoveEnd Moves the cursor to the end of the document
MovePgUp Moves the cursor one viewport page up
MovePgDown Moves the cursor one viewport page down
This enum is used by doKeyboardAction() to specify which action should be executed:
ActionBackspace Delete the character to the left of the cursor.
ActionDelete Delete the character to the right of the cursor.
ActionReturn Split the paragraph at the cursor position.
ActionKill If the cursor is not at the end of the paragraph, delete the text from the cursor position until the end of the paragraph. If the cursor is at the end of the paragraph, delete the hard line break at the end of the paragraph: this will cause this paragraph to be joined with the following paragraph.
ActionWordBackspace Delete the word to the left of the cursor position.
ActionWordDelete Delete the word to the right of the cursor position
enum QTextEdit::WordWrap |
enum QTextEdit::WordWrap |
This enum defines the QTextEdit's word wrap modes.
NoWrap Do not wrap the text.
WidgetWidth Wrap the text at the current width of the widget (this is the default). Wrapping is at whitespace by default; this can be changed with setWrapPolicy().
FixedPixelWidth Wrap the text at a fixed number of pixels from the widget's left side. The number of pixels is set with wrapColumnOrWidth().
FixedColumnWidth Wrap the text at a fixed number of character columns from the widget's left side. The number of characters is set with wrapColumnOrWidth(). This is useful if you need formatted text that can also be displayed gracefully on devices with monospaced fonts, for example a standard VT100 terminal, where you might set wrapColumnOrWidth() to 80.
This enum defines where text can be wrapped in word wrap mode.
AtWhiteSpace Don't use this deprecated value (it is a synonym for AtWordBoundary
which you should use instead). Anywhere Break anywhere, including within words. AtWordBoundary Break lines at word boundaries, e.g. spaces or newlines AtWordOrDocumentBoundary Break lines at whitespace, e.g. spaces or newlines if possible. Break it anywhere otherwise.
QTextEdit::QTextEdit | ( | const QString & | text, |
const QString & | context = QString::null , |
||
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructs a QTextEdit called name, with parent parent. The text edit will display the text text using context context.
The context is a path which the text edit's QMimeSourceFactory uses to resolve the locations of files and images. It is passed to the mimeSourceFactory() when quering data.
For example if the text contains an image tag, {
}, and the context is "path/to/look/in", the QMimeSourceFactory will try to load the image from "path/to/look/in/image.png". If the tag was {
}, the context will not be used (because QMimeSourceFactory recognizes that we have used an absolute path) and will try to load "/image.png". The context is applied in exactly the same way to hrefs, for example, {Target}, would resolve to "path/to/look/in/target.html".
QTextEdit::QTextEdit | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Constructs an empty QTextEdit called name, with parent parent.
QTextEdit::~QTextEdit | ( | ) | [virtual] |
QTextEdit::QTextEdit | ( | const QString & | text, |
const QString & | context = QString::null , |
||
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
QTextEdit::QTextEdit | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
virtual QTextEdit::~QTextEdit | ( | ) | [virtual] |
int QTextEdit::alignment | ( | ) | const |
Returns the alignment of the current paragraph.
Reimplementado en QMultiLineEdit y QMultiLineEdit.
int QTextEdit::alignment | ( | ) | const |
Reimplementado en QMultiLineEdit y QMultiLineEdit.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. If there is an anchor at position pos (in contents coordinates), its href
is returned, otherwise QString::null is returned.
QString QTextEdit::anchorAt | ( | const QPoint & | pos, |
AnchorAttribute | attr | ||
) |
If there is an anchor at position pos (in contents coordinates), the text for attribute attr is returned, otherwise QString::null is returned.
QString QTextEdit::anchorAt | ( | const QPoint & | pos, |
AnchorAttribute | a | ||
) |
void QTextEdit::append | ( | const QString & | text | ) | [virtual, slot] |
Appends a new paragraph with text to the end of the text edit. Note that the undo/redo history is cleared by this function, and no undo history is kept for appends which makes them faster than insert()s. If you want to append text which is added to the undo/redo history as well, use insertParagraph().
virtual void QTextEdit::append | ( | const QString & | text | ) | [virtual, slot] |
uint QTextEdit::autoFormatting | ( | ) | const |
uint QTextEdit::autoFormatting | ( | ) | const |
bool QTextEdit::bold | ( | ) | const |
Returns TRUE if the current format is bold; otherwise returns FALSE.
bool QTextEdit::bold | ( | ) | const |
Returns the index of the character (relative to its paragraph) at position pos (in contents coordinates). If para is not 0, *para is set to the character's paragraph.
void QTextEdit::clear | ( | void | ) | [virtual, slot] |
Deletes all the text in the text edit.
virtual void QTextEdit::clear | ( | ) | [virtual, slot] |
virtual void QTextEdit::clearParagraphBackground | ( | int | para | ) | [virtual, slot] |
void QTextEdit::clearParagraphBackground | ( | int | para | ) | [virtual, slot] |
Clears the background color of the paragraph para, so that the default color is used again.
This signal is emitted when the mouse is clicked on the paragraph para at character position pos.
QColor QTextEdit::color | ( | ) | const |
Returns the color of the current format.
QColor QTextEdit::color | ( | ) | const |
void QTextEdit::contentsContextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsContextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a contextMenuEvent() in {e}: the mouse position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsDragEnterEvent | ( | QDragEnterEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsDragEnterEvent | ( | QDragEnterEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dragEnterEvent(): the drag position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsDragLeaveEvent | ( | QDragLeaveEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsDragLeaveEvent | ( | QDragLeaveEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dragLeaveEvent(): the drag position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsDragMoveEvent | ( | QDragMoveEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsDragMoveEvent | ( | QDragMoveEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dragMoveEvent(): the drag position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsDropEvent | ( | QDropEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsDropEvent | ( | QDropEvent * | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a dropEvent(): the drop position is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsMouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsMouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mouseDoubleClickEvent(): the click position in e is translated to be a point on the contents.
The default implementation generates a normal mouse press event.
Reimplementado de QScrollView.
void QTextEdit::contentsMouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsMouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mouseMoveEvent(): the mouse position in e is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mousePressEvent(): the press position in e is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsMouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsMouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a mouseReleaseEvent(): the release position in e is translated to be a point on the contents.
Reimplementado de QScrollView.
void QTextEdit::contentsWheelEvent | ( | QWheelEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::contentsWheelEvent | ( | QWheelEvent * | e | ) | [protected, virtual] |
This event handler is called whenever the QScrollView receives a wheelEvent() in {e}: the mouse position is translated to be a point on the contents.
Reimplementado de QScrollView.
QString QTextEdit::context | ( | ) | const |
Returns the context of the text edit. The context is a path which the text edit's QMimeSourceFactory uses to resolve the locations of files and images.
QString QTextEdit::context | ( | ) | const |
void QTextEdit::copy | ( | ) | [virtual, slot] |
Copies any selected text (from selection 0) to the clipboard.
virtual void QTextEdit::copy | ( | ) | [virtual, slot] |
void QTextEdit::copyAvailable | ( | bool | yes | ) | [signal] |
This signal is emitted when text is selected or de-selected in the text edit.
When text is selected this signal will be emitted with yes set to TRUE. If no text has been selected or if the selected text is de-selected this signal is emitted with yes set to FALSE.
If yes is TRUE then copy() can be used to copy the selection to the clipboard. If yes is FALSE then copy() does nothing.
void QTextEdit::copyAvailable | ( | bool | ) | [signal] |
QPopupMenu * QTextEdit::createPopupMenu | ( | const QPoint & | pos | ) | [protected, virtual] |
This function is called to create a right mouse button popup menu at the document position pos. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller.
QPopupMenu * QTextEdit::createPopupMenu | ( | ) | [protected, virtual] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. This function is called to create a right mouse button popup menu. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller.
This function is only called if createPopupMenu( const QPoint & ) returns 0.
virtual QPopupMenu* QTextEdit::createPopupMenu | ( | const QPoint & | pos | ) | [protected, virtual] |
virtual QPopupMenu* QTextEdit::createPopupMenu | ( | ) | [protected, virtual] |
void QTextEdit::currentAlignmentChanged | ( | int | a | ) | [signal] |
This signal is emitted if the alignment of the current paragraph has changed.
The new alignment is a.
void QTextEdit::currentAlignmentChanged | ( | int | a | ) | [signal] |
void QTextEdit::currentColorChanged | ( | const QColor & | c | ) | [signal] |
This signal is emitted if the color of the current format has changed.
The new color is c.
void QTextEdit::currentColorChanged | ( | const QColor & | c | ) | [signal] |
QFont QTextEdit::currentFont | ( | ) | const |
Returns the font of the current format.
QFont QTextEdit::currentFont | ( | ) | const |
void QTextEdit::currentFontChanged | ( | const QFont & | f | ) | [signal] |
This signal is emitted if the font of the current format has changed.
The new font is f.
void QTextEdit::currentFontChanged | ( | const QFont & | f | ) | [signal] |
void QTextEdit::currentVerticalAlignmentChanged | ( | VerticalAlignment | a | ) | [signal] |
This signal is emitted if the vertical alignment of the current format has changed.
The new vertical alignment is a.
void QTextEdit::currentVerticalAlignmentChanged | ( | VerticalAlignment | a | ) | [signal] |
void QTextEdit::cursorPositionChanged | ( | QTextCursor * | c | ) | [signal] |
This signal is emitted if the position of the cursor has changed. para contains the paragraph index and pos contains the character position within the paragraph.
void QTextEdit::cursorPositionChanged | ( | QTextCursor * | c | ) | [signal] |
void QTextEdit::cut | ( | ) | [virtual, slot] |
Copies the selected text (from selection 0) to the clipboard and deletes it from the text edit.
If there is no selected text (in selection 0) nothing happens.
virtual void QTextEdit::cut | ( | ) | [virtual, slot] |
virtual void QTextEdit::del | ( | ) | [virtual, slot] |
void QTextEdit::del | ( | ) | [virtual, slot] |
If there is some selected text (in selection 0) it is deleted. If there is no selected text (in selection 0) the character to the right of the text cursor is deleted.
void QTextEdit::doChangeInterval | ( | ) | [protected, virtual, slot] |
virtual void QTextEdit::doChangeInterval | ( | ) | [protected, virtual, slot] |
QTextDocument * QTextEdit::document | ( | ) | const [inline, protected] |
QTextDocument* QTextEdit::document | ( | ) | const [protected] |
QString QTextEdit::documentTitle | ( | ) | const |
QString QTextEdit::documentTitle | ( | ) | const |
virtual void QTextEdit::doKeyboardAction | ( | KeyboardAction | action | ) | [virtual, slot] |
void QTextEdit::doKeyboardAction | ( | KeyboardAction | action | ) | [virtual, slot] |
This signal is emitted when the mouse is double-clicked on the paragraph para at character position pos.
Reimplementado de QScrollView.
void QTextEdit::drawContents | ( | QPainter * | p, |
int | clipx, | ||
int | clipy, | ||
int | clipw, | ||
int | cliph | ||
) | [protected, virtual] |
Reimplement this function if you are viewing a drawing area rather than a widget.
The function should draw the rectangle (clipx, clipy, clipw, cliph) of the contents using painter p. The clip rectangle is in the scrollview's coordinates.
For example:
{ // Fill a 40000 by 50000 rectangle at (100000,150000) // Calculate the coordinates... int x1 = 100000, y1 = 150000; int x2 = x1+40000-1, y2 = y1+50000-1; // Clip the coordinates so X/Windows will not have problems... if (x1 < clipx) x1=clipx; if (y1 < clipy) y1=clipy; if (x2 > clipx+clipw-1) x2=clipx+clipw-1; if (y2 > clipy+cliph-1) y2=clipy+cliph-1; // Paint using the small coordinates... if ( x2 >= x1 && y2 >= y1 ) p->fillRect(x1, y1, x2-x1+1, y2-y1+1, red); }
The clip rectangle and translation of the painter p is already set appropriately.
Reimplementado de QScrollView.
virtual void QTextEdit::ensureCursorVisible | ( | ) | [virtual, slot] |
void QTextEdit::ensureCursorVisible | ( | ) | [virtual, slot] |
Ensures that the cursor is visible by scrolling the text edit if necessary.
This is the main event handler; it handles event e. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.
The main event handler first passes an event through all event filters that have been installed. If none of the filters intercept the event, it calls one of the specialized event handlers.
Key press and release events are treated differently from other events. event() checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event() calls keyPressEvent().
This function returns TRUE if it is able to pass the event over to someone (i.e. someone wanted the event); otherwise returns FALSE.
Reimplementado de QWidget.
Reimplementado de QScrollView.
This event filter ensures the scroll bars are updated when a single contents widget is resized, shown, hidden or destroyed; it passes mouse events to the QScrollView. The event is in e and the object is in obj.
Reimplementado de QScrollView.
QString QTextEdit::family | ( | ) | const |
QString QTextEdit::family | ( | ) | const |
Returns the font family of the current format.
bool QTextEdit::find | ( | const QString & | expr, |
bool | cs, | ||
bool | wo, | ||
bool | forward = TRUE , |
||
int * | para = 0 , |
||
int * | index = 0 |
||
) | [virtual] |
Finds the next occurrence of the string, expr. Returns TRUE if expr was found; otherwise returns FALSE.
If para and index are both 0 the search begins from the current cursor position. If para and index are both not 0, the search begins from the *index character position in the *para paragraph.
If cs is TRUE the search is case sensitive, otherwise it is case insensitive. If wo is TRUE the search looks for whole word matches only; otherwise it searches for any matching text. If forward is TRUE (the default) the search works forward from the starting position to the end of the text, otherwise it works backwards to the beginning of the text.
If expr is found the function returns TRUE. If index and para are not 0, the number of the paragraph in which the first character of the match was found is put into *para, and the index position of that character within the paragraph is put into *index.
If expr is not found the function returns FALSE. If index and para are not 0 and expr is not found, *index and *para are undefined.
Please note that this function will make the next occurrence of the string (if found) the current selection, and will thus modify the cursor position.
Using the para and index parameters will not work correctly in case the document contains tables.
virtual bool QTextEdit::find | ( | const QString & | expr, |
bool | cs, | ||
bool | wo, | ||
bool | forward = TRUE , |
||
int * | para = 0 , |
||
int * | index = 0 |
||
) | [virtual] |
Reimplemented to allow tabbing through links. If n is TRUE the tab moves the focus to the next child; if n is FALSE the tab moves the focus to the previous child. Returns TRUE if the focus was moved; otherwise returns FALSE.
Reimplementado de QScrollView.
Reimplementado de QScrollView.
QFont QTextEdit::font | ( | ) | const |
Returns QScrollView::font()
Reimplementado de QWidget.
This function sets the *para and *index parameters to the current cursor position. para and index must not be 0.
bool QTextEdit::getFormat | ( | int | para, |
int | index, | ||
QFont * | font, | ||
QColor * | color, | ||
VerticalAlignment * | verticalAlignment | ||
) | [virtual] |
virtual bool QTextEdit::getFormat | ( | int | para, |
int | index, | ||
QFont * | font, | ||
QColor * | color, | ||
VerticalAlignment * | verticalAlignment | ||
) | [virtual] |
bool QTextEdit::getParagraphFormat | ( | int | para, |
QFont * | font, | ||
QColor * | color, | ||
VerticalAlignment * | verticalAlignment, | ||
int * | alignment, | ||
QStyleSheetItem::DisplayMode * | displayMode, | ||
QStyleSheetItem::ListStyle * | listStyle, | ||
int * | listDepth | ||
) | [virtual] |
virtual bool QTextEdit::getParagraphFormat | ( | int | para, |
QFont * | font, | ||
QColor * | color, | ||
VerticalAlignment * | verticalAlignment, | ||
int * | alignment, | ||
QStyleSheetItem::DisplayMode * | displayMode, | ||
QStyleSheetItem::ListStyle * | listStyle, | ||
int * | listDepth | ||
) | [virtual] |
void QTextEdit::getSelection | ( | int * | paraFrom, |
int * | indexFrom, | ||
int * | paraTo, | ||
int * | indexTo, | ||
int | selNum = 0 |
||
) | const |
void QTextEdit::getSelection | ( | int * | paraFrom, |
int * | indexFrom, | ||
int * | paraTo, | ||
int * | indexTo, | ||
int | selNum = 0 |
||
) | const |
If there is a selection, *paraFrom is set to the number of the paragraph in which the selection begins and *paraTo is set to the number of the paragraph in which the selection ends. (They could be the same.) *indexFrom is set to the index at which the selection begins within *paraFrom, and *indexTo is set to the index at which the selection ends within *paraTo.
If there is no selection, *paraFrom, *indexFrom, *paraTo and *indexTo are all set to -1.
If paraFrom, indexFrom, paraTo or indexTo is 0 this function does nothing.
The selNum is the number of the selection (multiple selections are supported). It defaults to 0 (the default selection).
bool QTextEdit::hasSelectedText | ( | ) | const |
bool QTextEdit::hasSelectedText | ( | ) | const |
Returns how many pixels high the text edit needs to be to display all the text if the text edit is w pixels wide.
Reimplementado de QWidget.
Returns the preferred height for this widget, given the width w. The default implementation returns 0, indicating that the preferred height does not depend on the width.
Reimplementado de QWidget.
void QTextEdit::imComposeEvent | ( | QIMEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive Input Method composition events. This handler is called when the user has entered some text using an Input Method.
The default implementation calls e->ignore(), which rejects the Input Method event. See the QIMEvent documentation for more details.
Reimplementado de QWidget.
void QTextEdit::imEndEvent | ( | QIMEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive Input Method composition events. This handler is called when the user has finished inputting text via an Input Method.
The default implementation calls e->ignore(), which rejects the Input Method event. See the QIMEvent documentation for more details.
Reimplementado de QWidget.
void QTextEdit::imStartEvent | ( | QIMEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive Input Method composition events. This handler is called when the user begins entering text using an Input Method.
The default implementation calls e->ignore(), which rejects the Input Method event. See the QIMEvent documentation for more details.
Reimplementado de QWidget.
virtual void QTextEdit::indent | ( | ) | [virtual, slot] |
void QTextEdit::indent | ( | ) | [virtual, slot] |
void QTextEdit::insert | ( | const QString & | text, |
uint | insertionFlags = CheckNewLines|RemoveSelected |
||
) | [slot] |
virtual void QTextEdit::insert | ( | const QString & | text, |
bool | , | ||
bool | = TRUE , |
||
bool | = TRUE |
||
) | [virtual, slot] |
void QTextEdit::insert | ( | const QString & | text, |
uint | insertionFlags = CheckNewLines | RemoveSelected |
||
) | [slot] |
Inserts text at the current cursor position.
The insertionFlags define how the text is inserted. If RedoIndentation
is set, the paragraph is re-indented. If CheckNewLines
is set, newline characters in text result in hard line breaks (i.e. new paragraphs). If checkNewLine
is not set, the behaviour of the editor is undefined if the text contains newlines. (It is not possible to change QTextEdit's newline handling behavior, but you can use QString::replace() to preprocess text before inserting it.) If RemoveSelected
is set, any selected text (in selection 0) is removed before the text is inserted.
The default flags are CheckNewLines
| RemoveSelected
.
If the widget is in LogText
mode this function will do nothing.
void QTextEdit::insert | ( | const QString & | text, |
bool | indent, | ||
bool | checkNewLine = TRUE , |
||
bool | removeSelected = TRUE |
||
) | [virtual, slot] |
Reimplementado en QMultiLineEdit y QMultiLineEdit.
Inserts text in the paragraph para at position index.
Reimplementado en QMultiLineEdit y QMultiLineEdit.
Inserts text as a new paragraph at position para. If para is -1, the text is appended. Use append() if the append operation is performance critical.
bool QTextEdit::isModified | ( | ) | const |
bool QTextEdit::isModified | ( | ) | const |
bool QTextEdit::isOverwriteMode | ( | ) | const [inline] |
bool QTextEdit::isOverwriteMode | ( | ) | const [inline] |
bool QTextEdit::isReadOnly | ( | ) | const [inline] |
bool QTextEdit::isReadOnly | ( | ) | const [inline] |
bool QTextEdit::isRedoAvailable | ( | ) | const |
Returns TRUE if redo is available; otherwise returns FALSE.
bool QTextEdit::isRedoAvailable | ( | ) | const |
bool QTextEdit::isUndoAvailable | ( | ) | const |
bool QTextEdit::isUndoAvailable | ( | ) | const |
Returns TRUE if undo is available; otherwise returns FALSE.
bool QTextEdit::isUndoRedoEnabled | ( | ) | const |
bool QTextEdit::isUndoRedoEnabled | ( | ) | const |
bool QTextEdit::italic | ( | ) | const |
Returns TRUE if the current format is italic; otherwise returns FALSE.
bool QTextEdit::italic | ( | ) | const |
void QTextEdit::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Processes the key event, e. By default key events are used to provide keyboard navigation and text editing.
Reimplementado de QWidget.
Reimplementado en Editor, QTextBrowser, QIconViewItemLineEdit, QTextBrowser y Editor.
void QTextEdit::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
This event handler, for event e, can be reimplemented in a subclass to receive key press events for the widget.
A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.
If you reimplement this handler, it is very important that you explicitly ignore the event if you do not understand it, so that the widget's parent can interpret it; otherwise, the event will be implicitly accepted. Although top-level widgets are able to choose whether to accept or ignore unknown events because they have no parent widgets that could otherwise handle them, it is good practice to explicitly ignore events to make widgets as reusable as possible.
The default implementation closes popup widgets if the user presses Esc. Otherwise the event is ignored.
Reimplementado de QWidget.
Reimplementado en Editor, QTextBrowser, QIconViewItemLineEdit, QTextBrowser y Editor.
int QTextEdit::length | ( | ) | const |
int QTextEdit::length | ( | ) | const |
Returns the line number of the line in paragraph para in which the character at position index appears. The index position is relative to the beginning of the paragraph. If there is no such paragraph or no such character at the index position (e.g. the index is out of range) -1 is returned.
int QTextEdit::lines | ( | ) | const |
int QTextEdit::lines | ( | ) | const |
Returns the number of lines in the text edit; this could be 0.
Returns the number of lines in paragraph para, or -1 if there is no paragraph with index para.
bool QTextEdit::linkUnderline | ( | ) | const |
bool QTextEdit::linkUnderline | ( | ) | const |
int QTextEdit::maxLogLines | ( | ) | [slot] |
QMimeSourceFactory * QTextEdit::mimeSourceFactory | ( | ) | const |
Returns the QMimeSourceFactory which is being used by this text edit.
QMimeSourceFactory* QTextEdit::mimeSourceFactory | ( | ) | const |
void QTextEdit::modificationChanged | ( | bool | m | ) | [signal] |
This signal is emitted when the modification status of the document has changed. If m is TRUE, the document was modified, otherwise the modification state has been reset to unmodified.
void QTextEdit::modificationChanged | ( | bool | m | ) | [signal] |
virtual void QTextEdit::moveCursor | ( | CursorAction | action, |
bool | select | ||
) | [virtual, slot] |
void QTextEdit::moveCursor | ( | CursorAction | action, |
bool | select | ||
) | [virtual, slot] |
Moves the text cursor according to action. This is normally used by some key event handler. select specifies whether the text between the current cursor position and the new position should be selected.
QBrush QTextEdit::paper | ( | ) | const |
QBrush QTextEdit::paper | ( | ) | const |
Returns the paragraph which is at position pos (in contents coordinates).
Returns the background color of the paragraph para or an invalid color if para is out of range or the paragraph has no background set
Returns the length of the paragraph para (i.e. the number of characters), or -1 if there is no paragraph with index para.
This function ignores newlines.
Returns the rectangle of the paragraph para in contents coordinates, or an invalid rectangle if para is out of range.
int QTextEdit::paragraphs | ( | ) | const |
Returns the number of paragraphs in the text; an empty textedit is always considered to have one paragraph, so 1 is returned in this case.
int QTextEdit::paragraphs | ( | ) | const |
void QTextEdit::paste | ( | ) | [virtual, slot] |
Pastes the text from the clipboard into the text edit at the current cursor position. Only plain text is pasted.
If there is no text in the clipboard nothing happens.
void QTextEdit::pasteSubType | ( | const QCString & | subtype | ) | [virtual, slot] |
Pastes the text with format subtype from the clipboard into the text edit at the current cursor position. The subtype can be "plain" or "html".
If there is no text with format subtype in the clipboard nothing happens.
virtual void QTextEdit::pasteSubType | ( | const QCString & | subtype | ) | [virtual, slot] |
virtual void QTextEdit::placeCursor | ( | const QPoint & | pos, |
QTextCursor * | c = 0 |
||
) | [virtual, slot] |
void QTextEdit::placeCursor | ( | const QPoint & | pos, |
QTextCursor * | c = 0 |
||
) | [virtual, slot] |
Places the cursor c at the character which is closest to position pos (in contents coordinates). If c is 0, the default text cursor is used.
int QTextEdit::pointSize | ( | ) | const |
Returns the point size of the font of the current format.
int QTextEdit::pointSize | ( | ) | const |
void QTextEdit::polish | ( | ) | [virtual, slot] |
Delayed initialization of a widget.
This function will be called after a widget has been fully created and before it is shown the very first time.
Polishing is useful for final initialization which depends on having an instantiated widget. This is something a constructor cannot guarantee since the initialization of the subclasses might not be finished.
After this function, the widget has a proper font and palette and QApplication::polish() has been called.
Remember to call QWidget's implementation first when reimplementing this function to ensure that your program does not end up in infinite recursion.
Reimplementado de QWidget.
void QTextEdit::redo | ( | ) | [virtual, 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.
virtual void QTextEdit::redo | ( | ) | [virtual, slot] |
void QTextEdit::redoAvailable | ( | bool | yes | ) | [signal] |
This signal is emitted when the availability of redo changes. If yes is TRUE, then redo() will work until redoAvailable( FALSE ) is next emitted.
void QTextEdit::redoAvailable | ( | bool | yes | ) | [signal] |
virtual void QTextEdit::removeParagraph | ( | int | para | ) | [virtual, slot] |
void QTextEdit::removeParagraph | ( | int | para | ) | [virtual, slot] |
Removes the paragraph para.
virtual void QTextEdit::removeSelectedText | ( | int | selNum = 0 | ) | [virtual, slot] |
void QTextEdit::removeSelectedText | ( | int | selNum = 0 | ) | [virtual, slot] |
Deletes the text of selection selNum (by default, the default selection, 0). If there is no selected text nothing happens.
virtual void QTextEdit::removeSelection | ( | int | selNum = 0 | ) | [virtual, slot] |
void QTextEdit::removeSelection | ( | int | selNum = 0 | ) | [virtual, slot] |
Removes the selection selNum (by default 0). This does not remove the selected text.
void QTextEdit::repaintChanged | ( | ) | [protected] |
virtual void QTextEdit::resetFormat | ( | ) | [virtual, slot] |
void QTextEdit::resetFormat | ( | ) | [virtual, slot] |
void QTextEdit::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::resizeEvent | ( | QResizeEvent * | event | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::returnPressed | ( | ) | [signal] |
This signal is emitted if the user pressed the Return or the Enter key.
void QTextEdit::returnPressed | ( | ) | [signal] |
virtual void QTextEdit::scrollToAnchor | ( | const QString & | name | ) | [virtual, slot] |
void QTextEdit::scrollToAnchor | ( | const QString & | name | ) | [virtual, slot] |
void QTextEdit::scrollToBottom | ( | ) | [virtual, slot] |
Scrolls to the bottom of the document and does formatting if required.
virtual void QTextEdit::scrollToBottom | ( | ) | [virtual, slot] |
void QTextEdit::selectAll | ( | bool | select = TRUE | ) | [virtual, slot] |
If select is TRUE (the default), all the text is selected as selection 0. If select is FALSE any selected text is unselected, i.e. the default selection (selection 0) is cleared.
virtual void QTextEdit::selectAll | ( | bool | select = TRUE | ) | [virtual, slot] |
QString QTextEdit::selectedText | ( | ) | const |
QString QTextEdit::selectedText | ( | ) | const |
void QTextEdit::selectionChanged | ( | ) | [signal] |
void QTextEdit::selectionChanged | ( | ) | [signal] |
This signal is emitted whenever the selection changes.
virtual void QTextEdit::setAlignment | ( | int | a | ) | [virtual, slot] |
Reimplementado en QMultiLineEdit y QMultiLineEdit.
void QTextEdit::setAlignment | ( | int | a | ) | [virtual, slot] |
Sets the alignment of the current paragraph to a. Valid alignments are Qt::AlignLeft
, Qt::AlignRight
, Qt::AlignJustify
and Qt::AlignCenter
(which centers horizontally).
Reimplementado en QMultiLineEdit y QMultiLineEdit.
void QTextEdit::setAutoFormatting | ( | uint | features | ) |
void QTextEdit::setAutoFormatting | ( | uint | features | ) |
virtual void QTextEdit::setBold | ( | bool | b | ) | [virtual, slot] |
void QTextEdit::setBold | ( | bool | b | ) | [virtual, slot] |
If b is TRUE sets the current format to bold; otherwise sets the current format to non-bold.
virtual void QTextEdit::setColor | ( | const QColor & | c | ) | [virtual, slot] |
void QTextEdit::setColor | ( | const QColor & | c | ) | [virtual, slot] |
Sets the color of the current format, i.e. of the text, to c.
void QTextEdit::setCurrentFont | ( | const QFont & | f | ) | [inline, virtual, slot] |
Sets the font of the current format to f.
If the widget is in LogText
mode this function will do nothing. Use setFont() instead.
virtual void QTextEdit::setCurrentFont | ( | const QFont & | f | ) | [virtual, slot] |
Reimplementado en QMultiLineEdit y QMultiLineEdit.
Sets the cursor to position index in paragraph para.
Reimplementado en QMultiLineEdit y QMultiLineEdit.
void QTextEdit::setDocument | ( | QTextDocument * | doc | ) | [protected] |
void QTextEdit::setDocument | ( | QTextDocument * | doc | ) | [protected] |
void QTextEdit::setEnabled | ( | bool | b | ) | [virtual, slot] |
Reimplementado de QScrollView.
void QTextEdit::setEnabled | ( | bool | enable | ) | [virtual, slot] |
Reimplementado de QScrollView.
virtual void QTextEdit::setFamily | ( | const QString & | f | ) | [virtual, slot] |
void QTextEdit::setFamily | ( | const QString & | fontFamily | ) | [virtual, slot] |
Sets the font family of the current format to fontFamily.
virtual void QTextEdit::setFormat | ( | QTextFormat * | f, |
int | flags | ||
) | [virtual, slot] |
void QTextEdit::setFormat | ( | QTextFormat * | f, |
int | flags | ||
) | [virtual, slot] |
virtual void QTextEdit::setItalic | ( | bool | b | ) | [virtual, slot] |
void QTextEdit::setItalic | ( | bool | b | ) | [virtual, slot] |
If b is TRUE sets the current format to italic; otherwise sets the current format to non-italic.
void QTextEdit::setLinkUnderline | ( | bool | b | ) | [virtual, slot] |
virtual void QTextEdit::setLinkUnderline | ( | bool | ) | [virtual, slot] |
void QTextEdit::setMaxLogLines | ( | int | numLines | ) | [slot] |
virtual void QTextEdit::setMimeSourceFactory | ( | QMimeSourceFactory * | factory | ) | [virtual, slot] |
void QTextEdit::setMimeSourceFactory | ( | QMimeSourceFactory * | factory | ) | [virtual, slot] |
Sets the text edit's mimesource factory to factory. See QMimeSourceFactory for further details.
void QTextEdit::setModified | ( | bool | m | ) | [virtual, slot] |
virtual void QTextEdit::setModified | ( | bool | m | ) | [virtual, slot] |
virtual void QTextEdit::setOverwriteMode | ( | bool | b | ) | [inline, virtual, slot] |
virtual void QTextEdit::setOverwriteMode | ( | bool | b | ) | [inline, virtual, slot] |
virtual void QTextEdit::setPaper | ( | const QBrush & | pap | ) | [virtual, slot] |
void QTextEdit::setPaper | ( | const QBrush & | pap | ) | [virtual, slot] |
Sets the background color of the paragraph para to bg.
virtual void QTextEdit::setParagType | ( | QStyleSheetItem::DisplayMode | dm, |
QStyleSheetItem::ListStyle | listStyle | ||
) | [virtual, slot] |
void QTextEdit::setParagType | ( | QStyleSheetItem::DisplayMode | dm, |
QStyleSheetItem::ListStyle | listStyle | ||
) | [virtual, slot] |
virtual void QTextEdit::setPointSize | ( | int | s | ) | [virtual, slot] |
void QTextEdit::setPointSize | ( | int | s | ) | [virtual, slot] |
Sets the point size of the current format to s.
Note that if s is zero or negative, the behaviour of this function is not defined.
void QTextEdit::setReadOnly | ( | bool | b | ) | [virtual, slot] |
virtual void QTextEdit::setReadOnly | ( | bool | b | ) | [virtual, slot] |
virtual void QTextEdit::setSelection | ( | int | parag_from, |
int | index_from, | ||
int | parag_to, | ||
int | index_to, | ||
int | selNum = 0 |
||
) | [virtual, slot] |
void QTextEdit::setSelection | ( | int | paraFrom, |
int | indexFrom, | ||
int | paraTo, | ||
int | indexTo, | ||
int | selNum = 0 |
||
) | [virtual, slot] |
Sets a selection which starts at position indexFrom in paragraph paraFrom and ends at position indexTo in paragraph paraTo.
Any existing selections which have a different id (selNum) are left alone, but if an existing selection has the same id as selNum it is removed and replaced by this selection.
Uses the selection settings of selection selNum. If selNum is 0, this is the default selection.
The cursor is moved to the end of the selection if selNum is 0, otherwise the cursor position remains unchanged.
virtual void QTextEdit::setSelectionAttributes | ( | int | selNum, |
const QColor & | back, | ||
bool | invertText | ||
) | [virtual, slot] |
void QTextEdit::setSelectionAttributes | ( | int | selNum, |
const QColor & | back, | ||
bool | invertText | ||
) | [virtual, slot] |
Sets the background color of selection number selNum to back and specifies whether the text of this selection should be inverted with invertText.
This only works for selNum > 0. The default selection (selNum == 0) gets its attributes from the text edit's colorGroup().
void QTextEdit::setStyleSheet | ( | QStyleSheet * | styleSheet | ) | [virtual, slot] |
Sets the stylesheet to use with this text edit to styleSheet. Changes will only take effect for new text added with setText() or append().
virtual void QTextEdit::setStyleSheet | ( | QStyleSheet * | styleSheet | ) | [virtual, slot] |
void QTextEdit::setTabChangesFocus | ( | bool | b | ) | [slot] |
void QTextEdit::setTabChangesFocus | ( | bool | b | ) | [slot] |
void QTextEdit::setTabStopWidth | ( | int | ts | ) | [virtual, slot] |
virtual void QTextEdit::setTabStopWidth | ( | int | ts | ) | [virtual, slot] |
void QTextEdit::setText | ( | const QString & | txt | ) | [inline, slot] |
Reimplementado en QTextBrowser y QTextBrowser.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Changes the text of the text edit to the string text and the context to context. Any previous text is removed.
text may be interpreted either as plain text or as rich text, depending on the textFormat(). The default setting is AutoText
, i.e. the text edit auto-detects the format from text.
For rich text the rendering style and available tags are defined by a styleSheet(); see QStyleSheet for details.
The optional context is a path which the text edit's QMimeSourceFactory uses to resolve the locations of files and images. (See {QTextEdit::QTextEdit()}.) It is passed to the text edit's QMimeSourceFactory when quering data.
Note that the undo/redo history is cleared by this function.
Reimplementado en QTextBrowser y QTextBrowser.
void QTextEdit::setText | ( | const QString & | txt | ) | [inline, slot] |
Reimplementado en QTextBrowser y QTextBrowser.
Reimplementado en QTextBrowser y QTextBrowser.
void QTextEdit::setTextFormat | ( | TextFormat | f | ) | [virtual, slot] |
virtual void QTextEdit::setTextFormat | ( | TextFormat | f | ) | [virtual, slot] |
void QTextEdit::setUnderline | ( | bool | b | ) | [virtual, slot] |
If b is TRUE sets the current format to underline; otherwise sets the current format to non-underline.
virtual void QTextEdit::setUnderline | ( | bool | b | ) | [virtual, slot] |
virtual void QTextEdit::setUndoDepth | ( | int | d | ) | [virtual, slot] |
void QTextEdit::setUndoDepth | ( | int | d | ) | [virtual, slot] |
void QTextEdit::setUndoRedoEnabled | ( | bool | b | ) | [virtual, slot] |
virtual void QTextEdit::setUndoRedoEnabled | ( | bool | b | ) | [virtual, slot] |
virtual void QTextEdit::setVerticalAlignment | ( | VerticalAlignment | a | ) | [virtual, slot] |
void QTextEdit::setVerticalAlignment | ( | VerticalAlignment | a | ) | [virtual, slot] |
Sets the vertical alignment of the current format, i.e. of the text, to a.
void QTextEdit::setWordWrap | ( | WordWrap | mode | ) | [virtual, slot] |
virtual void QTextEdit::setWordWrap | ( | WordWrap | mode | ) | [virtual, slot] |
void QTextEdit::setWrapColumnOrWidth | ( | int | value | ) | [virtual, slot] |
virtual void QTextEdit::setWrapColumnOrWidth | ( | int | ) | [virtual, slot] |
void QTextEdit::setWrapPolicy | ( | WrapPolicy | policy | ) | [virtual, slot] |
virtual void QTextEdit::setWrapPolicy | ( | WrapPolicy | policy | ) | [virtual, slot] |
QSize QTextEdit::sizeHint | ( | ) | const [virtual] |
Reimplementado de QScrollView.
Reimplementado en QErrorMessageTextView.
QSize QTextEdit::sizeHint | ( | ) | const [virtual] |
Reimplementado de QScrollView.
Reimplementado en QErrorMessageTextView.
void QTextEdit::sliderReleased | ( | ) | [protected, slot] |
void QTextEdit::sliderReleased | ( | ) | [protected, slot] |
QStyleSheet * QTextEdit::styleSheet | ( | ) | const |
Returns the QStyleSheet which is being used by this text edit.
QStyleSheet* QTextEdit::styleSheet | ( | ) | const |
void QTextEdit::sync | ( | ) | [virtual, slot] |
QTextEdit is optimized for large amounts text. One of its optimizations is to format only the visible text, formatting the rest on demand, e.g. as the user scrolls, so you don't usually need to call this function.
In some situations you may want to force the whole text to be formatted. For example, if after calling setText(), you wanted to know the height of the document (using contentsHeight()), you would call this function first.
virtual void QTextEdit::sync | ( | ) | [virtual, slot] |
QSyntaxHighlighter * QTextEdit::syntaxHighlighter | ( | ) | const |
Returns the QSyntaxHighlighter set on this QTextEdit. 0 is returned if no syntax highlighter is set.
QSyntaxHighlighter* QTextEdit::syntaxHighlighter | ( | ) | const |
bool QTextEdit::tabChangesFocus | ( | ) | const |
bool QTextEdit::tabChangesFocus | ( | ) | const |
int QTextEdit::tabStopWidth | ( | ) | const |
int QTextEdit::tabStopWidth | ( | ) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the text of paragraph para.
If textFormat() is RichText
the text will contain HTML formatting tags.
QString QTextEdit::text | ( | ) | const |
QString QTextEdit::text | ( | ) | const |
void QTextEdit::textChanged | ( | ) | [signal] |
void QTextEdit::textChanged | ( | ) | [signal] |
QTextCursor * QTextEdit::textCursor | ( | ) | const [inline, protected] |
Returns the text edit's text cursor.
QTextCursor* QTextEdit::textCursor | ( | ) | const [protected] |
TextFormat QTextEdit::textFormat | ( | ) | const |
TextFormat QTextEdit::textFormat | ( | ) | const |
bool QTextEdit::underline | ( | ) | const |
Returns TRUE if the current format is underlined; otherwise returns FALSE.
bool QTextEdit::underline | ( | ) | const |
void QTextEdit::undo | ( | ) | [virtual, 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.
virtual void QTextEdit::undo | ( | ) | [virtual, slot] |
void QTextEdit::undoAvailable | ( | bool | yes | ) | [signal] |
This signal is emitted when the availability of undo changes. If yes is TRUE, then undo() will work until undoAvailable( FALSE ) is next emitted.
void QTextEdit::undoAvailable | ( | bool | yes | ) | [signal] |
int QTextEdit::undoDepth | ( | ) | const |
int QTextEdit::undoDepth | ( | ) | const |
void QTextEdit::updateStyles | ( | ) | [protected] |
void QTextEdit::updateStyles | ( | ) | [protected] |
void QTextEdit::viewportResizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Reimplementado de QScrollView.
void QTextEdit::viewportResizeEvent | ( | QResizeEvent * | ) | [protected, virtual] |
To provide simple processing of events on the contents, this function receives all resize events sent to the viewport.
Reimplementado de QScrollView.
void QTextEdit::windowActivationChange | ( | bool | oldActive | ) | [protected, virtual] |
Reimplementado de QWidget.
void QTextEdit::windowActivationChange | ( | bool | oldActive | ) | [protected, virtual] |
This virtual function is called for a widget when its window is activated or deactivated by the window system. oldActive is the previous state; you can get the new setting from isActiveWindow().
Reimplement this function if your widget needs to know when its window becomes activated or deactivated.
The default implementation updates the visible part of the widget if the inactive and the active colorgroup are different for colors other than the highlight and link colors.
Reimplementado de QWidget.
WordWrap QTextEdit::wordWrap | ( | ) | const |
WordWrap QTextEdit::wordWrap | ( | ) | const |
int QTextEdit::wrapColumnOrWidth | ( | ) | const |
int QTextEdit::wrapColumnOrWidth | ( | ) | const |
WrapPolicy QTextEdit::wrapPolicy | ( | ) | const |
WrapPolicy QTextEdit::wrapPolicy | ( | ) | const |
void QTextEdit::zoomIn | ( | int | range | ) | [virtual, slot] |
Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size. This does not change the size of any images.
QTextEdit::zoomIn | ( | ) | [inline, virtual, slot] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Zooms in on the text by making the base font size one point larger and recalculating all font sizes to be the new size. This does not change the size of any images.
virtual void QTextEdit::zoomIn | ( | int | range | ) | [virtual, slot] |
virtual void QTextEdit::zoomIn | ( | ) | [inline, virtual, slot] |
virtual void QTextEdit::zoomOut | ( | ) | [inline, virtual, slot] |
void QTextEdit::zoomOut | ( | int | range | ) | [virtual, slot] |
Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size. This does not change the size of any images.
virtual void QTextEdit::zoomOut | ( | int | range | ) | [virtual, slot] |
QTextEdit::zoomOut | ( | ) | [inline, virtual, slot] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Zooms out on the text by making the base font size one point smaller and recalculating all font sizes to be the new size. This does not change the size of any images.
virtual void QTextEdit::zoomTo | ( | int | size | ) | [virtual, slot] |
void QTextEdit::zoomTo | ( | int | size | ) | [virtual, slot] |
Zooms the text by making the base font size size points and recalculating all font sizes to be the new size. This does not change the size of any images.
QSyntaxHighlighter [friend] |
QTextBrowser [friend] |
AutoFormatting QTextEdit::autoFormatting [read, write] |
the enabled set of auto formatting features
The value can be any combination of the values in the AutoFormatting
enum. The default is AutoAll
. Choose AutoNone
to disable all automatic formatting.
Currently, the only automatic formatting feature provided is AutoBulletList
; future versions of Qt may offer more.
QString QTextEdit::documentTitle [read] |
the title of the document parsed from the text.
For PlainText
the title will be an empty string. For RichText
the title will be the text between the {<title>} tags, if present, otherwise an empty string.
bool QTextEdit::hasSelectedText [read] |
whether some text is selected in selection 0
int QTextEdit::length [read] |
the number of characters in the text
bool QTextEdit::linkUnderline [read, write] |
whether hypertext links will be underlined
If TRUE (the default) hypertext links will be displayed underlined. If FALSE links will not be displayed underlined.
bool QTextEdit::modified [read, write] |
whether the document has been modified by the user
bool QTextEdit::overwriteMode [read, write] |
the text edit's overwrite mode
If FALSE (the default) characters entered by the user are inserted with any characters to the right being moved out of the way. If TRUE, the editor is in overwrite mode, i.e. characters entered by the user overwrite any characters to the right of the cursor position.
QBrush QTextEdit::paper [read, write] |
the background (paper) brush.
The brush that is currently used to draw the background of the text edit. The initial setting is an empty brush.
bool QTextEdit::readOnly [read, write] |
whether the text edit is read-only
In a read-only text edit the user can only navigate through the text and select text; modifying the text is not possible.
This property's default is FALSE.
QString QTextEdit::selectedText [read] |
The selected text (from selection 0) or an empty string if there is no currently selected text (in selection 0).
The text is always returned as PlainText
if the textFormat() is PlainText
or AutoText
, otherwise it is returned as HTML.
bool QTextEdit::tabChangesFocus [read, write] |
whether TAB changes focus or is accepted as input
In some occasions text edits should not allow the user to input tabulators or change indentation using the TAB key, as this breaks the focus chain. The default is FALSE.
int QTextEdit::tabStopWidth [read, write] |
the tab stop width in pixels
QString QTextEdit::text [read, write] |
the text edit's text
There is no default text.
On setting, any previous text is deleted.
The text may be interpreted either as plain text or as rich text, depending on the textFormat(). The default setting is AutoText
, i.e. the text edit auto-detects the format of the text.
For richtext, calling text() on an editable QTextEdit will cause the text to be regenerated from the textedit. This may mean that the QString returned may not be exactly the same as the one that was set.
TextFormat QTextEdit::textFormat [read, write] |
the text format: rich text, plain text, log text or auto text.
The text format is one of the following: PlainText - all characters, except newlines, are displayed verbatim, including spaces. Whenever a newline appears in the text the text edit inserts a hard line break and begins a new paragraph. RichText - rich text rendering. The available styles are defined in the default stylesheet QStyleSheet::defaultSheet(). LogText - optimized mode for very large texts. Supports a very limited set of formatting tags (color, bold, underline and italic settings). AutoText - this is the default. The text edit autodetects which rendering style is best, PlainText
or RichText
. This is done by using the QStyleSheet::mightBeRichText() function.
int QTextEdit::undoDepth [read, write] |
bool QTextEdit::undoRedoEnabled [read, write] |
whether undo/redo is enabled
When changing this property, the undo/redo history is cleared.
The default is TRUE.
WordWrap QTextEdit::wordWrap [read, write] |
the word wrap mode
The default mode is WidgetWidth
which causes words to be wrapped at the right edge of the text edit. Wrapping occurs at whitespace, keeping whole words intact. If you want wrapping to occur within words use setWrapPolicy(). If you set a wrap mode of FixedPixelWidth
or FixedColumnWidth
you should also call setWrapColumnOrWidth() with the width you want.
int QTextEdit::wrapColumnOrWidth [read, write] |
the position (in pixels or columns depending on the wrap mode) where text will be wrapped
If the wrap mode is FixedPixelWidth
, the value is the number of pixels from the left edge of the text edit at which text should be wrapped. If the wrap mode is FixedColumnWidth
, the value is the column number (in character columns) from the left edge of the text edit at which text should be wrapped.
WrapPolicy QTextEdit::wrapPolicy [read, write] |
the word wrap policy, at whitespace or anywhere
Defines where text can be wrapped when word wrap mode is not NoWrap
. The choices are AtWordBoundary
(the default), Anywhere
and AtWordOrDocumentBoundary