breadcrumb
_breadcrumb
¶
Navigation breadcrumb widget.
Classes:
| Name | Description |
|---|---|
FXBreadcrumb |
A clickable breadcrumb trail for hierarchical navigation. |
Classes¶
FXBreadcrumb
¶
FXBreadcrumb(
parent: Optional[QWidget] = None,
separator: str = "chevron_right",
home_icon: str = "home",
show_navigation: bool = False,
path_separator: str = "/",
home_path: Optional[List[str]] = None,
)
Bases: FXThemeAware, QWidget
flowchart TD
fxgui.fxwidgets._breadcrumb.FXBreadcrumb[FXBreadcrumb]
fxgui.fxstyle.FXThemeAware[FXThemeAware]
fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._breadcrumb.FXBreadcrumb
click fxgui.fxwidgets._breadcrumb.FXBreadcrumb href "" "fxgui.fxwidgets._breadcrumb.FXBreadcrumb"
click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
A clickable breadcrumb trail for hierarchical navigation.
This widget provides a navigation breadcrumb with clickable path segments, separator icons, and optional back/forward navigation. Double-click the breadcrumb to switch to edit mode for typing paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Optional[QWidget]
|
Parent widget. |
None
|
|
str
|
Icon name for separator between segments. |
'chevron_right'
|
|
str
|
Icon name for the home/root segment. |
'home'
|
|
bool
|
Show back/forward navigation buttons. |
False
|
|
str
|
Character used to join path segments in edit mode. |
'/'
|
|
Optional[List[str]]
|
Path segments to navigate to when home is clicked. If None, navigates to the first segment only. |
None
|
Signals
segment_clicked: Emitted when a segment is clicked (index, path list). home_clicked: Emitted when the home segment is clicked. path_edited: Emitted when user submits a typed path (raw string). navigated_back: Emitted when navigating back in history. navigated_forward: Emitted when navigating forward in history.
Examples:
>>> breadcrumb = FXBreadcrumb(show_navigation=True)
>>> breadcrumb.set_path(["Home", "Projects", "MyProject", "Assets"])
>>> breadcrumb.segment_clicked.connect(
... lambda idx, path: print(f"Navigate to: {'/'.join(path[:idx+1])}")
... )
>>> breadcrumb.path_edited.connect(lambda text: print(f"User typed: {text}"))
Methods:
| Name | Description |
|---|---|
append_segment |
Append a segment to the path. |
can_go_back |
Check if back navigation is available. |
can_go_forward |
Check if forward navigation is available. |
clear |
Clear the breadcrumb path. |
clear_history |
Clear the navigation history. |
enter_edit_mode |
Programmatically enter edit mode. |
eventFilter |
Handle escape key and focus loss to exit edit mode. |
go_back |
Navigate to the previous path in history. |
go_forward |
Navigate to the next path in history. |
is_editing |
Check if currently in edit mode. |
navigate_to |
Navigate to a specific path index, removing subsequent segments. |
pop_segment |
Remove and return the last segment. |
set_path |
Set the breadcrumb path. |
Attributes:
| Name | Type | Description |
|---|---|---|
home_path |
Optional[List[str]]
|
Get the home path. |
path |
List[str]
|
Return the current path segments. |
Attributes¶
Functions¶
append_segment
¶
go_back
¶
go_back() -> bool
Navigate to the previous path in history.
Returns:
| Type | Description |
|---|---|
bool
|
True if navigation occurred, False if at beginning of history. |
go_forward
¶
go_forward() -> bool
Navigate to the next path in history.
Returns:
| Type | Description |
|---|---|
bool
|
True if navigation occurred, False if at end of history. |