📄 qtmultilineedit.html
字号:
<p> <p>See also <a href="#wordWrap-prop">wordWrap</a>.<h3 class=fn><a name="WrapPolicy-enum"></a>QtMultiLineEdit::WrapPolicy</h3> <p> Defines where text can be wrapped in word wrap mode.<p> The following values are valid:<ul><li> AtWhiteSpace - break only after whitespace<li> Anywhere - break anywhere</ul><p> <p>See also <a href="#wrapPolicy-prop">wrapPolicy</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QtMultiLineEdit"></a>QtMultiLineEdit::QtMultiLineEdit ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )</h3>Constructs a new, empty, QtMultiLineEdit with parent <em>parent</em> andcalled <em>name</em>.<h3 class=fn><a name="~QtMultiLineEdit"></a>QtMultiLineEdit::~QtMultiLineEdit ()</h3>Destroys the QtMultiLineEdit<h3 class=fn>int <a name="alignment"></a>QtMultiLineEdit::alignment () const</h3><p>Returns the alignment.See the <a href="qtmultilineedit.html#alignment-prop">"alignment"</a> property for details.<h3 class=fn>void <a name="append"></a>QtMultiLineEdit::append ( const <a href="qstring.html">QString</a> & s )<tt> [slot]</tt></h3>Appends <em>s</em> to the text.<h3 class=fn>bool <a name="atBeginning"></a>QtMultiLineEdit::atBeginning () const</h3><p>Returns TRUE if the cursor is at the beginning; otherwise returns FALSE.See the <a href="qtmultilineedit.html#atBeginning-prop">"atBeginning"</a> property for details.<h3 class=fn>bool <a name="atEnd"></a>QtMultiLineEdit::atEnd () const</h3><p>Returns TRUE if the cursor is at the end; otherwise returns FALSE.See the <a href="qtmultilineedit.html#atEnd-prop">"atEnd"</a> property for details.<h3 class=fn>bool <a name="autoUpdate"></a>QtMultiLineEdit::autoUpdate () const</h3><p>Returns TRUE if auto update is enabled; otherwise returns FALSE.See the <a href="qtmultilineedit.html#autoUpdate-prop">"autoUpdate"</a> property for details.<h3 class=fn>void <a name="backspace"></a>QtMultiLineEdit::backspace ()<tt> [virtual protected]</tt></h3>Deletes the character on the left side of the text cursor and movesthe cursor one position to the left. If a text has been marked bythe user (e.g. by clicking and dragging) the cursor is put at thebeginning of the marked text and the marked text is removed.<p>See also <a href="#del">del</a>().<h3 class=fn>void <a name="clear"></a>QtMultiLineEdit::clear ()<tt> [slot]</tt></h3>Removes all text.<h3 class=fn>void <a name="copy"></a>QtMultiLineEdit::copy () const<tt> [slot]</tt></h3>Copies the marked text to the clipboard. Will copy onlyif <a href="#echoMode">echoMode</a>() is Normal.<h3 class=fn>void <a name="copyAvailable"></a>QtMultiLineEdit::copyAvailable ( bool yes )<tt> [signal]</tt></h3><p> This signal is emitted when the availability of cut/copy changes.If <em>yes</em> is TRUE, then <a href="#cut">cut</a>() and <a href="#copy">copy</a>() will work until<a href="#copyAvailable">copyAvailable</a>( FALSE ) is next emitted.<h3 class=fn>void <a name="copyText"></a>QtMultiLineEdit::copyText () const<tt> [slot]</tt></h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.<p> Backward compatibility.<h3 class=fn>void <a name="cursorDown"></a>QtMultiLineEdit::cursorDown ( bool mark = FALSE )<tt> [virtual protected]</tt></h3>Moves the cursor one line down. If <em>mark</em> is TRUE, the textis marked.<p>See also <a href="#cursorUp">cursorUp</a>(), <a href="#cursorLeft">cursorLeft</a>() and <a href="#cursorRight">cursorRight</a>().<h3 class=fn>void <a name="cursorLeft"></a>QtMultiLineEdit::cursorLeft ( bool mark = FALSE, bool wrap = TRUE )<tt> [virtual protected]</tt></h3>Moves the cursor one character to the left. If <em>mark</em> is TRUE, the textis marked. If <em>wrap</em> is TRUE, the cursor moves to the end of theprevious line if it is placed at the beginning of the current line.<p> <p>See also <a href="#cursorRight">cursorRight</a>(), <a href="#cursorUp">cursorUp</a>() and <a href="#cursorDown">cursorDown</a>().<h3 class=fn><a href="qpoint.html">QPoint</a> <a name="cursorPoint"></a>QtMultiLineEdit::cursorPoint () const<tt> [protected]</tt></h3>Returns the top center point where the cursor is drawn<h3 class=fn>void <a name="cursorPosition"></a>QtMultiLineEdit::cursorPosition ( int * line, int * col ) const</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.<p> Use <a href="#getCursorPosition">getCursorPosition</a>() instead.<h3 class=fn>void <a name="cursorRight"></a>QtMultiLineEdit::cursorRight ( bool mark = FALSE, bool wrap = TRUE )<tt> [virtual protected]</tt></h3>Moves the cursor one character to the right. If <em>mark</em> is TRUE, the textis marked. If <em>wrap</em> is TRUE, the cursor moves to the beginning of the nextline if it is placed at the end of the current line.<p>See also <a href="#cursorLeft">cursorLeft</a>(), <a href="#cursorUp">cursorUp</a>() and <a href="#cursorDown">cursorDown</a>().<h3 class=fn>void <a name="cursorUp"></a>QtMultiLineEdit::cursorUp ( bool mark = FALSE )<tt> [virtual protected]</tt></h3>Moves the cursor up one line. If <em>mark</em> is TRUE, the textis marked.<p>See also <a href="#cursorDown">cursorDown</a>(), <a href="#cursorLeft">cursorLeft</a>() and <a href="#cursorRight">cursorRight</a>().<h3 class=fn>void <a name="cursorWordBackward"></a>QtMultiLineEdit::cursorWordBackward ( bool mark )</h3>Moves the cursor one word to the left. If <em>mark</em> is TRUE, the textis marked.<p>See also <a href="#cursorWordForward">cursorWordForward</a>().<h3 class=fn>void <a name="cursorWordForward"></a>QtMultiLineEdit::cursorWordForward ( bool mark )</h3>Moves the cursor one word to the right. If <em>mark</em> is TRUE, the textis marked.<p>See also <a href="#cursorWordBackward">cursorWordBackward</a>().<h3 class=fn>void <a name="cut"></a>QtMultiLineEdit::cut ()<tt> [slot]</tt></h3>Copies the selected text to the clipboard and deletes the selected text.<h3 class=fn>int <a name="defaultTabStop"></a>QtMultiLineEdit::defaultTabStop ()<tt> [static]</tt></h3>Returns the distance between tab stops.<p> <p>See also <a href="#setDefaultTabStop">setDefaultTabStop</a>().<h3 class=fn>void <a name="del"></a>QtMultiLineEdit::del ()<tt> [virtual protected]</tt></h3>Deletes the character on the right side of the text cursor. If atext has been marked by the user (e.g. by clicking and dragging) thecursor is put at the beginning of the marked text and the markedtext is removed. <p>See also <a href="#backspace">backspace</a>().<h3 class=fn>void <a name="deselect"></a>QtMultiLineEdit::deselect ()<tt> [slot]</tt></h3>Deselects all text (i.e. removes marking) and leaves the cursor at thecurrent position.<h3 class=fn><a href="qtmultilineedit.html#EchoMode-enum">EchoMode</a> <a name="echoMode"></a>QtMultiLineEdit::echoMode () const</h3><p>Returns the echo mode.See the <a href="qtmultilineedit.html#echoMode-prop">"echoMode"</a> property for details.<h3 class=fn>bool <a name="edited"></a>QtMultiLineEdit::edited () const</h3><p>Returns TRUE if the text had been edited; otherwise returns FALSE.See the <a href="qtmultilineedit.html#edited-prop">"edited"</a> property for details.<h3 class=fn>void <a name="end"></a>QtMultiLineEdit::end ( bool mark = FALSE )<tt> [virtual protected]</tt></h3>Moves the text cursor to the right end of the line. If <em>mark</em> is TRUEtext is marked towards the last position. If it is FALSE and thecursor is moved, all marked text is unmarked.<p> <p>See also <a href="#home">home</a>().<h3 class=fn>void <a name="focusInEvent"></a>QtMultiLineEdit::focusInEvent ( <a href="qfocusevent.html">QFocusEvent</a> * )<tt> [virtual protected]</tt></h3>Starts the cursor blinking.<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget</a>.<h3 class=fn>void <a name="getCursorPosition"></a>QtMultiLineEdit::getCursorPosition ( int * line, int * col ) const</h3>Returns the current line and characterposition within that line, in the variables pointed toby <em>line</em> and <em>col</em> respectively.<p> <p>See also <a href="#setCursorPosition">setCursorPosition</a>().<h3 class=fn>bool <a name="getMarkedRegion"></a>QtMultiLineEdit::getMarkedRegion ( int * line1, int * col1, int * line2, int * col2 ) const<tt> [protected]</tt></h3>If there is marked text, sets <em>line1</em>, <em>col1</em>, <em>line2</em> and <em>col2</em>to the start and end of the marked region and returns TRUE. ReturnsFALSE if there is no marked text.<h3 class=fn><a href="qstring.html">QString</a> * <a name="getString"></a>QtMultiLineEdit::getString ( int line ) const<tt> [protected]</tt></h3> <p> Returns a pointer to the text at line <em>line</em>.<h3 class=fn>int <a name="hMargin"></a>QtMultiLineEdit::hMargin () const</h3><p>Returns the horizontal margin The horizontal margin current set. The default is 3.See the <a href="qtmultilineedit.html#hMargin-prop">"hMargin"</a> property for details.<h3 class=fn>bool <a name="hasMarkedText"></a>QtMultiLineEdit::hasMarkedText () const<tt> [protected]</tt></h3>Returns TRUE if there is marked text.<h3 class=fn>void <a name="home"></a>QtMultiLineEdit::home ( bool mark = FALSE )<tt> [virtual protected]</tt></h3>Moves the text cursor to the left end of the line. If <em>mark</em> isTRUE, text is marked towards the first position. If it is FALSE andthe cursor is moved, all marked text is unmarked.<p> <p>See also <a href="#end">end</a>().<h3 class=fn>void <a name="insert"></a>QtMultiLineEdit::insert ( const <a href="qstring.html">QString</a> & s )<tt> [slot]</tt></h3>Inserts <em>s</em> at the current cursor position.<h3 class=fn>void <a name="insert-2"></a>QtMultiLineEdit::insert ( const <a href="qstring.html">QString</a> & str, bool mark )<tt> [virtual protected]</tt></h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Inserts string <em>str</em> at the current cursor position. If <em>mark</em> isTRUE the string is marked.<h3 class=fn>void <a name="insertAt"></a>QtMultiLineEdit::insertAt ( const <a href="qstring.html">QString</a> & s, int line, int col, bool mark = FALSE )<tt> [virtual]</tt></h3>Inserts <em>s</em> at line number <em>line</em>, after character number <em>col</em>in the line.If <em>s</em> contains newline characters, new lines are inserted.If <em>mark</em> is TRUE the inserted text is selected.<p> The cursor position is adjusted. If the insertion position is equal tothe cursor position, the cursor is placed after the end of the new text.<p> <h3 class=fn>void <a name="insertChar"></a>QtMultiLineEdit::insertChar ( <a href="qchar.html">QChar</a> c )<tt> [protected]</tt></h3>Inserts <em>c</em> at the current cursor position.(this function is provided for backward compatibility -it simply calls <a href="#insert">insert</a>()).<h3 class=fn>void <a name="insertLine"></a>QtMultiLineEdit::insertLine ( const <a href="qstring.html">QString</a> & txt, int line = -1 )<tt> [virtual]</tt></h3>Inserts <em>txt</em> at line number <em>line</em>. If <em>line</em> is less than zero,or larger than the number of rows, the new text is put at the end.If <em>txt</em> contains newline characters, several lines are inserted.<p> The cursor position is not changed.<h3 class=fn>bool <a name="isEndOfParagraph"></a>QtMultiLineEdit::isEndOfParagraph ( int row ) const<tt> [protected]</tt></h3>Returns wether <em>row</em> is the last row in a paragraph.<p> This function is only interesting in word wrap mode, otherwise itsreturn value is always TRUE.<p> <p>See also <a href="#wordWrap-prop">wordWrap</a>.<h3 class=fn>bool <a name="isOverwriteMode"></a>QtMultiLineEdit::isOverwriteMode () const</h3><p>Returns the overwrite mode.See the <a href="qtmultilineedit.html#overWriteMode-prop">"overWriteMode"</a> property for details.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -