<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # QLineEdit Class Reference ## [[QtGui](index.htm) module] 在QLineEdit中widget是一個單行的文本編輯器。[More...](#details) 繼承[QWidget](qwidget.html)。 ### Types * `enum EchoMode { Normal, NoEcho, Password, PasswordEchoOnEdit }` ### Methods * `__init__ (self, QWidget?parent?=?None)` * `__init__ (self, QString?contents, QWidget?parent?=?None)` * `Qt.Alignment alignment (self)` * `backspace (self)` * `changeEvent (self, QEvent)` * `clear (self)` * `QCompleter completer (self)` * `contextMenuEvent (self, QContextMenuEvent)` * `copy (self)` * `QMenu createStandardContextMenu (self)` * `cursorBackward (self, bool?mark, int?steps?=?1)` * `cursorForward (self, bool?mark, int?steps?=?1)` * `Qt.CursorMoveStyle cursorMoveStyle (self)` * `int cursorPosition (self)` * `int cursorPositionAt (self, QPoint?pos)` * `QRect cursorRect (self)` * `cursorWordBackward (self, bool?mark)` * `cursorWordForward (self, bool?mark)` * `cut (self)` * `del_ (self)` * `deselect (self)` * `QString displayText (self)` * `bool dragEnabled (self)` * `dragEnterEvent (self, QDragEnterEvent)` * `dragLeaveEvent (self, QDragLeaveEvent?e)` * `dragMoveEvent (self, QDragMoveEvent?e)` * `dropEvent (self, QDropEvent)` * `EchoMode echoMode (self)` * `end (self, bool?mark)` * `bool event (self, QEvent)` * `focusInEvent (self, QFocusEvent)` * `focusOutEvent (self, QFocusEvent)` * `(int?left, int?top, int?right, int?bottom) getTextMargins (self)` * `bool hasAcceptableInput (self)` * `bool hasFrame (self)` * `bool hasSelectedText (self)` * `home (self, bool?mark)` * `initStyleOption (self, QStyleOptionFrame?option)` * `QString inputMask (self)` * `inputMethodEvent (self, QInputMethodEvent)` * `QVariant inputMethodQuery (self, Qt.InputMethodQuery)` * `insert (self, QString)` * `bool isModified (self)` * `bool isReadOnly (self)` * `bool isRedoAvailable (self)` * `bool isUndoAvailable (self)` * `keyPressEvent (self, QKeyEvent)` * `int maxLength (self)` * `QSize minimumSizeHint (self)` * `mouseDoubleClickEvent (self, QMouseEvent)` * `mouseMoveEvent (self, QMouseEvent)` * `mousePressEvent (self, QMouseEvent)` * `mouseReleaseEvent (self, QMouseEvent)` * `paintEvent (self, QPaintEvent)` * `paste (self)` * `QString placeholderText (self)` * `redo (self)` * `selectAll (self)` * `QString selectedText (self)` * `int selectionStart (self)` * `setAlignment (self, Qt.Alignment?flag)` * `setCompleter (self, QCompleter?completer)` * `setCursorMoveStyle (self, Qt.CursorMoveStyle?style)` * `setCursorPosition (self, int)` * `setDragEnabled (self, bool?b)` * `setEchoMode (self, EchoMode)` * `setFrame (self, bool)` * `setInputMask (self, QString?inputMask)` * `setMaxLength (self, int)` * `setModified (self, bool)` * `setPlaceholderText (self, QString)` * `setReadOnly (self, bool)` * `setSelection (self, int, int)` * `setText (self, QString)` * `setTextMargins (self, int?left, int?top, int?right, int?bottom)` * `setTextMargins (self, QMargins?margins)` * `setValidator (self, QValidator)` * `QSize sizeHint (self)` * `QString text (self)` * `QMargins textMargins (self)` * `undo (self)` * `QValidator validator (self)` ### Qt Signals * `void cursorPositionChanged (int,int)` * `void editingFinished ()` * `void returnPressed ()` * `void selectionChanged ()` * `void textChanged (const QString&)` * `void textEdited (const QString&)` * * * ## Detailed Description 在QLineEdit中widget是一個單行的文本編輯器。 A線編輯允許用戶輸入和編輯純文本單行與編輯功能,包括撤銷和重做,剪切和粘貼,拖放一個有用的集合。 通過改變[echoMode](qlineedit.html#echoMode-prop)()一個行編輯的,它也可以被用來作為“只寫”字段,用于輸入密碼等。 的文本的長度可被約束到[maxLength](qlineedit.html#maxLength-prop)( ) 。該文本可以使用任意的限制[validator](qlineedit.html#validator)()或[inputMask](qlineedit.html#inputMask-prop)() ,或兩者兼而有之。當在同一行上編輯一個驗證器和輸入掩碼之間切換時,最好清除驗證或輸入掩碼,以防止未定義的行為。 一個相關的類是[QTextEdit](qtextedit.html)它允許多行,富文本編輯。 您可以更改文本[setText](qlineedit.html#text-prop)()或[insert](qlineedit.html#insert)( ) 。全文檢索與[text](qlineedit.html#text-prop)();顯示的文本(其可以是不同的,見[EchoMode](qlineedit.html#EchoMode-enum))檢索與[displayText](qlineedit.html#displayText-prop)( ) 。文本可以與被選擇[setSelection](qlineedit.html#setSelection)()或[selectAll](qlineedit.html#selectAll)() ,并且選擇可以是[cut](qlineedit.html#cut)( )[copy](qlineedit.html#copy)( )滅蠅燈和[paste](qlineedit.html#paste)( )D 。文本可與對齊[setAlignment](qlineedit.html#alignment-prop)( ) 。 當文本改變[textChanged](qlineedit.html#textChanged)( )信號被發射,當文本的變化快于通過呼叫其他[setText](qlineedit.html#text-prop)( )的[textEdited](qlineedit.html#textEdited)()信號被發射,當光標被移動的[cursorPositionChanged](qlineedit.html#cursorPositionChanged)( )信號被發射,而當回車鍵按下[returnPressed](qlineedit.html#returnPressed)()信號被發射。 當編輯完成,要么是因為該行的編輯失去焦點或Return / Enter鍵被按下[editingFinished](qlineedit.html#editingFinished)()信號被發射。 需要注意的是,如果有一個驗證器就行了編輯設置,[returnPressed](qlineedit.html#returnPressed)()/[editingFinished](qlineedit.html#editingFinished)()信號將只被發射,如果驗證器返回[QValidator.Acceptable](qvalidator.html#State-enum)。 默認情況下, QLineEdits必須由指定的Windows和Motif風格指南的框架,你可以通過調用的setFrame (假)將其關閉。 默認鍵綁定描述如下。該行編輯亦規定,提出了一些的這些編輯選項的上下文菜單(通常由單擊鼠標右鍵調用)。 | Keypress | Action | | --- | --- | | Left Arrow | Moves the cursor one character to the left. | | Shift+Left Arrow | Moves and selects text one character to the left. | | Right Arrow | Moves the cursor one character to the right. | | Shift+Right Arrow | Moves and selects text one character to the right. | | Home | Moves the cursor to the beginning of the line. | | End | Moves the cursor to the end of the line. | | Backspace | Deletes the character to the left of the cursor. | | Ctrl+Backspace | Deletes the word to the left of the cursor. | | Delete | Deletes the character to the right of the cursor. | | Ctrl+Delete | Deletes the word to the right of the cursor. | | Ctrl+A | Select all. | | Ctrl+C | Copies the selected text to the clipboard. | | Ctrl+Insert | Copies the selected text to the clipboard. | | Ctrl+K | Deletes to the end of the line. | | Ctrl+V | Pastes the clipboard text into line edit. | | Shift+Insert | Pastes the clipboard text into line edit. | | Ctrl+X | Deletes the selected text and copies it to the clipboard. | | Shift+Delete | Deletes the selected text and copies it to the clipboard. | | Ctrl+Z | Undoes the last operation. | | Ctrl+Y | Redoes the last undone operation. | 一個表示有效字符的任何其他鍵序列,將導致該字符將被插入到該行編輯。 | ![Screenshot of a Macintosh style line edit](https://img.kancloud.cn/e6/91/e691c62760d119ec1a25a94e9568d17a_300x34.png) | A line edit shown in the [Macintosh widget style](index.htm). | | ![Screenshot of a Windows XP style line edit](https://img.kancloud.cn/07/88/07881d0a1874a06256b2e4b55c9d87f6_312x32.png) | A line edit shown in the [Windows XP widget style](index.htm). | | ![Screenshot of a Plastique style line edit](https://img.kancloud.cn/04/52/045251ee06091fd56faac3c044b7935c_211x34.png) | A line edit shown in the [Plastique widget style](index.htm). | * * * ## Type Documentation ``` QLineEdit.EchoMode ``` 該枚舉類型描述了一個行編輯應該如何顯示其內容。 | Constant | Value | Description | | --- | --- | --- | | `QLineEdit.Normal` | `0` | 顯示字符以它們輸入。這是默認的。 | | `QLineEdit.NoEcho` | `1` | 不顯示任何信息。這可能是適當的密碼,其中的密碼,即使是長度應當保密。 | | `QLineEdit.Password` | `2` | 顯示星號而不是實際輸入的字符。 | | `QLineEdit.PasswordEchoOnEdit` | `3` | 因為他們進入編輯時,否則顯示星號顯示字符。 | **See also** [setEchoMode](qlineedit.html#echoMode-prop)()和[echoMode](qlineedit.html#echoMode-prop)( ) 。 * * * ## Method Documentation ``` QLineEdit.__init__ (self, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個行編輯,沒有文字。 最大文本長度設置為32767個字符。 該_parent_參數被發送到[QWidget](qwidget.html)構造函數。 **See also** [setText](qlineedit.html#text-prop)()和[setMaxLength](qlineedit.html#maxLength-prop)( ) 。 ``` QLineEdit.__init__ (self, QString?contents, QWidget?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個包含文本行編輯_contents_。 光標的位置被設置為一行的末尾和最大文本長度,以32767個字符。 該_parent_和參數發送到[QWidget](qwidget.html)構造函數。 **See also** [text](qlineedit.html#text-prop)()和[setMaxLength](qlineedit.html#maxLength-prop)( ) 。 ``` Qt.Alignment QLineEdit.alignment (self) ``` [ ``` QLineEdit.backspace (self) ``` 如果沒有文本被選中,刪除的字符文本光標的左邊,光標移動一個位置到左邊。如果有任何文字被選中,將光標移動到所選文本的開頭和選定的文本被刪除。 ](index.htm) [**See also**](index.htm) [del_](qlineedit.html#del)( ) 。 ``` QLineEdit.changeEvent (self, QEvent) ``` 從重新實現[QWidget.changeEvent](qwidget.html#changeEvent)( ) 。 ``` QLineEdit.clear (self) ``` 清除行編輯的內容。 **See also** [setText](qlineedit.html#text-prop)()和[insert](qlineedit.html#insert)( ) 。 ``` QCompleter QLineEdit.completer (self) ``` [](qcompleter.html) [返回當前](qcompleter.html)[QCompleter](qcompleter.html)提供完井。 這個函數中引入了Qt 4.2中。 **See also** [setCompleter](qlineedit.html#setCompleter)( ) 。 ``` QLineEdit.contextMenuEvent (self, QContextMenuEvent) ``` 從重新實現[QWidget.contextMenuEvent](qwidget.html#contextMenuEvent)( ) 。 顯示與標準上下文菜單創建[createStandardContextMenu](qlineedit.html#createStandardContextMenu)( ) 。 如果你不想要的行編輯有一個上下文菜單,可以設置其[contextMenuPolicy](qwidget.html#contextMenuPolicy-prop)至[Qt.NoContextMenu](qt.html#ContextMenuPolicy-enum)。如果你想自定義右鍵菜單,重新實現這個函數。如果你想擴展標準上下文菜單,重新實現這個函數,調用[createStandardContextMenu](qlineedit.html#createStandardContextMenu)()和extend菜單返回。 ``` void LineEdit.contextMenuEvent([QContextMenuEvent](qcontextmenuevent.html) *event) { [QMenu](qmenu.html) *menu = createStandardContextMenu(); menu->addAction(tr("My Menu Item")); //... menu->exec(event->globalPos()); delete menu; } ``` 該_event_參數用于獲得該鼠標光標是產生事件時的位置。 **See also** [setContextMenuPolicy](qwidget.html#contextMenuPolicy-prop)( ) 。 ``` QLineEdit.copy (self) ``` 將所選文本復制到剪貼板,如果有任何的,如果[echoMode](qlineedit.html#echoMode-prop)()是[Normal](qlineedit.html#EchoMode-enum)。 **See also** [cut](qlineedit.html#cut)()和[paste](qlineedit.html#paste)( ) 。 ``` QMenu QLineEdit.createStandardContextMenu (self) ``` [](qmenu.html) [這個函數創建當用戶點擊該行編輯用鼠標右鍵其顯示在標準上下文菜單。它是從默認稱為](qmenu.html)[contextMenuEvent](qlineedit.html#contextMenuEvent)()處理。在彈出菜單的所有權被傳遞給調用者。 ``` QLineEdit.cursorBackward (self, bool?mark, int?steps?=?1) ``` 使光標向后移動_steps_字符。如果_mark_是真正的每個字符移到被添加到選擇,如果_mark_是假的選擇被清除。 **See also** [cursorForward](qlineedit.html#cursorForward)( ) 。 ``` QLineEdit.cursorForward (self, bool?mark, int?steps?=?1) ``` 使光標向前移動_steps_字符。如果_mark_是真正的每個字符移到被添加到選擇,如果_mark_是假的選擇被清除。 **See also** [cursorBackward](qlineedit.html#cursorBackward)( ) 。 ``` Qt.CursorMoveStyle QLineEdit.cursorMoveStyle (self) ``` [ ``` int QLineEdit.cursorPosition (self) ``` ``` int QLineEdit.cursorPositionAt (self, QPoint?pos) ``` 返回點下的光標位置_pos_。 ](qt.html#CursorMoveStyle-enum) ``` QRect QLineEdit.cursorRect (self) ``` [ 返回包含lineedit光標的矩形。 此功能被引入Qt的4.4 。 ``` QLineEdit.cursorWordBackward (self, bool?mark) ``` 向后移動光標一個字。如果_mark_是真的,這個詞也被選中。 ](qrect.html) [**See also**](qrect.html) [cursorWordForward](qlineedit.html#cursorWordForward)( ) 。 ``` QLineEdit.cursorWordForward (self, bool?mark) ``` 向前移動光標一個字。如果_mark_是真的,這個詞也被選中。 **See also** [cursorWordBackward](qlineedit.html#cursorWordBackward)( ) 。 ``` QLineEdit.cut (self) ``` 將所選文本復制到剪貼板,然后將其刪除,如果有任何的,如果[echoMode](qlineedit.html#echoMode-prop)()是[Normal](qlineedit.html#EchoMode-enum)。 如果當前的驗證程序不允許刪除選定的文本,切( )將復制而不刪除。 **See also** [copy](qlineedit.html#copy)( )[paste](qlineedit.html#paste)()和[setValidator](qlineedit.html#setValidator)( ) 。 ``` QLineEdit.del_ (self) ``` 如果沒有文本被選中,刪除的字符文本光標的右側。如果有任何文字被選中,將光標移動到所選文本的開頭和選定的文本被刪除。 **See also** [backspace](qlineedit.html#backspace)( ) 。 ``` QLineEdit.deselect (self) ``` 取消選擇任何選定的文本。 **See also** [setSelection](qlineedit.html#setSelection)()和[selectAll](qlineedit.html#selectAll)( ) 。 ``` QString QLineEdit.displayText (self) ``` ``` bool QLineEdit.dragEnabled (self) ``` ``` QLineEdit.dragEnterEvent (self, QDragEnterEvent) ``` 從重新實現[QWidget.dragEnterEvent](qwidget.html#dragEnterEvent)( ) 。 ``` QLineEdit.dragLeaveEvent (self, QDragLeaveEvent?e) ``` 從重新實現[QWidget.dragLeaveEvent](qwidget.html#dragLeaveEvent)( ) 。 ``` QLineEdit.dragMoveEvent (self, QDragMoveEvent?e) ``` 從重新實現[QWidget.dragMoveEvent](qwidget.html#dragMoveEvent)( ) 。 ``` QLineEdit.dropEvent (self, QDropEvent) ``` 從重新實現[QWidget.dropEvent](qwidget.html#dropEvent)( ) 。 ``` EchoMode QLineEdit.echoMode (self) ``` [ ``` QLineEdit.end (self, bool?mark) ``` 將文本光標移動到該行的末尾,除非它已經存在。如果_mark_誠然,選擇文本朝著最后一個位置,否則,任何選定的文本都被取消,如果光標移動。 ](qlineedit.html#EchoMode-enum) [**See also**](qlineedit.html#EchoMode-enum) [home](qlineedit.html#home)( ) 。 ``` bool QLineEdit.event (self, QEvent) ``` 從重新實現[QObject.event](qobject.html#event)( ) 。 ``` QLineEdit.focusInEvent (self, QFocusEvent) ``` 從重新實現[QWidget.focusInEvent](qwidget.html#focusInEvent)( ) 。 ``` QLineEdit.focusOutEvent (self, QFocusEvent) ``` 從重新實現[QWidget.focusOutEvent](qwidget.html#focusOutEvent)( ) 。 ``` (int?left, int?top, int?right, int?bottom) QLineEdit.getTextMargins (self) ``` 返回小部件的文本邊距_left_,_top_,_right_和_bottom_。 此功能被引入Qt的4.5 。 **See also** [setTextMargins](qlineedit.html#setTextMargins)( ) 。 ``` bool QLineEdit.hasAcceptableInput (self) ``` ``` bool QLineEdit.hasFrame (self) ``` ``` bool QLineEdit.hasSelectedText (self) ``` ``` QLineEdit.home (self, bool?mark) ``` 將文本光標移動到行的開頭,除非它已經存在。如果_mark_誠然,文本被選中向第一位置,否則,任何選定的文本都被取消,如果光標移動。 **See also** [end](qlineedit.html#end)( ) 。 ``` QLineEdit.initStyleOption (self, QStyleOptionFrame?option) ``` 初始化_option_與其它的值[QLineEdit](qlineedit.html)。當他們需要一個這種方法是有用的子類[QStyleOptionFrame](qstyleoptionframe.html) or [QStyleOptionFrameV2](qstyleoptionframev2.html),但不希望在所有的信息填寫自己。此功能將檢查的版本[QStyleOptionFrame](qstyleoptionframe.html)并填寫了附加價值[QStyleOptionFrameV2](qstyleoptionframev2.html)。 **See also** [QStyleOption.initFrom](qstyleoption.html#initFrom)( ) 。 ``` QString QLineEdit.inputMask (self) ``` ``` QLineEdit.inputMethodEvent (self, QInputMethodEvent) ``` 從重新實現[QWidget.inputMethodEvent](qwidget.html#inputMethodEvent)( ) 。 ``` QVariant QLineEdit.inputMethodQuery (self, Qt.InputMethodQuery) ``` 從重新實現[QWidget.inputMethodQuery](qwidget.html#inputMethodQuery)( ) 。 ``` QLineEdit.insert (self, QString) ``` 刪除任何選定的文本,插入_newText_,并驗證其結果。如果它是有效的,但將其設置為行編輯的新內容。 **See also** [setText](qlineedit.html#text-prop)()和[clear](qlineedit.html#clear)( ) 。 ``` bool QLineEdit.isModified (self) ``` ``` bool QLineEdit.isReadOnly (self) ``` ``` bool QLineEdit.isRedoAvailable (self) ``` ``` bool QLineEdit.isUndoAvailable (self) ``` ``` QLineEdit.keyPressEvent (self, QKeyEvent) ``` 從重新實現[QWidget.keyPressEvent](qwidget.html#keyPressEvent)( ) 。 給定的按鍵轉換_event_成一條線編輯操作。 如果Return或Enter鍵被按下和當前文本是有效的(或可[made valid](qvalidator.html#fixup)由驗證器) ,所述信號[returnPressed](qlineedit.html#returnPressed)()被發射。 默認的鍵綁定列在類的詳細說明。 ``` int QLineEdit.maxLength (self) ``` ``` QSize QLineEdit.minimumSizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.minimumSizeHint](qwidget.html#minimumSizeHint-prop)( ) 。 返回一個最小尺寸的行編輯。 返回的寬度是足夠的至少一個字符。 ``` QLineEdit.mouseDoubleClickEvent (self, QMouseEvent) ``` 從重新實現[QWidget.mouseDoubleClickEvent](qwidget.html#mouseDoubleClickEvent)( ) 。 ``` QLineEdit.mouseMoveEvent (self, QMouseEvent) ``` 從重新實現[QWidget.mouseMoveEvent](qwidget.html#mouseMoveEvent)( ) 。 ``` QLineEdit.mousePressEvent (self, QMouseEvent) ``` 從重新實現[QWidget.mousePressEvent](qwidget.html#mousePressEvent)( ) 。 ``` QLineEdit.mouseReleaseEvent (self, QMouseEvent) ``` 從重新實現[QWidget.mouseReleaseEvent](qwidget.html#mouseReleaseEvent)( ) 。 ``` QLineEdit.paintEvent (self, QPaintEvent) ``` 從重新實現[QWidget.paintEvent](qwidget.html#paintEvent)( ) 。 ``` QLineEdit.paste (self) ``` 在光標位置插入剪貼板中的文本,刪除任何選定的文本,提供線路的編輯是不是[read-only](qlineedit.html#readOnly-prop)。 如果最終的結果是不能接受的電流[validator](qlineedit.html#setValidator),沒有任何反應。 **See also** [copy](qlineedit.html#copy)()和[cut](qlineedit.html#cut)( ) 。 ``` QString QLineEdit.placeholderText (self) ``` ``` QLineEdit.redo (self) ``` 重做上次操作,如果是重做[available](qlineedit.html#redoAvailable-prop)。 ``` QLineEdit.selectAll (self) ``` 選擇所有文本(即突出了它),將光標移動到最后。此時的默認值已經被插入,因為如果用戶鍵入點擊插件之前,所選的文本將被刪除是有用的。 **See also** [setSelection](qlineedit.html#setSelection)()和[deselect](qlineedit.html#deselect)( ) 。 ``` QString QLineEdit.selectedText (self) ``` ``` int QLineEdit.selectionStart (self) ``` selectionStart ( )返回行編輯所選的第一個字符或-1的索引,如果沒有選定的文本。 **See also** [selectedText](qlineedit.html#selectedText-prop)( ) 。 ``` QLineEdit.setAlignment (self, Qt.Alignment?flag) ``` ``` QLineEdit.setCompleter (self, QCompleter?completer) ``` 設置此行編輯從完成者提供自動補全,_c_。完成模式設置使用[QCompleter.setCompletionMode](qcompleter.html#completionMode-prop)( ) 。 要使用[QCompleter](qcompleter.html)與[QValidator](qvalidator.html) or [QLineEdit.inputMask](qlineedit.html#inputMask-prop),你需要確保該模型提供[QCompleter](qcompleter.html)包含有效的條目。您可以使用[QSortFilterProxyModel](qsortfilterproxymodel.html)以確保該[QCompleter](qcompleter.html)的模型只包含有效的條目。 If _c_== 0 , setCompleter ()刪除當前的完成者,有效地禁用自動完成。 這個函數中引入了Qt 4.2中。 **See also** [completer](qlineedit.html#completer)()和[QCompleter](qcompleter.html)。 ``` QLineEdit.setCursorMoveStyle (self, Qt.CursorMoveStyle?style) ``` ``` QLineEdit.setCursorPosition (self, int) ``` ``` QLineEdit.setDragEnabled (self, bool?b) ``` ``` QLineEdit.setEchoMode (self, EchoMode) ``` ``` QLineEdit.setFrame (self, bool) ``` ``` QLineEdit.setInputMask (self, QString?inputMask) ``` ``` QLineEdit.setMaxLength (self, int) ``` ``` QLineEdit.setModified (self, bool) ``` ``` QLineEdit.setPlaceholderText (self, QString) ``` ``` QLineEdit.setReadOnly (self, bool) ``` ``` QLineEdit.setSelection (self, int, int) ``` 從位置選擇文本_start_和_length_字符。消極的長度是允許的。 **See also** [deselect](qlineedit.html#deselect)( )[selectAll](qlineedit.html#selectAll)()和[selectedText](qlineedit.html#selectedText-prop)( ) 。 ``` QLineEdit.setText (self, QString) ``` ``` QLineEdit.setTextMargins (self, int?left, int?top, int?right, int?bottom) ``` 圍繞設置在框架內的文字邊緣有大小_left_,_top_,_right_和_bottom_。 另請參閱[getTextMargins](qlineedit.html#getTextMargins)( ) 。 此功能被引入Qt的4.5 。 **See also** [textMargins](qlineedit.html#textMargins)( ) 。 ``` QLineEdit.setTextMargins (self, QMargins?margins) ``` 設置_margins_周圍的邊框內的文字。 另請參閱[textMargins](qlineedit.html#textMargins)( ) 。 此功能被引入Qt的4.6 。 ``` QLineEdit.setValidator (self, QValidator) ``` 設置此行編輯只接受輸入驗證器,_v_,會接受。這使您可以放置在可輸入的文字任意的限制。 If _v_== 0 , setValidator將()刪除當前輸入驗證器。初始設置是有沒有輸入驗證器(即任何輸入被接受最多[maxLength](qlineedit.html#maxLength-prop)())。 **See also** [validator](qlineedit.html#validator)( )[QIntValidator](qintvalidator.html),[QDoubleValidator](qdoublevalidator.html)和[QRegExpValidator](qregexpvalidator.html)。 ``` QSize QLineEdit.sizeHint (self) ``` [](qsize.html) [從重新實現](qsize.html)[QWidget.sizeHint](qwidget.html#sizeHint-prop)( ) 。 返回推薦大小小部件。 寬度回來,以像素為單位,通常是足夠的大約15到20個字符。 ``` QString QLineEdit.text (self) ``` ``` QMargins QLineEdit.textMargins (self) ``` [ 返回小部件的文本利潤。 此功能被引入Qt的4.6 。 ](qmargins.html) [**See also**](qmargins.html) [setTextMargins](qlineedit.html#setTextMargins)( ) 。 ``` QLineEdit.undo (self) ``` 撤消上一個操作,如果是撤銷[available](qlineedit.html#undoAvailable-prop)。取消選擇當前的選擇,并更新選擇的開始到當前光標位置。 ``` QValidator QLineEdit.validator (self) ``` [ 返回一個指針,指向當前輸入驗證器,或者0 ,如果沒有驗證已定。 ](qvalidator.html) [**See also**](qvalidator.html) [setValidator](qlineedit.html#setValidator)( ) 。 * * * ## Qt Signal Documentation ``` void cursorPositionChanged (int,int) ``` 這是該信號的默認超載。 這個信號被發射時的光標移動。先前的位置由下式給出_old_,并通過新的位置_new_。 **See also** [setCursorPosition](qlineedit.html#cursorPosition-prop)()和[cursorPosition](qlineedit.html#cursorPosition-prop)( ) 。 ``` void editingFinished () ``` 這是該信號的默認超載。 這個信號時,回車鍵被按下或發出的行編輯失去焦點。需要注意的是,如果有一個[validator](qlineedit.html#validator)()或[inputMask](qlineedit.html#inputMask-prop)()設定就行編輯和輸入/返回鍵時, editingFinished ()??信號將只被發射,如果輸入如下的[inputMask](qlineedit.html#inputMask-prop)( )和[validator](qlineedit.html#validator)()返回[QValidator.Acceptable](qvalidator.html#State-enum)。 ``` void returnPressed () ``` 這是該信號的默認超載。 當回車鍵被按下時,這個信號被發射。需要注意的是,如果有一個[validator](qlineedit.html#validator)()或[inputMask](qlineedit.html#inputMask-prop)( )設置就行了編輯,該returnPressed ( )信號將只如果輸入如下發出的[inputMask](qlineedit.html#inputMask-prop)( )和[validator](qlineedit.html#validator)()返回[QValidator.Acceptable](qvalidator.html#State-enum)。 ``` void selectionChanged () ``` 這是該信號的默認超載。 這個信號被發射時的選擇改變。 **See also** [hasSelectedText](qlineedit.html#hasSelectedText-prop)()和[selectedText](qlineedit.html#selectedText-prop)( ) 。 ``` void textChanged (const QString&) ``` 這是該信號的默認超載。 這個信號被發射時的文本改變。該_text_參數是新的文本。 不像[textEdited](qlineedit.html#textEdited)( ) ,這個信號也時發出的文本編程方式改變,例如,通過調用[setText](qlineedit.html#text-prop)( ) 。 ``` void textEdited (const QString&) ``` 這是該信號的默認超載。 這個信號被發射時的文本編輯。該_text_參數是新的文本。 不像[textChanged](qlineedit.html#textChanged)( ) ,這個信號沒有發出時,文本編程方式改變,例如,通過調用[setText](qlineedit.html#text-prop)( ) 。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看