SearchPopupField QML Type

SearchField with a Popup to show autocompletion entries or search results. More...

Import Statement: import org.kde.kirigamiaddons.components
Inherits:

Control

Status: Deprecated

This type is deprecated. We strongly advise against using it in new code.

Properties

Signals

Detailed Description

Use Kirigami.SearchDialog instead.

Can be replaced by the following code:

Kirigami.SearchField {
    TapHandler {
        onTapped: {
            searchDialog.open();
        }
        acceptedButtons: Qt.RightButton | Qt.LeftButton
    }
    Keys.onPressed: (event) => {
        if (event.key !== Qt.Key_Tab || event.key !== Qt.Key_Backtab) {
            searchDialog.open();
            searchDialog.text = text;
        }
    }
    Keys.priority: Keys.AfterItem

    Kirigami.SearchDialog {
        id: searchDialog
        ...
    }
}

See also SearchDialog.

Property Documentation

autoAccept : bool [default: false]

This property sets whether the accepted signal is fired automatically when the text is changed.

Setting this to false will require that the user presses return or enter (the same way a TextInput works).


delaySearch : bool [default: false]

This property sets whether to delay automatic acceptance of the search input.

Set this to true if your search is expensive (such as for online operations or in exceptionally slow data sets) and want to delay it for 2.5 seconds.

Note: If you must have immediate feedback (filter-style), use the text property directly instead of accepted()


fieldFocus : bool

This hold the focus state of the internal SearchField.



popupContentItem : Item [default]

This property holds the content item of the popup.

Overflow will be automatically handled as popupContentItem is contained inside a ScrollView.

This is the default element of SearchPopupField.

SearchPopupField {
    ListView {
        model: SearchModel {}
        delegate: QQC2.ItemDelegate {}

        Kirigami.PlaceholderMessage {
            id: loadingPlaceholder
            anchors.centerIn: parent
            width: parent.width - Kirigami.Units.gridUnit * 4
            // ...
        }
    }
}

searchField : Kirigami.SearchField


text : string

This property holds the text of the search field.


Signal Documentation

accepted()

This signal is triggered when the user trigger a search.

Note: The corresponding handler is onAccepted.