Eneboo - Documentación para desarrolladores
Slots públicos | Métodos públicos | Métodos protegidos | Propiedades
Referencia de la Clase QMultiLineEdit

The QMultiLineEdit widget is a simple editor for inputting text. Más...

#include <qmultilineedit.h>

Diagrama de herencias de QMultiLineEdit
QTextEdit QTextEdit QScrollView QScrollView QScrollView QScrollView QFrame QFrame QFrame QFrame QFrame QFrame QFrame QFrame

Lista de todos los miembros.

Slots públicos

void deselect ()
void deselect ()

Métodos públicos

 QMultiLineEdit (QWidget *parent=0, const char *name=0)
 ~QMultiLineEdit ()
QString textLine (int line) const
int numLines () const
virtual void insertLine (const QString &s, int line=-1)
virtual void insertAt (const QString &s, int line, int col)
virtual void insertAt (const QString &s, int line, int col, bool mark)
virtual void removeLine (int line)
virtual void setCursorPosition (int line, int col)
virtual void setCursorPosition (int line, int col, bool mark)
bool atBeginning () const
bool atEnd () const
void setAlignment (int flags)
int alignment () const
void setEdited (bool)
bool edited () const
bool hasMarkedText () const
QString markedText () const
void cursorWordForward (bool mark)
void cursorWordBackward (bool mark)
bool autoUpdate () const
virtual void setAutoUpdate (bool)
int totalWidth () const
int totalHeight () const
int maxLines () const
void setMaxLines (int)
 QMultiLineEdit (QWidget *parent=0, const char *name=0)
 ~QMultiLineEdit ()
QString textLine (int line) const
int numLines () const
virtual void insertLine (const QString &s, int line=-1)
virtual void insertAt (const QString &s, int line, int col)
virtual void insertAt (const QString &s, int line, int col, bool mark)
virtual void removeLine (int line)
virtual void setCursorPosition (int line, int col)
virtual void setCursorPosition (int line, int col, bool mark)
bool atBeginning () const
bool atEnd () const
void setAlignment (int flags)
int alignment () const
void setEdited (bool)
bool edited () const
bool hasMarkedText () const
QString markedText () const
void cursorWordForward (bool mark)
void cursorWordBackward (bool mark)
bool autoUpdate () const
virtual void setAutoUpdate (bool)
int totalWidth () const
int totalHeight () const
int maxLines () const
void setMaxLines (int)

Métodos protegidos

QPoint cursorPoint () const
virtual void insertAndMark (const QString &, bool mark)
virtual void newLine ()
virtual void killLine ()
virtual void pageUp (bool mark=FALSE)
virtual void pageDown (bool mark=FALSE)
virtual void cursorLeft (bool mark=FALSE, bool wrap=TRUE)
virtual void cursorRight (bool mark=FALSE, bool wrap=TRUE)
virtual void cursorUp (bool mark=FALSE)
virtual void cursorDown (bool mark=FALSE)
virtual void backspace ()
virtual void home (bool mark=FALSE)
virtual void end (bool mark=FALSE)
bool getMarkedRegion (int *line1, int *col1, int *line2, int *col2) const
int lineLength (int row) const
QPoint cursorPoint () const
virtual void insertAndMark (const QString &, bool mark)
virtual void newLine ()
virtual void killLine ()
virtual void pageUp (bool mark=FALSE)
virtual void pageDown (bool mark=FALSE)
virtual void cursorLeft (bool mark=FALSE, bool wrap=TRUE)
virtual void cursorRight (bool mark=FALSE, bool wrap=TRUE)
virtual void cursorUp (bool mark=FALSE)
virtual void cursorDown (bool mark=FALSE)
virtual void backspace ()
virtual void home (bool mark=FALSE)
virtual void end (bool mark=FALSE)
bool getMarkedRegion (int *line1, int *col1, int *line2, int *col2) const
int lineLength (int row) const

Propiedades

int numLines
 the number of paragraphs in the editor
bool atBeginning
 whether the cursor is placed at the beginning of the text
bool atEnd
 whether the cursor is placed at the end of the text
Alignment alignment
 The editor's paragraph alignment.
bool edited
 whether the document has been edited by the user

Descripción detallada

The QMultiLineEdit widget is a simple editor for inputting text.

The QMultiLineEdit was a simple editor widget in former Qt versions. Qt 3.0 includes a new richtext engine which obsoletes QMultiLineEdit. It is still included for compatibility reasons. It is now a subclass of QTextEdit, and provides enough of the old QMultiLineEdit API to keep old applications working.

If you implement something new with QMultiLineEdit, we suggest using QTextEdit instead and call QTextEdit::setTextFormat(Qt::PlainText).

Although most of the old QMultiLineEdit API is still available, there is a few difference. The old QMultiLineEdit operated on lines, not on paragraphs. As lines change all the time during wordwrap, the new richtext engine uses paragraphs as basic elements in the data structure. All functions (numLines(), textLine(), etc.) that operated on lines, now operate on paragraphs. Further, getString() has been removed completely. It revealed too much of the internal data structure.

Applications which made normal and reasonable use of QMultiLineEdit should still work without problems. Some odd usage will require some porting. In these cases, it may be better to use QTextEdit now.

qmlined-m.png
qmlined-w.png
Ver también:
QTextEdit

Documentación del constructor y destructor

QMultiLineEdit::QMultiLineEdit ( QWidget parent = 0,
const char *  name = 0 
)

Constructs a new, empty, QMultiLineEdit with parent parent called name.

QMultiLineEdit::~QMultiLineEdit ( )
QMultiLineEdit::QMultiLineEdit ( QWidget parent = 0,
const char *  name = 0 
)
QMultiLineEdit::~QMultiLineEdit ( )

Documentación de las funciones miembro

int QMultiLineEdit::alignment ( ) const

Returns the alignment of the current paragraph.

Ver también:
setAlignment()

Reimplementado de QTextEdit.

int QMultiLineEdit::alignment ( ) const

Returns the alignment of the current paragraph.

Ver también:
setAlignment()

Reimplementado de QTextEdit.

bool QMultiLineEdit::atBeginning ( ) const
bool QMultiLineEdit::atBeginning ( ) const
bool QMultiLineEdit::atEnd ( ) const
bool QMultiLineEdit::atEnd ( ) const
bool QMultiLineEdit::autoUpdate ( ) const [inline]
bool QMultiLineEdit::autoUpdate ( ) const [inline]
void QMultiLineEdit::backspace ( ) [protected, virtual]

Deletes the character on the left side of the text cursor and moves the cursor one position to the left. If a text has been selected by the user (e.g. by clicking and dragging) the cursor is put at the beginning of the selected text and the selected text is removed.

Ver también:
del()
virtual void QMultiLineEdit::backspace ( ) [protected, virtual]
void QMultiLineEdit::cursorDown ( bool  mark = FALSE) [protected, virtual]

Moves the cursor one line down. If mark is TRUE, the text is selected.

Ver también:
cursorUp() cursorLeft() cursorRight()
virtual void QMultiLineEdit::cursorDown ( bool  mark = FALSE) [protected, virtual]
void QMultiLineEdit::cursorLeft ( bool  mark = FALSE,
bool  wrap = TRUE 
) [protected, virtual]

Moves the cursor one character to the left. If mark is TRUE, the text is selected. The wrap parameter is currently ignored.

Ver también:
cursorRight() cursorUp() cursorDown()
virtual void QMultiLineEdit::cursorLeft ( bool  mark = FALSE,
bool  wrap = TRUE 
) [protected, virtual]
QPoint QMultiLineEdit::cursorPoint ( ) const [protected]
QPoint QMultiLineEdit::cursorPoint ( ) const [protected]

Returns the top center point where the cursor is drawn.

void QMultiLineEdit::cursorRight ( bool  mark = FALSE,
bool  wrap = TRUE 
) [protected, virtual]

Moves the cursor one character to the right. If mark is TRUE, the text is selected. The wrap parameter is currently ignored.

Ver también:
cursorLeft() cursorUp() cursorDown()
virtual void QMultiLineEdit::cursorRight ( bool  mark = FALSE,
bool  wrap = TRUE 
) [protected, virtual]
void QMultiLineEdit::cursorUp ( bool  mark = FALSE) [protected, virtual]

Moves the cursor up one line. If mark is TRUE, the text is selected.

Ver también:
cursorDown() cursorLeft() cursorRight()
virtual void QMultiLineEdit::cursorUp ( bool  mark = FALSE) [protected, virtual]
void QMultiLineEdit::cursorWordBackward ( bool  mark)

Moves the cursor one word to the left. If mark is TRUE, the text is selected.

Ver también:
cursorWordForward()
void QMultiLineEdit::cursorWordBackward ( bool  mark)
void QMultiLineEdit::cursorWordForward ( bool  mark)

Moves the cursor one word to the right. If mark is TRUE, the text is selected.

Ver también:
cursorWordBackward()
void QMultiLineEdit::cursorWordForward ( bool  mark)
void QMultiLineEdit::deselect ( ) [inline, slot]
void QMultiLineEdit::deselect ( ) [inline, slot]
bool QMultiLineEdit::edited ( ) const
bool QMultiLineEdit::edited ( ) const
void QMultiLineEdit::end ( bool  mark = FALSE) [protected, virtual]

Moves the text cursor to the right end of the line. If mark is TRUE, text is selected toward the last position. If it is FALSE and the cursor is moved, all selected text is unselected.

Ver también:
home()
virtual void QMultiLineEdit::end ( bool  mark = FALSE) [protected, virtual]
bool QMultiLineEdit::getMarkedRegion ( int line1,
int col1,
int line2,
int col2 
) const [protected]

If there is selected text, sets line1, col1, line2 and col2 to the start and end of the selected region and returns TRUE. Returns FALSE if there is no selected text.

bool QMultiLineEdit::getMarkedRegion ( int line1,
int col1,
int line2,
int col2 
) const [protected]
bool QMultiLineEdit::hasMarkedText ( ) const
bool QMultiLineEdit::hasMarkedText ( ) const

Returns TRUE if there is selected text.

void QMultiLineEdit::home ( bool  mark = FALSE) [protected, virtual]

Moves the text cursor to the left end of the line. If mark is TRUE, text is selected toward the first position. If it is FALSE and the cursor is moved, all selected text is unselected.

Ver también:
end()
virtual void QMultiLineEdit::home ( bool  mark = FALSE) [protected, virtual]
virtual void QMultiLineEdit::insertAndMark ( const QString ,
bool  mark 
) [protected, virtual]
void QMultiLineEdit::insertAndMark ( const QString str,
bool  mark 
) [protected, virtual]

Inserts str at the current cursor position and selects the text if mark is TRUE.

QMultiLineEdit::insertAt ( const QString s,
int  line,
int  col 
) [inline, virtual]

Reimplementado de QTextEdit.

virtual void QMultiLineEdit::insertAt ( const QString text,
int  para,
int  index 
) [inline, virtual]

Inserts text in the paragraph para at position index.

Reimplementado de QTextEdit.

virtual void QMultiLineEdit::insertAt ( const QString s,
int  line,
int  col,
bool  mark 
) [virtual]
void QMultiLineEdit::insertAt ( const QString s,
int  line,
int  col,
bool  mark 
) [virtual]

Inserts string s at paragraph number line, after character number col in the paragraph. If s contains newline characters, new lines are inserted. If mark is TRUE the inserted string will be selected.

The cursor position is adjusted.

void QMultiLineEdit::insertLine ( const QString txt,
int  line = -1 
) [virtual]

Inserts txt at paragraph number line. If line is less than zero, or larger than the number of paragraphs, the new text is put at the end. If txt contains newline characters, several paragraphs are inserted.

The cursor position is not changed.

virtual void QMultiLineEdit::insertLine ( const QString s,
int  line = -1 
) [virtual]
virtual void QMultiLineEdit::killLine ( ) [protected, virtual]
void QMultiLineEdit::killLine ( ) [protected, virtual]

Deletes text from the current cursor position to the end of the line. (Note that this function still operates on lines, not paragraphs.)

int QMultiLineEdit::lineLength ( int  row) const [protected]

Returns the number of characters at paragraph number row. If row is out of range, -1 is returned.

int QMultiLineEdit::lineLength ( int  row) const [protected]
QString QMultiLineEdit::markedText ( ) const

Returns a copy of the selected text.

QString QMultiLineEdit::markedText ( ) const
int QMultiLineEdit::maxLines ( ) const [inline]
int QMultiLineEdit::maxLines ( ) const [inline]
virtual void QMultiLineEdit::newLine ( ) [protected, virtual]
void QMultiLineEdit::newLine ( ) [protected, virtual]

Splits the paragraph at the current cursor position.

int QMultiLineEdit::numLines ( ) const
int QMultiLineEdit::numLines ( ) const
void QMultiLineEdit::pageDown ( bool  mark = FALSE) [protected, virtual]

Moves the cursor one page down. If mark is TRUE, the text is selected.

virtual void QMultiLineEdit::pageDown ( bool  mark = FALSE) [protected, virtual]
virtual void QMultiLineEdit::pageUp ( bool  mark = FALSE) [protected, virtual]
void QMultiLineEdit::pageUp ( bool  mark = FALSE) [protected, virtual]

Moves the cursor one page up. If mark is TRUE, the text is selected.

virtual void QMultiLineEdit::removeLine ( int  line) [virtual]
void QMultiLineEdit::removeLine ( int  paragraph) [virtual]

Deletes the paragraph at paragraph number paragraph. If paragraph is less than zero or larger than the number of paragraphs, nothing is deleted.

void QMultiLineEdit::setAlignment ( int  a) [virtual]

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 de QTextEdit.

void QMultiLineEdit::setAlignment ( int  a) [virtual]

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 de QTextEdit.

virtual void QMultiLineEdit::setAutoUpdate ( bool  ) [inline, virtual]
void QMultiLineEdit::setAutoUpdate ( bool  ) [inline, virtual]
void QMultiLineEdit::setCursorPosition ( int  line,
int  col 
) [inline, virtual]

Reimplementado de QTextEdit.

virtual void QMultiLineEdit::setCursorPosition ( int  line,
int  col,
bool  mark 
) [virtual]
virtual void QMultiLineEdit::setCursorPosition ( int  para,
int  index 
) [inline, virtual]

Sets the cursor to position index in paragraph para.

Ver también:
getCursorPosition()

Reimplementado de QTextEdit.

void QMultiLineEdit::setCursorPosition ( int  line,
int  col,
bool  mark 
) [virtual]

Sets the cursor position to character number col in paragraph number line. The parameters are adjusted to lie within the legal range.

If mark is FALSE, the selection is cleared. otherwise it is extended.

void QMultiLineEdit::setEdited ( bool  )
void QMultiLineEdit::setEdited ( bool  e)
void QMultiLineEdit::setMaxLines ( int  ) [inline]
void QMultiLineEdit::setMaxLines ( int  ) [inline]
QString QMultiLineEdit::textLine ( int  line) const
QString QMultiLineEdit::textLine ( int  line) const

Returns the text at line number line (possibly the empty string), or a null string if line is invalid.

int QMultiLineEdit::totalHeight ( ) const [inline]
int QMultiLineEdit::totalHeight ( ) const [inline]
int QMultiLineEdit::totalWidth ( ) const [inline]
int QMultiLineEdit::totalWidth ( ) const [inline]

Documentación de propiedades

Alignment QMultiLineEdit::alignment [read, write]

The editor's paragraph alignment.

Sets the alignment to flag, which must be AlignLeft, AlignHCenter or AlignRight.

If flag is an illegal flag nothing happens.

Ver también:
Qt::AlignmentFlags
bool QMultiLineEdit::atBeginning [read]

whether the cursor is placed at the beginning of the text

Ver también:
atEnd
bool QMultiLineEdit::atEnd [read]

whether the cursor is placed at the end of the text

Ver también:
atBeginning
bool QMultiLineEdit::edited [read, write]

whether the document has been edited by the user

This is the same as QTextEdit's "modifed" property.

Ver también:
QTextEdit::modified
int QMultiLineEdit::numLines [read]

the number of paragraphs in the editor

The count includes any empty paragraph at top and bottom, so for an empty editor this method returns 1.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'