⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qmultilineedit.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.BI "virtual void \fBcursorRight\fR ( bool " "mark" "=FALSE, bool " "wrap" " = TRUE ) ".br.ti -1c.BI "virtual void \fBcursorUp\fR ( bool " "mark" "=FALSE ) ".br.ti -1c.BI "virtual void \fBcursorDown\fR ( bool " "mark" "=FALSE ) ".br.ti -1c.BI "virtual void \fBbackspace\fR () ".br.ti -1c.BI "virtual void \fBdel\fR () ".br.ti -1c.BI "virtual void \fBhome\fR ( bool " "mark" "=FALSE ) ".br.ti -1c.BI "virtual void \fBend\fR ( bool " "mark" "=FALSE ) ".br.ti -1c.BI "bool \fBgetMarkedRegion\fR ( int * " "line1" ", int * " "col1" ", int * " "line2" ", int * col2 ) const".br.ti -1c.BI "int \fBlineLength\fR ( int row ) const".br.ti -1c.BI "QString* \fBgetString\fR ( int row ) const".br.ti -1c.BI "bool \fBisEndOfParagraph\fR ( int row ) const".br.ti -1c.BI "QString \fBstringShown\fR ( int row ) const".br.ti -1c.BI "void \fBinsertChar\fR ( QChar ) ".br.in -1c.SS "Properties"<table border=1 cellpadding=3 cellspacing=0> <tr><th>Type<th>Name<th>READ<th>WRITE<th>Options <tr><td>int<td>numLines<td>numLines<td>&nbsp;<td>&nbsp; <tr><td>bool<td>atBeginning<td>atBeginning<td>&nbsp;<td>&nbsp; <tr><td>bool<td>atEnd<td>atEnd<td>&nbsp;<td>&nbsp; <tr><td>int<td>maxLineWidth<td>maxLineWidth<td>&nbsp;<td>&nbsp; <tr><td>Alignment<td>alignment<td>alignment<td>setAlignment<td>&nbsp; <tr><td>bool<td>edited<td>edited<td>setEdited<td> DESIGNABLE false <tr><td>EchoMode<td>echoMode<td>echoMode<td>setEchoMode<td>&nbsp; <tr><td>int<td>maxLength<td>maxLength<td>setMaxLength<td>&nbsp; <tr><td>int<td>maxLines<td>maxLines<td>setMaxLines<td>&nbsp; <tr><td>int<td>hMargin<td>hMargin<td>setHMargin<td>&nbsp; <tr><td>WordWrap<td>wordWrap<td>wordWrap<td>setWordWrap<td>&nbsp; <tr><td>int<td>wrapColumnOrWidth<td>wrapColumnOrWidth<td>setWrapColumnOrWidth<td>&nbsp; <tr><td>WrapPolicy<td>wrapPolicy<td>wrapPolicy<td>setWrapPolicy<td>&nbsp; <tr><td>bool<td>autoUpdate<td>autoUpdate<td>setAutoUpdate<td> DESIGNABLE false <tr><td>bool<td>undoEnabled<td>isUndoEnabled<td>setUndoEnabled<td>&nbsp; <tr><td>int<td>undoDepth<td>undoDepth<td>setUndoDepth<td>&nbsp; <tr><td>bool<td>readOnly<td>isReadOnly<td>setReadOnly<td>&nbsp; <tr><td>bool<td>overWriteMode<td>isOverwriteMode<td>setOverwriteMode<td>&nbsp; <tr><td>QString<td>text<td>text<td>setText<td>&nbsp; <tr><td>int<td>length<td>length<td>&nbsp;<td>&nbsp; </table>.SH DESCRIPTIONThe QMultiLineEdit widget is a simple editor for inputting text..PPThe QMultiLineEdit widget provides multiple line text input and display. It is intended for moderate amounts of text. There are no arbitrary limitations, but if you try to handle megabytes of data, performance will suffer..PPPer default, the edit widget does not perform any word wrapping. This can be adjusted by calling setWordWrap(). Both dynamic wrapping according to the visible width or a fixed number of character or pixels is supported..PPThe widget can be used to display text by calling setReadOnly(TRUE).PPThe default key bindings are described in keyPressEvent(); they cannot be customized except by inheriting the class..PP<img src=qmlined-m.png> <img src=qmlined-w.png>.PPExamples:.(lmainlyQt/editor.cpp layout/layout.cpp mainlyXt/editor.cpp mainlyMotif/editor.cpp rot13/rot13.cpp scrollview/scrollview.cpp customlayout/main.cpp.)l.SS "Member Type Documentation".SH "QMultiLineEdit::EchoMode"This enum type describes the ways in which QLineEdit can display its contents. The currently defined values are: .TP\fCNormal\fR - display characters as they are entered. This is the default..TP\fCNoEcho\fR - do not display anything..TP\fCPassword\fR - display asterisks instead of the characters actually entered..IP.PPSee also setEchoMode(), echoMode() and QLineEdit::EchoMode..SH "QMultiLineEdit::WordWrap"This enum describes the multiline edit's word wrap mode..PPThe following values are valid:.TP\fCNoWrap\fR - no word wrap at all..TP\fCWidgetWidth\fR - word wrap depending on the current width of the editor widget.TP\fCFixedPixelWidth\fR - wrap according to a fix amount of pixels ( see wrapColumnOrWidth() ).TP\fCFixedColumnWidth\fR - wrap according to a fix character column. This is useful whenever you need formatted text that can also be displayed gracefully on devices with monospaced fonts, for example a standard VT100 terminal. In that case wrapColumnOrWidth() should typically be set to 80..PPSee also setWordWrap()..SH "QMultiLineEdit::WrapPolicy"Defines where text can be wrapped in word wrap mode..PPThe following values are valid:.TP\fCAtWhiteSpace\fR - break only after whitespace.TP\fCAnywhere\fR - break anywhere.PPSee also setWrapPolicy()..SH MEMBER FUNCTION DOCUMENTATION.SH "QMultiLineEdit::QMultiLineEdit ( QWidget * parent=0, const char * name=0 )"Constructs a new, empty, QMultiLineEdit..SH "QMultiLineEdit::~QMultiLineEdit ()"Destroys the QMultiLineEdit..SH "int QMultiLineEdit::alignment () const"Returns the alignment..PPSee also setAlignment() and Qt::AlignmentFlags..SH "void QMultiLineEdit::append ( const QString & s ) \fC[slot]\fR"Appends \fIs\fR to the text..SH "bool QMultiLineEdit::atBeginning () const"Returns TRUE if the cursor is placed at the beginning of the text..SH "bool QMultiLineEdit::atEnd () const"Returns TRUE if the cursor is placed at the end of the text..SH "bool QMultiLineEdit::autoUpdate () const"Returns TRUE if the view updates itself automatically whenever it is changed in some way..PPSee also setAutoUpdate()..SH "void QMultiLineEdit::backspace () \fC[virtual protected]\fR"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 marked by the user (e.g. by clicking and dragging) the cursor is put at the beginning of the marked text and the marked text is removed..PPSee also del()..SH "void QMultiLineEdit::clear () \fC[slot]\fR"Removes all text..SH "void QMultiLineEdit::copy () const \fC[slot]\fR"Copies the marked text to the clipboard. Will copy only if echoMode() is Normal..SH "void QMultiLineEdit::copyAvailable ( bool yes ) \fC[signal]\fR"This signal is emitted when the availability of cut/copy changes. If \fIyes\fR is TRUE, then cut() and copy() will work until copyAvailable( FALSE ) is next emitted..SH "void QMultiLineEdit::copyText () const \fC[slot]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPBackward compatibility..SH "void QMultiLineEdit::cursorDown ( bool mark=FALSE ) \fC[virtual protected]\fR"Moves the cursor one line down. If \fImark\fR is TRUE, the text is marked..PPSee also cursorUp(), cursorLeft() and cursorRight()..SH "void QMultiLineEdit::cursorLeft ( bool mark=FALSE, bool wrap = TRUE ) \fC[virtual protected]\fR"Moves the cursor one character to the left. If \fImark\fR is TRUE, the text is marked. If \fIwrap\fR is TRUE, the cursor moves to the end of the previous line if it is placed at the beginning of the current line..PPSee also cursorRight(), cursorUp() and cursorDown()..SH "QPoint QMultiLineEdit::cursorPoint () const \fC[protected]\fR"Returns the top center point where the cursor is drawn..SH "void QMultiLineEdit::cursorPosition ( int * line, int * col ) const"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPUse getCursorPosition() instead..SH "void QMultiLineEdit::cursorRight ( bool mark=FALSE, bool wrap = TRUE ) \fC[virtual protected]\fR"Moves the cursor one character to the right. If \fImark\fR is TRUE, the text is marked. If \fIwrap\fR is TRUE, the cursor moves to the beginning of the next line if it is placed at the end of the current line..PPSee also cursorLeft(), cursorUp() and cursorDown()..SH "void QMultiLineEdit::cursorUp ( bool mark=FALSE ) \fC[virtual protected]\fR"Moves the cursor up one line. If \fImark\fR is TRUE, the text is marked..PPSee also cursorDown(), cursorLeft() and cursorRight()..SH "void QMultiLineEdit::cursorWordBackward ( bool mark )"Moves the cursor one word to the left. If \fImark\fR is TRUE, the text is marked..PPSee also cursorWordForward()..SH "void QMultiLineEdit::cursorWordForward ( bool mark )"Moves the cursor one word to the right. If \fImark\fR is TRUE, the text is marked..PPSee also cursorWordBackward()..SH "void QMultiLineEdit::cut () \fC[slot]\fR"Copies the selected text to the clipboard and deletes the selected text..SH "int QMultiLineEdit::defaultTabStop () \fC[static]\fR"Returns the distance between tab stops..PPSee also setDefaultTabStop();..SH "void QMultiLineEdit::del () \fC[virtual protected]\fR"Deletes the character on the right side of the text cursor. If a text has been marked by the user (e.g. by clicking and dragging) the cursor is put at the beginning of the marked text and the marked text is removed..PPSee also backspace()..SH "void QMultiLineEdit::deselect () \fC[slot]\fR"Deselects all text (i.e. removes marking) and leaves the cursor at the current position..SH "void QMultiLineEdit::dragEnterEvent ( QDragEnterEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMultiLineEdit::dragLeaveEvent ( QDragLeaveEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMultiLineEdit::dragMoveEvent ( QDragMoveEvent * event ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMultiLineEdit::dropEvent ( QDropEvent * event ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QMultiLineEdit::EchoMode QMultiLineEdit::echoMode() const"Returns the currently set echo mode..PPSee also setEchoMode()..SH "bool QMultiLineEdit::edited () const"Returns the edited flag of the line edit. If this returns FALSE, the contents has not been changed since the construction of the QMultiLineEdit (or the last call to setEdited( FALSE ), if any). If it returns TRUE, the contents have been edited, or setEdited( TRUE ) has been called..PPSee also setEdited()..SH "void QMultiLineEdit::end ( bool mark=FALSE ) \fC[virtual protected]\fR"Moves the text cursor to the right end of the line. If mark is TRUE text is marked towards the last position. If it is FALSE and the cursor is moved, all marked text is unmarked..PPSee also home()..SH "bool QMultiLineEdit::event ( QEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QObject..SH "void QMultiLineEdit::focusInEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Starts the cursor blinking..PPReimplemented from QWidget..SH "void QMultiLineEdit::focusOutEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMultiLineEdit::getCursorPosition ( int * line, int * col ) const"Returns the current line and character position within that line, in the variables pointed to by \fIline\fR and \fIcol\fR respectively..PPSee also setCursorPosition()..SH "bool QMultiLineEdit::getMarkedRegion ( int * line1, int * col1, int * line2, int * col2 ) const \fC[protected]\fR"If there is marked text, sets \fIline1, col1, line2\fR and \fIcol2\fR to the start and end of the marked region and returns TRUE. Returns FALSE if there is no marked text..SH "QString * QMultiLineEdit::getString ( int line ) const \fC[protected]\fR"Returns a pointer to the text at line \fIline.\fR.SH "int QMultiLineEdit::hMargin () const"Returns the horizontal margin current set. The default is 3..PPSee also setHMargin()..SH "bool QMultiLineEdit::hasMarkedText () const \fC[protected]\fR"Returns TRUE if there is marked text..SH "void QMultiLineEdit::home ( bool mark=FALSE ) \fC[virtual protected]\fR"Moves the text cursor to the left end of the line. If \fImark\fR is TRUE, text is marked towards the first position. If it is FALSE and the cursor is moved, all marked text is unmarked..PPSee also end()..SH "void QMultiLineEdit::insert ( const QString & s ) \fC[slot]\fR"Inserts \fIs\fR at the current cursor position..SH "void QMultiLineEdit::insert ( const QString & str, bool mark ) \fC[virtual protected]\fR"Inserts \fIc\fR at the current cursor position..SH "void QMultiLineEdit::insertAt ( const QString & s, int line, int col, bool mark = FALSE ) \fC[virtual]\fR"Inserts \fItxt\fR at line number \fIline,\fR after character number \fIcol\fR in the line. If \fItxt\fR contains newline characters, new lines are inserted..PPThe cursor position is adjusted. If the insertion position is equal to the cursor position, the cursor is placed after the end of the new text..SH "void QMultiLineEdit::insertChar ( QChar c ) \fC[protected]\fR"Inserts \fIc\fR at the current cursor position. (this function is provided for backward compatibility - it simply calls insert())..SH "void QMultiLineEdit::insertLine ( const QString & txt, int line = -1 ) \fC[virtual]\fR"Inserts \fItxt\fR at line number \fIline.\fR If \fIline\fR is less than zero, or larger than the number of rows, the new text is put at the end. If \fItxt\fR contains newline characters, several lines are inserted..PPThe cursor position is not changed..SH "bool QMultiLineEdit::isEndOfParagraph ( int row ) const \fC[protected]\fR"Returns wether \fIrow\fR is the last row in a paragraph..PPThis function is only interesting in word wrap mode, otherwise its return value is always TRUE..PPSee also setWordWrap()..SH "bool QMultiLineEdit::isOverwriteMode () const"Returns TRUE if this multi line edit is in overwrite mode, i.e. if characters typed replace characters in the editor..PPSee also setOverwriteMode()..SH "bool QMultiLineEdit::isReadOnly () const"Returns FALSE if this multi line edit accepts text input. Scrolling and cursor movements are accepted in any case..PPSee also setReadOnly() and QWidget::isEnabled()..SH "bool QMultiLineEdit::isUndoEnabled () const"Returns whether the multilineedit is currently undo enabled or not..PPSee also setUndoEnabled()..SH "void QMultiLineEdit::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"The key press event handler converts a key press to some line editor action..PPHere are the default key bindings when isReadOnly() is FALSE:.TP\fI Left Arrow \fR Move the cursor one character leftwards.TP\fI Right Arrow \fR Move the cursor one character rightwards.TP\fI Up Arrow \fR Move the cursor one line upwards.TP\fI Down Arrow \fR Move the cursor one line downwards.TP\fI Page Up \fR Move the cursor one page upwards.TP\fI Page Down \fR Move the cursor one page downwards.TP\fI Backspace \fR Delete the character to the left of the cursor.TP\fI Home \fR Move the cursor to the beginning of the line.TP\fI End \fR Move the cursor to the end of the line.TP\fI Delete \fR Delete the character to the right of the cursor.TP\fI Shift - Left Arrow \fR Mark text one character leftwards.TP\fI Shift - Right Arrow \fR Mark text one character rightwards.TP\fI Control-A \fR Move the cursor to the beginning of the line.TP\fI Control-B \fR Move the cursor one character leftwards.TP\fI Control-C \fR Copy the marked text to the clipboard.TP\fI Control-D \fR Delete the character to the right of the cursor.TP\fI Control-E \fR Move the cursor to the end of the line.TP\fI Control-F \fR Move the cursor one character rightwards.TP\fI Control-H \fR Delete the character to the left of the cursor

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -