ActionTextField QML Type

An advanced control to create custom textfields with inline buttons. More...

Import Statement: import org.kde.kirigami
Inherits:

TextField

Inherited By:

PasswordField and SearchField

Properties

Detailed Description

ActionTextField can display inline action buttons on the leading or trailing sides, and is used as the base class for other kinds of specialized text fields, including SearchField and PasswordField.

Example usage:

import org.kde.kirigami as Kirigami

Kirigami.ActionTextField {
    id: inputField

    placeholderText: i18n("Enter name")

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

    onAccepted: console.log("Entered text is " + inputField.text);
}

Property Documentation

focusSequence : keysequence

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

By default no shortcut is set.


leftActions : list<Action>

This property holds a list of actions that will be displayed on the leading 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 trailing side of the text field.

By default this list is empty.