search_bar
_search_bar
¶
Enhanced search input widget.
Classes:
| Name | Description |
|---|---|
FXSearchBar |
An enhanced search input widget with built-in features. |
Classes¶
FXSearchBar
¶
FXSearchBar(
parent: Optional[QWidget] = None,
placeholder: str = "Search...",
debounce_ms: int = 300,
show_filter: bool = False,
filters: Optional[list] = None,
)
Bases: FXThemeAware, QWidget
flowchart TD
fxgui.fxwidgets._search_bar.FXSearchBar[FXSearchBar]
fxgui.fxstyle.FXThemeAware[FXThemeAware]
fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._search_bar.FXSearchBar
click fxgui.fxwidgets._search_bar.FXSearchBar href "" "fxgui.fxwidgets._search_bar.FXSearchBar"
click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
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 |
|---|---|---|---|
|
Optional[QWidget]
|
Parent widget. |
None
|
|
str
|
Placeholder text. |
'Search...'
|
|
int
|
Debounce delay in milliseconds for search_changed signal. |
300
|
|
bool
|
Whether to show the filter dropdown. |
False
|
|
Optional[list]
|
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 |
Clear the search input. |
setFocus |
Set focus to the search input. |
set_filters |
Set the filter dropdown options. |
set_placeholder |
Set the placeholder text. |
show_filter |
Show or hide the filter dropdown. |
Attributes:
| Name | Type | Description |
|---|---|---|
filter |
str
|
Return the current filter selection. |
text |
str
|
Return the current search text. |