Search Bar¶
A search input widget with optional suggestions and filtering.
Preview
FXSearchBar
¶
Bases: ,
An enhanced search input widget with built-in features.
This widget provides a search input with: - Search icon - Clear button - Optional filter dropdown - Debounced search signal for live filtering
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
Parent widget. |
None
|
|
|
Placeholder text. |
'Search...'
|
|
|
Debounce delay in milliseconds for search_changed signal. |
300
|
|
|
Whether to show the filter dropdown. |
False
|
|
|
List of filter options for the dropdown. |
None
|
Signals
search_changed: Emitted when the search text changes (debounced). search_submitted: Emitted when Enter is pressed. filter_changed: Emitted when the filter selection changes.
Examples:
>>> search = FXSearchBar(placeholder="Search assets...")
>>> search.search_changed.connect(lambda text: print(f"Searching: {text}"))
>>> search.set_filters(["All", "Models", "Textures", "Materials"])
Methods:
| Name | Description |
|---|---|
|
Clear the search input. |
|
Set focus to the search input. |
|
Set the filter dropdown options. |
|
Set the placeholder text. |
|
Show or hide the filter dropdown. |
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
Return the current filter selection. |
|
|
Return the current search text. |