class_lineedit.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the LineEdit.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_LineEdit:
  6. LineEdit
  7. ========
  8. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Control that provides single-line string editing.
  10. Description
  11. -----------
  12. LineEdit provides a single-line string editor, used for text fields.
  13. It features many built-in shortcuts which will always be available (``Ctrl`` here maps to ``Command`` on macOS):
  14. - Ctrl + C: Copy
  15. - Ctrl + X: Cut
  16. - Ctrl + V or Ctrl + Y: Paste/"yank"
  17. - Ctrl + Z: Undo
  18. - Ctrl + Shift + Z: Redo
  19. - Ctrl + U: Delete text from the cursor position to the beginning of the line
  20. - Ctrl + K: Delete text from the cursor position to the end of the line
  21. - Ctrl + A: Select all text
  22. - Up/Down arrow: Move the cursor to the beginning/end of the line
  23. On macOS, some extra keyboard shortcuts are available:
  24. - Ctrl + F: Like the right arrow key, move the cursor one character right
  25. - Ctrl + B: Like the left arrow key, move the cursor one character left
  26. - Ctrl + P: Like the up arrow key, move the cursor to the previous line
  27. - Ctrl + N: Like the down arrow key, move the cursor to the next line
  28. - Ctrl + D: Like the Delete key, delete the character on the right side of cursor
  29. - Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor
  30. - Command + Left arrow: Like the Home key, move the cursor to the beginning of the line
  31. - Command + Right arrow: Like the End key, move the cursor to the end of the line
  32. Properties
  33. ----------
  34. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  35. | :ref:`Align<enum_LineEdit_Align>` | :ref:`align<class_LineEdit_property_align>` | ``0`` |
  36. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  37. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_LineEdit_property_caret_blink>` | ``false`` |
  38. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  39. | :ref:`float<class_float>` | :ref:`caret_blink_speed<class_LineEdit_property_caret_blink_speed>` | ``0.65`` |
  40. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  41. | :ref:`int<class_int>` | :ref:`caret_position<class_LineEdit_property_caret_position>` | ``0`` |
  42. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  43. | :ref:`bool<class_bool>` | :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` | ``false`` |
  44. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  45. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_LineEdit_property_context_menu_enabled>` | ``true`` |
  46. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  47. | :ref:`bool<class_bool>` | :ref:`editable<class_LineEdit_property_editable>` | ``true`` |
  48. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  49. | :ref:`bool<class_bool>` | :ref:`expand_to_text_length<class_LineEdit_property_expand_to_text_length>` | ``false`` |
  50. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  51. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | **O:** ``2`` |
  52. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  53. | :ref:`int<class_int>` | :ref:`max_length<class_LineEdit_property_max_length>` | ``0`` |
  54. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  55. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | **O:** ``1`` |
  56. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  57. | :ref:`float<class_float>` | :ref:`placeholder_alpha<class_LineEdit_property_placeholder_alpha>` | ``0.6`` |
  58. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  59. | :ref:`String<class_String>` | :ref:`placeholder_text<class_LineEdit_property_placeholder_text>` | ``""`` |
  60. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  61. | :ref:`Texture<class_Texture>` | :ref:`right_icon<class_LineEdit_property_right_icon>` | |
  62. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  63. | :ref:`bool<class_bool>` | :ref:`secret<class_LineEdit_property_secret>` | ``false`` |
  64. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  65. | :ref:`String<class_String>` | :ref:`secret_character<class_LineEdit_property_secret_character>` | ``"*"`` |
  66. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  67. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_LineEdit_property_selecting_enabled>` | ``true`` |
  68. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  69. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>` | ``true`` |
  70. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  71. | :ref:`String<class_String>` | :ref:`text<class_LineEdit_property_text>` | ``""`` |
  72. +----------------------------------------------+-----------------------------------------------------------------------------+--------------+
  73. Methods
  74. -------
  75. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`append_at_cursor<class_LineEdit_method_append_at_cursor>` **(** :ref:`String<class_String>` text **)** |
  77. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`clear<class_LineEdit_method_clear>` **(** **)** |
  79. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`deselect<class_LineEdit_method_deselect>` **(** **)** |
  81. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_LineEdit_method_get_menu>` **(** **)** const |
  83. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`menu_option<class_LineEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  85. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`select<class_LineEdit_method_select>` **(** :ref:`int<class_int>` from=0, :ref:`int<class_int>` to=-1 **)** |
  87. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`select_all<class_LineEdit_method_select_all>` **(** **)** |
  89. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------+
  90. Theme Properties
  91. ----------------
  92. +---------------------------------+----------------------------+--------------------------------+
  93. | :ref:`Texture<class_Texture>` | clear | |
  94. +---------------------------------+----------------------------+--------------------------------+
  95. | :ref:`Color<class_Color>` | clear_button_color | Color( 0.88, 0.88, 0.88, 1 ) |
  96. +---------------------------------+----------------------------+--------------------------------+
  97. | :ref:`Color<class_Color>` | clear_button_color_pressed | Color( 1, 1, 1, 1 ) |
  98. +---------------------------------+----------------------------+--------------------------------+
  99. | :ref:`Color<class_Color>` | cursor_color | Color( 0.94, 0.94, 0.94, 1 ) |
  100. +---------------------------------+----------------------------+--------------------------------+
  101. | :ref:`StyleBox<class_StyleBox>` | focus | |
  102. +---------------------------------+----------------------------+--------------------------------+
  103. | :ref:`Font<class_Font>` | font | |
  104. +---------------------------------+----------------------------+--------------------------------+
  105. | :ref:`Color<class_Color>` | font_color | Color( 0.88, 0.88, 0.88, 1 ) |
  106. +---------------------------------+----------------------------+--------------------------------+
  107. | :ref:`Color<class_Color>` | font_color_selected | Color( 0, 0, 0, 1 ) |
  108. +---------------------------------+----------------------------+--------------------------------+
  109. | :ref:`Color<class_Color>` | font_color_uneditable | Color( 0.88, 0.88, 0.88, 0.5 ) |
  110. +---------------------------------+----------------------------+--------------------------------+
  111. | :ref:`int<class_int>` | minimum_spaces | 12 |
  112. +---------------------------------+----------------------------+--------------------------------+
  113. | :ref:`StyleBox<class_StyleBox>` | normal | |
  114. +---------------------------------+----------------------------+--------------------------------+
  115. | :ref:`StyleBox<class_StyleBox>` | read_only | |
  116. +---------------------------------+----------------------------+--------------------------------+
  117. | :ref:`Color<class_Color>` | selection_color | Color( 0.49, 0.49, 0.49, 1 ) |
  118. +---------------------------------+----------------------------+--------------------------------+
  119. Signals
  120. -------
  121. .. _class_LineEdit_signal_text_change_rejected:
  122. - **text_change_rejected** **(** **)**
  123. Emitted when trying to append text that would overflow the :ref:`max_length<class_LineEdit_property_max_length>`.
  124. ----
  125. .. _class_LineEdit_signal_text_changed:
  126. - **text_changed** **(** :ref:`String<class_String>` new_text **)**
  127. Emitted when the text changes.
  128. ----
  129. .. _class_LineEdit_signal_text_entered:
  130. - **text_entered** **(** :ref:`String<class_String>` new_text **)**
  131. Emitted when the user presses :ref:`@GlobalScope.KEY_ENTER<class_@GlobalScope_constant_KEY_ENTER>` on the ``LineEdit``.
  132. Enumerations
  133. ------------
  134. .. _enum_LineEdit_Align:
  135. .. _class_LineEdit_constant_ALIGN_LEFT:
  136. .. _class_LineEdit_constant_ALIGN_CENTER:
  137. .. _class_LineEdit_constant_ALIGN_RIGHT:
  138. .. _class_LineEdit_constant_ALIGN_FILL:
  139. enum **Align**:
  140. - **ALIGN_LEFT** = **0** --- Aligns the text on the left-hand side of the ``LineEdit``.
  141. - **ALIGN_CENTER** = **1** --- Centers the text in the middle of the ``LineEdit``.
  142. - **ALIGN_RIGHT** = **2** --- Aligns the text on the right-hand side of the ``LineEdit``.
  143. - **ALIGN_FILL** = **3** --- Stretches whitespaces to fit the ``LineEdit``'s width.
  144. ----
  145. .. _enum_LineEdit_MenuItems:
  146. .. _class_LineEdit_constant_MENU_CUT:
  147. .. _class_LineEdit_constant_MENU_COPY:
  148. .. _class_LineEdit_constant_MENU_PASTE:
  149. .. _class_LineEdit_constant_MENU_CLEAR:
  150. .. _class_LineEdit_constant_MENU_SELECT_ALL:
  151. .. _class_LineEdit_constant_MENU_UNDO:
  152. .. _class_LineEdit_constant_MENU_REDO:
  153. .. _class_LineEdit_constant_MENU_MAX:
  154. enum **MenuItems**:
  155. - **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text.
  156. - **MENU_COPY** = **1** --- Copies the selected text.
  157. - **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
  158. Non-printable escape characters are automatically stripped from the OS clipboard via :ref:`String.strip_escapes<class_String_method_strip_escapes>`.
  159. - **MENU_CLEAR** = **3** --- Erases the whole ``LineEdit`` text.
  160. - **MENU_SELECT_ALL** = **4** --- Selects the whole ``LineEdit`` text.
  161. - **MENU_UNDO** = **5** --- Undoes the previous action.
  162. - **MENU_REDO** = **6** --- Reverse the last undo action.
  163. - **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  164. Property Descriptions
  165. ---------------------
  166. .. _class_LineEdit_property_align:
  167. - :ref:`Align<enum_LineEdit_Align>` **align**
  168. +-----------+------------------+
  169. | *Default* | ``0`` |
  170. +-----------+------------------+
  171. | *Setter* | set_align(value) |
  172. +-----------+------------------+
  173. | *Getter* | get_align() |
  174. +-----------+------------------+
  175. Text alignment as defined in the :ref:`Align<enum_LineEdit_Align>` enum.
  176. ----
  177. .. _class_LineEdit_property_caret_blink:
  178. - :ref:`bool<class_bool>` **caret_blink**
  179. +-----------+---------------------------------+
  180. | *Default* | ``false`` |
  181. +-----------+---------------------------------+
  182. | *Setter* | cursor_set_blink_enabled(value) |
  183. +-----------+---------------------------------+
  184. | *Getter* | cursor_get_blink_enabled() |
  185. +-----------+---------------------------------+
  186. If ``true``, the caret (visual cursor) blinks.
  187. ----
  188. .. _class_LineEdit_property_caret_blink_speed:
  189. - :ref:`float<class_float>` **caret_blink_speed**
  190. +-----------+-------------------------------+
  191. | *Default* | ``0.65`` |
  192. +-----------+-------------------------------+
  193. | *Setter* | cursor_set_blink_speed(value) |
  194. +-----------+-------------------------------+
  195. | *Getter* | cursor_get_blink_speed() |
  196. +-----------+-------------------------------+
  197. Duration (in seconds) of a caret's blinking cycle.
  198. ----
  199. .. _class_LineEdit_property_caret_position:
  200. - :ref:`int<class_int>` **caret_position**
  201. +-----------+----------------------------+
  202. | *Default* | ``0`` |
  203. +-----------+----------------------------+
  204. | *Setter* | set_cursor_position(value) |
  205. +-----------+----------------------------+
  206. | *Getter* | get_cursor_position() |
  207. +-----------+----------------------------+
  208. The cursor's position inside the ``LineEdit``. When set, the text may scroll to accommodate it.
  209. ----
  210. .. _class_LineEdit_property_clear_button_enabled:
  211. - :ref:`bool<class_bool>` **clear_button_enabled**
  212. +-----------+---------------------------------+
  213. | *Default* | ``false`` |
  214. +-----------+---------------------------------+
  215. | *Setter* | set_clear_button_enabled(value) |
  216. +-----------+---------------------------------+
  217. | *Getter* | is_clear_button_enabled() |
  218. +-----------+---------------------------------+
  219. If ``true``, the ``LineEdit`` will show a clear button if ``text`` is not empty, which can be used to clear the text quickly.
  220. ----
  221. .. _class_LineEdit_property_context_menu_enabled:
  222. - :ref:`bool<class_bool>` **context_menu_enabled**
  223. +-----------+---------------------------------+
  224. | *Default* | ``true`` |
  225. +-----------+---------------------------------+
  226. | *Setter* | set_context_menu_enabled(value) |
  227. +-----------+---------------------------------+
  228. | *Getter* | is_context_menu_enabled() |
  229. +-----------+---------------------------------+
  230. If ``true``, the context menu will appear when right-clicked.
  231. ----
  232. .. _class_LineEdit_property_editable:
  233. - :ref:`bool<class_bool>` **editable**
  234. +-----------+---------------------+
  235. | *Default* | ``true`` |
  236. +-----------+---------------------+
  237. | *Setter* | set_editable(value) |
  238. +-----------+---------------------+
  239. | *Getter* | is_editable() |
  240. +-----------+---------------------+
  241. If ``false``, existing text cannot be modified and new text cannot be added.
  242. ----
  243. .. _class_LineEdit_property_expand_to_text_length:
  244. - :ref:`bool<class_bool>` **expand_to_text_length**
  245. +-----------+----------------------------------+
  246. | *Default* | ``false`` |
  247. +-----------+----------------------------------+
  248. | *Setter* | set_expand_to_text_length(value) |
  249. +-----------+----------------------------------+
  250. | *Getter* | get_expand_to_text_length() |
  251. +-----------+----------------------------------+
  252. If ``true``, the ``LineEdit`` width will increase to stay longer than the :ref:`text<class_LineEdit_property_text>`. It will **not** compress if the :ref:`text<class_LineEdit_property_text>` is shortened.
  253. ----
  254. .. _class_LineEdit_property_max_length:
  255. - :ref:`int<class_int>` **max_length**
  256. +-----------+-----------------------+
  257. | *Default* | ``0`` |
  258. +-----------+-----------------------+
  259. | *Setter* | set_max_length(value) |
  260. +-----------+-----------------------+
  261. | *Getter* | get_max_length() |
  262. +-----------+-----------------------+
  263. Maximum amount of characters that can be entered inside the ``LineEdit``. If ``0``, there is no limit.
  264. ----
  265. .. _class_LineEdit_property_placeholder_alpha:
  266. - :ref:`float<class_float>` **placeholder_alpha**
  267. +-----------+------------------------------+
  268. | *Default* | ``0.6`` |
  269. +-----------+------------------------------+
  270. | *Setter* | set_placeholder_alpha(value) |
  271. +-----------+------------------------------+
  272. | *Getter* | get_placeholder_alpha() |
  273. +-----------+------------------------------+
  274. Opacity of the :ref:`placeholder_text<class_LineEdit_property_placeholder_text>`. From ``0`` to ``1``.
  275. ----
  276. .. _class_LineEdit_property_placeholder_text:
  277. - :ref:`String<class_String>` **placeholder_text**
  278. +-----------+------------------------+
  279. | *Default* | ``""`` |
  280. +-----------+------------------------+
  281. | *Setter* | set_placeholder(value) |
  282. +-----------+------------------------+
  283. | *Getter* | get_placeholder() |
  284. +-----------+------------------------+
  285. Text shown when the ``LineEdit`` is empty. It is **not** the ``LineEdit``'s default value (see :ref:`text<class_LineEdit_property_text>`).
  286. ----
  287. .. _class_LineEdit_property_right_icon:
  288. - :ref:`Texture<class_Texture>` **right_icon**
  289. +----------+-----------------------+
  290. | *Setter* | set_right_icon(value) |
  291. +----------+-----------------------+
  292. | *Getter* | get_right_icon() |
  293. +----------+-----------------------+
  294. Sets the icon that will appear in the right end of the ``LineEdit`` if there's no :ref:`text<class_LineEdit_property_text>`, or always, if :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` is set to ``false``.
  295. ----
  296. .. _class_LineEdit_property_secret:
  297. - :ref:`bool<class_bool>` **secret**
  298. +-----------+-------------------+
  299. | *Default* | ``false`` |
  300. +-----------+-------------------+
  301. | *Setter* | set_secret(value) |
  302. +-----------+-------------------+
  303. | *Getter* | is_secret() |
  304. +-----------+-------------------+
  305. If ``true``, every character is replaced with the secret character (see :ref:`secret_character<class_LineEdit_property_secret_character>`).
  306. ----
  307. .. _class_LineEdit_property_secret_character:
  308. - :ref:`String<class_String>` **secret_character**
  309. +-----------+-----------------------------+
  310. | *Default* | ``"*"`` |
  311. +-----------+-----------------------------+
  312. | *Setter* | set_secret_character(value) |
  313. +-----------+-----------------------------+
  314. | *Getter* | get_secret_character() |
  315. +-----------+-----------------------------+
  316. The character to use to mask secret input (defaults to "\*"). Only a single character can be used as the secret character.
  317. ----
  318. .. _class_LineEdit_property_selecting_enabled:
  319. - :ref:`bool<class_bool>` **selecting_enabled**
  320. +-----------+------------------------------+
  321. | *Default* | ``true`` |
  322. +-----------+------------------------------+
  323. | *Setter* | set_selecting_enabled(value) |
  324. +-----------+------------------------------+
  325. | *Getter* | is_selecting_enabled() |
  326. +-----------+------------------------------+
  327. If ``false``, it's impossible to select the text using mouse nor keyboard.
  328. ----
  329. .. _class_LineEdit_property_shortcut_keys_enabled:
  330. - :ref:`bool<class_bool>` **shortcut_keys_enabled**
  331. +-----------+----------------------------------+
  332. | *Default* | ``true`` |
  333. +-----------+----------------------------------+
  334. | *Setter* | set_shortcut_keys_enabled(value) |
  335. +-----------+----------------------------------+
  336. | *Getter* | is_shortcut_keys_enabled() |
  337. +-----------+----------------------------------+
  338. If ``false``, using shortcuts will be disabled.
  339. ----
  340. .. _class_LineEdit_property_text:
  341. - :ref:`String<class_String>` **text**
  342. +-----------+-----------------+
  343. | *Default* | ``""`` |
  344. +-----------+-----------------+
  345. | *Setter* | set_text(value) |
  346. +-----------+-----------------+
  347. | *Getter* | get_text() |
  348. +-----------+-----------------+
  349. String value of the ``LineEdit``.
  350. **Note:** Changing text using this property won't emit the :ref:`text_changed<class_LineEdit_signal_text_changed>` signal.
  351. Method Descriptions
  352. -------------------
  353. .. _class_LineEdit_method_append_at_cursor:
  354. - void **append_at_cursor** **(** :ref:`String<class_String>` text **)**
  355. Adds ``text`` after the cursor. If the resulting value is longer than :ref:`max_length<class_LineEdit_property_max_length>`, nothing happens.
  356. ----
  357. .. _class_LineEdit_method_clear:
  358. - void **clear** **(** **)**
  359. Erases the ``LineEdit`` text.
  360. ----
  361. .. _class_LineEdit_method_deselect:
  362. - void **deselect** **(** **)**
  363. Clears the current selection.
  364. ----
  365. .. _class_LineEdit_method_get_menu:
  366. - :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** const
  367. Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``LineEdit``. By default, this menu is displayed when right-clicking on the ``LineEdit``.
  368. ----
  369. .. _class_LineEdit_method_menu_option:
  370. - void **menu_option** **(** :ref:`int<class_int>` option **)**
  371. Executes a given action as defined in the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  372. ----
  373. .. _class_LineEdit_method_select:
  374. - void **select** **(** :ref:`int<class_int>` from=0, :ref:`int<class_int>` to=-1 **)**
  375. Selects characters inside ``LineEdit`` between ``from`` and ``to``. By default, ``from`` is at the beginning and ``to`` at the end.
  376. ::
  377. text = "Welcome"
  378. select() # Will select "Welcome".
  379. select(4) # Will select "ome".
  380. select(2, 5) # Will select "lco".
  381. ----
  382. .. _class_LineEdit_method_select_all:
  383. - void **select_all** **(** **)**
  384. Selects the whole :ref:`String<class_String>`.