ActionTextField QML Type

An advanced control to create custom textfields with action buttons (for example, with a Clear button). More...

Import Statement: import org.kde.kirigami
Inherits:

TextField

Inherited By:

PasswordField and SearchField

Properties

Detailed Description

Example usage for a search field:

 import org.kde.kirigami as Kirigami

 Kirigami.ActionTextField {
     id: searchField

     placeholderText: i18n("Search…")

     focusSequence: StandardKey.Find

     rightActions: Kirigami.Action {
         icon.name: "edit-clear"
         visible: searchField.text.length > 0
         onTriggered: {
             searchField.clear();
             searchField.accepted();
         }
     }

     onAccepted: console.log("Search text is " + searchField.text);
 }

Property Documentation

focusSequence : keysequence

This property holds a shortcut sequence that will focus the text field.


leftActions : list<Action>

This property holds a list of actions that will be displayed on the left side of the text field.

By default this list is empty.


rightActions : list<Action>

This property holds a list of actions that will be displayed on the right side of the text field.

By default this list is empty.