Pages
API Documentation
On this page

ActionTextField QML Type

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

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.

Each action's text property will be displayed in a tooltip on hover.

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.

[since 6.18] focusSequences : keysequence

This property holds multiple shortcut sequences that will focus the text field.

By default no shortcut is set.

This property was introduced in Qt 6.18.

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.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.