SearchBar QML Type | Fluid Reference Documentation

- Fluid Reference Documentation
- Fluid 1.2.0

# SearchBar QML Type

Provides a searchbar, that supports autocompletion and displays search results using cards. More...

Import Statement: | import Fluid.Controls 1.1

- List of all members, including inherited members

## Properties

- cardWidth : int
- expanded : bool
- persistent : bool
- searchPlaceHolder : string
- searchResults : model
- searchSuggestions : model
- searchText : string
- searchTextFont : font
- suggestionDelegate : Component
- suggestionTextRole : string
- suggestionsHeight : int
- waveColor : color

## Signals

- search(query)

## Methods

- void close()
- void open()

## Detailed Description

## Property Documentation

cardWidth : int

The width of the search card. By default the search bar centers in the parent with a margin of 64 each side

[read-only] expanded : bool

Whether the SearchBar is currently open

persistent : bool

Whether the SearchBar is persistent or expandable

searchPlaceHolder : string

The string to display when the search field is empty

searchResults : model

The model containing the search results

searchSuggestions : model

The suggestions to display.

See also SearchBar::suggestionTextRole and SearchBar::suggestionDelegate.

searchText : string

The current search text in the search bar typed in so far.

searchTextFont : font

The font of text in search TextInput box

This property was introduced in Fluid.Controls 1.1.

suggestionDelegate : Component

The delegate item for the suggestion list view.

See also SearchBar::searchSuggestions.

suggestionTextRole : string

The model type that contains the text to display in the suggestion delegate

See also SearchBar::searchSuggestions.

suggestionsHeight : int

The viewable area of the suggestions list until it begins scrolling.

waveColor : color

The background color of the expanded search bar.

## Signal Documentation

search(query)

Is emitted, when the user searches for a query. The query parameter contains the search query as string. Use this signal to provide search results.

## Method Documentation

void close()

Closes the search bar

void open()

Opens the search bar