SearchPopupField QML Type
SearchField with a Popup to show autocompletion entries or search results. This type is deprecated. We strongly advise against using it in new code. 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.
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
[default: false] autoAccept : bool
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).
[default: false] delaySearch : bool
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.
popup : Popup
[default] popupContentItem : Item
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.